Skip to content
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

Add mold linker build #2161

Merged
merged 1 commit into from
Jun 5, 2024
Merged

Conversation

egtvedt
Copy link
Contributor

@egtvedt egtvedt commented May 28, 2024

Allows building the #mold linker, which can then be used in the cross-toolchain by passing the -fuse-ld=mold to the gcc flags. It is much faster than ld or gold.

This requires a C++20 compiler and cmake.

Initially implemented by Arnaud, and HC added configure check for cmake.

Outstanding task to validate compiler is C++20 compatible.

@egtvedt
Copy link
Contributor Author

egtvedt commented May 28, 2024

Originally implemented in PR #2150, and I adjusted the check for cmake.

Hopefully kept original author as primary to keep credits.

@cpackham
Copy link
Contributor

I've hit the thing to allow the build but as there's no sample that uses this it won't test much (other than checking that the additions don't break anything).

@egtvedt
Copy link
Contributor Author

egtvedt commented May 28, 2024

I've hit the thing to allow the build but as there's no sample that uses this it won't test much (other than checking that the additions don't break anything).

I ran a local build, and could produce a toolchain with mold available and appears to run as expected.

Can do a bit more testing tomorrow after revisiting your comment.

Allows building the #mold linker, which can then be used in the
cross-toolchain by passing the -fuse-ld=mold to the gcc flags. It is
much faster than ld or gold.

This requires a C++20 compiler and cmake.

Initially implemented by Arnaud, and HC added configure check for cmake.

Outstanding task to validate compiler is C++20 compatible.

Signed-off-by: Arnaud Vrac <avrac@freebox.fr>
Signed-off-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no>
@egtvedt
Copy link
Contributor Author

egtvedt commented May 29, 2024

I've hit the thing to allow the build but as there's no sample that uses this it won't test much (other than checking that the additions don't break anything).

I ran a local build, and could produce a toolchain with mold available and appears to run as expected.

Can do a bit more testing tomorrow after revisiting your comment.

Quick hello world test program executes as expected on target.

Bonus is the executable size reduction from 76kB to 16kB.

@rawoul
Copy link
Contributor

rawoul commented May 31, 2024

Sorry, I haven't had much time to follow the feedback on my PR, and I'm happy to see you are taking things forward ! I've tested toolchains with mold for i686 and aarch64 targets with no issues, building and executing a lot of linux packages, including wpewebkit, qt, etc... I had few issues in the past but with 2.31 I don't have a single problem.

@cpackham cpackham mentioned this pull request Jun 3, 2024
@cpackham cpackham merged commit f9ab04b into crosstool-ng:master Jun 5, 2024
58 checks passed
@egtvedt egtvedt deleted the add-mold-linker branch June 17, 2024 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants