Skip to content

Commit

Permalink
[cmake] Disable building enable_execute_stack.c for baremetal targets.
Browse files Browse the repository at this point in the history
Disable building enable_execute_stack.c for targets that do not have
support for mprotect().

Differential Revision: https://reviews.llvm.org/D33018

llvm-svn: 302680
  • Loading branch information
Catherine Moore authored and Catherine Moore committed May 10, 2017
1 parent 307e291 commit 61efa17
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions compiler-rt/CMakeLists.txt
Expand Up @@ -31,6 +31,9 @@ mark_as_advanced(COMPILER_RT_BUILD_SANITIZERS)
option(COMPILER_RT_BUILD_XRAY "Build xray" ON)
mark_as_advanced(COMPILER_RT_BUILD_XRAY)

set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOLEAN
"Build for a bare-metal target.")

if (COMPILER_RT_STANDALONE_BUILD)
load_llvm_config()

Expand Down
7 changes: 6 additions & 1 deletion compiler-rt/lib/builtins/CMakeLists.txt
Expand Up @@ -66,7 +66,6 @@ set(GENERIC_SOURCES
divti3.c
divtf3.c
divxc3.c
enable_execute_stack.c
eprintf.c
extendsfdf2.c
extendhfsf2.c
Expand Down Expand Up @@ -191,6 +190,12 @@ option(COMPILER_RT_EXCLUDE_ATOMIC_BUILTIN
"Skip the atomic builtin (this may be needed if system headers are unavailable)"
Off)

if(NOT COMPILER_RT_BAREMETAL_BUILD)
set(GENERIC_SOURCES
${GENERIC_SOURCES}
enable_execute_stack.c)
endif()

if(COMPILER_RT_HAS_ATOMIC_KEYWORD AND NOT COMPILER_RT_EXCLUDE_ATOMIC_BUILTIN)
set(GENERIC_SOURCES
${GENERIC_SOURCES}
Expand Down

0 comments on commit 61efa17

Please sign in to comment.