Add --enable-new-dtags to LDFLAGS

cyrus-sasl-lib is present during the build as a dependency of the
default build group.  This flag prevents the libtool wrappers from
trying to relink binaries when running them during "make check", which
fails nowadays because package-notes requires RPM_ARCH and RPM_PACKAGE_*
variables.  While this linker flag is enabled by default in Fedora
binutils, it is not in RHEL/ELN, resulting in build failures.
This commit is contained in:
Yaakov Selkowitz 2023-07-12 16:45:03 -04:00 committed by yselkowitz
parent 153a5db59e
commit 9f1fb6080e

View File

@ -186,6 +186,7 @@ rm configure aclocal.m4 config/ltmain.sh Makefile.in
export NOCONFIGURE=yes export NOCONFIGURE=yes
sh autogen.sh sh autogen.sh
%set_build_flags
# Find Kerberos. # Find Kerberos.
krb5_prefix=`krb5-config --prefix` krb5_prefix=`krb5-config --prefix`
if test x$krb5_prefix = x%{_prefix} ; then if test x$krb5_prefix = x%{_prefix} ; then
@ -222,7 +223,8 @@ if test x"$LIB_DIR" != "x-L%{_libdir}"; then
LDFLAGS="$LIB_DIR $LDFLAGS"; export LDFLAGS LDFLAGS="$LIB_DIR $LDFLAGS"; export LDFLAGS
fi fi
CFLAGS="$RPM_OPT_FLAGS $CFLAGS $CPPFLAGS -fPIC -pie -Wl,-z,relro -Wl,-z,now"; export CFLAGS # run "make check" against the built library rather than the one in buildroot
LDFLAGS="-Wl,--enable-new-dtags $LDFLAGS"; export LDFLAGS
echo "$CFLAGS" echo "$CFLAGS"
echo "$CPPFLAGS" echo "$CPPFLAGS"