Spec File: Use a different method to disable the annobin plugin (#2054571)

This commit is contained in:
Nick Clifton 2022-02-16 12:49:47 +00:00
parent 4f1eb1f73a
commit 1b6c8e58c5
1 changed files with 12 additions and 17 deletions

View File

@ -2,7 +2,7 @@
Name: annobin Name: annobin
Summary: Annotate and examine compiled binary files Summary: Annotate and examine compiled binary files
Version: 10.54 Version: 10.54
Release: 2%{?dist} Release: 3%{?dist}
License: GPLv3+ License: GPLv3+
# Maintainer: nickc@redhat.com # Maintainer: nickc@redhat.com
# Web Page: https://sourceware.org/annobin/ # Web Page: https://sourceware.org/annobin/
@ -66,7 +66,7 @@ Source: https://nickc.fedorapeople.org/%{annobin_sources}
%global annobin_source_dir %{_usrsrc}/annobin %global annobin_source_dir %{_usrsrc}/annobin
# Insert patches here, if needed. Eg: # Insert patches here, if needed. Eg:
# Patch01: annobin.foo.patch # Patch01: annobin-foo.patch
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
@ -284,14 +284,12 @@ Installs an annobin plugin that can be used by Clang.
%global ANNOBIN_GCC_PLUGIN_DIR %(gcc --print-file-name=plugin) %global ANNOBIN_GCC_PLUGIN_DIR %(gcc --print-file-name=plugin)
%{!?llvm_version:%global llvm_version 12.0.1} %{!?llvm_plugin_dir:%global llvm_plugin_dir %{_libdir}/llvm/plugins}
%{!?llvm_plugin_dir:%global llvm_plugin_dir %{_libdir}/llvm/%{llvm_version}} %{!?clang_plugin_dir:%global clang_plugin_dir %{_libdir}/clang/plugins}
%{!?clang_plugin_dir:%global clang_plugin_dir %{_libdir}/clang/%{llvm_version}}
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
%prep %prep
if [ -z "%{gcc_vr}" ]; then if [ -z "%{gcc_vr}" ]; then
echo "*** Missing gcc_vr spec file macro, cannot continue." >&2 echo "*** Missing gcc_vr spec file macro, cannot continue." >&2
exit 1 exit 1
@ -379,33 +377,27 @@ make -C gcc-plugin clean
BUILD_FLAGS="-fplugin=%{_tmppath}/tmp_annobin.so" BUILD_FLAGS="-fplugin=%{_tmppath}/tmp_annobin.so"
# Disable the standard annobin plugin so that we do get conflicts. # Disable the standard annobin plugin so that we do get conflicts.
# Note: the "-fplugin=annobin" is here, despite the fact that it will also OPTS="$(rpm --eval '%undefine _annotated_build %build_cflags %build_ldflags')"
# be automatically added to the gcc command line via
# "-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1" because of a bug in gcc's
# plugin command line options handling. GCC will issue an error saying that
# there is no plugin called "annobin" matching the -fplugin-arg-annobin-disable
# option, despite the fact that there patently is.
BUILD_FLAGS="$BUILD_FLAGS -fplugin=annobin -fplugin-arg-annobin-disable"
# If building on systems with an assembler that does not support the # If building on systems with an assembler that does not support the
# .attach_to_group pseudo op (eg RHEL-7) then enable the next line. # .attach_to_group pseudo op (eg RHEL-7) then enable the next line.
# BUILD_FLAGS="$BUILD_FLAGS -fplugin-arg-tmp_annobin-no-attach" # BUILD_FLAGS="$BUILD_FLAGS -fplugin-arg-tmp_annobin-no-attach"
make -C gcc-plugin CXXFLAGS="%{optflags} $BUILD_FLAGS" make -C gcc-plugin CXXFLAGS="$OPTS $BUILD_FLAGS"
rm %{_tmppath}/tmp_annobin.so rm %{_tmppath}/tmp_annobin.so
%endif %endif
%if %{with clangplugin} %if %{with clangplugin}
cp clang-plugin/annobin-for-clang.so %{_tmppath}/tmp_annobin.so cp clang-plugin/annobin-for-clang.so %{_tmppath}/tmp_annobin.so
make -C clang-plugin all CXXFLAGS="%{optflags} $BUILD_FLAGS" make -C clang-plugin all CXXFLAGS="$OPTS $BUILD_FLAGS"
%endif %endif
%if %{with llvmplugin} %if %{with llvmplugin}
cp llvm-plugin/annobin-for-llvm.so %{_tmppath}/tmp_annobin.so cp llvm-plugin/annobin-for-llvm.so %{_tmppath}/tmp_annobin.so
make -C llvm-plugin all CXXFLAGS="%{optflags} $BUILD_FLAGS" make -C llvm-plugin all CXXFLAGS="$OPTS $BUILD_FLAGS"
%endif %endif
# endif for %%if {with_lugin_rebuild} # endif for %%if {with_plugin_rebuild}
%endif %endif
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
@ -491,6 +483,9 @@ fi
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
%changelog %changelog
* Wed Feb 16 2022 Nick Clifton <nickc@redhat.com> - 10.54-3
- Spec File: Use a different method to disable the annobin plugin (#2054571)
* Mon Feb 14 2022 Jakub Jelinek <jakub@redhat.com> - 10.54-2 * Mon Feb 14 2022 Jakub Jelinek <jakub@redhat.com> - 10.54-2
- NVR bump to allow rebuild for new GCC. - NVR bump to allow rebuild for new GCC.