This is an auto-filled bug because sys-devel/clang fails to compile on x86. Feel free to adjust the summary to clarify the exact issue. Attached build log and emerge --info
Created attachment 617888 [details] clang-9.0.1:20200310-104054.log.bz2 build log
Created attachment 617890 [details] emerge --info emerge --info
/usr/lib/gcc/i686-pc-linux-gnu/9.2.0/../../../../i686-pc-linux-gnu/bin/ld: bfd_new_link_order failed collect2: error: ld returned 1 exit status Looks like binutils problem.
> CFLAGS="-O2 -pipe -march=native -g -ggdb" > CXXFLAGS="-O2 -pipe -march=native -g -ggdb" > LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu" I would guess that debugging information enabled by -ggdb overflows 4GB limit on disk. Let's see if I can reproduce it. Should be easy to make linker error less obscure.
On my x86 system final linking fails with: /usr/lib/gcc/i686-pc-linux-gnu/9.2.0/../../../../i686-pc-linux-gnu/bin/ld: failed to set dynamic section sizes: memory exhausted Which sounds about right if you are close to the limit.
LDFLAGS+=-Wl,--no-keep-memory allows to contain memory usage down to ~2.1GB RSS RAM.
You might want to add more conservative RAM behaviour with: use x86 && append-ldflags "-Wl,--no-keep-memory" I'll sort out binutils error reporting separately.
As for where RAM usage comes from 'ld.gold ... --stat' renders the following stats: ``` ... ld.gold: output file size: 1506527692 bytes ... ld.gold: .debug_str merged strings input bytes: 1861265804 ld.gold: .debug_str merged strings input strings: 25865501 ld.gold: .debug_str merged strings entries: 849387; buckets: 1447153 ld.gold: .debug_str merged strings Stringdata structures: 85222 ... ``` 1.8GB of debug strings alone which required in-memory deduplication. ld.bfd has a similar profile with 1.5x smaller RAM usage.
I wonder if this is something we should do on all systems where linker executable uses ABI with 32-bit pointers (something for toolchain-funcs or flag-o-matic?) but I guess this is good enough for now.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ec2b13a11a6b5712817b20dab096a668f4afd06f commit ec2b13a11a6b5712817b20dab096a668f4afd06f Author: Michał Górny <mgorny@gentoo.org> AuthorDate: 2020-06-29 15:03:37 +0000 Commit: Michał Górny <mgorny@gentoo.org> CommitDate: 2020-06-29 15:04:58 +0000 sys-devel/clang: Pass -Wl,--no-keep-memory to linker on x86 Closes: https://bugs.gentoo.org/712052 Signed-off-by: Michał Górny <mgorny@gentoo.org> sys-devel/clang/clang-10.0.0.ebuild | 4 ++++ sys-devel/clang/clang-10.0.1.9999.ebuild | 4 ++++ sys-devel/clang/clang-10.0.1_rc1.ebuild | 4 ++++ sys-devel/clang/clang-11.0.0.9999.ebuild | 4 ++++ 4 files changed, 16 insertions(+)