From cc148d9b098e71abd990cdd4759391867e4996c5 Mon Sep 17 00:00:00 2001 From: William Brown Date: Wed, 3 Jan 2018 14:01:59 +1000 Subject: [PATCH] Ticket 49515 - cannot link, missing -fPIC Bug Description: When building the server with --disable-gcc-security, due to an issue in autotools linker flag emission on RPM based system, -fPIC is missing. --enable-gcc-security masks this by providing -specs that add -fPIC when required on the types. This causes the build to fail in some conditions, Fix Description: Detect and add the rpm cc specs if present on all builds. https://pagure.io/389-ds-base/issue/49515 Author: wibrown Review by: ??? --- configure.ac | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 3b348cd..ef58b29 100644 --- a/configure.ac +++ b/configure.ac @@ -163,8 +163,12 @@ AC_ARG_ENABLE(gcc-security, AS_HELP_STRING([--enable-gcc-security], [Enable gcc ) ], [ + # Without this, -fPIC doesn't work on generic fedora builds, --disable-gcc-sec. AC_MSG_RESULT(no) - gccsec_defs="" + AM_COND_IF([RPM_HARDEND_CC], + [ gccsec_defs="-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1" ], + [ gccsec_defs="" ] + ) ]) AC_SUBST([gccsec_defs]) -- 1.8.3.1