aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2020-04-12 13:26:21 +0800
committerfanquake <fanquake@gmail.com>2020-04-12 18:38:00 +0800
commitf2b5b0a3b48f9241971c14238040048f8b630811 (patch)
tree32c8c93f0e17fecb375c0ab55357238de8fa0188
parentb8b050a8d642e38c81d1e451750c2c8db92fee5e (diff)
build: add linker optimization flags to guix
Any -O argument will enable optimizations in GNU ld. We can use -O2 here, as this matches our compile flags. Note that this would also enable additional optimizations if using the lld or gold linkers, when compared to -O0.
-rw-r--r--contrib/guix/libexec/build.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh
index 6ef803340b..550b1b8f40 100644
--- a/contrib/guix/libexec/build.sh
+++ b/contrib/guix/libexec/build.sh
@@ -177,7 +177,7 @@ HOST_CXXFLAGS="$HOST_CFLAGS"
# LDFLAGS
case "$HOST" in
- *linux*) HOST_LDFLAGS="-Wl,--as-needed -Wl,--dynamic-linker=$glibc_dynamic_linker -static-libstdc++" ;;
+ *linux*) HOST_LDFLAGS="-Wl,--as-needed -Wl,--dynamic-linker=$glibc_dynamic_linker -static-libstdc++ -Wl,-O2" ;;
*mingw*) HOST_LDFLAGS="-Wl,--no-insert-timestamp" ;;
esac