about summary refs log tree commit diff
path: root/qemu_mode
diff options
context:
space:
mode:
authorAndrea Fioraldi <andreafioraldi@gmail.com>2021-03-09 21:03:18 +0100
committerAndrea Fioraldi <andreafioraldi@gmail.com>2021-03-09 21:03:18 +0100
commita0a917ad87b066fc96ba7e69e5aa837b3837d67c (patch)
tree3429fd641c37594d1883f85f4c8aeaa77c92bcfd /qemu_mode
parent791c5c171d9e4e7391a9c3760a4a8eb4ce2b4058 (diff)
downloadafl++-a0a917ad87b066fc96ba7e69e5aa837b3837d67c.tar.gz
better CROSS detection
Diffstat (limited to 'qemu_mode')
-rwxr-xr-xqemu_mode/build_qemu_support.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/qemu_mode/build_qemu_support.sh b/qemu_mode/build_qemu_support.sh
index 4d3d9bf6..0101b733 100755
--- a/qemu_mode/build_qemu_support.sh
+++ b/qemu_mode/build_qemu_support.sh
@@ -376,6 +376,18 @@ if [ "$ORIG_CROSS" = "" ]; then
   then # works on Arch Linux
     CROSS=$CPU_TARGET-pc-linux-gnu-gcc
   fi
+  if ! command -v "$CROSS" > /dev/null && [ "$CPU_TARGET" = "i386" ]
+  then
+    CROSS=i686-linux-gnu-gcc
+    if ! command -v "$CROSS" > /dev/null
+    then # works on Arch Linux
+      CROSS=i686-pc-linux-gnu-gcc
+    fi
+    if ! command -v "$CROSS" > /dev/null && [ "`uname -m`" = "x86_64" ]
+    then # set -m32
+      CROSS="$CC -m32"
+    fi
+  fi
 fi
 
 if ! command -v "$CROSS" > /dev/null ; then