diff --git a/annobin.spec b/annobin.spec index ae77d1043789eb0ef30a097dd4157e03e2b5d7b8..738ae17311413035063bb16a8234e1259714f522 100644 --- a/annobin.spec +++ b/annobin.spec @@ -1,4 +1,4 @@ -%define anolis_release 1 +%define anolis_release 2 %{?scl_package:%global scl gcc-toolset-14} %global scl_prefix gcc-toolset-14- @@ -75,6 +75,13 @@ ExcludeArch: loongarch64 #--------------------------------------------------------------------------------- +# Bootstrapping: Set this to 1 to build annobin with the system gcc. +# Then once GTS-gcc is built and in the buildroot, reset this variable +# to 0, bump the NVR and rebuild GTS-annobin. +%define bootstrapping 1 + +#--------------------------------------------------------------------------------- + %global annobin_sources annobin-%{version}.tar.xz Source: https://nickc.fedorapeople.org/%{annobin_sources} # For the latest sources use: git clone git://sourceware.org/git/annobin.git @@ -92,12 +99,12 @@ Source: https://nickc.fedorapeople.org/%{annobin_sources} # XXX Bootstrapping - build annobin with the system gcc first. -# XXX BuildRequires: %%{?scl_prefix}gcc %%{?scl_prefix}gcc-c++ -# XXX BuildRequires: %%{?scl_prefix}annobin-plugin-gcc +# BuildRequires: %%{?scl_prefix}gcc %%{?scl_prefix}gcc-c++ +# BuildRequires: %%{?scl_prefix}annobin-plugin-gcc BuildRequires: gcc gcc-c++ -# XXX %%define gcc_for_annobin %%{?_scl_root}/usr/bin/gcc -# XXX %%define gxx_for_annobin %%{?_scl_root}/usr/bin/g++ +# %%define gcc_for_annobin %%{?_scl_root}/usr/bin/gcc +# %%define gxx_for_annobin %%{?_scl_root}/usr/bin/g++ %define gcc_for_annobin /usr/bin/gcc %define gxx_for_annobin /usr/bin/g++ @@ -334,8 +341,23 @@ Installs an annobin plugin that can be used by Clang. # Decide where the plugins will live. Change if necessary. +%if %{bootstrapping} + +# If we are bootstrapping then we will be using the system gcc. But we do +# not want to install the newly built GTS-14 annobin plugin into the system +# plugin directory. So we hard code a path here. +# FIXME: This is going to need to be updated every time we bootstrap. Find +# a better way. +# OpenAnolis use the gcc-toolset-14 +%global ANNOBIN_GCC_PLUGIN_DIR /opt/rh/%{scl_prefix}/root/usr/lib/gcc/x86_64-redhat-linux/14/plugin + +%else + + %global ANNOBIN_GCC_PLUGIN_DIR %(%gcc_for_annobin --print-file-name=plugin) +%endif + %{!?llvm_plugin_dir:%global llvm_plugin_dir %{_libdir}/llvm/plugins} %{!?clang_plugin_dir:%global clang_plugin_dir %{_libdir}/clang/plugins} @@ -579,5 +601,8 @@ make check GCC=%gcc_for_annobin #--------------------------------------------------------------------------------- %changelog +* Wed Feb 26 2025 Chang Gao - 12.52-2 +- Enable bootstrap to prepare first build + * Thu Oct 24 2024 mgb01105731 - 12.52-1 - Init import of sources.