diff --git a/.devtoolset-12-annobin.metadata b/.devtoolset-12-annobin.metadata index 0d8c363..4902fbb 100644 --- a/.devtoolset-12-annobin.metadata +++ b/.devtoolset-12-annobin.metadata @@ -1 +1 @@ -e1906be7abdd1b63d6d71fe2206c3507b27787ac SOURCES/annobin-10.76.tar.xz +6dfc4263307cf9d7c91de164184b090eaea100e7 SOURCES/annobin-11.08.tar.xz diff --git a/.gitignore b/.gitignore index 219e5f9..c0b362b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/annobin-10.76.tar.xz +SOURCES/annobin-11.08.tar.xz diff --git a/SPECS/annobin.spec b/SPECS/annobin.spec index af9501d..bcb813e 100644 --- a/SPECS/annobin.spec +++ b/SPECS/annobin.spec @@ -4,7 +4,7 @@ Name: %{?scl_prefix}annobin Summary: Annotate and examine compiled binary files -Version: 10.76 +Version: 11.08 Release: 1%{?dist} License: GPLv3+ # Maintainer: nickc@redhat.com @@ -63,12 +63,16 @@ License: GPLv3+ #--------------------------------------------------------------------------------- +%global annobin_sources annobin-%{version}.tar.xz # Source: https://nickc.fedorapeople.org/annobin-%%{version}.tar.xz -Source: annobin-%{version}.tar.xz +Source: %{annobin_sources} # For the latest sources use: git clone git://sourceware.org/git/annobin.git +# This is where a copy of the sources will be installed. +%global annobin_source_dir %{?_scl_root}/%{_usrsrc}/annobin + # Insert patches here, if needed. -# Patch01: annocheck-not-build-with-plugin.patch +# Patch01: annobin-atexit-test-fix.patch # Remember to add %%patchNN -p1 directives after the %%setup command. # For RHEL-7 we do not build for the AArch64 target. @@ -81,16 +85,17 @@ ExcludeArch: aarch64 %{?scl:Requires:%scl_runtime} %{?scl:BuildRequires:%scl_runtime} %{?scl:BuildRequires:scl-utils-build} -# We need the devtoolset-11 version of gcc to build annobin, as otherwise the versions will not match. +# We need the devtoolset-12 version of gcc to build annobin, as otherwise the versions will not match. %{?scl:Requires:%scl_require_package %{scl} gcc} BuildRequires: %{?scl_prefix}gcc - %define gcc_for_annobin %{?_scl_root}/usr/bin/gcc %define gxx_for_annobin %{?_scl_root}/usr/bin/g++ +# Make sure that the necessary sub-packages are built. + %if %{with gccplugin} -Requires: annobin-plugin-gcc +Requires: %{name}-plugin-gcc # [Stolen from gcc-python-plugin] # GCC will only load plugins that were built against exactly that build of GCC @@ -148,14 +153,12 @@ BuildRequires: %{?scl_prefix}gcc-plugin-devel %{?scl_prefix}gcc-c++ %endif -%if %{with llvmplugin} -Requires: annobin-plugin-llvm -BuildRequires: clang clang-devel llvm llvm-devel compiler-rt +%if %{with clangplugin} +Requires: %{name}-plugin-clang %endif -%if %{with clangplugin} -Requires: annobin-plugin-clang -BuildRequires: clang clang-devel llvm llvm-devel compiler-rt +%if %{with llvmplugin} +Requires: %{name}-plugin-llvm %endif # The documentation uses pod2man... @@ -202,14 +205,16 @@ Provides the documentation files and example shell scripts for use with annobin. Summary: Test scripts and binaries for checking the behaviour and output of the annobin plugin Requires: %{name}-docs = %{version}-%{release} -%description tests -Provides a means to test the generation of annotated binaries and the parsing -of the resulting files. +BuildRequires: make, sharutils %if %{with debuginfod} BuildRequires: elfutils-debuginfod-client-devel %endif +%description tests +Provides a means to test the generation of annotated binaries and the parsing +of the resulting files. + %endif #---------------------------------------------------------------------------- @@ -218,9 +223,9 @@ BuildRequires: elfutils-debuginfod-client-devel %package annocheck Summary: A tool for checking the security hardening status of binaries -BuildRequires: %{?scl_prefix}gcc elfutils elfutils-devel elfutils-libelf-devel rpm-devel %{?scl_prefix}binutils-devel +BuildRequires: %{?scl_prefix}gcc elfutils elfutils-devel elfutils-libelf-devel rpm-devel %{?scl_prefix}binutils-devel make %if %{with debuginfod} -BuildRequires: elfutils-debuginfod-client-devel make +BuildRequires: elfutils-debuginfod-client-devel %endif Requires: %{name}-docs = %{version}-%{release} @@ -239,11 +244,14 @@ hardening options. Summary: annobin gcc plugin Requires: %{name}-docs = %{version}-%{release} -Conflicts: annobin <= 9.60-1 +Conflicts: %{name} <= 9.60-1 %description plugin-gcc Installs an annobin plugin that can be used by gcc. +# Information about the gcc plugin is recorded in this file. +%global aver annobin-plugin-version-info + %endif #--------------------------------------------------------------------------------- @@ -253,7 +261,8 @@ Installs an annobin plugin that can be used by gcc. Summary: annobin llvm plugin Requires: %{name}-docs = %{version}-%{release} -Conflicts: annobin <= 9.60-1 +Conflicts: %{name} <= 9.60-1 +BuildRequires: clang clang-devel llvm llvm-devel compiler-rt %description plugin-llvm Installs an annobin plugin that can be used by llvm tools. @@ -267,7 +276,8 @@ Installs an annobin plugin that can be used by llvm tools. Summary: annobin clang plugin Requires: %{name}-docs = %{version}-%{release} -Conflicts: annobin <= 9.60-1 +Conflicts: %{name} <= 9.60-1 +BuildRequires: clang clang-devel llvm llvm-devel compiler-rt %description plugin-clang Installs an annobin plugin that can be used by clang. @@ -334,7 +344,7 @@ CONFIG_ARGS="$CONFIG_ARGS --with-llvm" %endif %if %{without tests} -CONFIG_ARGS="$CONFIG_ARGS --without-test" +CONFIG_ARGS="$CONFIG_ARGS --without-tests" %endif %if %{without annocheck} @@ -405,28 +415,49 @@ make -C llvm-plugin all CXXFLAGS="%{optflags} $BUILD_FLAGS" #--------------------------------------------------------------------------------- %install + # PLUGIN_INSTALL_DIR is used by the Clang and LLVM makefiles... %make_install PLUGIN_INSTALL_DIR=%{buildroot}/%{llvm_plugin_dir} %if %{with clangplugin} -# Move clang plugin to a seperate directory. +# Move the clang plugin to a seperate directory. mkdir -p %{buildroot}/%{clang_plugin_dir} mv %{buildroot}/%{llvm_plugin_dir}/annobin-for-clang.so %{buildroot}/%{clang_plugin_dir} %endif +%if %{with gccplugin} +# Record the version of gcc that built this plugin. +# Note - we cannot just store %%{gcc_vr} as sometimes the gcc rpm version changes +# without the NVR being altered. See BZ #2030671 for more discussion on this. +mkdir -p %{buildroot}/%{ANNOBIN_GCC_PLUGIN_DIR} +cat `gcc --print-file-name=rpmver` > %{buildroot}/%{ANNOBIN_GCC_PLUGIN_DIR}/%{aver} + +# # Rename the plugin to the DTS version. +# pushd %%{buildroot}/%%{ANNOBIN_GCC_PLUGIN_DIR} > /dev/null +# mv annobin.so.0.0.0 dts-annobin.so.0.0.0 +# rm -f annobin.so annobin.so.0 +# ln -s dts-annobin.so.0.0.0 dts-annobin.so +# ln -s dts-annobin.so.0.0.0 dts-annobin.so.0 +# popd > /dev/null + +# Also install a copy of the sources into the build tree. +mkdir -p %{buildroot}%{annobin_source_dir} +cp %{_sourcedir}/%{annobin_sources} %{buildroot}%{annobin_source_dir}/latest-annobin.tar.xz +%endif + rm -f %{buildroot}%{_infodir}/dir #--------------------------------------------------------------------------------- %if %{with tests} %check -# On RHEL7 the assembler does not support all of the annobin tests. -# With scl the tests are run with the wrong version of gcc. Hence -# we allow the tests to fail. +# FIXME: Run the tests twice. The first time so that we can get error messages... make check GCC=%gcc_for_annobin || : if [ -f tests/test-suite.log ]; then cat tests/test-suite.log fi +# ... the second time so that we get a failure exit code. +make check GCC=%gcc_for_annobin %if %{with clangplugin} # FIXME: RUN CLANG tests @@ -454,30 +485,83 @@ fi %if %{with llvmplugin} %files plugin-llvm +%dir %{llvm_plugin_dir} %{llvm_plugin_dir}/annobin-for-llvm.so %endif %if %{with clangplugin} %files plugin-clang +%dir %{clang_plugin_dir} %{clang_plugin_dir}/annobin-for-clang.so %endif %if %{with gccplugin} %files plugin-gcc -%{ANNOBIN_GCC_PLUGIN_DIR} +%dir %{ANNOBIN_GCC_PLUGIN_DIR} +# %%{ANNOBIN_GCC_PLUGIN_DIR}/dts-annobin.so +# %%{ANNOBIN_GCC_PLUGIN_DIR}/dts-annobin.so.0 +# %%{ANNOBIN_GCC_PLUGIN_DIR}/dts-annobin.so.0.0.0 +%{ANNOBIN_GCC_PLUGIN_DIR}/annobin.so +%{ANNOBIN_GCC_PLUGIN_DIR}/annobin.so.0 +%{ANNOBIN_GCC_PLUGIN_DIR}/annobin.so.0.0.0 +%{ANNOBIN_GCC_PLUGIN_DIR}/%{aver} +%{annobin_source_dir}/latest-annobin.tar.xz %endif %if %{with annocheck} %files annocheck -%{_bindir}/annocheck -%{_mandir}/man1/annocheck.1* %{_includedir}/libannocheck.h %{_libdir}/libannocheck.* +%{_bindir}/annocheck +%{_mandir}/man1/annocheck.1* +%{_libdir}/pkgconfig/libannocheck.pc %endif #--------------------------------------------------------------------------------- %changelog +* Tue Jan 31 2023 Nick Clifton - 11.08-1 +- Annocheck: Fix atexit test. Fix recording of version numbers. (#2165528) + +* Fri Jan 27 2023 Nick Clifton - 11.06-1 +- Rebase to 11.06. (#2165024) +- Annocheck: Fix handling of file built by multiple versions of gcc. (#2160700) +- Spec file: Enable annotated building. +- Annocheck: Fix handling of empty files. (#2159292) +- Annocheck: Add crti.o and crtn.o to the list of known glibc special files. (#2158740) +- Annocheck: Fix memory leaks. +- Annocheck: Do not assume that object files contain no code simply because they do not have an executable segment. (#2158386) +- Annocheck: Add more special glibc filenames. (#2158100) +- Annocheck: Improve handling of tool versions. + +* Fri Dec 16 2022 Nick Clifton - 10.98-1 +- GCC Plugin: Fix building with gcc-13. +- Annocheck: Add test for binaries built by cross compilers. +- Annocheck: Improve heuristic used to detect binaries without code. (#2144533) +- Annocheck: Use real filename rather than debuginfo filename. (#2152280) +- Rebase to 10.94, brining in support for LLVM 15. (#2118992) +- Annocheck: Better detection of binaries which do not contain code. (#2144533) +- Annocheck: Provide more information when a test is skipped because the file being tested was not compiled. +- Annocheck: Try harder not to run mutually exclusive tests. +- Tests: Fix future-test so that it properly handles the situation where the compiler does not support the new options. +- Libannocheck: Actually set result fields after tests are run. +- Libannocheck: Replace libannocheck_version variable with LIBANNOCHECK_VERSION define. +- Libannocheck: Remove 'Requires binutils-devel' from libannocheck.pc. +- Libannocheck: Move into separate sub-package. +- Libannocheck: Add libannocheck.pc pkgconfig file. +- Libannocheck: Add libannocheck_reinit(). +- GCC Plugin: Record -ftrivial-auto-var-init and -fzero-call-used-regs. +- Annocheck: Add future tests for -ftrivial-auto-var-init and -fzero-call-used-regs. +- Clang Plugin: Fix for building with Clang-15. (#2125875) +- Annocheck: Add a test for the inconsistent use of -Ofast. (#1248744) +- Plugin: Fix top level configuration support for RiscV. +- Annocheck: Improvements to the size tool. +- Annocheck: Fixes for libannocheck.h. +- Annocheck: Add automatic profile selection. +- Annocheck: Improve gap detection and reporting. +- Spec File: Use the %%dir directive in the %%files section to ensure that +- plugin directories are useable. (#2080454) + * Fri Jun 24 2022 Nick Clifton - 10.76-1 - Remove bogus Provides from annobin-doc subpackage. (#2099481) - Annocheck: Check build-id of separate debuginfo files.