Created attachment 796147 [details] compressed build log from aarch64-cross emerge-aarch64-unknown-linux-gnu -pv compiler-rt These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild N ] sys-libs/compiler-rt-14.0.6:14.0.6::gentoo to /usr/aarch64-unknown-linux-gnu/ USE="-clang -debug -test -verify-sig" 0 KiB and will leave these files to be installed: >>> Completed installing sys-libs/compiler-rt-14.0.6 into /var/tmp/portage/portage/sys-libs/compiler-rt-14.0.6/image * Final size of build directory: 48752 KiB (47.6 MiB) * Final size of installed tree: 4 KiB ./ ./usr/ ./usr/share/ ./usr/share/doc/ ./usr/share/doc/compiler-rt-14.0.6/ ./usr/share/doc/compiler-rt-14.0.6/README.txt.bz2 >>> Done.
Created attachment 796150 [details] output from emerge --info
ehr, I just confirmed the issue on native aarch64. Is this intended? the files are shipped on Arch Linux arm port: cd /usr/lib/clang/14.0.6/lib/linux && ls | grep crt clang_rt.crtbegin-aarch64.o clang_rt.crtend-aarch64.o
I can't reproduce this. Anythign interesting about your system?
please share the logs of your successfull build + emerge --info of device, maybe I can see some clue
lets forget about the cross compile, it will most likely be broken at runtime anyway the native compile works for 14.0.6 if built with gcc, so USE="-clang -debug -test -verify-sig" emerge -av =compiler-rt-14.0.6 -1 will result in installing no files but the readme. how does the ebuild detect what ninja has to do? >>> Compiling source in /var/tmp/portage/sys-libs/compiler-rt-14.0.6/work/compiler-rt ... * Source directory (CMAKE_USE_DIR): "/var/tmp/portage/sys-libs/compiler-rt-14.0.6/work/compiler-rt" * Build directory (BUILD_DIR): "/var/tmp/portage/sys-libs/compiler-rt-14.0.6/work/compiler-rt-14.0.6_build" ninja -v -j4 -l0 ninja: no work to do. >>> Source compiled.
(In reply to tt_1 from comment #5) > lets forget about the cross compile, it will most likely be broken at It doesn't, it runs ninja. The ninja files are generated by CMake. I'll upload my logs now.
Created attachment 796279 [details] build.log (sam, successful build)
Created attachment 796282 [details] emerge --info (sam, successful build)
(In reply to Sam James from comment #6) > (In reply to tt_1 from comment #5) > > lets forget about the cross compile, it will most likely be broken at > It doesn't, it runs ninja. The ninja files are generated by CMake. > > I'll upload my logs now. I can reproduce now I've upgraded the rest of the chroot!
Created attachment 796300 [details] bad qlop list
(In reply to Sam James from comment #7) > Created attachment 796279 [details] > build.log (sam, successful build) I lied, it wasn't a successful build at all, I'm sorry -- I'd checked with ebuild and compared qith equery f, I have no idea why.
Sorry for the confusion. I *can* reproduce it on jiji (mgorny: feel free to try it on jiji: # machinectl shell arm64-stable # emerge -v1 compiler-rt)
(In reply to Sam James from comment #12) > Sorry for the confusion. I *can* reproduce it on jiji > > (mgorny: feel free to try it on jiji: > # machinectl shell arm64-stable > # emerge -v1 compiler-rt) If I go back, 14.0.4 doesn't work for me anymore either. But I'm pretty sure it did in the past (like when i saw the equery f earlier?)
(In reply to Sam James from comment #13) > (In reply to Sam James from comment #12) > > Sorry for the confusion. I *can* reproduce it on jiji > > > > (mgorny: feel free to try it on jiji: > > # machinectl shell arm64-stable > > # emerge -v1 compiler-rt) > > If I go back, 14.0.4 doesn't work for me anymore either. But I'm pretty sure > it did in the past (like when i saw the equery f earlier?) 13.0.1 does work.
I don't yet get why but if I drop -nostartfiles, it works (i.e. revert 828d8bf14cac680b319b107412d1eda05661436f). commit 828d8bf14cac680b319b107412d1eda05661436f Author: Andreas K. Hüttel <dilfridge@gentoo.org> Date: Wed Jul 20 21:22:10 2022 +0000 sys-libs/compiler-rt: add -nostartfiles to nolib_flags This avoids bootstrapping failures during e.g. pure LLVM stage builds as compiler-rt is checking for a working compiler but without -nostartfiles, is actually checking for a working compiler-rt too (which isn't yet installed!) See https://archives.gentoo.org/gentoo-releng-autobuilds/message/eaafa503472438245449f93c2bb64578: ``` : && /usr/lib/llvm/14/bin/clang -O2 -pipe -nodefaultlibs -lc CMakeFiles/cmTC_77c36.dir/testCCompiler.c.o -o cmTC_77c36 && : ld.lld: error: cannot open crtbeginS.o: No such file or directory ld.lld: error: cannot open crtendS.o: No such file or directory clang-14: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed. ``` Signed-off-by: Sam James <sam@gentoo.org>
(In reply to Sam James from comment #15) > I don't yet get why but if I drop -nostartfiles, it works (i.e. revert > 828d8bf14cac680b319b107412d1eda05661436f). > Maybe we can change the logic to be: - if USE=clang, do not touch LDFLAGS yet, and force clang usage (as it is now, but change the elif -> if) - if compiler test fails regardless of USE=clang, try again with nolib_flags with -nodefaultlibs -lc - if *that* fails, try again with -nodefaultlibs -nostartfiles -lc Right now, I think we're prematurely always using -nostartfiles even when it's not an issue, and apparently that breaks things. As for *WHY*, my guess is -nostartfiles triggers something that means we only build for targets (?) and the ebuild only has -DCAN_TARGET_x86_64 & -DCAN_TARGET_i386. So we might want to see if we need options like that for other arches.
commit 755d296048de0477d2608299f6e5f9dcb5ec1af4 Author: Michał Górny <mgorny@gentoo.org> Date: Mon Aug 1 07:59:29 2022 +0200 sys-libs/compiler-rt: Try the runtimes build for 15.x Signed-off-by: Michał Górny <mgorny@gentoo.org>
Do I have to bootstrap the whole 15.x toolchain to test the fix? Or may I locally backport the patch to the 14.0.6 ebuild instead?
(In reply to tt_1 from comment #18) > Do I have to bootstrap the whole 15.x toolchain to test the fix? > > Or may I locally backport the patch to the 14.0.6 ebuild instead? We're still talking about it, it's just a relevant change wrt the bug. I have not tried backporting the runtime stuff. Did build for me with whole 15.x stuff. I'll see about a workaround for 14.x later obviously.
Actually, I'd assumed it'd be more work, you might be able to make it work with 14.x with a runtime build trivially...
hey there, I tried =compiler-rt-14.0.6-r1 and can confirm its working with USE="+clang" on a native compiler, also USE="-clang" is working. USE="-clang" on cross compile not working (not sure if desireable?)
(In reply to tt_1 from comment #21) > hey there, I tried =compiler-rt-14.0.6-r1 and can confirm its working with > USE="+clang" on a native compiler, also USE="-clang" is working. > > > USE="-clang" on cross compile not working (not sure if desireable?) I didn't mean to commit -r1 yet but really glad you tried it, could you show me what happens w -clang and cross? The *hope* is the "runtimes" stuff handles all the workarounds for us but I'm not sure if I believe in it yet
Created attachment 797116 [details] compressed build log from aarch64-cross I really don't know whats going on behind the scenes with regard to cross, have a look at the build log maybe?
(In reply to tt_1 from comment #23) > Created attachment 797116 [details] > compressed build log from aarch64-cross > > I really don't know whats going on behind the scenes with regard to cross, > have a look at the build log maybe? Oh dear. It fails in the worst possible way, too (installing nothing). Okay, first, let me revert the -nostartfiles change from before, so we're not broken anymore for !amd64, and we go from there.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dc072af65039e77a4ecc35ffee42b0a29523d122 commit dc072af65039e77a4ecc35ffee42b0a29523d122 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-08-03 23:32:44 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-08-03 23:33:08 +0000 sys-libs/compiler-rt: try better workaround for -nostartfiles Fix no installed files on !amd64. Bug: https://bugs.gentoo.org/862540 Signed-off-by: Sam James <sam@gentoo.org> sys-libs/compiler-rt/compiler-rt-14.0.6-r1.ebuild | 150 ++++++++++++++++++++++ 1 file changed, 150 insertions(+)
I'll sync 15.x 9999 depending on how this one goes.
ok, so recent changes commited for -r1 enable the native compile, regardless of clang useflag cross-compile still broken, as expected
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8bb13b19b42601b8b57c5b1c2d64d1b0a04fede5 commit 8bb13b19b42601b8b57c5b1c2d64d1b0a04fede5 Author: Alexander Miller <alex.miller@gmx.de> AuthorDate: 2022-08-06 23:22:09 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-08-24 04:56:27 +0000 sys-libs/compiler-rt: Override start symbol when adding -nostartfiles to LDFLAGS Trying to link executables for the configure checks generates linker warnings (in the CMake logs) like: "warning: cannot find entry symbol _start; defaulting to 0000000000001000". Moreover, with flags like -flto or -Wl,--gc-sections, the linker can discard all code, rendering the checks useless. Set main as entry symbol when linking with -nostartfiles to avoid both issues. (Note that the binaries would still crash, but that doesn't matter since they are never executed.) Bug: https://bugs.gentoo.org/862540 Closes: https://bugs.gentoo.org/862798 Signed-off-by: Alexander Miller <alex.miller@gmx.de> Signed-off-by: Sam James <sam@gentoo.org> sys-libs/compiler-rt/compiler-rt-14.0.6-r1.ebuild | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7b05d4a0ac1d854afa97048fa1fe166d0e123d61 commit 7b05d4a0ac1d854afa97048fa1fe166d0e123d61 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-08-24 04:58:55 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-08-24 04:58:55 +0000 sys-libs/compiler-rt: forward port nostartfiles fix Bug: https://bugs.gentoo.org/862540 Bug: https://bugs.gentoo.org/862798 See: 8bb13b19b42601b8b57c5b1c2d64d1b0a04fede5 Signed-off-by: Sam James <sam@gentoo.org> sys-libs/compiler-rt/compiler-rt-14.0.6-r1.ebuild | 1 + sys-libs/compiler-rt/compiler-rt-15.0.0.9999.ebuild | 6 ++++-- sys-libs/compiler-rt/compiler-rt-15.0.0_rc2.ebuild | 6 ++++-- sys-libs/compiler-rt/compiler-rt-16.0.0.9999.ebuild | 6 ++++-- 4 files changed, 13 insertions(+), 6 deletions(-)