Avoid setting annobin flags if !_annotated_build

Without this, the glibc build fails if annobin hasn't been bootstrapped
against an updated gcc major version.  This will likely never happen in
production builds since _annotated_build is always set through
redhat-rpm-config but when testing with annobin disabled (*and* with a
rebased gcc), it may end up unnecessarily making gcc look for annobin.
This commit is contained in:
Siddhesh Poyarekar 2021-12-09 06:29:40 +05:30
parent 333464235d
commit 2a12adcea2

View File

@ -151,7 +151,7 @@ end \
Summary: The GNU libc libraries
Name: glibc
Version: %{glibcversion}
Release: 26%{?dist}
Release: 27%{?dist}
# In general, GPLv2+ is used by programs, LGPLv2+ is used for
# libraries.
@ -1145,6 +1145,7 @@ rpm_inherit_flags \
"-mtune=zEC12" \
"-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1" \
%if 0%{?_annotated_build} > 0
# libc_nonshared.a cannot be built with the default hardening flags
# because the glibc build system is incompatible with
# -D_FORTIFY_SOURCE. The object files need to be marked as to be
@ -1152,6 +1153,7 @@ rpm_inherit_flags \
# annobin does not work here because of flag ordering issues.)
# See <https://bugzilla.redhat.com/show_bug.cgi?id=1668822>.
BuildFlagsNonshared="-fplugin=annobin -fplugin-arg-annobin-disable -Wa,--generate-missing-build-notes=yes"
%endif
# Special flag to enable annobin annotations for statically linked
# assembler code. Needs to be passed to make; not preserved by
@ -2260,6 +2262,9 @@ fi
%files -f compat-libpthread-nonshared.filelist -n compat-libpthread-nonshared
%changelog
* Thu Dec 09 2021 Siddhesh Poyarekar <siddhesh@redhat.com> - 2.34.9000-27
- Set BuildFlagsNonshared only if _annotated_build is set.
* Sat Dec 04 2021 Florian Weimer <fweimer@redhat.com> - 2.34.9000-26
- Drop glibc-rh2026399.patch, not needed anymore due to upstream fix.
- Auto-sync with upstream branch master,