From e301d27ebb45d595cce64994908336b33061a8b9 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 27 Mar 2024 15:37:48 +0000 Subject: [PATCH] Clang & LLVM Plugins: Allow environment to override fortification level. Resolves: RHEL-30579 --- annobin.spec | 18 +++++++++++++++--- sources | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/annobin.spec b/annobin.spec index 7cf8ea9..9f01367 100644 --- a/annobin.spec +++ b/annobin.spec @@ -1,7 +1,7 @@ Name: annobin Summary: Annotate and examine compiled binary files -Version: 12.46 +Version: 12.47 Release: 1%{?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/ @@ -380,6 +380,12 @@ export CLANG_TARGET_OPTIONS="-fcf-protection" %ifarch aarch64 export CLANG_TARGET_OPTIONS="-mbranch-protection=standard" %endif +%ifnarch risv64 +export CLANG_TARGET_OPTIONS="$CLANG_TARGET_OPTIONS -flto" +%endif + +# Override the default fortification level used by the Clang and LLVM plugins. +export PLUGIN_FORTIFY_OPTION="-D_FORTIFY_SOURCE=3" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" CXXFLAGS="$CFLAGS" %configure ${CONFIG_ARGS} || cat config.log @@ -413,12 +419,14 @@ rm %{_tmppath}/tmp_annobin.so %if %{with clangplugin} cp clang-plugin/annobin-for-clang.so %{_tmppath}/tmp_annobin.so -make -C clang-plugin all CXXFLAGS="$OPTS $BUILD_FLAGS" +# To enable verbose more in the plugin append the following: ANNOBIN="verbose" +make -C clang-plugin clean all CLANG_TARGET_OPTIONS="$CLANG_TARGET_OPTIONS $BUILD_FLAGS" %endif %if %{with llvmplugin} cp llvm-plugin/annobin-for-llvm.so %{_tmppath}/tmp_annobin.so -make -C llvm-plugin all CXXFLAGS="$OPTS $BUILD_FLAGS" +# To enable verbose more in the plugin append the following: ANNOBIN_VERBOSE="true" +make -C llvm-plugin clean all CLANG_TARGET_OPTIONS="$CLANG_TARGET_OPTIONS $BUILD_FLAGS" %endif # endif for %%if {with_plugin_rebuild} @@ -523,6 +531,10 @@ make check #--------------------------------------------------------------------------------- %changelog +* Wed Mar 27 2024 Nick Clifton - 12.47-1 +- Clang & LLVM Plugins: Allow environment to override fortification level. (RHEL-30579) +- Spec File: Override fortification level and set it to 3. + * Mon Mar 25 2024 Tulio Magno Quites Machado Filho - 12.46-1 - Annocheck: Improve detection of -mbranch-protection option. (RHEL-526) - Clang Plugin: Add global-file-syms option. diff --git a/sources b/sources index bc5c161..6ff094a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (annobin-12.46.tar.xz) = 6805298e1168dbdd287e706a5d58de0cf06d715b40254f33d757b356b5655f0d1ddc519c478b836c7b8ee89813982b35fc5bec6384a010e40e0d56888d6eb5b2 +SHA512 (annobin-12.47.tar.xz) = 3182a948e9ec2b06943fbeace9c6b5cda457e5fe227e702f851592d98f2291959e1969e67c1ef70a509ededc1c2500ab0243f2a317dc4c8a205246cab457a2ba