Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 835758 - gnome-base/librsvg fails to cross compile with: error adding symbols: file in wrong format
Summary: gnome-base/librsvg fails to cross compile with: error adding symbols: file in...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL: https://gitlab.gnome.org/GNOME/librsv...
Whiteboard:
Keywords:
: 904984 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-03-21 19:21 UTC by tt_1
Modified: 2023-04-24 21:56 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
compressed debug log from armv7-cross (build.log.gz,25.78 KB, application/gzip)
2022-03-21 19:21 UTC, tt_1
Details
output from emerge --info (armv7) (emerge-info,5.29 KB, text/plain)
2022-03-21 19:21 UTC, tt_1
Details

Note You need to log in before you can comment on or make changes to this bug.
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. ***