]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - c++tools/configure.ac
configure: Implement --enable-host-pie
[thirdparty/gcc.git] / c++tools / configure.ac
index 6662b5ad7c99dc00d33ffa8aad9421b1160b2a61..1e42689f2ebde47da462f3379d3e215c60ba43ba 100644 (file)
@@ -102,8 +102,15 @@ fi
 AC_ARG_ENABLE(default-pie,
 [AS_HELP_STRING([--enable-default-pie],
                  [enable Position Independent Executable as default])],
-[PIEFLAG=-fPIE], [PIEFLAG=])
-AC_SUBST([PIEFLAG])
+[PICFLAG=-fPIE], [PICFLAG=])
+
+# Enable --enable-host-pie
+AC_ARG_ENABLE(host-pie,
+[AS_HELP_STRING([--enable-host-pie],
+               [build host code as PIE])],
+[PICFLAG=-fPIE; LD_PICFLAG=-pie], [])
+AC_SUBST(PICFLAG)
+AC_SUBST(LD_PICFLAG)
 
 # Check if O_CLOEXEC is defined by fcntl
 AC_CACHE_CHECK(for O_CLOEXEC, ac_cv_o_cloexec, [