summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac11
1 files changed, 11 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index be271c1159..50384f320e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -935,6 +935,16 @@ else
enable_lto='no'
fi
+AC_ARG_ENABLE(ld-gc, AS_HELP_STRING([--enable-ld-gc], [Enable garbage collection of unused symbols on linking (default: auto)]))
+if (test "${enable_ld_gc}" != "no"); then
+ NM_COMPILER_FLAG([-fdata-sections -ffunction-sections -Wl,--gc-sections], [enable_ld_gc='yes'], [
+ if (test "${enable_ld_gc}" = "yes"); then
+ AC_MSG_ERROR([Unused symbol eviction requested but not supported.])
+ else
+ enable_ld_gc='no'
+ fi
+ ])
+fi
dnl -------------------------
dnl Vala bindings
@@ -1194,5 +1204,6 @@ echo " more-asserts: $more_asserts"
echo " valgrind: $with_valgrind $with_valgrind_suppressions"
echo " code coverage: $enable_code_coverage"
echo " LTO: $enable_lto"
+echo " linker garbage collection: $enable_ld_gc"
echo " JSON validation: $enable_json_validation"
echo