From: Raymond Chiu Date: Thu, 31 Jan 2019 00:00:08 +0000 (-0800) Subject: Add -Wl,--no-as-needed to ld flags X-Git-Tag: android-x86-9.0-r1~403 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=787f953343b0cd97e946682cc28be5d9900f2e49;p=android-x86%2Fexternal-swiftshader.git 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/24268 Reviewed-by: Chris Forbes Tested-by: Chris Forbes --- diff --git a/CMakeLists.txt b/CMakeLists.txt index cb417fdf7..ee373b07a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/kokoro/gcp_ubuntu/continuous.sh b/kokoro/gcp_ubuntu/continuous.sh index 4caf6ce36..e1c5bc78e 100755 --- a/kokoro/gcp_ubuntu/continuous.sh +++ b/kokoro/gcp_ubuntu/continuous.sh @@ -12,4 +12,4 @@ git submodule update --init mkdir -p build && cd build cmake .. -make --jobs=$(nproc) +make --jobs=$(nproc) VERBOSE=1