From fde60ad240219fd77016de83c097602ad5b37cee Mon Sep 17 00:00:00 2001 From: David Abdurachmanov Date: Fri, 25 Aug 2023 09:24:49 +0300 Subject: [PATCH] Disable LTO on riscv64 for LLVM/Clang ld.gold is not supported on riscv64. This means that LTO plugin is not available on LLVM/Clang. Signed-off-by: David Abdurachmanov --- ...-Remove-flto-from-Clang-LLVM-plugins.patch | 40 +++++++++++++++++++ annobin.spec | 7 +++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 0001-Remove-flto-from-Clang-LLVM-plugins.patch diff --git a/0001-Remove-flto-from-Clang-LLVM-plugins.patch b/0001-Remove-flto-from-Clang-LLVM-plugins.patch new file mode 100644 index 0000000..54816ba --- /dev/null +++ b/0001-Remove-flto-from-Clang-LLVM-plugins.patch @@ -0,0 +1,40 @@ +From fdc6708a31f3569547daffbc4196c1c25fa2e1da Mon Sep 17 00:00:00 2001 +From: David Abdurachmanov +Date: Fri, 28 Apr 2023 15:37:28 +0000 +Subject: [PATCH] Remove -flto from Clang & LLVM plugins + +This requres LLVMgold.so, which is not supported right now. + +Signed-off-by: David Abdurachmanov +--- + clang-plugin/Makefile.in | 1 - + llvm-plugin/Makefile.in | 1 - + 2 files changed, 2 deletions(-) + +diff --git a/clang-plugin/Makefile.in b/clang-plugin/Makefile.in +index 5e4dc24..26cd5d9 100644 +--- a/clang-plugin/Makefile.in ++++ b/clang-plugin/Makefile.in +@@ -14,7 +14,6 @@ PLUGIN_OPTIONS = \ + -fPIC \ + -Wall \ + -O2 \ +- -flto \ + -g -grecord-gcc-switches \ + -Wl,--build-id=md5 \ + -Wl,-z,now +diff --git a/llvm-plugin/Makefile.in b/llvm-plugin/Makefile.in +index 36d7c41..5009a39 100644 +--- a/llvm-plugin/Makefile.in ++++ b/llvm-plugin/Makefile.in +@@ -14,7 +14,6 @@ PLUGIN_OPTIONS = \ + -fPIC \ + -Wall \ + -O2 \ +- -flto \ + -g -grecord-gcc-switches \ + -Wl,--build-id=md5 \ + -Wl,-z,now +-- +2.40.0 + diff --git a/annobin.spec b/annobin.spec index 4918be7..75fd810 100644 --- a/annobin.spec +++ b/annobin.spec @@ -2,7 +2,7 @@ Name: annobin Summary: Annotate and examine compiled binary files Version: 12.24 -Release: 1%{?dist} +Release: 1.0.riscv64%{?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 @@ -69,6 +69,8 @@ Source: https://nickc.fedorapeople.org/%{annobin_sources} # Insert patches here, if needed. Eg: Patch01: annobin-plugin-default-string-notes.patch +Patch02: 0001-Remove-flto-from-Clang-LLVM-plugins.patch + #--------------------------------------------------------------------------------- # Make sure that the necessary sub-packages are built. @@ -524,6 +526,9 @@ make check #--------------------------------------------------------------------------------- %changelog +* Fri Aug 25 2023 David Abdurachmanov - 12.24-1.0.riscv64 +- Disable LTO on riscv64 (for LLVM/Clang) + * Fri Aug 04 2023 Nick Clifron - 12.24-1 - Annocheck: Change GO FIPS test to look for CGO_ENABLED markers.