+ # ---- Database configuration macros.
+@@ -929,10 +930,10 @@
+ export RPM_BUILD_ROOT}\
+ %{?_javaclasspath:CLASSPATH=\"%{_javaclasspath}\"\
+ export CLASSPATH}\
+- unset PERL_MM_OPT\
++ unset PERL_MM_OPT || :\
+ LANG=C\
+ export LANG\
+- unset DISPLAY\
++ unset DISPLAY || :\
+ \
+ %{verbose:set -x}%{!verbose:exec > /dev/null}\
+ umask 022\
+@@ -1371,5 +1372,23 @@
+ #%__executable_requires @RPMCONFIGDIR@/executabledeps.sh --requires
+ %__scriptlet_requires /bin/bash --rpm-requires
+
++# PLD rpm macros
++%_enable_debug_packages 1
++
++#-----------------------------------------------------------------
++# CFLAGS and LDFLAGS used to build
++
++%debuginfocflags %{expand:%%define __dic_%{?_enable_debug_packages} 1}%{?__dic_1: -gdwarf-2 -g2}%{expand:%%undefine __dic_%{?_enable_debug_packages}}
++# -feliminate-dwarf2-dups disabled until PR ld/3290 is fixed.
++
++%debugcflags -O0 -g -Wall
++%optldflags -Wl,--as-needed
++
++# Warning: those macros are overwritten by macros.build,
++# left here for compatibility
++%rpmcflags %{?debug:%debugcflags}%{!?debug:%optflags}%{?debuginfocflags}
++%rpmcxxflags %{rpmcflags}
++%rpmldflags %{!?no_build_with_as_needed:-Wl,--as-needed}
++
+ # \endverbatim
+ #*/
+