chiark / gitweb /
build: Compile everything with PIE
authorCristian Rodríguez <crrodriguez@opensuse.org>
Sun, 18 May 2014 15:46:42 +0000 (11:46 -0400)
committerLennart Poettering <lennart@poettering.net>
Sun, 18 May 2014 16:14:35 +0000 (01:14 +0900)
configure.ac

index 30ef33d..469fc2d 100644 (file)
@@ -176,6 +176,7 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
         -fdata-sections \
         -fstack-protector \
         -fstack-protector-strong \
+        -fPIE \
         --param=ssp-buffer-size=4])
 AS_CASE([$CFLAGS], [*-O[[12345\ ]]*],
         [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
@@ -195,6 +196,7 @@ CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
         -Wl,--gc-sections \
         -Wl,-z,relro \
         -Wl,-z,now \
+        -pie \
         -Wl,-fuse-ld=gold])
 AC_SUBST([OUR_LDFLAGS], "$with_ldflags $sanitizer_ldflags")