#19 Set clang bcond default based on %toolchain
Opened 4 months ago by tbaeder. Modified 4 months ago
rpms/ tbaeder/binutils rawhide  into  rawhide

file modified
+21 -3
@@ -39,7 +39,7 @@ 

  Summary: A GNU collection of binary utilities

  Name: binutils%{?name_cross}%{?_with_debug:-debug}

  Version: 2.36.1

- Release: 12%{?dist}

+ Release: 13%{?dist}

  License: GPLv3+

  URL: https://sourceware.org/binutils

  
@@ -114,11 +114,17 @@ 

  %bcond_without docs

  # Default: Always run the testsuite.

  %bcond_without testsuite

- # Use clang as the build time compiler.  Default: gcc

- %bcond_with clang 

  # Default: support debuginfod.

  %bcond_without debuginfod

  

+ # Use clang as the build time compiler.

+ # Default to gcc if %%toolchain is not clang

+ %if "%toolchain" == "clang"

+ %bcond_without clang

+ %else

+ %bcond_with clang

+ %endif

+ 

  # Use the system supplied version of the zlib compress library.

  # Change this to use the binutils builtin version instead.

  %bcond_without systemzlib
@@ -469,6 +475,14 @@ 

  #----------------------------------------------------------------------------

  

  %build

+ # There is a problem with the clang+libtool+lto combination.

+ # The LDFLAGS containing -flto are not being passed when linking the

+ # libbfd.so, so the build fails. Disable LTO.

+ %if %{with clang}

+ %global _lto_cflags %{nil}

+ %define enable_lto 0

+ %endif

+ 

  echo target is %{binutils_target}

  %set_build_flags

  
@@ -862,6 +876,10 @@ 

  

  #----------------------------------------------------------------------------

  %changelog

+ * Wed May 19 2021 Timm Bäder <tabeder@redhat.com> - 2.36.1-13

+ - Set clang bconf default based on %%toolchain

+ - Diable LTO when using clang

+ 

  * Tue May 18 2021 Nick Clifton  <nickc@redhat.com> - 2.36.1-12

  - Generate PLT relocs for weak undefined PPC function symbols.  (#1960730)

  

And disable LTO when using clang.

I 'm not sure if the bcond handling here is correct or not, or if you'd instead like another variable that's set to true either when %{with clang} or %toolchain == clang.

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

Metadata