Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 244892 - x86_64-linux-uclibc target fails when the host is multilib based
Summary: x86_64-linux-uclibc target fails when the host is multilib based
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 312327 322757 343423 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-10-29 15:57 UTC by Jimmy.Jazz
Modified: 2012-04-23 17:33 UTC (History)
3 users (show)

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


Attachments
gcc log file (cross-x86_64-pc-linux-uclibc:gcc-4.3.2:20081029-145117.log,1.59 MB, text/plain)
2008-10-29 15:59 UTC, Jimmy.Jazz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jimmy.Jazz 2008-10-29 15:57:57 UTC
Hello,

I tried to build a new tool chain with the latest gentoo ebuilds evailable in the portage tree but I cannot manage to pass stage4. ld cannot find -lc.

I have run the following command and even tried it with the last 0.9.30_rc3 uclibc version.

PORTDIR_OVERLAY=/usr/portage/local/crossdev  crossdev --k 2.6.27-r2 --g 4.3.2 --b 2.19.50.0.1 --l 0.9.30_rc1 --target x86_64-pc-linux-uclibc -v

the command returns,

/usr/libexec/gcc/x86_64-pc-linux-uclibc/ld: skipping incompatible /usr/x86_64-pc-linux-uclibc/usr/lib/../lib/libc.so when searching for -lc
/usr/libexec/gcc/x86_64-pc-linux-uclibc/ld: skipping incompatible /usr/x86_64-pc-linux-uclibc/usr/lib/../lib/libc.a when searching for -lc
/usr/libexec/gcc/x86_64-pc-linux-uclibc/ld: skipping incompatible /usr/x86_64-pc-linux-uclibc/usr/lib/libc.so when searching for -lc
/usr/libexec/gcc/x86_64-pc-linux-uclibc/ld: skipping incompatible /usr/x86_64-pc-linux-uclibc/usr/lib/libc.a when searching for -lc
/usr/libexec/gcc/x86_64-pc-linux-uclibc/ld: skipping incompatible /usr/x86_64-pc-linux-uclibc/usr/lib/libc.so when searching for -lc
/usr/libexec/gcc/x86_64-pc-linux-uclibc/ld: skipping incompatible /usr/x86_64-pc-linux-uclibc/usr/lib/libc.a when searching for -lc
/usr/libexec/gcc/x86_64-pc-linux-uclibc/ld: cannot find -lc
collect2: ld a retourné 1 code d'état d'exécution
make[4]: *** [libgcc_s.so] Erreur 1

PORTDIR_OVERLAY=/usr/portage/local/crossdev contains,

# ls -l cross-x86_64-pc-linux-uclibc
total 7
lrwxrwxrwx 1 root root   31 oct. 29 15:47 binutils -> /usr/portage/sys-devel/binutils
lrwxrwxrwx 1 root root   26 oct. 29 15:47 gcc -> /usr/portage/sys-devel/gcc
lrwxrwxrwx 1 root root   26 oct. 29 15:47 gdb -> /usr/portage/sys-devel/gdb
lrwxrwxrwx 1 root root   29 oct. 29 15:47 insight -> /usr/portage/dev-util/insight
lrwxrwxrwx 1 root root   37 oct. 29 15:47 linux-headers -> /usr/portage/sys-kernel/linux-headers
drwxr-xr-x 3 root root 1024 oct. 28 22:55 uclibc
gentoo crossdev # ls -l cross-x86_64-pc-linux-uclibc/uclibc
total 23
drwxrwxr-x 2 portage portage  1024 oct. 27 22:55 files
-rw-r--r-- 1 root    root     1402 oct. 28 22:55 Manifest
lrwxrwxrwx 1 root    root       28 oct. 28 22:55 uclibc -> /usr/portage/sys-libs/uclibc
-rw-r--r-- 1 root    root    14431 oct. 28 22:55 uclibc-0.9.30_rc3.ebuild

When testing with uclibc-0.9.30_rc1, uclibc was a link to  /usr/portage tree.

Is it a problem with multilib ?





Reproducible: Always




emerge --info

