]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rpm: Use hardened LDFLAGS 25173/head
authorBoris Ranto <branto@redhat.com>
Thu, 4 Oct 2018 11:05:14 +0000 (13:05 +0200)
committerPrashant D <pdhange@redhat.com>
Tue, 20 Nov 2018 04:50:35 +0000 (23:50 -0500)
Currently, we do pass the hardened CFLAGS and CPPFLAGS when building the
code. However, we do not pass the hardened flags to the linker. This
means that the binaries are linked without the options like -Wl,-z,now.
As a result, we do not fully harden the binaries that we build.

This commit fixes this by passing the RPM_LD_FLAGS to the linker so the
builds are linked with the properly hardened flags.

Fixes: http://tracker.ceph.com/issues/36316
Signed-off-by: Boris Ranto <branto@redhat.com>
(cherry picked from commit ea6d7d2c9878b08528d120aa35e2fd9e18b3ba0f)

ceph.spec.in

index d708aea337a01658ed3b7467d7a5240ca16b9a21..fa34ade2dd11b1243df5d762b7c340ca3be90920 100644 (file)
@@ -806,6 +806,7 @@ export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed -e 's/i386/i486/'`
 export CPPFLAGS="$java_inc"
 export CFLAGS="$RPM_OPT_FLAGS"
 export CXXFLAGS="$RPM_OPT_FLAGS"
+export LDFLAGS="$RPM_LD_FLAGS"
 
 env | sort