From e483a1290ace1098eddaeff53eee71150a07684e Mon Sep 17 00:00:00 2001 From: Igor Kotrasinski Date: Thu, 10 Aug 2017 11:58:31 +0200 Subject: [PATCH] Add PIE linker flags Since krb5 uses gcc rather than ld for linking, add the '-pie' flag to CFLAGS. Fixes krb5 executables not building as PIE (for ASLR). Change-Id: If911b4e4839b64af1090aaa210681aecb79a4c31 Signed-off-by: Igor Kotrasinski --- packaging/krb5.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/krb5.spec b/packaging/krb5.spec index f15972c..9f8e843 100644 --- a/packaging/krb5.spec +++ b/packaging/krb5.spec @@ -66,7 +66,7 @@ cp %{SOURCE1001} . rm -f src/lib/krb5/krb/deltat.c cd src %{?asan:LDFLAGS+=" -ldl -pthread "} -CFLAGS="$RPM_OPT_FLAGS -I/usr/include/et -fno-strict-aliasing -D_GNU_SOURCE -fPIC -fgnu89-inline " \ +CFLAGS="$RPM_OPT_FLAGS -I/usr/include/et -fno-strict-aliasing -D_GNU_SOURCE -fPIC -fgnu89-inline -Wl,-pie " \ ./configure \ --host=%{_host} --build=%{_build} \ --prefix=/usr/lib/mit \ -- 2.7.4