Add --without-gcc-plugin option.

This commit is contained in:
Nick Clifton 2020-11-09 13:55:03 +00:00
parent e6e8317766
commit c0eabbb63f
2 changed files with 25 additions and 9 deletions

View File

@ -1,7 +1,7 @@
Name: annobin Name: annobin
Summary: Annotate and examine compiled binary files Summary: Annotate and examine compiled binary files
Version: 9.38 Version: 9.40
Release: 1%{?dist} Release: 1%{?dist}
License: GPLv3+ License: GPLv3+
# ProtocolURL: https://fedoraproject.org/wiki/Toolchain/Watermark # ProtocolURL: https://fedoraproject.org/wiki/Toolchain/Watermark
@ -25,6 +25,9 @@ License: GPLv3+
# Use "--without clangplugin" to disable the building of the annobin plugin for Clang. # Use "--without clangplugin" to disable the building of the annobin plugin for Clang.
%bcond_without clangplugin %bcond_without clangplugin
# Use "--without gccplugin" to disable the building of the annobin plugin for GCC.
%bcond_without gccplugin
# Use "--without llvmplugin" to disable the building of the annobin plugin for LLVM. # Use "--without llvmplugin" to disable the building of the annobin plugin for LLVM.
%bcond_without llvmplugin %bcond_without llvmplugin
@ -33,7 +36,7 @@ License: GPLv3+
# checking logic or when building on RHEL-7 or earlier. # checking logic or when building on RHEL-7 or earlier.
%global with_hard_gcc_version_requirement 1 %global with_hard_gcc_version_requirement 1
%bcond_without annobin_plugin %bcond_without plugin_rebuild
# Allow the building of annobin without using annobin itself. # Allow the building of annobin without using annobin itself.
# This is because if we are bootstrapping a new build environment we can have # This is because if we are bootstrapping a new build environment we can have
# a new version of gcc installed, but without a new of annobin installed. # a new version of gcc installed, but without a new of annobin installed.
@ -44,7 +47,7 @@ License: GPLv3+
# then it will abort. # then it will abort.
# #
# The default is to use annobin. cf BZ 1630550. # The default is to use annobin. cf BZ 1630550.
%if %{without annobin_plugin} %if %{without plugin_rebuild}
%undefine _annotated_build %undefine _annotated_build
%endif %endif
@ -203,7 +206,7 @@ touch doc/annobin.info
%build %build
CONFIG_ARGS= CONFIG_ARGS="--quiet --with-gcc-plugin-dir=%{ANNOBIN_GCC_PLUGIN_DIR}"
%if %{with debuginfod} %if %{with debuginfod}
CONFIG_ARGS="$CONFIG_ARGS --with-debuginfod" CONFIG_ARGS="$CONFIG_ARGS --with-debuginfod"
@ -215,6 +218,10 @@ CONFIG_ARGS="$CONFIG_ARGS --without-debuginfod"
CONFIG_ARGS="$CONFIG_ARGS --with-clang" CONFIG_ARGS="$CONFIG_ARGS --with-clang"
%endif %endif
%if %{without gccplugin}
CONFIG_ARGS="$CONFIG_ARGS --without-gcc-plugin"
%endif
%if %{with llvmplugin} %if %{with llvmplugin}
CONFIG_ARGS="$CONFIG_ARGS --with-llvm" CONFIG_ARGS="$CONFIG_ARGS --with-llvm"
%endif %endif
@ -223,18 +230,20 @@ CONFIG_ARGS="$CONFIG_ARGS --with-llvm"
CONFIG_ARGS="$CONFIG_ARGS --without-test" CONFIG_ARGS="$CONFIG_ARGS --without-test"
%endif %endif
%configure --quiet --with-gcc-plugin-dir=%{ANNOBIN_GCC_PLUGIN_DIR} ${CONFIG_ARGS} || cat config.log %configure ${CONFIG_ARGS} || cat config.log
%make_build %make_build
%if %{with plugin_rebuild}
# Rebuild the plugin(s), this time using the plugin itself! This # Rebuild the plugin(s), this time using the plugin itself! This
# ensures that the plugin works, and that it contains annotations # ensures that the plugin works, and that it contains annotations
# of its own. # of its own.
%if %{with gccplugin}
cp gcc-plugin/.libs/annobin.so.0.0.0 %{_tmppath}/tmp_annobin.so cp gcc-plugin/.libs/annobin.so.0.0.0 %{_tmppath}/tmp_annobin.so
make -C gcc-plugin clean make -C gcc-plugin clean
BUILD_FLAGS="-fplugin=%{_tmppath}/tmp_annobin.so" BUILD_FLAGS="-fplugin=%{_tmppath}/tmp_annobin.so"
%if %{with annobin_plugin}
# 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 # Note: the "-fplugin=annobin" is here, despite the fact that it will also
# be automatically added to the gcc command line via # be automatically added to the gcc command line via
@ -243,7 +252,6 @@ BUILD_FLAGS="-fplugin=%{_tmppath}/tmp_annobin.so"
# there is no plugin called "annobin" matching the -fplugin-arg-annobin-disable # there is no plugin called "annobin" matching the -fplugin-arg-annobin-disable
# option, despite the fact that there patently is. # option, despite the fact that there patently is.
BUILD_FLAGS="$BUILD_FLAGS -fplugin=annobin -fplugin-arg-annobin-disable" BUILD_FLAGS="$BUILD_FLAGS -fplugin=annobin -fplugin-arg-annobin-disable"
%endif
# If building on RHEL7, enable the next option as the .attach_to_group # If building on RHEL7, enable the next option as the .attach_to_group
# assembler pseudo op is not available in the assembler. # assembler pseudo op is not available in the assembler.
@ -251,6 +259,7 @@ BUILD_FLAGS="$BUILD_FLAGS -fplugin=annobin -fplugin-arg-annobin-disable"
make -C gcc-plugin CXXFLAGS="%{optflags} $BUILD_FLAGS" make -C gcc-plugin CXXFLAGS="%{optflags} $BUILD_FLAGS"
rm %{_tmppath}/tmp_annobin.so rm %{_tmppath}/tmp_annobin.so
%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
@ -262,6 +271,8 @@ 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="%{optflags} $BUILD_FLAGS"
%endif %endif
%endif
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# PLUGIN_INSTALL_DIR is used by the Clang and LLVM makefiles... # PLUGIN_INSTALL_DIR is used by the Clang and LLVM makefiles...
@ -284,7 +295,6 @@ fi
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
%files %files
%{ANNOBIN_GCC_PLUGIN_DIR}
%license COPYING3 LICENSE %license COPYING3 LICENSE
%exclude %{_datadir}/doc/annobin-plugin/COPYING3 %exclude %{_datadir}/doc/annobin-plugin/COPYING3
%exclude %{_datadir}/doc/annobin-plugin/LICENSE %exclude %{_datadir}/doc/annobin-plugin/LICENSE
@ -299,6 +309,9 @@ fi
%if %{with clangplugin} %if %{with clangplugin}
%{ANNOBIN_CLANG_PLUGIN_DIR} %{ANNOBIN_CLANG_PLUGIN_DIR}
%endif %endif
%if %{with clangplugin}
%{ANNOBIN_GCC_PLUGIN_DIR}
%endif
%if %{with llvmplugin} %if %{with llvmplugin}
%{ANNOBIN_CLANG_PLUGIN_DIR} %{ANNOBIN_CLANG_PLUGIN_DIR}
%endif %endif
@ -312,6 +325,9 @@ fi
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
%changelog %changelog
* Mon Nov 09 2020 Nick Clifton <nickc@redhat.com> - 9.40-1
- Add --without-gcc-plugin option.
* Fri Nov 06 2020 Nick Clifton <nickc@redhat.com> - 9.38-1 * Fri Nov 06 2020 Nick Clifton <nickc@redhat.com> - 9.38-1
- Annocheck: Fix bug parsing DW_AT_producer. - Annocheck: Fix bug parsing DW_AT_producer.

View File

@ -1 +1 @@
SHA512 (annobin-9.38.tar.xz) = 68cf8ff879bcdbde34aba259557724af45888d03fb6eeed48569322c383c527499b743240a91441a4d992c4021d4fab3fb0cc569107cf61dc45803380b4a82a5 SHA512 (annobin-9.40.tar.xz) = 3d3863d241ccede5285bc6205b0583e204acf39eb58cfb9616551b09695f749f7e1278783a32979cf7a1d81fd8724e497e59e5c13b38768c3027f9b383df2397