On Tue, 2024-10-01 at 23:24 +0200, Helmut Grohne wrote: > Source: gcc-avr > Version: 1:7.3.0+Atmel3.7.0-2 > Tags: patch > User: debian-cr...@lists.debian.org > Usertags: ftcbfs > > gcc-avr fails to cross build from source for two distinct reasons. The > first reason only shows for certain architecture combinations such as > build=amd64 + host=arm64 as we pass -mbranch-protection=standard for > arm64 and amd64 doesn't understand the flag. The way gcc forwards > compiler flags mostly works, but it happens to inject host compiler > flags for the libcpp build for the build architecture and that doesn't > go well. Since gcc passes compiler flags to the relevant sub-configure > scripts, it is generally not necessary to force CFLAGS/CXXFLAGS on the > make invocation and I propose to drop this. > > The other issue is that the build eventually runs avr-gcc -dump-specs > and there is no avr-gcc in $PATH. The trivial solution here is to add a > recursive dependency together with marking avr-gcc Multi-Arch: foreign > (which is ok as the architecture is encoded into the package name). > Possibly, a better solution is to actually build an avr-gcc with > host:=build!=target first and then do the real build as a second pass. > In any case, the recursive dependency makes it build. > > I'm attaching a patch for your convenience. > > Helmut
Helmut, Thank you for testing my package and providing a patch. I would take it as-is and call it a day, but I am in the middle of switching my upstream source from Microchip to the Debian package gcc-source as well as switching over to using the dh sequencer. I don't know what impact this will have on cross building so I need to be able to reproduce the build errors that you reported. Is there a cross build test case that uses amd64 as the host or were they only with other host architectures? I do have an arm64 and riscv SBC available for me to build on, it would just take longer than the amd64 host build. Thanks -Steve