summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoakim Sindholt <opensource@zhasha.com>2015-08-28 14:01:31 +0200
committerJoakim Sindholt <opensource@zhasha.com>2015-08-28 14:24:45 +0200
commit21e0297a34c46cae38ab8bb00796fee98dc31722 (patch)
tree042964edf0e4f58e7314669b9b06f0e5f4a56d93
parent6b827e29e2bd0ba498dc56dfaf2b201bef126c75 (diff)
turn on LTO (experimental)
-rw-r--r--bin/p9c.sh10
-rw-r--r--bin/p9l.sh10
2 files changed, 10 insertions, 10 deletions
diff --git a/bin/p9c.sh b/bin/p9c.sh
index 794329f..22da344 100644
--- a/bin/p9c.sh
+++ b/bin/p9c.sh
@@ -14,6 +14,7 @@ USE_RENAME=true
USE_MISSINGPROTO=true
USE_OPTIMIZATION=true
USE_ASM=false
+USE_LTO=true
FILES=()
OPTS=()
@@ -57,6 +58,7 @@ do
;;
N)
USE_OPTIMIZATION=false
+ USE_LTO=false
;;
S)
OPTS+=("-S")
@@ -133,10 +135,10 @@ then
TARG="--target=${CLANGARCH}"
# use LTO
- #if [[ $USE_ASM == false && $USE_OPTIMIZATION == true ]]
- #then
- # OPTS+=("-flto")
- #fi
+ if [[ $USE_LTO == true && $USE_ASM == false ]]
+ then
+ OPTS+=("-flto")
+ fi
# turn on fortify
OPTS+=("-isystem" "${DIR}/../src/fortify-headers/include")
diff --git a/bin/p9l.sh b/bin/p9l.sh
index 70711bb..ad9f5e5 100644
--- a/bin/p9l.sh
+++ b/bin/p9l.sh
@@ -180,12 +180,10 @@ if [ -e "${LIBDIR}/rcrt1.o" ]; then CRTSTART+=("${LIBDIR}/rcrt1.o"); fi
if [ -e "${LIBDIR}/crtn.o" ]; then CRTEND+=("${LIBDIR}/crtn.o"); fi
LTOOPTS=()
-#if [ $USE_LTO == true ]
-#then
-# LTOOPTS+=("--plugin")
-# LTOOPTS+=("$(clang -print-file-name=LLVMgold.so)")
-# LTOOPTS+=("--plugin-opt=-march=${MARCH}")
-#fi
+if [ $USE_LTO == true ]
+then
+ LTOOPTS+=("--plugin" "$(clang -print-file-name=LLVMgold.so)" "-plugin-opt=-march=${MARCH}")
+fi
ld.gold \
--gc-sections -pie -Bstatic -Bsymbolic -E -X -e "${START_SYM}" \
-z now -z nodlopen -z nodump -z nodelete -z noexecstack -z text \