Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 233190 - net-firewall/ebtables-2.0.8.2 fails to cross-compile due to using host's native ld
Summary: net-firewall/ebtables-2.0.8.2 fails to cross-compile due to using host's nati...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM Linux
: High minor (vote)
Assignee: Peter Volkov (RETIRED)
URL:
Whiteboard:
Keywords:
: 233195 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-07-28 20:20 UTC by Andy Getz
Modified: 2008-08-13 04:41 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Getz 2008-07-28 20:20:24 UTC
...
armv5tel-softfloat-linux-gnueabi-gcc -Wall -Wunused -fPIC -DPROGVERSION=\"2.0.8-2\" -DPROGNAME=\"ebtables\" -DPROGDATE=\"May\ 2007\" -D_PATH_ETHERTYPES=\"/etc/ethertypes\" -DEBTD_ARGC_MAX=50 -DEBTD_CMDLINE_MAXLN=2048 -c ebtables-standalone.c -o ebtables-standalone.o -Iinclude/
ld -shared -soname libebtc.so -o libebtc.so -lc getethertype.o communication.o libebtc.o useful_functions.o ebtables.o
ld: getethertype.o: Relocations in generic ELF (EM: 40)
getethertype.o: could not read symbols: File in wrong format
make: *** [libebtc] Error 1
 *
 * ERROR: net-firewall/ebtables-2.0.8.2 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 2340:  Called die
 * The specific snippet of code:
 *       emake CC="$(tc-getCC)" || die "emake failed"
 *  The die message:
 *   emake failed

Reproducible: Always

Steps to Reproduce:
1. Use crossdev to build a cross-toolchain
2. Setup environment to build for target per section I.5 of the Gentoo Embedded handbook (http://www.gentoo.org/proj/en/base/embedded/handbook/?part=1&chap=5)
3. emerge ebtables

Actual Results:  
Linking using the host's native linker (ld) failed, and so did the build.

Expected Results:  
Linking using the cross-linker (armv5tel-softfloat-linux-gnueabi-ld in this case) succeeds, and so does the build.

Easy fix:
--- /usr/portage/net-firewall/ebtables/ebtables-2.0.8.2.ebuild  2008-05-11 07:06:23.000000000 -0400
+++ /usr/local/portage/net-firewall/ebtables/ebtables-2.0.8.2.ebuild    2008-07-28 16:18:15.000000000 -0400
@@ -32,12 +32,12 @@
 }
 
 src_compile() {
-       emake CC="$(tc-getCC)" || die "emake failed"
+       emake CC="$(tc-getCC)" LD="$(tc-getLD)" || die "emake failed"
 }
 
 src_install() {
        dodoc ChangeLog THANKS
-       make DESTDIR="${D}" install || die
+       make DESTDIR="${D}" CC="$(tc-getCC)" LD="$(tc-getLD)" install || die
        keepdir /var/lib/ebtables/
 
        newinitd "${FILESDIR}"/ebtables.initd ebtables
Comment 1 Wormo (RETIRED) gentoo-dev 2008-07-29 00:29:04 UTC
*** Bug 233195 has been marked as a duplicate of this bug. ***
Comment 2 Wormo (RETIRED) gentoo-dev 2008-07-29 00:30:14 UTC
Thanks for the fix; assigning to maintainer
Comment 3 Peter Volkov (RETIRED) gentoo-dev 2008-08-13 04:41:23 UTC
Thank you for report Suertreus. I've fixed this in a bit different way:
1. Use gcc for linking as it supplies additional required libraries to linker
2. Make build process respect LDFLAGS
Fixed in ebtables-2.0.8.2-r1.