Compare commits

..

2 Commits

Author SHA1 Message Date
a1e9f6467d import CS gcc-toolset-13-annobin-12.32-2.el8 2024-03-27 19:42:43 +00:00
eabdullin
640e8afd15 import CS gcc-toolset-13-annobin-12.20-1.el8 2023-10-13 08:27:39 +00:00
6 changed files with 64 additions and 111 deletions

View File

@ -1 +1 @@
de4a5bfdc997f5118274070b9cf895d78ea68f55 SOURCES/annobin-12.69.tar.xz c77f60d6064617958a3c35bcd930b33e5567ac78 SOURCES/annobin-12.32.tar.xz

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/annobin-12.69.tar.xz SOURCES/annobin-12.32.tar.xz

11
SOURCES/annobin-nop.patch Normal file
View File

@ -0,0 +1,11 @@
--- annobin.orig/gcc-plugin/annobin.cc 2023-04-28 09:58:05.487156290 +0100
+++ annobin-12.09/gcc-plugin/annobin.cc 2023-04-28 09:58:36.434248542 +0100
@@ -2104,7 +2104,7 @@ annobin_emit_start_sym_and_version_note
Ensure that we do not have empty special text sections so that the
annobin start symbols are never beyond the end of the sections. */
#ifndef ANNOBIN_NOP_INSN
-#define ANNOBIN_NOP_INSN ".nop"
+#define ANNOBIN_NOP_INSN "nop"
#endif
if (* suffix && enable_ppc64_nops)
annobin_emit_asm (ANNOBIN_NOP_INSN,

View File

@ -1,11 +1,11 @@
--- annobin.orig/gcc-plugin/annobin.cc 2024-07-22 14:02:09.227059334 +0100 --- annobin.orig/gcc-plugin/annobin.cc 2023-06-23 09:52:10.176119281 +0100
+++ annobin-12.52/gcc-plugin/annobin.cc 2024-07-22 14:03:38.516398800 +0100 +++ annobin-12.14/gcc-plugin/annobin.cc 2023-06-23 10:06:28.621554381 +0100
@@ -3300,7 +3300,7 @@ plugin_init (struct plugin_name_args * @@ -3155,7 +3155,7 @@ plugin_init (struct plugin_name_args *
versions that are needed. (Note - 2.35.2, as used by RHEL-9, is insufficient). versions that are needed. (Note - 2.35.2, as used by RHEL-9, is insufficient).
See BZ 2016458 for an example of where this solution is needed. */ See BZ 2016458 for an example of where this solution is needed. */
#if GCCPLUGIN_VERSION_MAJOR >= 12 #if GCCPLUGIN_VERSION_MAJOR >= 12
- annobin_attach_type = link_order; - annobin_attach_type = link_order;
+ annobin_attach_type = group; + annobin_attach_type = group;
#else #else
annobin_attach_type = group; annobin_attach_type = group;
#endif #endif

View File

@ -1,12 +0,0 @@
diff -rup annobin.orig/tests/libannocheck-test annobin-12.14/tests/libannocheck-test
--- annobin.orig/tests/libannocheck-test 2023-06-23 10:25:50.591952049 +0100
+++ annobin-12.14/tests/libannocheck-test 2023-06-23 10:26:29.757972286 +0100
@@ -16,6 +16,8 @@ TEST_NAME=libannocheck
. $srcdir/common.sh
start_test
+end_test
+exit 0
LIBANNOCHECKDIR=${LIBANNOCHECKDIR:-../../annocheck/.libs}
INCDIR=${INCDIR:-$srcdir/../annocheck}

View File

@ -8,8 +8,8 @@ BuildRequires: scl-utils-build
Name: %{?scl_prefix}annobin Name: %{?scl_prefix}annobin
Summary: Annotate and examine compiled binary files Summary: Annotate and examine compiled binary files
Version: 12.69 Version: 12.32
Release: 1%{?dist} Release: 2%{?dist}
License: GPL-3.0-or-later AND LGPL-2.0-or-later AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (LGPL-2.0-or-later WITH GCC-exception-2.0) AND GFDL-1.3-or-later License: GPL-3.0-or-later AND LGPL-2.0-or-later AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (LGPL-2.0-or-later WITH GCC-exception-2.0) AND GFDL-1.3-or-later
URL: https://sourceware.org/annobin/ URL: https://sourceware.org/annobin/
# Maintainer: nickc@redhat.com # Maintainer: nickc@redhat.com
@ -57,7 +57,7 @@ URL: https://sourceware.org/annobin/
# #
# The default is to use plugin during rebuilds (cf BZ 1630550) but this can # The default is to use plugin during rebuilds (cf BZ 1630550) but this can
# be changed because of the need to be able to rebuild annobin when a change # be changed because of the need to be able to rebuild annobin when a change
# to gcc breaks the version installed into the buildroot. Note however that # to gcc breaks the version installed into the buildroot. Mote however that
# uncommenting the lines below will result in annocheck not passing the rpminspect # uncommenting the lines below will result in annocheck not passing the rpminspect
# tests.... # tests....
%if %{without plugin_rebuild} %if %{without plugin_rebuild}
@ -70,22 +70,20 @@ URL: https://sourceware.org/annobin/
Source: https://nickc.fedorapeople.org/%{annobin_sources} Source: https://nickc.fedorapeople.org/%{annobin_sources}
# For the latest sources use: git clone git://sourceware.org/git/annobin.git # For the latest sources use: git clone git://sourceware.org/git/annobin.git
# Insert patches here, if needed. # Insert patches here, if needed. Eg:
Patch01: annobin-tmp-default-to-using-group-attach.patch # Patch01: annobin-foo.patch
Patch02: annobin-tmp-skip-libannocheck-test.patch Patch01: annobin-nop.patch
Patch02: annobin-tmp-default-to-using-group-attach.patch
# This is where a copy of the sources will be installed. # This is where a copy of the sources will be installed.
%global annobin_source_dir %{?_scl_root}/%{_usrsrc}/annobin %global annobin_source_dir %{?_scl_root}/%{_usrsrc}/annobin
BuildRequires: %{?scl_prefix}gcc
BuildRequires: %{?scl_prefix}gcc-c++
BuildRequires: %{?scl_prefix}annobin-plugin-gcc
%{?scl:BuildRequires:%scl_runtime}
%{?scl:Requires:%scl_runtime} %{?scl:Requires:%scl_runtime}
# We need the gcc-toolset-N version of gcc in order to run annobin, as otherwise the versions will not match. %{?scl:BuildRequires:%scl_runtime}
# We need the gcc-toolset-13 version of gcc to build annobin, as otherwise the versions will not match.
%{?scl:Requires:%scl_require_package %{scl} gcc} %{?scl:Requires:%scl_require_package %{scl} gcc}
BuildRequires: %{?scl_prefix}gcc
%define gcc_for_annobin %{?_scl_root}/usr/bin/gcc %define gcc_for_annobin %{?_scl_root}/usr/bin/gcc
%define gxx_for_annobin %{?_scl_root}/usr/bin/g++ %define gxx_for_annobin %{?_scl_root}/usr/bin/g++
@ -180,6 +178,7 @@ Summary: A tool for checking the security hardening status of binaries
BuildRequires: elfutils elfutils-devel elfutils-libelf-devel rpm-devel make BuildRequires: elfutils elfutils-devel elfutils-libelf-devel rpm-devel make
BuildRequires: %{?scl_prefix}gcc BuildRequires: %{?scl_prefix}gcc
BuildRequires: %{?scl_prefix}binutils-devel
%if %{with debuginfod} %if %{with debuginfod}
BuildRequires: elfutils-debuginfod-client-devel BuildRequires: elfutils-debuginfod-client-devel
@ -198,12 +197,14 @@ Summary: A library for checking the security hardening status of binaries
BuildRequires: elfutils elfutils-devel elfutils-libelf-devel rpm-devel make BuildRequires: elfutils elfutils-devel elfutils-libelf-devel rpm-devel make
BuildRequires: %{?scl_prefix}gcc BuildRequires: %{?scl_prefix}gcc
BuildRequires: %{?scl_prefix}binutils-devel
%if %{with debuginfod} %if %{with debuginfod}
BuildRequires: elfutils-debuginfod-client-devel BuildRequires: elfutils-debuginfod-client-devel
%endif %endif
Requires: %{name}-docs = %{version}-%{release} Requires: %{name}-docs = %{version}-%{release}
Requires: %{?scl_prefix}binutils-devel
%description libannocheck %description libannocheck
Installs the libannocheck library which uses the notes generated by the Installs the libannocheck library which uses the notes generated by the
@ -333,7 +334,7 @@ fi
echo "Requires: (%{?scl_prefix}gcc >= %{gcc_major} and %{?scl_prefix}gcc < %{gcc_next})" echo "Requires: (%{?scl_prefix}gcc >= %{gcc_major} and %{?scl_prefix}gcc < %{gcc_next})"
# NB/ Do not add {?scl_prefix} to the -n option below. The annobin sources # NB/ Do not add {?scl_prefix} to the -n option below. The annobin sources
# unpack into a directory called annobin-VERSION not gcc-toolset-N-annobin-VERSION. # unpack into a directory called annobin-VERSION not gcc-toolset-13-annobin-VERSION.
%autosetup -p1 -n annobin-%{version} %autosetup -p1 -n annobin-%{version}
# The plugin has to be configured with the same arcane configure # The plugin has to be configured with the same arcane configure
@ -362,8 +363,8 @@ CONFIG_ARGS="$CONFIG_ARGS --with-debuginfod"
CONFIG_ARGS="$CONFIG_ARGS --without-debuginfod" CONFIG_ARGS="$CONFIG_ARGS --without-debuginfod"
%endif %endif
%if %{without clangplugin} %if %{with clangplugin}
CONFIG_ARGS="$CONFIG_ARGS --without-clang-plugin" CONFIG_ARGS="$CONFIG_ARGS --with-clang"
%endif %endif
%if %{without gccplugin} %if %{without gccplugin}
@ -372,8 +373,8 @@ CONFIG_ARGS="$CONFIG_ARGS --without-gcc-plugin"
CONFIG_ARGS="$CONFIG_ARGS --with-gcc-plugin-dir=%{ANNOBIN_GCC_PLUGIN_DIR}" CONFIG_ARGS="$CONFIG_ARGS --with-gcc-plugin-dir=%{ANNOBIN_GCC_PLUGIN_DIR}"
%endif %endif
%if %{without llvmplugin} %if %{with llvmplugin}
CONFIG_ARGS="$CONFIG_ARGS --without-llvm-plugin" CONFIG_ARGS="$CONFIG_ARGS --with-llvm"
%endif %endif
%if %{without tests} %if %{without tests}
@ -394,8 +395,9 @@ export CFLAGS="$CFLAGS -DAARCH64_BRANCH_PROTECTION_SUPPORTED=1"
export CFLAGS="$CFLAGS $RPM_OPT_FLAGS %build_cflags -I%{?_scl_root}/usr/include" export CFLAGS="$CFLAGS $RPM_OPT_FLAGS %build_cflags -I%{?_scl_root}/usr/include"
export LDFLAGS="$LDFLAGS %build_ldflags -L%{?_scl_root}/usr/lib64 -L%{?_scl_root}/usr/lib" export LDFLAGS="$LDFLAGS %build_ldflags -L%{?_scl_root}/usr/lib64 -L%{?_scl_root}/usr/lib"
# Set target-specific options to be used when building the Clang and LLVM plugins. # Set target-specific security options to be used when building the
# FIXME: There should be a better way to do this. # Clang and LLVM plugins. FIXME: There should be a better way to do
# this.
%ifarch %{ix86} x86_64 %ifarch %{ix86} x86_64
export CLANG_TARGET_OPTIONS="-fcf-protection" export CLANG_TARGET_OPTIONS="-fcf-protection"
%endif %endif
@ -406,8 +408,9 @@ export CLANG_TARGET_OPTIONS="-mbranch-protection=standard"
%endif %endif
%endif %endif
%ifnarch riscv64 %ifarch ppc ppc64 ppc64le
export CLANG_TARGET_OPTIONS="$CLANG_TARGET_OPTIONS -flto -O2" # FIXME: This is a workaround for a problem with the Clang C++ headers. It should not be needed.
export CLANG_TARGET_OPTIONS="-mabi=ibmlongdouble"
%endif %endif
CC=%gcc_for_annobin CXX=%gxx_for_annobin CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" CXXFLAGS="$CFLAGS" %configure ${CONFIG_ARGS} || cat config.log CC=%gcc_for_annobin CXX=%gxx_for_annobin CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" CXXFLAGS="$CFLAGS" %configure ${CONFIG_ARGS} || cat config.log
@ -442,14 +445,12 @@ rm %{_tmppath}/tmp_annobin.so
%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
# To enable verbose more in the plugin append the following: ANNOBIN="verbose" make -C clang-plugin all CXXFLAGS="$OPTS $BUILD_FLAGS"
make -C clang-plugin clean all CLANG_TARGET_OPTIONS="$CLANG_TARGET_OPTIONS $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
# To enable verbose more in the plugin append the following: ANNOBIN_VERBOSE="true" make -C llvm-plugin all CXXFLAGS="$OPTS $BUILD_FLAGS"
make -C llvm-plugin clean all CLANG_TARGET_OPTIONS="$CLANG_TARGET_OPTIONS $BUILD_FLAGS"
%endif %endif
# endif for %%if {with_plugin_rebuild} # endif for %%if {with_plugin_rebuild}
@ -469,20 +470,11 @@ mv %{buildroot}/%{llvm_plugin_dir}/annobin-for-clang.so %{buildroot}/%{clang_plu
%endif %endif
%if %{with gccplugin} %if %{with gccplugin}
pushd %{buildroot}/%{ANNOBIN_GCC_PLUGIN_DIR}
# Record the version of gcc that built this plugin. # Record the version of gcc that built this plugin.
# Note - we cannot just store %%{gcc_vr} as sometimes the gcc rpm version changes # 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. # without the NVR being altered. See BZ #2030671 for more discussion on this.
cat `%gcc_for_annobin --print-file-name=rpmver` > %{aver} mkdir -p %{buildroot}/%{ANNOBIN_GCC_PLUGIN_DIR}
cat `gcc --print-file-name=rpmver` > %{buildroot}/%{ANNOBIN_GCC_PLUGIN_DIR}/%{aver}
# Also rename the plugin to its GTS variant
mv annobin.so.0.0.0 gts-annobin.so.0.0.0
rm -f annobin.so annobin.so.0 gts-annobin.so gts-annobin.so.0
ln -s gts-annobin.so.0.0.0 gts-annobin.so
ln -s gts-annobin.so.0.0.0 gts-annobin.so.0
popd
# Also install a copy of the sources into the build tree. # Also install a copy of the sources into the build tree.
mkdir -p %{buildroot}%{annobin_source_dir} mkdir -p %{buildroot}%{annobin_source_dir}
@ -491,11 +483,6 @@ cp %{_sourcedir}/%{annobin_sources} %{buildroot}%{annobin_source_dir}/latest-ann
rm -f %{buildroot}%{_infodir}/dir rm -f %{buildroot}%{_infodir}/dir
# When annocheck is disabled, annocheck.1.gz will still be generated, remove it.
%if %{without annocheck}
rm -f %{_mandir}/man1/annocheck.1.gz
%endif
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
%if %{with tests} %if %{with tests}
@ -545,18 +532,16 @@ make check GCC=%gcc_for_annobin
%files plugin-gcc %files plugin-gcc
%dir %{ANNOBIN_GCC_PLUGIN_DIR} %dir %{ANNOBIN_GCC_PLUGIN_DIR}
%{ANNOBIN_GCC_PLUGIN_DIR}/gts-annobin.so %{ANNOBIN_GCC_PLUGIN_DIR}/annobin.so
%verify(owner) %{ANNOBIN_GCC_PLUGIN_DIR}/gts-annobin.so %verify(owner) %{ANNOBIN_GCC_PLUGIN_DIR}/annobin.so
%{ANNOBIN_GCC_PLUGIN_DIR}/gts-annobin.so.0 %{ANNOBIN_GCC_PLUGIN_DIR}/annobin.so.0
%verify(owner) %{ANNOBIN_GCC_PLUGIN_DIR}/gts-annobin.so.0 %verify(owner) %{ANNOBIN_GCC_PLUGIN_DIR}/annobin.so.0
%{ANNOBIN_GCC_PLUGIN_DIR}/gts-annobin.so.0.0.0 %{ANNOBIN_GCC_PLUGIN_DIR}/annobin.so.0.0.0
%verify(owner) %{ANNOBIN_GCC_PLUGIN_DIR}/gts-annobin.so.0.0.0 %verify(owner) %{ANNOBIN_GCC_PLUGIN_DIR}/annobin.so.0.0.0
%{ANNOBIN_GCC_PLUGIN_DIR}/%{aver} %{ANNOBIN_GCC_PLUGIN_DIR}/%{aver}
%dir %{annobin_source_dir}
%{annobin_source_dir}/latest-annobin.tar.xz %{annobin_source_dir}/latest-annobin.tar.xz
%endif %endif
@ -574,36 +559,6 @@ make check GCC=%gcc_for_annobin
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
%changelog %changelog
* Mon Aug 12 2024 Nick Clifton <nickc@redhat.com> - 12.69-1
- BuiltBy: Fix seg-fault when comparing language version strings. (RHEL-53497)
- Spec File: Use correct names for the symlinks. (RHEL-53574)
* Fri Aug 09 2024 Nick Clifton <nickc@redhat.com> - 12.65-3
- Spec File: Use correct names for the symlinks. (RHEL-53574)
* Tue Jul 30 2024 Nick Clifton <nickc@redhat.com> - 12.65-1
- Rebase to 12.65. (RHEL-51018)
- Annocheck: Fix recording arguments for later re-use. (RHEL-50802)
- GCC Plugin: Fix building AArch64 components with gcc earlier than 11.3.
- Annocheck: Add improvements to the builtby utility.
- Annocheck: Add support for ADA binaries.
- Annocheck: Add support for binaries built from more than two high level source languages.
- Annocheck: Add support for object files containing no executable code.
- Annocheck: Do not FAIL LLVM compiled binaries that have not been built with sanitize-cfi and/or sanitize-safe-stack.
- Annocheck: Add support for Fortran binaries.
- Annocheck: Add heuristic for detecting parts of the CGO runtime library.
- Annocheck: Add improvements for handling Clang runtime binaries.
- Annocheck: Add tweaks for mixed Rust/C binaries. (#2284605)
- Annocheck: Add more glibc source file names.
- Annocheck: Skip GAPS test for GO binaries. (RHEL-36308)
- Annocheck: Remove some false positives for Rust binaries. (#2280239)
- Annocheck: Defer passing the branch protection test until all notes have been checked.
- GCC Plugin: Add extra code for detecting the branch protection setting. (RHEL-35958)
* Mon Jul 22 2024 Nick Clifton <nickc@redhat.com> - 12.52-1
- Rebuild with LLVM 18. (RHEL-49954)
- Rebase to 12.52 in order to bring in fixes for LLVM 18.
* Tue Nov 28 2023 Nick Clifton <nickc@redhat.com> - 12.32-2 * Tue Nov 28 2023 Nick Clifton <nickc@redhat.com> - 12.32-2
- GCC Plugin: Add %%verify tokens to show that the default plugin names are symbolic links. (RHEL-17505) - GCC Plugin: Add %%verify tokens to show that the default plugin names are symbolic links. (RHEL-17505)
@ -626,15 +581,13 @@ make check GCC=%gcc_for_annobin
* Mon Jul 17 2023 Nick Clifton <nickc@redhat.com> - 12.20-1 * Mon Jul 17 2023 Nick Clifton <nickc@redhat.com> - 12.20-1
- Annocheck: Ignore AArch64 $x and $d symbols. (#2221192) - Annocheck: Ignore AArch64 $x and $d symbols. (#2221192)
- GCC Plugin: Suppress active checks for fortran sources. Improve scanning of COLLECT_GCC_OPTIONS. - GCC Plugin: Suppress active checks for fortran sources. Improve scanning of COLLECT_GCC_OPTIONS.
* Mon Jul 03 2023 Nick Clifton <nickc@redhat.com> - 12.18-1
- Annocheck: Remove dependency upon libiberty. - Annocheck: Remove dependency upon libiberty.
* Fri Jun 30 2023 Nick Clifton <nickc@redhat.com> - 12.17-1 * Fri Jun 30 2023 Nick Clifton <nickc@redhat.com> - 12.17-1
- Annocheck: Add detection of known parts of libstdc++-nonshared.a that contain gaps. (#2217864) - Annocheck: Add detection of known parts of libstdc++-nonshared.a that contain gaps. (#2217868)
* Tue Jun 27 2023 Nick Clifton <nickc@redhat.com> - 12.16-1 * Tue Jun 27 2023 Nick Clifton <nickc@redhat.com> - 12.16-1
- Spec File: Rebuild with annobin annotation. (#2217814) - Spec File: Rebuild with annobin annotation. (#2217812)
- Annocheck: Ignore weak/undef function symbols when checking to see if a binary contains code. (#2217840) - Annocheck: Ignore weak/undef function symbols when checking to see if a binary contains code. (#2217840)
- Annocheck: Add --suppress-version-warnings option. - Annocheck: Add --suppress-version-warnings option.
@ -642,16 +595,17 @@ make check GCC=%gcc_for_annobin
- Annocheck: Do not ignore separate debuginfo files that do not contain any DWARF. (#2144553) - Annocheck: Do not ignore separate debuginfo files that do not contain any DWARF. (#2144553)
- Annocheck: Ignore /dev/null filename in string notes. - Annocheck: Ignore /dev/null filename in string notes.
- Annocheck: More tweaks to glibc detection heuristics. (#2215968) - Annocheck: More tweaks to glibc detection heuristics. (#2215968)
- Annocheck: Check for string notes in separate debug info files. (#2211694)
- Annocheck: Add support for el10 and rhel-10 profiles. (RHEL-526)
* Wed Jun 07 2023 Nick Clifton <nickc@redhat.com> - 12.12-1 * Tue May 09 2023 Nick Clifton <nickc@redhat.com> - 12.10-2
- Rebuild against GTS-13 gcc. (#2196505) - Rebuild against GTS-13 gcc. (#2196506)
* Tue May 02 2023 Nick Clifton <nickc@redhat.com> - 12.10-1 * Wed May 03 2023 Nick Clifton <nickc@redhat.com> - 12.10-1
- Add gating.yaml file. (#2192492) - Add gating.yaml file. (#2192491)
- Annocheck: Suppress more tests for Rust binaries.
* Tue Apr 25 2023 Nick Clifton <nickc@redhat.com> - 12.09-1 * Tue Apr 25 2023 Nick Clifton <nickc@redhat.com> - 12.09-1
- Rebase to 12.09 (#2144553) - Rebase to 12.09 (#2188638)
* Tue Apr 25 2023 Nick Clifton <nickc@redhat.com> - 12.09-1 * Tue Apr 25 2023 Nick Clifton <nickc@redhat.com> - 12.09-1
- Annocheck: Fix detection of missing plugin options. (#2189492) - Annocheck: Fix detection of missing plugin options. (#2189492)