Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 713978 - sys-devel/gcc-9.3.0 : collect2: error: ld returned 1 exit status
Summary: sys-devel/gcc-9.3.0 : collect2: error: ld returned 1 exit status
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo musl team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-22 12:48 UTC by Toralf Förster
Modified: 2020-03-24 15:49 UTC (History)
2 users (show)

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


Attachments
emerge-info.txt (emerge-info.txt,15.45 KB, text/plain)
2020-03-22 12:48 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,789 bytes, text/plain)
2020-03-22 12:48 UTC, Toralf Förster
Details
environment (environment,129.90 KB, text/plain)
2020-03-22 12:48 UTC, Toralf Förster
Details
etc.portage.tbz2 (etc.portage.tbz2,9.99 KB, application/x-bzip)
2020-03-22 12:48 UTC, Toralf Förster
Details
logs.tbz2 (logs.tbz2,72.28 KB, application/x-bzip)
2020-03-22 12:48 UTC, Toralf Förster
Details
sys-devel:gcc-9.3.0:20200322-112154.log.bz2 (sys-devel:gcc-9.3.0:20200322-112154.log.bz2,42.96 KB, application/x-bzip)
2020-03-22 12:48 UTC, Toralf Förster
Details
temp.tbz2 (temp.tbz2,77.50 KB, application/x-bzip)
2020-03-22 12:48 UTC, Toralf Förster
Details
emerge.log (emerge.log,14.24 KB, text/plain)
2020-03-24 15:41 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2020-03-22 12:48:10 UTC
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: i386 architecture of input file /usr/lib/../lib/crti.o is incompatible with i386:x86-64 output
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: i386 architecture of input file /usr/lib/../lib/crtn.o is incompatible with i386:x86-64 output
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:992: libgcc_s.so] Error 1
make[3]: Leaving directory /var/tmp/portage/sys-devel/gcc-9.3.0/work/build/x86_64-gentoo-linux-musl/libgcc
make[2]: *** [Makefile:16824: all-stage1-target-libgcc] Error 2

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.0_musl_hardened-20200322-121503

  -------------------------------------------------------------------

gcc-config -l:

Available Python interpreters, in order of preference:
  [1]   python3.7
  [2]   python3.6
  [3]   python2.7 (fallback)

timestamp of HEAD at this tinderbox image:
/var/db/repos/gentoo	Sun Mar 22 10:14:20 UTC 2020
/var/db/repos/musl	Sun Mar 22 03:12:57 UTC 2020

emerge -qpvO sys-devel/gcc
[ebuild  NS   ] sys-devel/gcc-9.3.0 [9.2.0-r2] USE="(cxx) hardened nls nptl openmp (pie) (ssp) (-altivec) -d -debug -doc (-fixed-point) -fortran -go -graphite (-jit) (-libssp) -lto (-multilib*) -objc -objc++ -objc-gc (-pch) -pgo (-sanitize*) -systemtap -test -vanilla (-vtv*)"
Comment 1 Toralf Förster gentoo-dev 2020-03-22 12:48:17 UTC
Created attachment 624412 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2020-03-22 12:48:23 UTC
Created attachment 624414 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2020-03-22 12:48:27 UTC
Created attachment 624416 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2020-03-22 12:48:29 UTC
Created attachment 624418 [details]
etc.portage.tbz2
Comment 5 Toralf Förster gentoo-dev 2020-03-22 12:48:32 UTC
Created attachment 624420 [details]
logs.tbz2
Comment 6 Toralf Förster gentoo-dev 2020-03-22 12:48:35 UTC
Created attachment 624422 [details]
sys-devel:gcc-9.3.0:20200322-112154.log.bz2
Comment 7 Toralf Förster gentoo-dev 2020-03-22 12:48:38 UTC
Created attachment 624424 [details]
temp.tbz2
Comment 8 Sergei Trofimovich (RETIRED) gentoo-dev 2020-03-22 14:06:37 UTC
I'm a bit surprised to see gcc to fail build itself, but it's probably another manifestation of bug #675954
Comment 9 Jory A. Pratt gentoo-dev 2020-03-24 03:19:51 UTC
(In reply to Sergei Trofimovich from comment #8)
> I'm a bit surprised to see gcc to fail build itself, but it's probably
> another manifestation of bug #675954

assumption would be wrong in this case.
Comment 10 Sergei Trofimovich (RETIRED) gentoo-dev 2020-03-24 08:34:53 UTC
Another odd thing is this transition:

> [ebuild  NS   ] sys-devel/gcc-9.3.0 [9.2.0-r2] USE="(cxx) hardened nls nptl openmp (pie) (ssp) (-altivec) -d -debug -doc (-fixed-point) -fortran -go -graphite (-jit) (-libssp) -lto (-multilib*) -objc -objc++ -objc-gc (-pch) -pgo (-sanitize*) -systemtap -test -vanilla (-vtv*)"

According to 'man emerge' '*' means: '*        suffix      transition to or from the enabled state'

'multilib' change looks unexpected assuming both 9.2.0-r2 and 9.3.0 ebuilds use the same eclass and profile.

Also, it's not very clear from the output, but build.log implies gcc ebuild comes from ::musl overlay and not gentoo:

 * Package:    sys-devel/gcc-9.3.0
 * Repository: musl

The failure snippet implies that /usr/lib/crti.o is a 32-bit file:

/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: i386 architecture of input file `/usr/lib/../lib/crti.o' is incompatible with i386:x86-64 output

Toralf, can you double-check it? That should be the output:

$ file /usr/lib/crti.o
/usr/lib/crti.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
Comment 11 Michael 'veremitz' Everitt 2020-03-24 08:38:19 UTC
How on earth are we starting out with a ::gentoo gcc and then switching to a ::musl gcc? It should be ::musl all along? Presently ::gentoo won't build properly under musl afaik...

Any why is portage output not displaying repositories, or is that me always using --verbose options everywhere .. XD
Comment 12 Toralf Förster gentoo-dev 2020-03-24 15:41:54 UTC
Created attachment 625010 [details]
emerge.log

emerge log
Comment 13 Toralf Förster gentoo-dev 2020-03-24 15:43:15 UTC
The musl hardened was setup in the same way as musl(In reply to Sergei > 
> $ file /usr/lib/crti.o
> /usr/lib/crti.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not
> stripped


$ chr img2/17.0_musl_hardened-20200322-121503
mr-fox ~ # file /usr/lib/crti.o
/usr/lib/crti.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped
mr-fox ~ # exit
Comment 14 Toralf Förster gentoo-dev 2020-03-24 15:49:45 UTC
wrong stage3 was used - my fault