[test-suite] r261399 - cmake: Disable PIE/ASLR by default
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 19 19:21:03 PST 2016
Author: matze
Date: Fri Feb 19 21:21:02 2016
New Revision: 261399
URL: http://llvm.org/viewvc/llvm-project?rev=261399&view=rev
Log:
cmake: Disable PIE/ASLR by default
Address space randomisation makes the performance of memory/cache
intensive benchmark indeterministic so disable it.
This adds the flags for apple ld, feel free to add the flags necessary
for other targets.
Modified:
test-suite/trunk/CMakeLists.txt
Modified: test-suite/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/CMakeLists.txt?rev=261399&r1=261398&r2=261399&view=diff
==============================================================================
--- test-suite/trunk/CMakeLists.txt (original)
+++ test-suite/trunk/CMakeLists.txt Fri Feb 19 21:21:02 2016
@@ -14,9 +14,22 @@ option(TEST_SUITE_SUPPRESS_WARNINGS "Sup
if(${TEST_SUITE_SUPPRESS_WARNINGS})
add_definitions(-w)
endif()
+
# We want reproducible builds, so using __DATE__ and __TIME__ is bad
add_definitions(-Werror=date-time)
+# Disabling address space randomization makes the performance of memory/cache
+# intensive benchmarks more deterministic.
+set(TEST_SUITE_DISABLE_PIE "True" CACHE BOOL
+ "Disable position independent executables and ASLR")
+mark_as_advanced(TEST_SUITE_DISABLE_PIE)
+if(TEST_SUITE_DISABLE_PIE)
+ if(APPLE)
+ list(APPEND LDFLAGS -Wl,-no_pie)
+ endif()
+ # TODO: Add apropriate flags to disable PIE/ASLR on linux, bsd, ...
+endif()
+
# Add path for custom modules
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
More information about the llvm-commits
mailing list