Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 622962 - sys-devel/gcc-5.4.0-r3: /usr/x86_64-pc-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/usr/lib/../lib/crti.o' is incompatible with i386 output
Summary: sys-devel/gcc-5.4.0-r3: /usr/x86_64-pc-linux-gnu/bin/ld: i386:x86-64 architec...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard: weird cflags
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-28 20:30 UTC by Karl Tomlinson
Modified: 2017-10-12 22:11 UTC (History)
0 users

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


Attachments
build log (sys-devel:gcc-5.4.0-r3:20170628-190455.log.gz,130.49 KB, application/gzip)
2017-06-28 20:33 UTC, Karl Tomlinson
Details
gcc-build-logs.tar.bz2 (gcc-build-logs.tar.bz2,60.04 KB, application/x-bzip)
2017-06-28 20:35 UTC, Karl Tomlinson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Tomlinson 2017-06-28 20:30:43 UTC
/var/tmp/portage/sys-devel/gcc-5.4.0-r3/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-5.4.0-r3/work/build/./gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include    -O2  -g -O2 -pipe -march=native -g1 -fno-omit-frame-pointer -DIN_GCC    -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fpic -mlong-double-80 -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fstack-check=no  -shared -nodefaultlibs -Wl,--soname=libgcc_s.so.1 -Wl,--version-script=libgcc.map -o 32/libgcc_s.so.1.tmp -g -O2 -pipe -march=native -g1 -fno-omit-frame-pointer -m32 -B./ _muldi3_s.o _negdi2_s.o _lshrdi3_s.o _ashldi3_s.o _ashrdi3_s.o _cmpdi2_s.o _ucmpdi2_s.o _clear_cache_s.o _trampoline_s.o __main_s.o _absvsi2_s.o _absvdi2_s.o _addvsi3_s.o _addvdi3_s.o _subvsi3_s.o _subvdi3_s.o _mulvsi3_s.o _mulvdi3_s.o _negvsi2_s.o _negvdi2_s.o _ctors_s.o _ffssi2_s.o _ffsdi2_s.o _clz_s.o _clzsi2_s.o _clzdi2_s.o _ctzsi2_s.o _ctzdi2_s.o _popcount_tab_s.o _popcountsi2_s.o _popcountdi2_s.o _paritysi2_s.o _paritydi2_s.o _powisf2_s.o _powidf2_s.o _powixf2_s.o _powitf2_s.o _mulsc3_s.o _muldc3_s.o _mulxc3_s.o _multc3_s.o _divsc3_s.o _divdc3_s.o _divxc3_s.o _divtc3_s.o _bswapsi2_s.o _bswapdi2_s.o _clrsbsi2_s.o _clrsbdi2_s.o _fixunssfsi_s.o _fixunsdfsi_s.o _fixunsxfsi_s.o _fixsfdi_s.o _fixdfdi_s.o _fixxfdi_s.o _fixunssfdi_s.o _fixunsdfdi_s.o _fixunsxfdi_s.o _floatdisf_s.o _floatdidf_s.o _floatdixf_s.o _floatundisf_s.o _floatundidf_s.o _floatundixf_s.o _divdi3_s.o _moddi3_s.o _udivdi3_s.o _umoddi3_s.o _udiv_w_sdiv_s.o _udivmoddi4_s.o cpuinfo_s.o tf-signs_s.o sfp-exceptions_s.o addtf3_s.o divtf3_s.o eqtf2_s.o getf2_s.o letf2_s.o multf3_s.o negtf2_s.o subtf3_s.o unordtf2_s.o fixtfsi_s.o fixunstfsi_s.o floatsitf_s.o floatunsitf_s.o fixtfdi_s.o fixunstfdi_s.o floatditf_s.o floatunditf_s.o extendsftf2_s.o extenddftf2_s.o extendxftf2_s.o trunctfsf2_s.o trunctfdf2_s.o trunctfxf2_s.o enable-execute-stack_s.o unwind-dw2_s.o unwind-dw2-fde-dip_s.o unwind-sjlj_s.o unwind-c_s.o emutls_s.o libgcc.a -lc && rm -f 32/libgcc_s.so && if [ -f 32/libgcc_s.so.1 ]; then mv -f 32/libgcc_s.so.1 32/libgcc_s.so.1.backup; else true; fi && mv 32/libgcc_s.so.1.tmp 32/libgcc_s.so.1 && ln -s libgcc_s.so.1 32/libgcc_s.so
/usr/x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/../lib/libc.so when searching for -lc
/usr/x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/../lib/libc.a when searching for -lc
/usr/x86_64-pc-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/usr/lib/../lib/crti.o' is incompatible with i386 output
/usr/x86_64-pc-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/usr/lib/../lib/crtn.o' is incompatible with i386 output
collect2: error: ld returned 1 exit status


Reproducible: Always

Steps to Reproduce:
1.emerge -v gcc

Actual Results:  
ld error

Expected Results:  
package merged

Tried binutils-config x86_64-pc-linux-gnu-2.26.1 and x86_64-pc-linux-gnu-2.28.

/usr/lib is a symlink to /usr/lib64.

% file /usr/lib64/crti.o 
/usr/lib64/crti.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped, with debug_info

which is expected.  If /usr/lib32/crti.o is not being used, I don't know why.

% file /usr/lib32/crti.o
/usr/lib32/crti.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped, with debug_info

