import annobin-9.35-1.el8

This commit is contained in:
CentOS Sources 2020-10-30 06:09:14 +00:00 committed by Andrew Lukoshko
parent 68bbc250df
commit 5baa62c9db
3 changed files with 107 additions and 46 deletions

View File

@ -1 +1 @@
89eff4420502ad81cd036c60501f2c4b5adbd7a8 SOURCES/annobin-9.23.tar.xz 1fc7507666eafdb9e216a24ec6358b54dcfaf3d9 SOURCES/annobin-9.35.tar.xz

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/annobin-9.23.tar.xz SOURCES/annobin-9.35.tar.xz

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.23 Version: 9.35
Release: 1%{?dist} Release: 1%{?dist}
License: GPLv3+ License: GPLv3+
# ProtocolURL: https://fedoraproject.org/wiki/Toolchain/Watermark # ProtocolURL: https://fedoraproject.org/wiki/Toolchain/Watermark
@ -22,28 +22,31 @@ License: GPLv3+
# time check for debuginfod support. # time check for debuginfod support.
%bcond_with debuginfod %bcond_with debuginfod
# Use "--with clangplugin" to build the annobin plugin for clang. # Use "--with clangplugin" to build the annobin plugin for Clang.
%bcond_with clangplugin %bcond_with clangplugin
# Use "--with llvmplugin" to build the annobin plugin for LLVM.
%bcond_with llvmplugin
# Set this to zero to disable the requirement for a specific version of gcc. # Set this to zero to disable the requirement for a specific version of gcc.
# This should only be needed if there is some kind of problem with the version # This should only be needed if there is some kind of problem with the version
# 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
# # Do not build the annobin plugin with annotation enabled. %bcond_without annobin_plugin
# # This is because if we are bootstrapping a new build environment we can have # Allow the building of annobin without using annobin itself.
# # a new version of gcc installed, but without a new of annobin installed. # This is because if we are bootstrapping a new build environment we can have
# # (i.e. we are building the new version of annobin to go with the new version # a new version of gcc installed, but without a new of annobin installed.
# # of gcc). If the *old* annobin plugin is used whilst building this new # (i.e. we are building the new version of annobin to go with the new version
# # version, the old plugin will complain that version of gcc for which it # of gcc). If the *old* annobin plugin is used whilst building this new
# # was built is different from the version of gcc that is now being used, and # version, the old plugin will complain that version of gcc for which it
# # then it will abort. # was built is different from the version of gcc that is now being used, and
# then it will abort.
# #
# Suppress this for BZ 1630550. # The default is to use annobin. cf BZ 1630550.
# The problem should now only arise when rebasing to a new major version %if %{without annobin_plugin}
# of gcc, in which case the undefine below can be temporarily reinstated. %undefine _annotated_build
# %endif
# %%undefine _annotated_build
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
@ -109,8 +112,13 @@ Requires: gcc
%endif %endif
BuildRequires: gcc gcc-plugin-devel gcc-c++ BuildRequires: gcc gcc-plugin-devel gcc-c++
# The documentation uses pod2man...
BuildRequires: perl perl-podlators
%if %{with clangplugin} %if %{with clangplugin}
BuildRequires: clang clang-devel llvm llvm-devel BuildRequires: clang clang-devel llvm llvm-devel compiler-rt gawk
%endif
%if %{with llvmplugin}
BuildRequires: clang clang-devel llvm llvm-devel compiler-rt gawk
%endif %endif
%description %description
@ -121,7 +129,11 @@ Note - the plugin is automatically enabled in gcc builds via flags
provided by the redhat-rpm-macros package. provided by the redhat-rpm-macros package.
%if %{with clangplugin} %if %{with clangplugin}
Also provides a plugin for clang which performs a similar function. Also provides a plugin for Clang which performs a similar function.
%endif
%if %{with llvmplugin}
Also provides a plugin for LLVM which performs a similar function.
%endif %endif
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
@ -158,12 +170,14 @@ hardening options.
%global ANNOBIN_GCC_PLUGIN_DIR %(gcc --print-file-name=plugin) %global ANNOBIN_GCC_PLUGIN_DIR %(gcc --print-file-name=plugin)
%if %{with clangplugin} %if %{with clangplugin} || %{with llvmplugin}
# FIXME: Clang does not appear to have an official plugin directory. # FIXME: We currently assume that the first directory listed in clang's
# Instead it just uses dlopen() with no pathname prefix. So we # search directory output is the one that we should use for plugins.
# construct a (hopefully good) path and rely upon users of annobin # This might not be correct.
# knowing about this location. # The gensub() below is because without it $2 would look like:
%global ANNOBIN_CLANG_PLUGIN_DIR /usr/lib64/clang/%(clang --dumpversion)/lib # " =/usr/lib64/clang/8.0.0"
# Note - we install LLVM plugins into the same directory as Clang plugins.
%global ANNOBIN_CLANG_PLUGIN_DIR %(clang --print-search-dirs | gawk -e'BEGIN { FS = ":" } /libraries/ { print gensub(" =","",1,$2) } END { }')
%endif %endif
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
@ -190,43 +204,72 @@ touch doc/annobin.info
%build %build
CONFIG_ARGS=
%if %{with debuginfod} %if %{with debuginfod}
%configure --quiet --with-gcc-plugin-dir=%{ANNOBIN_GCC_PLUGIN_DIR} --with-debuginfod || cat config.log CONFIG_ARGS="$CONFIG_ARGS --with-debuginfod"
%else %else
%configure --quiet --with-gcc-plugin-dir=%{ANNOBIN_GCC_PLUGIN_DIR} || cat config.log CONFIG_ARGS="$CONFIG_ARGS --without-debuginfod"
%endif %endif
%if %{with clangplugin}
CONFIG_ARGS="$CONFIG_ARGS --with-clang"
%endif
%if %{with llvmplugin}
CONFIG_ARGS="$CONFIG_ARGS --with-llvm"
%endif
%if %{without tests}
CONFIG_ARGS="$CONFIG_ARGS --without-test"
%endif
%configure --quiet --with-gcc-plugin-dir=%{ANNOBIN_GCC_PLUGIN_DIR} ${CONFIG_ARGS} || cat config.log
%make_build %make_build
# Rebuild the plugin, 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. This could mean that we end up with a plugin with # of its own.
# double annotations in it. (If the build system enables annotations
# for plugins by default). I have not tested this yet, but I think
# that it should be OK.
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 -fplugin-arg-tmp_annobin-rename" BUILD_FLAGS="-fplugin=%{_tmppath}/tmp_annobin.so"
# If building on RHEL7, enable the next option as the .attach_to_group assembler pseudo op is not available in the assembler.
%if %{with annobin_plugin}
# Disable the standard annobin plugin so that we do get conflicts.
# Note: the "-fplugin=annobin" is here, despite the fact that it will also
# 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"
%endif
# If building on RHEL7, enable the next option as the .attach_to_group
# assembler pseudo op is not available in the assembler.
# 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="%{optflags} $BUILD_FLAGS"
rm %{_tmppath}/tmp_annobin.so rm %{_tmppath}/tmp_annobin.so
%if %{with clangplugin} %if %{with clangplugin}
# FIXME: The symbolic link should not be needed. cp clang-plugin/annobin-for-clang.so %{_tmppath}/tmp_annobin.so
ln -f -s ../annobin-global.h clang-plugin make -C clang-plugin all CXXFLAGS="%{optflags} $BUILD_FLAGS"
make -C clang-plugin annobin.so %endif
%if %{with llvmplugin}
cp llvm-plugin/annobin-for-llvm.so %{_tmppath}/tmp_annobin.so
make -C llvm-plugin all CXXFLAGS="%{optflags} $BUILD_FLAGS"
%endif %endif
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# PLUGIN_INSTALL_DIR is used by the Clang and LLVM makefiles...
%install %install
%make_install %make_install PLUGIN_INSTALL_DIR=$RPM_BUILD_ROOT%{ANNOBIN_CLANG_PLUGIN_DIR}
%{__rm} -f %{buildroot}%{_infodir}/dir %{__rm} -f %{buildroot}%{_infodir}/dir
%if %{with clangplugin}
cp clang-plugin/annobin.so %{ANNOBIN_CLANG_PLUGIN_DIR}
%endif
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
%if %{with tests} %if %{with tests}
@ -237,10 +280,6 @@ make check
if [ -f tests/test-suite.log ]; then if [ -f tests/test-suite.log ]; then
cat tests/test-suite.log cat tests/test-suite.log
fi fi
%if %{with clangplugin}
# FIXME: Add tests of the clang plugin.
%endif
%endif %endif
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
@ -261,6 +300,9 @@ fi
%if %{with clangplugin} %if %{with clangplugin}
%{ANNOBIN_CLANG_PLUGIN_DIR} %{ANNOBIN_CLANG_PLUGIN_DIR}
%endif %endif
%if %{with llvmplugin}
%{ANNOBIN_CLANG_PLUGIN_DIR}
%endif
%if %{with annocheck} %if %{with annocheck}
%files annocheck %files annocheck
@ -271,6 +313,25 @@ fi
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
%changelog %changelog
* Tue Oct 13 2020 Nick Clifton <nickc@redhat.com> - 9.35-2
- Correct the directory chosen for 32-bit LLVM and Clang plugins. (#1884951)
- Allow the use of the SHF_LINK_ORDER section flag to discard unused notes. (Experimental).
- gcc-plugin: Fix test for empty PowerPC sections. (#1880634)
* Thu Sep 10 2020 Nick Clifton <nickc@redhat.com> - 9.32-1
- annocheck: Add tests for the AArch64 BTI and PAC security features. (#1862478)
- gcc plugin: Use a 4 byte offset for PowerPC start symbols, so that they do not break disassemblies.
- gcc plugin: Correct the detection of 32-bit x86 builds. (#1876197)
* Tue Sep 08 2020 Nick Clifton <nickc@redhat.com> - 9.29-1
- gcc plugin: Detect any attempt to access the global_options array.
- gcc plugin: Do not complain about missing pre-processor options when examining a preprocessed input file. (#1862718)
- Use more robust checks for AArch64 options.
- Detect CLANG compiled assembler that is missing IBT support.
- Improved target pointer size discovery.
- Add support for installing clang and llvm plugins.
- Temporary suppression of aarch64 pointer size check. (#1860549)
* Wed Jul 01 2020 Nick Clifton <nickc@redhat.com> - 9.23-1 * Wed Jul 01 2020 Nick Clifton <nickc@redhat.com> - 9.23-1
- Annocheck: Do not skip tests of the short-enums notes. (#1743635) - Annocheck: Do not skip tests of the short-enums notes. (#1743635)