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

Bug 564514

Summary: sys-devel/crossdev-20150716: wrong shared libraries path was selected for cross-toolchains.
Product: Gentoo Linux Reporter: Tom Li <biergaizi2009>
Component: [OLD] DevelopmentAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED DUPLICATE    
Severity: normal CC: alexander
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Tom Li 2015-10-30 17:23:36 UTC
It seems that crossdev is no longer able to deal with path of libraries properly! Regardless to my toolchains, the dynamic links to the shared libraries to always resolve to system standard path, instead of prefix path of cross-toolchains.

for example, crossdev -s4 avr will install binutils, but in fact it doesn't work.

/usr/x86_64-pc-linux-gnu/avr/binutils-bin/2.25.1/ld.bfd: symbol lookup error: /usr/x86_64-pc-linux-gnu/avr/binutils-bin/2.25.1/ld.bfd: undefined symbol: elf32_avr_setup_params

Obviously, GCC won't compile.

ldd shows that the wrong libraries was selected

ldd /usr/x86_64-pc-linux-gnu/avr/binutils-bin/2.25.1/ld
        linux-vdso.so.1 (0x0000038206548000)
        libbfd-2.25.1.so => /usr/lib64/libbfd-2.25.1.so (0x0000038205fea000)  <- no! should not be host library!
        libdl.so.2 => /lib64/libdl.so.2 (0x0000038205de6000)
        libc.so.6 => /lib64/libc.so.6 (0x0000038205a3b000)
        libz.so.1 => /lib64/libz.so.1 (0x0000038205823000)
        /lib64/ld-linux-x86-64.so.2 (0x0000038206328000)

After downgrading to binutils-2.23, it even unable to find some libraries such as libopcodes...

If I hack /etc/ld.so.conf.d/cross.conf && env-update, and path such as /usr/x86_64-pc-linux-gnu/x86_64-w64-mingw32/binutils-bin/2.2x.y, binutils works. But during the emerging of GCC, it happens again, GCC selects wrong assembler (host assembler), and it doesn't support cross-compile and it fails again...

I'm not able to compile AVR, MIPS, or MinGW toolchains for the same reason.

Reproducible: Always

Steps to Reproduce:
1. emerge "=sys-devel/crossdev-20150716"
2. crossdev -s4 avr
3. /usr/x86_64-pc-linux-gnu/avr/binutils-bin/2.25.1/ld
/usr/x86_64-pc-linux-gnu/avr/binutils-bin/2.25.1/ld: symbol lookup error: /usr/x86_64-pc-linux-gnu/avr/binutils-bin/2.25.1/ld: undefined symbol: elf32_avr_setup_params
Actual Results:  
 * Log: /var/log/portage/cross-avr-binutils.log
 * Emerging cross-binutils 
 * Log: /var/log/portage/cross-avr-gcc-stage1.log
 * Emerging cross-gcc-stage1 ...
 * gcc failed :(

Expected Results:  
The proper shared libraries should be used and GCC should compile.

Portage 2.2.23 (python 3.4.3-final-0, hardened/linux/amd64, gcc-5.2.0, glibc-2.22-r1, 4.2.3-hardened-r5 x86_64)
=================================================================
System uname: Linux-4.2.3-hardened-r5-x86_64-Intel-R-_Core-TM-_i7-2600K_CPU_@_3.40GHz-with-gentoo-2.2
KiB Mem:    16378700 total,   7218272 free
KiB Swap:    5324796 total,   5324796 free
sh bash 4.3_p42
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.22.0::gentoo
dev-lang/python:          2.7.10::gentoo, 3.4.3::gentoo
dev-util/cmake:           3.3.2-r1::gentoo
dev-util/pkgconfig:       0.29::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.18.3::gentoo
sys-apps/sandbox:         2.9::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.8.4::gentoo, 4.9.3::gentoo, 5.2.0::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.2::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r1::gentoo
Repositories:

gentoo
    location: /usr/portage/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

gamerlay
    location: /var/lib/layman/gamerlay
    masters: gentoo
    priority: 50

gentoo-zh
    location: /var/lib/layman/gentoo-zh
    masters: gentoo
    priority: 50

local
    location: /usr/local/portage
    masters: gentoo
    priority: 100

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
DISTDIR="/data/System/usr/portage/distfiles/"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs candy config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync metadata-transfer news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
GENTOO_MIRRORS="http://mirrors.aliyun.com/gentoo/ http://mirrors.sohu.com/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j8"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/mnt/compile/compile"
USE="X aac acl acpi aes alac alsa amd64 apng ass avx berkdb bittorrent bluetooth bluray branding bzip2 c++0x cairo cdda cdr cjk cli cracklib crypt cuda cups cxx dbus dri dvd dvdnav encode ffmpeg flac fontconfig gdbm gif gphoto2 gpm gudev hardened http2 iconv icu infinality ios ipod ipv6 jack jpeg justify lame libass lto mmx mmxext modules mp3 mtp multilib ncurses networkmanager nls nptl ogg opengl openmp opus pam pax_kernel pcre pie pkcs11 plasma png policykit popcnt pulseaudio python3 qt qt3support qt5 readline scanner seccomp semantic-desktop session smartcard sqlite sse sse2 sse3 sse4_1 sse4_2 ssl ssp ssse3 svg systemd tcpd threads tiff truetype twolame unicode upnp urandom usb vdpau vim-syntax vorbis webm wifi x264 xattr xinerama xmp xtpax zlib zsh-completion" ABI_X86="32 64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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 cgi cgid 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" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="zh_CN en_US zh cn" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" QEMU_SOFTMMU_TARGETS="mips64el mips64" QEMU_USER_TARGETS="mips64el mips64" RUBY_TARGETS="ruby20 ruby22" USERLAND="GNU" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.7 3.4"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Tom Li 2015-10-30 17:25:28 UTC
It seems some people at the forum hit by the same issue:
https://forums.gentoo.org/viewtopic-p-7823658.html
Comment 2 Alexander Tsoy 2015-10-30 17:28:05 UTC
This is a dupe of bug #562460
Comment 3 Tom Li 2015-10-31 05:05:03 UTC
Thanks Alexander, the bugfix saves me the day!

*** This bug has been marked as a duplicate of bug 562460 ***