Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 936858 - www-client/chromium: fails to link with sys-devel/mold-2.31.0 due to unknown "-llvm" parameter.
Summary: www-client/chromium: fails to link with sys-devel/mold-2.31.0 due to unknown ...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Chromium Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: systemwide-mold
  Show dependency tree
 
Reported: 2024-07-28 22:56 UTC by Alex Buell
Modified: 2024-08-27 12:22 UTC (History)
5 users (show)

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


Attachments
build.log (build.log,661.73 KB, text/x-log)
2024-07-28 22:57 UTC, Alex Buell
Details
emerge --info (emerge-info.log,7.12 KB, text/x-log)
2024-07-28 23:00 UTC, Alex Buell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Buell 2024-07-28 22:56:07 UTC
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
Comment 1 Alex Buell 2024-07-28 22:57:15 UTC
Created attachment 898482 [details]
build.log
Comment 2 Alex Buell 2024-07-28 23:00:07 UTC
Created attachment 898483 [details]
emerge --info
Comment 3 Larry the Git Cow gentoo-dev 2024-08-07 14:43:33 UTC
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(+)
Comment 4 Blacktea Hamburger 2024-08-20 06:56:48 UTC
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.
Comment 5 Matt Jolly gentoo-dev 2024-08-27 11:53:20 UTC
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")
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-08-27 12:22:07 UTC
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.