Commit 787f9533 by Raymond Chiu Committed by Chris Forbes

Add -Wl,--no-as-needed to ld flags

Older version of gcc mistakenly missed out on linking libdl without it. Change-Id: I5c12972c140348fa504e4ff4acb81655b445b4a5 Reviewed-on: https://swiftshader-review.googlesource.com/c/24268Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com> Tested-by: 's avatarChris Forbes <chrisforbes@google.com>
parent 77630f1e
......@@ -156,6 +156,11 @@ macro(set_shared_library_export_map TARGET DIR)
if(NOT MSAN AND NOT ASAN AND NOT TSAN AND NOT UBSAN)
set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--no-undefined")
endif()
# Older version of GCC have problem linking libdl when --as-needed is set.
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--no-as-needed")
endif()
endif()
endmacro()
......
......@@ -12,4 +12,4 @@ git submodule update --init
mkdir -p build && cd build
cmake ..
make --jobs=$(nproc)
make --jobs=$(nproc) VERBOSE=1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment