I had a new look at this, and got a bit further. I discovered that dh
passes the problematic flags to override_dh_auto_build using environment
variables. I was able to get rid of the problematic flags by setting
DEB_HOST_ARCH and DEB_BUILD_ARCH to not get amd64 specific flags, like
this:
diff --git a/debian/rules b/debian/rules
index 0db1fc0..9e893ed 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,6 +7,9 @@ export LC_ALL=C.UTF-8
export DEB_CXXFLAGS_MAINT_APPEND += -std=gnu++14
+export DEB_HOST_ARCH = arm-none-eabi
+export DEB_BUILD_ARCH = arm-none-eabi
+
%:
dh $@ --with sphinxdoc
Unfortunately the build still fail, this time with a new set of issues:
/usr/lib/gcc/arm-none-eabi/13.3.1/../../../arm-none-eabi/bin/ld: warning: -z
relro ignored
/usr/lib/gcc/arm-none-eabi/13.3.1/../../../arm-none-eabi/bin/ld:
/usr/lib/gcc/arm-none-eabi/13.3.1/../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc_nano.a(libc_a-signalr.o):
in function `_getpid_r':
/build/reproducible-path/newlib-4.4.0.20231231/build_nano/arm-none-eabi/thumb/v6-m/nofp/newlib/../../../../../../newlib/libc/reent/signalr.c:83:(.text+0x2a):
warning: _getpid is not implemented and will always fail
/usr/lib/gcc/arm-none-eabi/13.3.1/../../../arm-none-eabi/bin/ld:
/usr/lib/gcc/arm-none-eabi/13.3.1/../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc_nano.a(libc_a-signalr.o):
note: the message above does not take linker garbage collection into account
/usr/lib/gcc/arm-none-eabi/13.3.1/../../../arm-none-eabi/bin/ld:
/usr/lib/gcc/arm-none-eabi/13.3.1/../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc_nano.a(libc_a-signalr.o):
in function `_kill_r':
/build/reproducible-path/newlib-4.4.0.20231231/build_nano/arm-none-eabi/thumb/v6-m/nofp/newlib/../../../../../../newlib/libc/reent/signalr.c:53:(.text+0xe):
warning: _kill is not implemented and will always fail
/usr/lib/gcc/arm-none-eabi/13.3.1/../../../arm-none-eabi/bin/ld:
/usr/lib/gcc/arm-none-eabi/13.3.1/../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc_nano.a(libc_a-signalr.o):
note: the message above does not take linker garbage collection into account
/usr/lib/gcc/arm-none-eabi/13.3.1/../../../arm-none-eabi/bin/ld: region RAM
overflowed with stack
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
error: command ['ninja'] failed
make[2]: *** [Makefile:19: yotta] Error 1
make[2]: Leaving directory '/home/pere/src/firmware-microbit-micropython-salsa'
make[1]: *** [debian/rules:30: override_dh_auto_build] Error 2
make[1]: Leaving directory '/home/pere/src/firmware-microbit-micropython-salsa'
make: *** [debian/rules:15: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
debuild: fatal error at line 1184:
dpkg-buildpackage -us -uc -ui failed
pere@sludder:~/src/firmware-microbit-micropython-salsa$ vi debian/rules
%
It is unclear to me exactly what the problem is and how to fix it.
--
Happy hacking
Petter Reinholdtsen