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

Use gnu gold or clang lld linkers if available #2031

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
4 participants
@seelabs
Copy link
Contributor

commented Feb 27, 2017

These linkers significantly improve link times

@seelabs seelabs requested review from bachase and mellery451 Feb 27, 2017

@seelabs seelabs force-pushed the seelabs:lld branch from e2eb803 to 253b8bb Feb 27, 2017

@codecov-io

This comment has been minimized.

Copy link

commented Feb 27, 2017

Codecov Report

Merging #2031 into develop will decrease coverage by -0.01%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop    #2031      +/-   ##
===========================================
- Coverage    67.25%   67.25%   -0.01%     
===========================================
  Files          683      683              
  Lines        49231    49231              
===========================================
- Hits         33112    33110       -2     
- Misses       16119    16121       +2
Impacted Files Coverage Δ
src/ripple/app/paths/impl/PaySteps.cpp 68.97% <ø> (ø)
src/ripple/app/ledger/impl/LedgerMaster.cpp 44.41% <0%> (-0.23%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 460dd8f...42a2e86. Read the comment docs.

@bachase
Copy link
Contributor

left a comment

👍

@mellery451
Copy link
Contributor

left a comment

👍


# use gold linker if available
execute_process(
COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version

This comment has been minimized.

Copy link
@mellery451

mellery451 Feb 27, 2017

Contributor

I notice here you are using the C compiler here and in scons you are using the CXX compiler. I don't think it makes any practical difference, but perhaps stick with CXX for consistency?

This comment has been minimized.

Copy link
@seelabs

seelabs Feb 27, 2017

Author Contributor

It doesn't really matter, but it's easy enough to make the change. Will do.

@@ -554,6 +554,13 @@ def config_env(toolchain, variant, env):
if toolchain == 'clang':
env.Append(CCFLAGS=['-Wno-redeclared-class-member'])
env.Append(CPPDEFINES=['BOOST_ASIO_HAS_STD_ARRAY'])
try:
ldd_ver = subprocess.check_output([env['CLANG_CXX'], '-fuse-ld=lld', '-Wl,--version'],
stderr=subprocess.STDOUT).strip()

This comment has been minimized.

Copy link
@mellery451

mellery451 Feb 27, 2017

Contributor

do we want to check the contents of stdout (the version string) like in CMake or is zero exit status fine?

This comment has been minimized.

Copy link
@seelabs

seelabs Feb 27, 2017

Author Contributor

zero exit is fine.

if ("${LD_VERSION}" MATCHES "LLD")
append_flags(CMAKE_EXE_LINKER_FLAGS -fuse-ld=lld)
endif ()
unset(LD_VERSION)

This comment has been minimized.

Copy link
@mellery451

mellery451 Feb 27, 2017

Contributor

this doesn't seem to work on macos (it's not fatal, but the alternative linker is not detected). I'll investigate separately if the llvm linker can be used on macos, but that should not hold up this PR.

This comment has been minimized.

Copy link
@seelabs

seelabs Feb 27, 2017

Author Contributor

After investigating with @mellery451 lld was not available on his mac.

@seelabs seelabs force-pushed the seelabs:lld branch from e4eec64 to 42a2e86 Feb 28, 2017

@seelabs seelabs added the Passed label Feb 28, 2017

@seelabs

This comment has been minimized.

Copy link
Contributor Author

commented Mar 1, 2017

In 0.60.0-b7

@seelabs seelabs closed this Mar 1, 2017

@seelabs seelabs deleted the seelabs:lld branch Mar 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.