diff --git a/annobin.spec b/annobin.spec index 47be7dd..fb5c958 100644 --- a/annobin.spec +++ b/annobin.spec @@ -9,7 +9,7 @@ BuildRequires: scl-utils-build Name: %{?scl_prefix}annobin Summary: Annotate and examine compiled binary files Version: 12.65 -Release: 1%{?dist} +Release: 3%{?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 URL: https://sourceware.org/annobin/ # Maintainer: nickc@redhat.com @@ -70,21 +70,21 @@ URL: https://sourceware.org/annobin/ Source: https://nickc.fedorapeople.org/%{annobin_sources} # For the latest sources use: git clone git://sourceware.org/git/annobin.git -# Insert patches here, if needed. Eg: -# Patch01: annobin-foo.patch +# Insert patches here, if needed. Patch01: annobin-tmp-default-to-using-group-attach.patch Patch02: annobin-tmp-skip-libannocheck-test.patch # This is where a copy of the sources will be installed. %global annobin_source_dir %{?_scl_root}/%{_usrsrc}/annobin -%{?scl:Requires:%scl_runtime} -%{?scl:BuildRequires:%scl_runtime} +BuildRequires: %{?scl_prefix}gcc +BuildRequires: %{?scl_prefix}gcc-c++ # 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} - -BuildRequires: %{?scl_prefix}gcc %{?scl_prefix}gcc-c++ BuildRequires: %{?scl_prefix}annobin-plugin-gcc +%{?scl:BuildRequires:%scl_runtime} + +%{?scl:Requires:%scl_runtime} +%{?scl:Requires:%scl_require_package %{scl} gcc} %define gcc_for_annobin %{?_scl_root}/usr/bin/gcc %define gxx_for_annobin %{?_scl_root}/usr/bin/g++ @@ -394,9 +394,8 @@ export CFLAGS="$CFLAGS -DAARCH64_BRANCH_PROTECTION_SUPPORTED=1" 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" -# Set target-specific security options to be used when building the -# Clang and LLVM plugins. FIXME: There should be a better way to do -# this. +# Set target-specific options to be used when building the Clang and LLVM plugins. +# FIXME: There should be a better way to do this. %ifarch %{ix86} x86_64 export CLANG_TARGET_OPTIONS="-fcf-protection" %endif @@ -408,7 +407,7 @@ export CLANG_TARGET_OPTIONS="-mbranch-protection=standard" %endif %ifnarch riscv64 -export CLANG_TARGET_OPTIONS="$CLANG_TARGET_OPTIONS -flto" +export CLANG_TARGET_OPTIONS="$CLANG_TARGET_OPTIONS -flto -O2" %endif CC=%gcc_for_annobin CXX=%gxx_for_annobin CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" CXXFLAGS="$CFLAGS" %configure ${CONFIG_ARGS} || cat config.log @@ -470,11 +469,20 @@ mv %{buildroot}/%{llvm_plugin_dir}/annobin-for-clang.so %{buildroot}/%{clang_plu %endif %if %{with gccplugin} +pushd %{buildroot}/%{ANNOBIN_GCC_PLUGIN_DIR} + # 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_for_annobin --print-file-name=rpmver` > %{buildroot}/%{ANNOBIN_GCC_PLUGIN_DIR}/%{aver} +cat `%gcc_for_annobin --print-file-name=rpmver` > %{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 gts-annobin.so +ln -s gts-annobin.so.0.0 gts-annobin.so.0 + +popd # Also install a copy of the sources into the build tree. mkdir -p %{buildroot}%{annobin_source_dir} @@ -537,16 +545,18 @@ make check GCC=%gcc_for_annobin %files plugin-gcc %dir %{ANNOBIN_GCC_PLUGIN_DIR} -%{ANNOBIN_GCC_PLUGIN_DIR}/annobin.so -%verify(owner) %{ANNOBIN_GCC_PLUGIN_DIR}/annobin.so +%{ANNOBIN_GCC_PLUGIN_DIR}/gts-annobin.so +%verify(owner) %{ANNOBIN_GCC_PLUGIN_DIR}/gts-annobin.so -%{ANNOBIN_GCC_PLUGIN_DIR}/annobin.so.0 -%verify(owner) %{ANNOBIN_GCC_PLUGIN_DIR}/annobin.so.0 +%{ANNOBIN_GCC_PLUGIN_DIR}/gts-annobin.so.0 +%verify(owner) %{ANNOBIN_GCC_PLUGIN_DIR}/gts-annobin.so.0 -%{ANNOBIN_GCC_PLUGIN_DIR}/annobin.so.0.0.0 -%verify(owner) %{ANNOBIN_GCC_PLUGIN_DIR}/annobin.so.0.0.0 +%{ANNOBIN_GCC_PLUGIN_DIR}/gts-annobin.so.0.0.0 +%verify(owner) %{ANNOBIN_GCC_PLUGIN_DIR}/gts-annobin.so.0.0.0 %{ANNOBIN_GCC_PLUGIN_DIR}/%{aver} + +%dir %{annobin_source_dir} %{annobin_source_dir}/latest-annobin.tar.xz %endif @@ -564,6 +574,9 @@ make check GCC=%gcc_for_annobin #--------------------------------------------------------------------------------- %changelog +* Fri Aug 09 2024 Nick Clifton - 12.65-3 +- Spec File: Use correct names for the symlinks. (RHEL-53572) + * Tue Jul 30 2024 Nick Clifton - 12.65-1 - Rebase to 12.65. (RHEL-51018) - Annocheck: Fix recording arguments for later re-use. (RHEL-50802)