-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[le11] Add support for building with MOLD linker v2 #6875
Conversation
4f68c25
to
111ca3e
Compare
96fb6a0
to
ba488c4
Compare
|
ba488c4
to
16ede9c
Compare
Code changes look ok. I believe it should get the ok from project/device maintainers too, as it's changing the default linker. The TBB patch's PR: oneapi-src/oneTBB#824 |
16ede9c
to
375749f
Compare
@SupervisedThinking What was the issue you experienced with some Qt packages? We'd like to fix it on mold side if possible. |
The packages were "out-of-tree" packages & aren't included in vanilla LE. I can open issues later this week at the mold issue tracker 👍🏻 |
b1b1e0e
to
0b14534
Compare
0b14534
to
a868344
Compare
@rui314 thanks a lot for looking into it! I dug out the slowest working x86_64 box I could find here - an ancient 3GHz dualcore P4 with 2GB RAM and ran the testsuite on it. Due to slower speed (and also performance frequency governor which I forgot to activate in previous tests) the results are a bit more stable and pronounced. Interestingly mold (now latest master) is a bit slower than gold in x86_64 linking.
Perf stats with threads (-Wl,--perf)
Perf stats without threads (-Wl,--perf -Wl,--no-threads)
|
df7edcc
to
eb57175
Compare
eb57175
to
2576b8e
Compare
- Kodi fails to link static spdlog libs ``` mold: error: duplicate symbol: /mnt/dev/LibreELEC-RR/build.LibreELEC-RK3399.arm-11.0-devel/toolchain/armv8a-libreelec-linux-gnueabihf/sysroot/usr/lib/libspdlog.a(spdlog.cpp.o): /tmp/ccIINps6.ltrans2.ltrans.o: std::_Sp_make_shared_tag::_S_ti()::__tag mold: error: duplicate symbol: /mnt/dev/LibreELEC-RR/build.LibreELEC-RK3399.arm-11.0-devel/toolchain/armv8a-libreelec-linux-gnueabihf/sysroot/usr/lib/libspdlog.a(spdlog.cpp.o): /tmp/ccIINps6.ltrans0.ltrans.o: fmt::v9::detail::do_count_digits(unsigned int)::table mold: error: duplicate symbol: /mnt/dev/LibreELEC-RR/build.LibreELEC-RK3399.arm-11.0-devel/toolchain/armv8a-libreelec-linux-gnueabihf/sysroot/usr/lib/libspdlog.a(spdlog.cpp.o): /tmp/ccIINps6.ltrans0.ltrans.o: fmt::v9::detail::do_count_digits(unsigned long long)::bsr2log10 mold: error: duplicate symbol: /mnt/dev/LibreELEC-RR/build.LibreELEC-RK3399.arm-11.0-devel/toolchain/armv8a-libreelec-linux-gnueabihf/sysroot/usr/lib/libspdlog.a(spdlog.cpp.o): /tmp/ccIINps6.ltrans0.ltrans.o: fmt::v9::detail::do_count_digits(unsigned long long)::zero_or_powers_of_10 mold: error: duplicate symbol: /mnt/dev/LibreELEC-RR/build.LibreELEC-RK3399.arm-11.0-devel/toolchain/armv8a-libreelec-linux-gnueabihf/sysroot/usr/lib/libspdlog.a(spdlog.cpp.o): /tmp/ccIINps6.ltrans0.ltrans.o: fmt::v9::detail::basic_data<void>::pow10_significands mold: error: duplicate symbol: /mnt/dev/LibreELEC-RR/build.LibreELEC-RK3399.arm-11.0-devel/toolchain/armv8a-libreelec-linux-gnueabihf/sysroot/usr/lib/libspdlog.a(spdlog.cpp.o): /tmp/ccIINps6.ltrans0.ltrans.o: fmt::v9::detail::basic_data<void>::pow10_exponents mold: error: duplicate symbol: /mnt/dev/LibreELEC-RR/build.LibreELEC-RK3399.arm-11.0-devel/toolchain/armv8a-libreelec-linux-gnueabihf/sysroot/usr/lib/libspdlog.a(spdlog.cpp.o): /tmp/ccIINps6.ltrans0.ltrans.o: fmt::v9::detail::basic_data<void>::power_of_10_64 ```
2576b8e
to
8aefb33
Compare
@HiassofT ping - this should be good to go. Mold will only be build & used if the flags are set.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks good now.
Default hasn't changed, we still link with gold and mold isn't built unless MOLD_SUPPORT is changed to yes.
BTW: During testing I noticed that mold takes quite long to build - both on my 2C/4T X230 when testing native Linux builds on Debian and on my 4C/8T LE build laptop.
mimalloc and tbb can be neglected (they need roughly 10 seconds total), but mold needs well over 4 minutes to build (total LE build time is roughly 2 hours, with default gold)
Test with ccache wiped, building tbb+mimalloc+mold, all other deps built before
$ time ../run-rpi4.sh scripts/build_mt mold:host
real 4m44.906s
user 33m51.877s
sys 1m34.302s
mold's code is template heavy, and C++ compilers are unfortunately slow at compiling it. |
@rui314 just wondering: could you implement an option to enable or disable certain platforms? So for example build mold with x86_64 & arm 32bit support only? Wouldn't this decrease build time? |
@SupervisedThinking Technically we could, but it's very unlikely that we will add such a build-time option to mold because of https://github.com/rui314/mold/blob/main/CMakeLists.txt#L38-L44. We can't stop users from applying local patches to build only a part of the mold linker, but we don't want to officially support it. |
The basic idea is based on this PR #6665 which is somewhat stalled, not completely functional & needs rebase. Since mold linker benchmarks show nice performance gains it could speed up the compilation of the distro image on systems with a lot of cores/threads see https://github.com/rui314/mold#readme & xbmc/xbmc#20891 for details.
mold:host
conditionally asgcc
packages dependencyMOLD_SUPPORT
distro varspdlog
as shared lib to fix Kodi linking by moldKodi
support formold
linking in pkg build optsEDIT: rebased on #6928