Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 226035 - sys-apps/iproute2-2.6.22.20070710 fail to cross-compile
Summary: sys-apps/iproute2-2.6.22.20070710 fail to cross-compile
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-12 08:12 UTC by Bertrand Jacquin
Modified: 2008-06-21 05:49 UTC (History)
0 users

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 Bertrand Jacquin 2008-06-12 08:12:56 UTC
iproute2 use host gcc in place of toolchain gcc so crosscompilation failed. Host gcc is used only in directory netem as you can see in this trace :

...
i586-geode-linux-uclibc-gcc -D_GNU_SOURCE -march=k6-2 -O2 -pipe -fomit-frame-pointer -Wstrict-prototypes -Wall -I../include -DRESOLVE_HOSTNAMES   -c -o
 lnstat_util.o lnstat_util.c
i586-geode-linux-uclibc-gcc   lnstat.o lnstat_util.o  -lresolv -L../lib -lnetlink -lutil -o lnstat
make[1]: Leaving directory `/var/tmp/portage/sys-apps/iproute2-2.6.22.20070710/work/misc'
make[1]: Entering directory `/var/tmp/portage/sys-apps/iproute2-2.6.22.20070710/work/netem'
gcc -D_GNU_SOURCE -march=k6-2 -O2 -pipe -fomit-frame-pointer -Wstrict-prototypes -Wall -I../include -o maketable maketable.c -lm
maketable.c:1: error: CPU you selected does not support x86-64 instruction set
maketable.c:1: error: CPU you selected does not support x86-64 instruction set
make[1]: *** [maketable] Error 1
make[1]: Leaving directory `/var/tmp/portage/sys-apps/iproute2-2.6.22.20070710/work/netem'
make: *** [all] Error 2
 * 
 * ERROR: sys-apps/iproute2-2.6.22.20070710 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 2056:  Called die
 * The specific snippet of code:
 *       emake CC="$(tc-getCC)" AR="$(tc-getAR)" || die "make"
 *  The die message:
 *   make
 * 
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/log/portage/i586-geode-linux-uclibc/sys-apps:iproute2-2.6.22.20070710:20080612-080416.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-apps/iproute2-2.6.22.20070710/temp/environment'.
 * 

# /usr/bin/emerge --info
Portage 2.1.5.4 (uclibc/x86/2.4, gcc-3.4.6, uclibc-0.9.28.3-r3,
2.6.24-gentoo-r4 x86_64)
=================================================================
System uname: 2.6.24-gentoo-r4 x86_64 AMD Athlon(tm) 64 Processor 3200+
Timestamp of tree: Sun, 08 Jun 2008 14:16:01 +0000
app-shells/bash:     3.2_p39
dev-java/java-config: 1.3.7, 2.1.6
dev-lang/python:     2.5.2-r4
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.2.5
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.62
sys-devel/automake:  1.4_p6, 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1-r1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.25-r3
ACCEPT_KEYWORDS="x86"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k6-2 -O2 -pipe -fomit-frame-pointer"
CHOST="i586-geode-linux-uclibc"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/
/etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release
/etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/
/etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo
/etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=k6-2 -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks nodoc noinfo noman parallel-fetch sandbox
sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org
http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="C"
LC_ALL="C"
LDFLAGS=""
LINGUAS=""
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress
--force --whole-file --delete --stats --timeout=180 --exclude=/distfiles
--exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/opt/meleeweb/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="cli cracklib crypt dri ipv6 midi mudflap ncurses openmp pcre perl readline
reflection session spl ssl tcpd uclibc x86 xorg zlib" ALSA_PCM_PLUGINS="adpcm
alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa
lfloat linear meter mulaw multi null plug rate route share shm softvol"
APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm
authn_default authn_file authz_dbm authz_default authz_groupfile authz_host
authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir
disk_cache env expires ext_filter file_cache filter headers include info
log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling
status unique_id userdir usertrack vhost_alias" ELIBC="uclibc"
INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz
cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU"
VIDEO_CARDS="dummy fbdev v4l"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, MAKEOPTS,
PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

This bug is a revival of #54943


Reproducible: Always

Steps to Reproduce:
1. ROOT=/root/cross/i586-geode-linux-uclibc
PORTAGE_CONFIGROOT=/etc/ct/i586-geode-linux-uclibc
CHOST=i586-geode-linux-uclibc CBUILD=x86_64-pc-linux-gnu emerge -vat iproute2
Comment 1 SpanKY gentoo-dev 2008-06-12 13:13:39 UTC
that is because host gcc is *supposed* to be used in the netem subdirectory.  it's building utilities that it then executes.

the problem is that the target CFLAGS bleed and get used when executing on the build system.
Comment 2 Bertrand Jacquin 2008-06-12 17:31:16 UTC
Yes, I corrected the "bug" by doing that :

On iproute2 source
--- netem/Makefile.ori	2008-06-12 10:44:19.000000000 +0200
+++ netem/Makefile	2008-06-12 10:45:07.000000000 +0200
@@ -2,6 +2,7 @@
 DISTDATA = normal.dist pareto.dist paretonormal.dist experimental.dist
 
 HOSTCC ?= $(CC)
+CCOPTS  = $(CBUILD_CFLAGS)
 LDLIBS += -lm 
 
 all: $(DISTGEN) $(DISTDATA)

On iproute2 ebuild
--- /usr/portage/sys-apps/iproute2/iproute2-2.6.22.20070710.ebuild	2008-03-11 18:07:50.000000000 +0100
+++ iproute2-2.6.22.20070710.ebuild	2008-06-12 10:49:15.000000000 +0200
@@ -38,6 +38,7 @@
 	sed -i "s:-O2:${CFLAGS}:" Makefile || die "sed Makefile failed"
 
 	epatch "${FILESDIR}"/${PN}-2.6.16.20060323-build.patch #137574
+	epatch "${FILESDIR}"/${PN}-2.6.22.20070710-netem-hostcc.diff
 
 	local check base=${PORTAGE_CONFIGROOT}/etc/portage/patches
 	for check in {${CATEGORY}/${PF},${CATEGORY}/${P},${CATEGORY}/${PN}}; do

Then build like that :
ROOT=/root/cross/i586-geode-linux-uclibc
PORTAGE_CONFIGROOT=/etc/ct/i586-geode-linux-uclibc
CHOST=i586-geode-linux-uclibc CBUILD=x86_64-pc-linux-gnu CBUILD_CFLAGS="-march=athlon64 -O2 -pipe -fomit-frame-pointer" emerge -vat iproute2

It's really bad and just home working, so didn't post any fix.

But, what could be done for that ? Desactivate SUBDIR for cross compilation ? Get upstream ?