Skip to content
This repository was archived by the owner on Oct 28, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions cmake/EthCompilerSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")

option(USE_LD_GOLD "Use GNU gold linker" ON)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, which linker will we use for clang builds if we don't use the gold linker?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GNU ld. Also lld from LLVM can be used (is much faster, I'm using it for building LLVM itself where linking time is huge). In the same way: -fuse-ld=lld. But only clang supports it (GCC not).

As I explained in the commit message, Google has switched to use LLD, and they are not interested in maintaining ld.gold. Fedora is considering moving ld.gold out of the main package repo. And I have linking error when using clang-8. There must be new "linking features" that clang-8 depends on.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification!

if (USE_LD_GOLD)
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
if ("${LD_VERSION}" MATCHES "GNU gold")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=gold")
endif ()
endif ()

# Hide all symbols by default.
add_compile_options(-fvisibility=hidden)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
Expand Down
3 changes: 3 additions & 0 deletions cmake/ProjectBinaryen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ ExternalProject_Add(binaryen
-DCMAKE_INSTALL_LIBDIR=lib
-DCMAKE_BUILD_TYPE=Release
-DBUILD_STATIC_LIB=ON
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
${build_command}
${install_command}
BUILD_BYPRODUCTS ${binaryen_library} ${binaryen_other_libraries}
Expand Down
1 change: 1 addition & 0 deletions cmake/ProjectLibFF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ExternalProject_Add(libff
-DUSE_PT_COMPRESSION=Off
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config Release
LOG_BUILD 1
INSTALL_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config Release --target install
Expand Down
4 changes: 1 addition & 3 deletions libdevcore/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,8 @@ that users do not need to install language packs for their OS.
void setDefaultOrCLocale()
{
#if __unix__
if (!std::setlocale(LC_ALL, ""))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change needed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In libc++ the setlocale is not in the std namespace.

{
if (!setlocale(LC_ALL, ""))
setenv("LC_ALL", "C", 1);
}
#endif

#if defined(_WIN32)
Expand Down