Build Chromium using mold. And this happens: [726/60913] "python3.11" "../../build/toolchain/gcc_link_wrapper.py" --output="./chrome_sandbox" -- x86_64-pc-linux-gnu-clang++-18 -fuse-ld=lld -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--icf=all -Wl,--color-diagnostics -Wl,--thinlto-cache-dir=thinlto-cache -Wl,--thinlto-cache-policy=cache_size=10\%:cache_size_bytes=40g:cache_size_files=100000 -flto=thin -Wl,--thinlto-jobs=all -Wl,-mllvm,-import-instr-limit=30 -Wl,-mllvm,-disable-auto-upgrade-debug-info -Wl,-mllvm,-inlinehint-threshold=360 -fwhole-program-vtables -Wl,--undefined-version -Wl,--no-call-graph-profile-sort -no-canonical-prefixes -Wl,-z,defs -Wl,--as-needed -nostdlib++ -Wl,--lto-O0 -rdynamic -pie -Wl,--disable-new-dtags -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -fuse-ld=mold -Wl,--undefined-version -o "./chrome_sandbox" -Wl,--start-group @"./chrome_sandbox.rsp" -Wl,--end-group -ldl -lpthread -lrt -Wl,--start-group -Wl,--end-group FAILED: chrome_sandbox "python3.11" "../../build/toolchain/gcc_link_wrapper.py" --output="./chrome_sandbox" -- x86_64-pc-linux-gnu-clang++-18 -fuse-ld=lld -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--icf=all -Wl,--color-diagnostics -Wl,--thinlto-cache-dir=thinlto-cache -Wl,--thinlto-cache-policy=cache_size=10\%:cache_size_bytes=40g:cache_size_files=100000 -flto=thin -Wl,--thinlto-jobs=all -Wl,-mllvm,-import-instr-limit=30 -Wl,-mllvm,-disable-auto-upgrade-debug-info -Wl,-mllvm,-inlinehint-threshold=360 -fwhole-program-vtables -Wl,--undefined-version -Wl,--no-call-graph-profile-sort -no-canonical-prefixes -Wl,-z,defs -Wl,--as-needed -nostdlib++ -Wl,--lto-O0 -rdynamic -pie -Wl,--disable-new-dtags -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -fuse-ld=mold -Wl,--undefined-version -o "./chrome_sandbox" -Wl,--start-group @"./chrome_sandbox.rsp" -Wl,--end-group -ldl -lpthread -lrt -Wl,--start-group -Wl,--end-group mold: fatal: unknown -m argument: llvm Reproducible: Always
Created attachment 898482 [details] build.log
Created attachment 898483 [details] emerge --info
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=213cf8bacaee8816cd161bf4f48879befede462d commit 213cf8bacaee8816cd161bf4f48879befede462d Author: Matt Jolly <kangie@gentoo.org> AuthorDate: 2024-08-07 10:26:20 +0000 Commit: Matt Jolly <kangie@gentoo.org> CommitDate: 2024-08-07 14:40:32 +0000 www-client/chromium: add 127.0.6533.99 Attempt to detect and `die` if ld is 'mold'. This is not supported and causes builds to fail when targets are linked. Bug: https://bugs.gentoo.org/936858 Bug: https://bugs.gentoo.org/937510 Closes: https://bugs.gentoo.org/936792 Signed-off-by: Matt Jolly <kangie@gentoo.org> www-client/chromium/Manifest | 2 + www-client/chromium/chromium-127.0.6533.99.ebuild | 1480 +++++++++++++++++++++ 2 files changed, 1482 insertions(+)
Can you try to support mold instead of simply 'die'. See also https://github.com/rui314/mold/issues/336#issuecomment-1837256738 and https://github.com/rui314/mold/issues/336#issuecomment-1949930210.
If someone wants to upstream a patchset that makes it work I'm more than happy to remove the check. I'll even cherry-pick the patch and get it working in Gentoo early. I don't really have the bandwidth to manage the additional overhead of supporting toolchain bits that are not supported and/or tested upstream and don't work with default build settings. I don't use mold, and we can barely support Clang + lld as it is, having dropped GCC for "it broke upstream" reasons a little while ago. In the short term, consider a package.env, or if on glibc amd64 the google toolchain (USE="-system-toolchain")
I don't think this is a mold bug, really. It's Chromium using LLVM-specific options to the linker assuming it is lld. And if our Chromium maintainers in Gentoo aren't interested (entirely reasonably!) in patching Chromium for that, then it's WONTFIX.