-
-
Notifications
You must be signed in to change notification settings - Fork 247
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
Infrastructure: enable mold to be used in GCC 12+ #7188
base: development
Are you sure you want to change the base?
Conversation
src/CMakeLists.txt
Outdated
@@ -359,11 +359,17 @@ if(USE_3DMAPPER) | |||
list(APPEND mudlet_HDRS glwidget.h) | |||
endif(USE_3DMAPPER) | |||
|
|||
# credit to https://github.com/heavyai/heavydb/blob/master/CMakeLists.txt#L119 |
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.
This link will become outdated once the lines in the current blob get rearranged. You may want to specify a specific version, or remove the line number, to avoid linking an unrelated line after all.
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.
Good idea, done.
create links |
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.
mold
is available for Windows builds in MSYS2/Mingw-w64 environment - and the default GCC is already at 14.x - so how do we do the same thing for qmake
builds - https://github.com/rui314/mold#how-to-use suggests we need to add -fuse-ld=mold
for both Clang and (version >= 12) gcc - I guess this would be done by a QMAKE_LFLAGS+=-fuse-ld=mold
setting in the project file?
Such builds on Windows will need the mingw-w64-x86_64-mold
package for 64 bit builds - however there does not seem to be the equivalent package for 32 bit ones - I guess @jmckisson will want to take note of this...
I'm not sure. Not targetting Windows builds for |
@@ -366,11 +366,17 @@ if(USE_3DMAPPER) | |||
list(APPEND mudlet_HDRS glwidget.h) | |||
endif(USE_3DMAPPER) | |||
|
|||
# credit to https://github.com/heavyai/heavydb/blob/72c90bc290b79dd30240da41c103a00720f6b050/CMakeLists.txt#L119 | |||
macro(set_alternate_linker linker) | |||
find_program(LINKER_EXECUTABLE ld.${USE_ALTERNATE_LINKER} ${USE_ALTERNATE_LINKER}) | |||
if(LINKER_EXECUTABLE) | |||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 12.0.0) |
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.
According to https://github.com/rui314/mold#how-to-use the version check for the compiler (clang
) is not helpful here as -fuse-ld=mold
is what is always needed for that compiler.
😕
Brief overview of PR changes/additions
Enable mold linker - which is quicker than the default one - to be used in GCC 12+
Motivation for adding to Mudlet
#5800 (comment)
Other info (issues closed, discussion etc)
Credit to https://github.com/heavyai/heavydb/blob/master/CMakeLists.txt#L119