Portage 2.2_rc12 (default/linux/amd64/2008.0, gcc-4.3.2, glibc-2.8_p20080602-r0, 2.6.27.3-vesa x86_64)
=================================================================
System uname: Linux-2.6.27.3-vesa-x86_64-AMD_Athlon-tm-_64_Processor_3200+-with-glibc2.2.5
Timestamp of tree: Wed, 29 Oct 2008 06:45:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.6-r1
dev-lang/python:     2.5.2-r8
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.6.2
sys-apps/baselayout: 1.12.12
sys-apps/sandbox:    1.2.18.1-r3
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1-r1
sys-devel/binutils:  2.18-r4
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O3 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/splash/livecd-2007.0/1280x1024.cfg /lib/rcscripts/addons /sbin/rc /sbin/splash-functions-bl1.sh /sbin/splash-functions.sh /usr/local/share/cursors/xorg-x11/default/index.theme /usr/share/hddtemp/hddtemp.db /usr/src/linux/.config /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=k8 -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache collision-protect distlocks fixpackages parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unmerge-orphans userfetch userpriv"
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/"
LANG="fr_FR.UTF-8"
LC_ALL="fr_FR.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="fr"
MAKEOPTS="-j2"
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="/usr/portage/local/layman/sunrise /usr/portage/local/layman/zumastor /usr/portage/local/layman/secondlife /usr/portage/local/layman/gnome /usr/portage/local/java /usr/portage/local/overlay"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac acl acpi alsa amd64 avahi bash-completion bluetooth boost bzip2 cairo caps cli cracklib crypt css cups curl dbus dga dlloader dri dts dv dvb dvd dvdr exif expat fam fastcgi ffmpeg firefox flac fontconfig fuse gd gdbm gif glib gmp gnome gnome-keyring gnutls gphoto2 gpm gsl gstreamer gtk guile hal iconv icu ieee1394 imap imlib isdnlog jack jpeg jpeg2k lame lcms libedit libnotify libwww lirc logrotate lua lzo mad maildir mailwrapper matroska midi mmap mmx mmxext mng mp3 mpeg mudflap multilib musepack mysql ncurses network-cron newspr nls nptl nptlonly ogg openal openexr opengl openmp pam pch pcre pdf perl png posix pppd pulseaudio python qt4 quicktime readline reflection ruby sasl schroedinger sdl session slang speex spell spl sse sse2 ssl startup-notification svg sysfs sysvipc tcpd theora threads tiff truetype udev unicode urandom usb userlocales v4l v4l2 vhosts vim-syntax vorbis wmf wxwindows x264 xattr xcb xinetd xml xorg xpm xulrunner xv xvid zeroconf zlib" ALSA_CARDS="intel8x0 usb-audio" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd 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 dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="worker" CAMERAS="ptp2" DVB_CARDS="usb-wt220u" ELIBC="glibc" INPUT_DEVICES="joystick evdev wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr" LIRC_DEVICES="devinput userspace" USERLAND="GNU" VIDEO_CARDS="radeon r300 vesa"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jimmy.Jazz 2008-10-29 15:59:35 UTC
Created attachment 170230 [details]
gcc log file
Comment 2 Jimmy.Jazz 2008-10-29 16:04:48 UTC
The result:

# PORTDIR_OVERLAY=/usr/portage/local/crossdev  crossdev --k 2.6.27-r2 --g 4.3.2 --b 2.19.50.0.1 --l 0.9.30_rc3 --target x86_64-pc-linux-uclibc -vp
 * Restoring user setting 'UCLIBC_CPU' to 'K7'
 * Restoring user setting 'USE' to 'ipv6 savedconfig -iconv -uclibc-compat '
 * Restoring user setting 'CFLAGS' to '-Os -pipe'
------------------------------------------------------------------------------------------------------------
 * Host Portage ARCH:     amd64
 * Target Portage ARCH:   amd64
 * Target System:         x86_64-pc-linux-uclibc
 * Stage:                 4 (C/C++ compiler)

 * binutils:              binutils-2.19.50.0.1
 * gcc:                   gcc-4.3.2
 * headers:               linux-headers-2.6.27-r2
 * libc:                  uclibc-0.9.30_rc3

 * PORTDIR_OVERLAY:       /usr/portage/local/crossdev
 * PORT_LOGDIR:           /var/log/ebuild
 * PKGDIR:                /usr/portage/packages/cross/x86_64-pc-linux-uclibc
 * PORTAGE_TMPDIR:        /var/tmp/cross/x86_64-pc-linux-uclibc
  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -
rm: ne peut enlever `/usr/portage/local/crossdev/cross-x86_64-pc-linux-uclibc/uclibc': est un dossier
ln: création d'un lien symbolique `/usr/portage/local/crossdev/cross-x86_64-pc-linux-uclibc/uclibc/uclibc': Le fichier existe
 * Forcing the latest versions of {binutils,gcc}-config/gnuconfig ...                                 [ ok ]
 * Log: /var/log/ebuild/cross-x86_64-pc-linux-uclibc-binutils.log
 * Emerging cross-binutils ...

These are the packages that would be merged, in order:


Total: 0 packages, Size of downloads: 0 kB                                                            [ ok ]
 * Log: /var/log/ebuild/cross-x86_64-pc-linux-uclibc-linux-headers-quick.log
 * Emerging cross-linux-headers-quick ...

These are the packages that would be merged, in order:


Total: 0 packages, Size of downloads: 0 kB                                                            [ ok ]
 * Log: /var/log/ebuild/cross-x86_64-pc-linux-uclibc-uclibc-headers.log
 * Emerging cross-uclibc-headers ...

These are the packages that would be merged, in order:


Total: 0 packages, Size of downloads: 0 kB                                                            [ ok ]
 * Log: /var/log/ebuild/cross-x86_64-pc-linux-uclibc-gcc-stage1.log
 * Emerging cross-gcc-stage1 ...

These are the packages that would be merged, in order:


Total: 0 packages, Size of downloads: 0 kB                                                            [ ok ]
 * Log: /var/log/ebuild/cross-x86_64-pc-linux-uclibc-linux-headers.log
 * Emerging cross-linux-headers ...

These are the packages that would be merged, in order:


Total: 0 packages, Size of downloads: 0 kB                                                            [ ok ]
 * Log: /var/log/ebuild/cross-x86_64-pc-linux-uclibc-uclibc.log
 * Emerging cross-uclibc ...

These are the packages that would be merged, in order:


Total: 0 packages, Size of downloads: 0 kB                                                            [ ok ]
 * Log: /var/log/ebuild/cross-x86_64-pc-linux-uclibc-gcc-stage2.log
 * Emerging cross-gcc-stage2 ...

These are the packages that would be merged, in order:

[ebuild   R   ] cross-x86_64-pc-linux-uclibc/gcc-4.3.2  USE="(multilib) nls (-altivec) -bootstrap -build -doc (-fixed-point) -fortran -gcj -gtk -hardened -ip28 -ip32r10k -libffi -mudflap -multislot (-n32) (-n64) -nocxx* -objc -objc++ -objc-gc -openmp -test -vanilla" 0 kB [1]

Total: 1 package (1 reinstall), Size of downloads: 0 kB
Portage tree and overlays:
 [0] /usr/portage
 [1] /usr/portage/local/crossdev                                                                      [ ok ]
