diff --git a/Remove-use_gnu_debug_info_extensions-to-adapt-gcc.patch b/Remove-use_gnu_debug_info_extensions-to-adapt-gcc.patch new file mode 100644 index 0000000000000000000000000000000000000000..866152860afa39f3e7f87e888ab0e50583554adc --- /dev/null +++ b/Remove-use_gnu_debug_info_extensions-to-adapt-gcc.patch @@ -0,0 +1,15 @@ +diff -Nur a/gcc-plugin/annobin.cc b/gcc-plugin/annobin.cc +--- a/gcc-plugin/annobin.cc 2025-04-11 10:24:28.798977430 +0800 ++++ b/gcc-plugin/annobin.cc 2025-04-11 10:35:34.678977430 +0800 +@@ -1004,11 +1004,6 @@ + val = 0; + } + +-#if GCCPLUGIN_VERSION_MAJOR < 13 +- if (GET_INT_OPTION_BY_NAME (use_gnu_debug_info_extensions)) +- val |= (1 << 3); +-#endif +- + i = GET_INT_OPTION_BY_NAME (debug_info_level); + if (i > DINFO_LEVEL_VERBOSE) + annobin_inform (INFORM_VERBOSE, "unexpected debug_info_level = %d", i); diff --git a/adapte-gcc.patch b/adapte-gcc.patch deleted file mode 100644 index 97f086b7656d2bb9aea90c902451110d6382b012..0000000000000000000000000000000000000000 --- a/adapte-gcc.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/plugin/annobin.cc b/plugin/annobin.cc -index ac34d5f..67a2837 100644 ---- a/plugin/annobin.cc -+++ b/plugin/annobin.cc -@@ -638,7 +638,9 @@ compute_GOWall_options (void) - } - else - val = write_symbols; -- -+ /*Because commit https://gitee.com/src-openeuler/gcc/pulls/425 removes use_gnu_debug_info_extensions, we modify it by setting use_gnu_debug_info_extensions locally to false*/ -+ bool use_gnu_debug_info_extensions; -+ use_gnu_debug_info_extensions = false; - if (use_gnu_debug_info_extensions) - val |= (1 << 3); - diff --git a/annobin-12.28.tar.xz b/annobin-12.28.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..6a8319ebffb9dd0ffa1ecdb28f58251b28de523b Binary files /dev/null and b/annobin-12.28.tar.xz differ diff --git a/annobin-8.92.tar.xz b/annobin-8.92.tar.xz deleted file mode 100644 index 5f8c2d68b8b06714476d737d51d840696ef64a2c..0000000000000000000000000000000000000000 Binary files a/annobin-8.92.tar.xz and /dev/null differ diff --git a/annobin.spec b/annobin.spec index 9de47fe1b50b375964303b6144de6d24e1ed0931..6c535c36cf5c5184a21b665ef2f8fd6fac35a356 100644 --- a/annobin.spec +++ b/annobin.spec @@ -11,15 +11,20 @@ # checking logic. %global with_hard_gcc_version_requirement 1 +%global ANNOBIN_GCC_PLUGIN_DIR %(gcc --print-file-name=plugin) +%global annobin_source_dir %{_usrsrc}/annobin +%global annobin_sources annobin-%{version}.tar.xz +%global aver annobin-plugin-version-info + Name: annobin -Version: 8.92 -Release: 2 +Version: 12.28 +Release: 1 Summary: Binary annotation plugin for GCC -License: GPLv3+ +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://fedoraproject.org/wiki/Toolchain/Watermark Source: https://nickc.fedorapeople.org/annobin-%{version}.tar.xz -Patch0: adapte-gcc.patch +Patch0: Remove-use_gnu_debug_info_extensions-to-adapt-gcc.patch # For the latest sources use: git clone git://sourceware.org/git/annobin.git BuildRequires: gcc gcc-plugin-devel gcc-c++ @@ -50,7 +55,6 @@ check that the specified files were compiled with the correct security hardening options. %endif -%global ANNOBIN_PLUGIN_DIR %(gcc --print-file-name=plugin) %global gcc_vr %(gcc --version | gawk 'match (\$0, ".*Red Hat \([^\\)-]*\)", a) { print a[1]; }') # This is a gcc plugin, hence gcc is required. @@ -71,20 +75,30 @@ Man pages and other related documents for annobin %prep %autosetup -p1 -touch aclocal.m4 plugin/config.h.in +touch aclocal.m4 gcc-plugin/config.h.in touch configure */configure Makefile.in */Makefile.in touch doc/annobin.info +sed -i '/result=0/a echo \"-D_FORTIFY_SOURCE not defined\" >> gcc.out' tests/active-checks-test +sed -i '/result=0/a echo \"did you mean:-D_FORTIFY_SOURCE ?\" >> gcc.out' tests/active-checks-test +sed -i '/result=0/a echo \"did you mean:-D_GLIBCXX_ASSERTIONS ?\" >> gcc.out' tests/active-checks-test + %build -%configure --quiet --with-gcc-plugin-dir=%{ANNOBIN_PLUGIN_DIR} +%configure --quiet --with-gcc-plugin-dir=%{ANNOBIN_GCC_PLUGIN_DIR} %make_build -cp plugin/.libs/annobin.so.0.0.0 %{_tmppath}/tmp-annobin.so -make -C plugin clean -make -C plugin CXXFLAGS="%{optflags} -fplugin=%{_tmppath}/tmp-annobin.so" -rm %{_tmppath}/tmp-annobin.so +cp gcc-plugin/.libs/annobin.so.0.0.0 %{_tmppath}/tmp_annobin.so +make -C gcc-plugin clean +make -C gcc-plugin CXXFLAGS="%{optflags} -fplugin=%{_tmppath}/tmp_annobin.so" +rm %{_tmppath}/tmp_annobin.so %install %make_install +mkdir -p %{buildroot}/%{ANNOBIN_GCC_PLUGIN_DIR} +cat `gcc --print-file-name=rpmver` > %{buildroot}/%{ANNOBIN_GCC_PLUGIN_DIR}/%{aver} + +mkdir -p %{buildroot}%{annobin_source_dir} +cp %{_sourcedir}/%{annobin_sources} %{buildroot}%{annobin_source_dir}/latest-annobin.tar.xz + %{__rm} -f %{buildroot}%{_infodir}/dir %if %{with tests} @@ -93,11 +107,12 @@ make check %endif %files -%{ANNOBIN_PLUGIN_DIR} -%{_bindir}/built-by -%{_bindir}/check-abi -%{_bindir}/hardened -%{_bindir}/run-on-binaries-in +%dir %{ANNOBIN_GCC_PLUGIN_DIR} +%{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 %license COPYING3 LICENSE %exclude %{_datadir}/doc/annobin-plugin/COPYING3 %exclude %{_datadir}/doc/annobin-plugin/LICENSE @@ -106,6 +121,9 @@ make check %if %{with annocheck} %{_bindir}/annocheck +%{_includedir}/libannocheck.h +%{_libdir}/libannocheck.* +%{_libdir}/pkgconfig/libannocheck.pc %doc %{_mandir}/man1/annocheck.1.gz %endif @@ -117,6 +135,9 @@ make check %doc %{_mandir}/man1/run-on-binaries-in.1.gz %changelog +* Fri Apr 11 2025 yaoxin <1024769339@qq.com> - 12.28-1 +- Update to 12.28 + * Mon May 20 2024 xu_ping <707078654@qq.com> - 8.92-2 - Adapted gcc for openeuler