about summary refs log tree commit diff
path: root/llvm_mode
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2020-05-30 19:28:47 +0100
committerDavid Carlier <devnexen@gmail.com>2020-05-30 19:28:47 +0100
commit0adb664a315dbd3c5e63c348de0dfd44ff05edb4 (patch)
treeeacd1a1164e1966945ea385f4a46070884584815 /llvm_mode
parent4a5432890185fdce0fbfde60f507526ae6cf8a04 (diff)
downloadafl++-0adb664a315dbd3c5e63c348de0dfd44ff05edb4.tar.gz
OpenBSD build update and llvm mode fix
Unlike upstream version, LLVM in OpenBSD enable by default anti ROP gadget
 leading to bigger binaries and lower performances.
On OpenBSD, it needs to link to c++ abi for th unwind symbols.
Diffstat (limited to 'llvm_mode')
-rw-r--r--llvm_mode/GNUmakefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm_mode/GNUmakefile b/llvm_mode/GNUmakefile
index 50a6be2b..b2f5a366 100644
--- a/llvm_mode/GNUmakefile
+++ b/llvm_mode/GNUmakefile
@@ -226,6 +226,10 @@ endif
 
 ifeq "$(shell uname)" "OpenBSD"
   CLANG_LFL += `$(LLVM_CONFIG) --libdir`/libLLVM.so
+  CLANG_CFL += -mno-retpoline
+  CFLAGS += -mno-retpoline
+  # Needed for unwind symbols
+  LDFLAGS += -lc++abi
 endif
 
 ifeq "$(shell echo '$(HASH)include <sys/ipc.h>@$(HASH)include <sys/shm.h>@int main() { int _id = shmget(IPC_PRIVATE, 65536, IPC_CREAT | IPC_EXCL | 0600); shmctl(_id, IPC_RMID, 0); return 0;}' | tr @ '\n' | $(CC) -x c - -o .test2 2>/dev/null && echo 1 || echo 0 ; rm -f .test2 )" "1"