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
1 changed files with 3 additions and 1 deletions

View File

@ -186,6 +186,7 @@ rm configure aclocal.m4 config/ltmain.sh Makefile.in
export NOCONFIGURE=yes
sh autogen.sh
%set_build_flags
# Find Kerberos.
krb5_prefix=`krb5-config --prefix`
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
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 "$CPPFLAGS"