Bug #5081
simtrace2 doesn't build for ubuntu 20.04 and 20.10 and debian9
100%
Description
https://build.opensuse.org/package/show/network:osmocom:nightly/simtrace2
In OBS, we have Ubuntu 18.04 - 20.10 enabled. It builds fine for all but 20.04 and 20.10.
As noted in #4687, stack smashing protection is enabled there even when cross compiling for embedded, and causes larger binaries.
[ 473s] [COMPILING ./atmel_softpack_libraries/usb/device/dfu/dfu_driver.c] [ 474s] Memory region Used Size Region Size %age Used [ 474s] rom: 16600 B 16 KB 101.32% [ 474s] ram: 11688 B 48 KB 23.78/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: warning: changing start of section .stack by 4 bytes [ 474s] /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: warning: changing start of section .stack by 4 bytes [ 474s] /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: bin/qmod-dfu-flash.elf section `.text' will not fit in region `rom' [ 474s] /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: warning: changing start of section .stack by 4 bytes [ 474s] /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: warning: changing start of section .stack by 4 bytes [ 474s] /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: warning: changing start of section .stack by 4 bytes [ 474s] /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: region `rom' overflowed by 216 bytes
Related issues
Associated revisions
firmware: disable stack protector by default
Disable stack protector for all boards/apps by default, not only
qmod-dfu. Use 'make STACK_PROTECTOR=1' to enable.
This was recommened by Eric:
"I'd argue that we do not want this in general, since it adds canaries
to all functions that deal with buffers, and therefore impacts the
overall timing in a non determinstic way depending on inlining and
optimizations, while contributing nothing in non debug builds."
Related: OS#5081
Change-Id: I30ad97f231ea5b401def650bc9adc7e9f2770df0
History
#1 Updated by osmith about 1 month ago
- Related to Bug #4687: simtrace2 dpkg fails to build on Ubuntu 20.04 added
#2 Updated by osmith 15 days ago
- Subject changed from simtrace2 doesn't build for ubuntu 20.04 and 20.10 to simtrace2 doesn't build for ubuntu 20.04 and 20.10 and debian9
It also started failing on Debian 9, and this in-turn causes the Osmocom-repo-install-debian9 jenkins job to fail.
[ 108s] [COMPILING ./atmel_softpack_libraries/usb/device/dfu/dfu_driver.c] [ 108s] Memory region Used Size Region Size %age Used [ 108s] rom: 16400 B 16 KB 100.10% [ 108s] ram: 11688 B 48 KB 23.78/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: changing start of section .stack by 4 bytes [ 108s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: changing start of section .stack by 4 bytes [ 109s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: bin/qmod-dfu-flash.elf section `.text' will not fit in region `rom' [ 109s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: changing start of section .stack by 4 bytes [ 109s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: changing start of section .stack by 4 bytes [ 109s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: changing start of section .stack by 4 bytes [ 109s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: region `rom' overflowed by 16 bytes [ 109s] collect2: error: ld returned 1 exit status
On Debian 10, where it succeeds, it's also pretty close. I guess the newer GCC version used in debian 10 is a bit more efficient.
[ 149s] [COMPILING ./atmel_softpack_libraries/usb/device/dfu/dfu_driver.c] [ 149s] Memory region Used Size Region Size %age Used [ 149s] rom: 16328 B 16 KB 99.66% [ 149s] ram: 11688 B 48 KB 23.78/usr/lib/gcc/arm-none-eabi/7.3.1/../../../arm-none-eabi/bin/ld: warning: changing start of section .stack by 4 bytes [ 149s] /usr/lib/gcc/arm-none-eabi/7.3.1/../../../arm-none-eabi/bin/ld: warning: changing start of section .stack by 4 bytes [ 149s] /usr/lib/gcc/arm-none-eabi/7.3.1/../../../arm-none-eabi/bin/ld: warning: changing start of section .stack by 4 bytes [ 149s] /usr/lib/gcc/arm-none-eabi/7.3.1/../../../arm-none-eabi/bin/ld: warning: changing start of section .stack by 4 bytes [ 149s] /usr/lib/gcc/arm-none-eabi/7.3.1/../../../arm-none-eabi/bin/ld: warning: changing start of section .stack by 4 bytes
laforge, mschramm: I wonder if we can simply increase the rom region for dfu_driver.c, and take some from, e.g. usb.c:
[ 136s] [COMPILING libcommon/source/usb.c] [ 136s] Memory region Used Size Region Size %age Used [ 136s] rom: 25524 B 240 KB 10.39% [ 136s] ram: 24832 B 48 KB 50.52%Build logs:
#4 Updated by laforge 15 days ago
On Tue, Apr 06, 2021 at 02:28:56PM +0000, redmine@lists.osmocom.org wrote:
laforge, mschramm: I wonder if we can simply increase the rom region for dfu_driver.c, and take some from, e.g. usb.c:
no, that would render the flash layout incompatible, which is a nightmare
to support, and it would also mean we'd have to maintain builds for old and new
flash layout, and people will brick their devices all over the place.
#5 Updated by Hoernchen 15 days ago
I've had to prune strings to make it fit a year ago, and as the related ticket points out selectively disabling useless compiler options is apparently not possible, so I don't really see any great options here?
I suppose some dfu code parts can be removed after my patch to reset itself was introduced two months ago.
#6 Updated by osmith 14 days ago
- Status changed from New to In Progress
- Assignee set to osmith
- % Done changed from 0 to 90
I've disabled the stack protector for qmod-dfu now, this makes the build pass again: https://build.opensuse.org/package/show/home:osmith42/simtrace2
firmware: qmod-dfu: disable stack protector
Prevent build failure on debian 9, ubuntu 20.04, 20.10, where
bin/qmod-dfu-flash.elf does not fit the ROM.
Fixes: OS#5081
Change-Id: I9fffe4c323094679062428f41a4246b1c1b30ca2