Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Commit

Permalink
Fixed the segfault problem when custom passes are dynamically loaded by
Browse files Browse the repository at this point in the history
Clang.

See this thread: sampsyo/llvm-pass-skeleton#7
  • Loading branch information
shaobo-he committed Jul 30, 2018
1 parent 6e67ab5 commit d236b72
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ target_include_directories(xxHash PRIVATE

link_directories(${LLVM_LIBRARY_DIRS})

find_program(LLVM_CONFIG_EXECUTABLE NAMES llvm-config-3.9 llvm-config PATHS ${LLVM_CONFIG} DOC "llvm-config")
find_program(LLVM_CONFIG_EXECUTABLE NAMES llvm-config PATHS ${LLVM_CONFIG} DOC "llvm-config")
find_program(MAKE make)

if (LLVM_CONFIG_EXECUTABLE STREQUAL "LLVM_CONFIG_EXECUTABLE-NOTFOUND")
Expand All @@ -54,8 +54,6 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE
)

string(REPLACE "-fvisibility-inlines-hidden" "" LLVM_CXXFLAGS "${LLVM_CXXFLAGS}")

execute_process(
COMMAND ${LLVM_CONFIG_EXECUTABLE} --libs
OUTPUT_VARIABLE LLVM_LIBS
Expand Down Expand Up @@ -104,6 +102,10 @@ set_target_properties(InstrumentMonitors InstantiateHarness GenerateSeeds
PROPERTIES COMPILE_FLAGS "-fno-rtti"
)

set_target_properties(InstrumentMonitors
PROPERTIES LINK_FLAGS "-Wl,-znodelete"
)

# Get proper shared-library behavior (where symbols are not necessarily
# resolved when the shared library is linked) on OS X.
if(APPLE)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The fuzzer for constant time.
## Requirements

* The [Python] platform, version 2.7
* The [LLVM] compiler infrastructure, version 3.9
* The [LLVM] compiler infrastructure, version >= 5.0
* The [jemalloc] memory allocator

## Installation
Expand Down
2 changes: 1 addition & 1 deletion afl
Submodule afl updated 1 files
+1 −1 llvm_mode/Makefile

0 comments on commit d236b72

Please sign in to comment.