Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 835758

Summary: gnome-base/librsvg fails to cross compile with: error adding symbols: file in wrong format
Product: Gentoo Linux Reporter: tt_1 <herrtimson>
Component: Current packagesAssignee: Gentoo Linux Gnome Desktop Team <gnome>
Status: UNCONFIRMED ---    
Severity: normal CC: gentoo, jstein, rust
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://gitlab.gnome.org/GNOME/librsvg/-/issues/810
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: compressed debug log from armv7-cross
output from emerge --info (armv7)

Description tt_1 2022-03-21 19:21:20 UTC
Created attachment 767535 [details]
compressed debug log from armv7-cross

this regression was introduced in the librsvg-2.52 branch, basically it tries to use the hosts gcc to link the foreign binaries, similar to what happens when one uses cargo build --target without setting up the linking for the target in ~/.cargo/config:

  = note: /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/armv7a-unknown-linux-gnueabihf/tmp/portage/gnome-base/librsvg-2.54.0/work/librsvg-2.54.0-.arm/target/thumbv7neon-unknown-linux-gnueabihf/release/deps/rsvg_convert-6da247c81e33f7e1.rsvg_convert.aaca61b7-cgu.0.rcgu.o: relocations in generic ELF (EM: 40)
          /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/armv7a-unknown-linux-gnueabihf/tmp/portage/gnome-base/librsvg-2.54.0/work/librsvg-2.54.0-.arm/target/thumbv7neon-unknown-linux-gnueabihf/release/deps/rsvg_convert-6da247c81e33f7e1.rsvg_convert.aaca61b7-cgu.0.rcgu.o: relocations in generic ELF (EM: 40)
          /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/armv7a-unknown-linux-gnueabihf/tmp/portage/gnome-base/librsvg-2.54.0/work/librsvg-2.54.0-

the compressed build.log is attached
Comment 1 tt_1 2022-03-21 19:21:35 UTC
Created attachment 767536 [details]
output from emerge --info (armv7)
Comment 2 tt_1 2022-03-21 19:26:51 UTC
as stated in the url, its possible to give the linker information to the build process via .cargo/config, as in: 

diff --git a/.cargo/config b/.cargo/config
index a94e912..fd4f0a7 100644
--- a/.cargo/config
+++ b/.cargo/config
@@ -9,3 +9,6 @@ replace-with = 'vendored-sources'
 
 [source.vendored-sources]
 directory = './vendor'
+
+[target.armv7-unknown-linux-gnueabihf]
+linker = "armv7a-unknown-linux-gnueabihf-gcc"


this unbreaks the cross compile with armv7a-unknown-linux-gnueabihf toolchain

maybe its possible to generalize this, but I'm not good enough with toolchain-funcs stuff
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-04-24 21:56:43 UTC
*** Bug 904984 has been marked as a duplicate of this bug. ***