Comment 3 SpanKY gentoo-dev 2008-11-01 06:25:58 UTC
x86_64 uclibc really has never been tested
Comment 4 Jimmy.Jazz 2008-11-01 11:09:55 UTC
(In reply to comment #3)
> x86_64 uclibc really has never been tested
> 
It works well and the binaries are small. I'm pleased with x86_64 uclibc because I use it to generate small static executables for my initramfs filesystem. I could use i386 and even get smaller one but I prefer to have a full 64 bits system. 

crossdev was working well with uclibc 0.9.29, 2.18 binutils and 2.6.25 headers. I was even able to compile with 0.9.30_rc1 until I had the bad idea to crossdev -C everything. The binaries becomes even smaller. Now I'm getting the -lc message everytime I compile.

I didn't find something useful on the net about it but few people have the same issue.

I never emerged uclibc in a glibc environment directly with emerge -a uclibc.  Does it harm /etc/ld.so.conf ? Is it possible ? Could you please confirm ?
Comment 5 Jimmy.Jazz 2008-11-03 17:50:20 UTC
(In reply to comment #3)
> x86_64 uclibc really has never been tested
> 

I don't understand why gcc package built a 32bits version when uclibc libraries are 64bits only. The issue could have something to do with the multilib flag. Also, I recompiled the old toolchain/headers/uclibc packages that have been successful in the past but this time they failed. 

I don't have more success with i386-pc-linux-uclibc either :(



Comment 6 Jimmy.Jazz 2008-11-05 18:25:35 UTC
I tried all sort of combinations and none of them is working. Also I don't understand the meaning of the comment, "# @multilib_dir@ is not really necessary, but sometimes it has # more uses than just a directory name." 
Does it say multilib_dirs are not necessary. Also, why not tell crossdev to compile with -m64 or --disable-multilib flags and ignore such multilib directories when the target is 64bits. Has someone tried to cross compile for sparc64 platform ? Has it worked ?

Many things have changed in portage scripts as in toolchain eclasses since my last successful x86_64 cross-compilation. I was not able to alter them to make crossdev work again (it really has). 

When compiling i686-pc-linux-uclibc it is even worse. I have got the following message,

cc1: error: CPU you selected does not support x86-64 instruction set
cc1: error: CPU you selected does not support x86-64 instruction set
  CC ldso/ldso/ldso.oS
ldso/ldso/ldso.c:1: error: CPU you selected does not support x86-64 instruction set
  AS ldso/ldso/i386/resolve.oS

It looks like there is a real breakdown in the code.

Please could someone confirm both issues. So I won't feel too much lonely :)
Comment 7 SpanKY gentoo-dev 2008-11-08 14:32:41 UTC
i meant x86_64-uclibc has never been tested with the ebuilds.  the uclibc port itself has of course been tested (i'm the one who ported it in the first place after all).
Comment 8 Jimmy.Jazz 2008-11-13 14:53:36 UTC
(In reply to comment #7)
> i meant x86_64-uclibc has never been tested with the ebuilds.  the uclibc port
> itself has of course been tested (i'm the one who ported it in the first place
> after all).
> 
I know very well that you are an active member of gentoo community and a lead developer on that project. Also, I'm glad to see you are still involved in :). 

I tried to find out what has turned wrong but the toolchain class has been too deeply altered since and it has become difficult to trace the issue. gcc 4.3.2 doesn't help either.

The fact that I was able to upgrade the crossdev's toolchain and even build the last 1.12 busybox and uclibc 0.9.30 successfully (I could see that mdev block device generation as been corrected since :) is hard to understand.It was a really bad idea to run crossdev -C and refresh the x86_64-uclibc toolchain again. So... I'm stuck with that nasty stage 4 failure.

I would be glad if you could give me any hints.

Thanks
Comment 9 SpanKY gentoo-dev 2010-04-11 21:40:04 UTC
*** Bug 312327 has been marked as a duplicate of this bug. ***
Comment 10 SpanKY gentoo-dev 2010-06-07 09:54:12 UTC
*** Bug 322757 has been marked as a duplicate of this bug. ***
Comment 11 Andrew Frink 2010-09-06 23:18:17 UTC
Since the bug i filed got marked as a dupe of this bug, with the message "clear USE=multilib in your local package.use for now", i'll add this here.
* cross-x86_64-gentoo-linux-uclibc/gcc-4.4.4-r1 still fails with the same error message. 
* The profile "default/linux/amd64/10.0/desktop" forces the multilib flag for me, and all other non "no-multilib" profiles do as well. I'm running a ~amd64 system.
* As a "work around" you can add "cross-x86_64-gentoo-linux-uclibc/gcc -multilib" to "/etc/portage/profile/package.use.force" and "/etc/portage/package.use".

GCC with uclibc compiled and installed and builds binaries just fine after the addition of -multilib in the files mentioned above. 
Comment 12 SpanKY gentoo-dev 2010-11-09 13:14:07 UTC
*** Bug 343423 has been marked as a duplicate of this bug. ***
Comment 13 SpanKY gentoo-dev 2012-04-23 17:33:44 UTC
the latest crossdev controls multilib, so this should be fixed implicitly