# emerge --info '=sys-devel/gcc-5.4.0-r3::gentoo'                         
Portage 2.3.6 (python 3.4.5-final-0, default/linux/amd64/13.0/desktop/plasma/systemd, gcc-4.9.4, glibc-2.23-r4, 4.11.6-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.11.6-gentoo-x86_64-Intel-R-_Core-TM-_i7-6920HQ_CPU_@_2.90GHz-with-gentoo-2.3
KiB Mem:    32884500 total,   1181964 free
KiB Swap:   16777212 total,  16772624 free
Timestamp of repository gentoo: Wed, 28 Jun 2017 15:45:01 +0000
sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.28 p1.2) 2.28
app-shells/bash:          4.3_p48-r1::gentoo
dev-lang/perl:            5.24.1-r2::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo
dev-util/cmake:           3.7.2::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.26.3::gentoo
sys-apps/sandbox:         2.10-r3::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.26.1::gentoo, 2.28-r2::gentoo
sys-devel/gcc:            4.9.4::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r4::gentoo
Repositories:

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

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

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

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

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -fpredictive-commoning -fgcse-after-reload -frename-registers -fweb -funswitch-loops -g1 -fno-omit-frame-pointer -momit-leaf-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=native -fpredictive-commoning -fgcse-after-reload -frename-registers -fweb -funswitch-loops -g1 -fno-omit-frame-pointer -momit-leaf-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs collision-protect compress-build-logs compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.swin.edu.au/gentoo http://ftp.ucsb.edu/pub/mirrors/linux/gentoo/"
LANG="en_NZ.UTF-8"
LDFLAGS="-Wl,-O1,--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 --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi activefilter aiglx aio alsa amd64 amr amrnb amrwb apache2 apng archive ares asf async athena audiofile audit avahi bash-completion berkdb bitmap-fonts bluetooth branding bugzilla bzip2 cairo cap caps cdda cdparanoia cdr cli clucene cracklib crypt cryptsetup cups cupsddk curl cxx dbus declarative dell diet disk-partition divx dlloader dmi dnd dri dtmf dts dv dvd dvdread dvi elfutils emacs emboss encode eolconv exif faac faad fam fame fbcon ffmpeg fftw firefox flac fontconfig fontforge fortran fts3 gd gdbm geoip gif gimpprint git glamor glut gmp gphoto2 gpm grammar gs gsm gtk gzip-el harfbuzz hotpixels iconv id3tag imagemagick imlib ipv6 ithreads jbig jpeg kde kdeenablefinal kdehiddenvisibility kdexdeltas kdrive kipi kpathsea kwallet ladspa lame laptop lcms lensfun libnl libnotify live lm_sensors logrotate loop-aes lua lzma lzo m17n-lib mad maildir math matroska mjpeg mmap mmx mmxext mng modules mozdevelop mozilla moznocompose mozsvg mp3 mp4 mpe mpeg mplayer multilib musicbrainz ncurses no-old-linux nodrm nptl nptlonly nscd numeric ocr ogg openexr opengl openmp opus pam pam_console pango pcap pcre pdf pdfimport phonon plasma png pnp policykit pop postproc pth pulseaudio qml qos qt3support qt5 raw rdoc readline real realmedia redeyes resolvconf rtc scanner schroedinger sdl seccomp semantic-desktop session sip sipim smp sndfile sound spell sqlite sqlite3 sse sse2 sse3 ssh ssl ssse3 startup-notification stats svg sysfs syslog system-icu system-jpeg system-libvpx system-sqlite systemd tcpd theora thesaurus threads threadsonly thumbnail tiff timidity truetype truetype-debugger truetype-fonts type1-fonts udev udis86 udisks unicode unwind upower usb utempter utils vdpau visualization vorbis wav widgets wifi win32codecs wmp wxwidgets x264 x86emu xattr xcb xchattext xcomposite xft xine xinerama xml xnest xpm xscreensaver xulrunner xv xvfb xvid xvmc yv12 zeroconf zip zlib zsh-completion" ABI_X86="64" ALSA_CARDS="hda-intel seq-dummy virmidi" 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="canon ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="synaptics evdev libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_US" LIRC_DEVICES="sir" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby21 ruby22" SANE_BACKENDS="epson net" USERLAND="GNU" VIDEO_CARDS="i965 radeonsi" 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"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

# emerge -pqv '=sys-devel/gcc-5.4.0-r3::gentoo'
[ebuild  NS   ] sys-devel/gcc-5.4.0-r3 [4.9.4] USE="cxx doc fortran (multilib) nptl openmp sanitize vtv (-altivec) (-awt) -cilk -debug (-fixed-point) -gcj -go -graphite (-hardened) (-jit) (-libssp) -mpx -nls -nopie -nossp -objc -objc++ -objc-gc -regression-test -vanilla"
Comment 1 Karl Tomlinson 2017-06-28 20:33:12 UTC
Created attachment 478306 [details]
build log
Comment 2 Karl Tomlinson 2017-06-28 20:35:07 UTC
Created attachment 478308 [details]
gcc-build-logs.tar.bz2
Comment 3 Karl Tomlinson 2017-10-12 22:11:07 UTC
This was probably due to a SYMLINK_LIB="no" that was accidentally copied with settings from another install.

Noticed when the baselayout-2.4.1-r2 install self-destructed with

 * Converting /lib from a symlink to a dir
 * Migrating /lib32 to /lib
 * Converting /usr/lib from a symlink to a dir
 * Migrating /usr/lib32 to /usr/lib
 * Converting /usr/local/lib from a symlink to a dir
/usr/bin/python3.4m: can't open file '/usr/lib/portage/python3.4/filter-bash-environment.py': [Errno 2] No such file or directory

Don't know why the "Your system profile has SYMLINK_LIB=" warning was not emitted.

But after restoring the symlinks and removing SYMLINK_LIB="no", gcc-5.4.0-r3 installs now, thanks.