about summary refs log tree commit diff
diff options
context:
space:
mode:
authorhexcoder <heiko@hexco.de>2021-01-05 16:49:04 +0000
committerhexcoder <heiko@hexco.de>2021-01-05 16:49:04 +0000
commitfaefad564be4b6bd8b311cb4990e8fd33acb5c1c (patch)
treecc839c9f3e0bd46bbc90d8129f447c0655111f65
parent6b54310452a1b743a90ad45fcc511f59dd7821ec (diff)
downloadafl++-faefad564be4b6bd8b311cb4990e8fd33acb5c1c.tar.gz
Haiku afl-system-config disable debugger, afl-cc.c avoid -lrt
-rwxr-xr-xafl-system-config9
-rw-r--r--src/afl-cc.c17
2 files changed, 22 insertions, 4 deletions
diff --git a/afl-system-config b/afl-system-config
index 919932c3..456cccac 100755
--- a/afl-system-config
+++ b/afl-system-config
@@ -84,5 +84,14 @@ if [ "$PLATFORM" = "Darwin" ] ; then
   fi
   DONE=1
 fi
+if [ "$PLATFORM" = "Haiku" ] ; then
+  SETTINGS=~/config/settings/system/debug_server/settings
+  [ -r ${SETTINGS} ] && grep -qE "default_action\s+kill" ${SETTINGS} && { echo "Nothing to do"; } || { \
+    echo We change the debug_server default_action from user to silenty kill; \
+    [ ! -r ${SETTINGS} ] && echo "default_action kill" >${SETTINGS} || { mv ${SETTINGS} s.tmp; sed -e "s/default_action\s\s*user/default_action kill/" s.tmp > ${SETTINGS}; rm s.tmp; }; \
+    echo Settings applied.; \
+  }
+  DONE=1
+fi
 test -z "$DONE" && echo Error: Unknown platform: $PLATFORM
 exit 0
diff --git a/src/afl-cc.c b/src/afl-cc.c
index 964df57f..27bf8cf0 100644
--- a/src/afl-cc.c
+++ b/src/afl-cc.c
@@ -792,9 +792,11 @@ static void edit_params(u32 argc, char **argv, char **envp) {
 
   }
 
-#if defined(USEMMAP) && !defined(__HAIKU__)
+#if defined(USEMMAP)
+#if !defined(__HAIKU__)
   cc_params[cc_par_cnt++] = "-lrt";
 #endif
+#endif
 
   cc_params[cc_par_cnt++] = "-D__AFL_HAVE_MANUAL_CONTROL=1";
   cc_params[cc_par_cnt++] = "-D__AFL_COMPILER=1";
@@ -950,9 +952,11 @@ static void edit_params(u32 argc, char **argv, char **envp) {
           alloc_printf("-Wl,--dynamic-list=%s/dynamic_list.txt", obj_path);
   #endif
 
-  #ifdef USEMMAP
+  #if defined(USEMMAP)
+  #if !defined(__HAIKU__)
     cc_params[cc_par_cnt++] = "-lrt";
   #endif
+  #endif
 
   }
 
@@ -1622,13 +1626,18 @@ int main(int argc, char **argv, char **envp) {
     if (have_lto)
       SAYF("afl-cc LTO with ld=%s %s\n", AFL_REAL_LD, AFL_CLANG_FLTO);
     if (have_llvm)
-      SAYF("afl-cc LLVM version %d with the the binary path \"%s\".\n",
+      SAYF("afl-cc LLVM version %d using binary path \"%s\".\n",
            LLVM_MAJOR, LLVM_BINDIR);
 #endif
 
-#ifdef USEMMAP
+#if defined(USEMMAP)
+#if !defined(__HAIKU__)
+    cc_params[cc_par_cnt++] = "-lrt";
     SAYF("Compiled with shm_open support (adds -lrt when linking).\n");
 #else
+    SAYF("Compiled with shm_open support.\n");
+#endif
+#else
     SAYF("Compiled with shmat support.\n");
 #endif
     SAYF("\n");