]> Zhao Yanbai Git Server - minix.git/commitdiff
llvm: Preserve default OPTFLAGS when adding instrumentation.
authorCristiano Giuffrida <giuffrida@cs.vu.nl>
Sun, 22 Jun 2014 09:09:51 +0000 (11:09 +0200)
committerLionel Sambuc <lionel@minix3.org>
Mon, 28 Jul 2014 15:06:10 +0000 (17:06 +0200)
minix/llvm/build.llvm

index 2dd0f05683a569370b7334cb25db598bfe8c7534..142f47084faceacf1bad76113d0bb2b376a11bde 100755 (executable)
@@ -16,7 +16,6 @@ MINIX_LLVM_DIR=
 LLVMPASS=
 LLVMARGS=
 LLVMPASS_PATHS=
-OPTFLAGS="  "
 TARGET_MODULES=
 MINIX_MODS=
 
@@ -113,9 +112,11 @@ if [ "${GENERATE_MAP}" != "" ] && [[ ${GENERATE_MAP} =~ [yY][eE][sS] ]]; then
         generate_modules_map
 fi
 
+: ${OPTFLAGS="-disable-opt -disable-internalize -disable-inlining -load ${MINIX_LLVM_DIR}/bin/weak-alias-module-override.so -weak-alias-module-override"}
+
 # If we are really instrumenting with some pass...
 if [ "${LLVMPASS_PATHS}" != "" ]; then
-       OPTFLAGS=" -disable-opt ${LLVMPASS_PATHS} ${LLVMARGS}"
+       OPTFLAGS=" ${OPTFLAGS} ${LLVMPASS_PATHS} ${LLVMARGS}"
 fi
 
 TARGET_MODULES=`echo $C | sed -e "s/,/ /g"`