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 a SCons option for Mold linker #4531

Closed
LinuxUserGD opened this issue May 12, 2022 · 1 comment · Fixed by godotengine/godot#63278
Closed

Add a SCons option for Mold linker #4531

LinuxUserGD opened this issue May 12, 2022 · 1 comment · Fixed by godotengine/godot#63278
Milestone

Comments

@LinuxUserGD
Copy link

LinuxUserGD commented May 12, 2022

Describe the project you are working on

With LDFLAGS="-fuse-ld=mold" and LD="ld.mold" env vars it's possible to compile any project with gcc/clang compiler while using mold as linker: https://github.com/rui314/mold.git

Describe the problem or limitation you are having in your project

Currently there are only llvm=yes, lld=yes and thinlto=yes scons options to define compiler/linker.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Add scons option mold=yes for linking final executable with mold.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Change a/platform/x11/detect.py and add scons option / env args for mold linker.

If this enhancement will not be used often, can it be worked around with a few lines of script?

Adding LINKFLAGS="-fuse-ld=mold" to scons command line should work too.

Is there a reason why this should be core and not an add-on in the asset library?

Proposal is about build system configuration when compiling godot from source.

@Calinou
Copy link
Member

Calinou commented May 12, 2022

Currently there are only llvm=yes, lld=yes and thinlto=yes scons options to define compiler/linker.

These are actually use_llvm=yes, use_lld=yes and use_thinlto=yes.

That said, now might be a good time to change the options to enums to avoid incompatible choices:

  • Replace use_lto=yes and use_thinlto=yes with lto=none|thin|full.
  • Replace use_lld=yes with linker=default|ld|gold|lld|mold.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants