[libvirt PATCH] rpm: disable LTO in Fedora 34

Daniel P. Berrangé posted 1 patch 3 years, 6 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20201021121948.420118-1-berrange@redhat.com
libvirt.spec.in | 7 +++++++
1 file changed, 7 insertions(+)
[libvirt PATCH] rpm: disable LTO in Fedora 34
Posted by Daniel P. Berrangé 3 years, 6 months ago
A binutils change has caused breakage when linking the tests

/usr/bin/ld: tests/libtest_qemu_driver.so: undefined reference to `__open_missing_mode'

This is probably a regression in binutils, so disable LTO until we get
more clarity on the root cause and whether binutils or libvirt will need
changing.

  https://bugzilla.redhat.com/show_bug.cgi?id=1889763

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 libvirt.spec.in | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libvirt.spec.in b/libvirt.spec.in
index 325566f329..2a4324b974 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -990,6 +990,13 @@ Libvirt plugin for NSS for translating domain names into IP addresses.
 %autosetup -S git_am
 
 %build
+
+%if 0%{?fedora} == 34
+    # binutils change in F34 broke linking of tests
+    # https://bugzilla.redhat.com/show_bug.cgi?id=1889763
+    %define _lto_cflags %{nil}
+%endif
+
 %if ! %{supported_platform}
 echo "This RPM requires either Fedora >= %{min_fedora} or RHEL >= %{min_rhel}"
 exit 1
-- 
2.26.2

Re: [libvirt PATCH] rpm: disable LTO in Fedora 34
Posted by Daniel P. Berrangé 3 years, 6 months ago
On Wed, Oct 21, 2020 at 01:19:48PM +0100, Daniel P. Berrangé wrote:
> A binutils change has caused breakage when linking the tests
> 
> /usr/bin/ld: tests/libtest_qemu_driver.so: undefined reference to `__open_missing_mode'
> 
> This is probably a regression in binutils, so disable LTO until we get
> more clarity on the root cause and whether binutils or libvirt will need
> changing.
> 
>   https://bugzilla.redhat.com/show_bug.cgi?id=1889763
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  libvirt.spec.in | 7 +++++++
>  1 file changed, 7 insertions(+)

I've pushed this as a CI build fix now that my test pipeline has
succeeded.

> 
> diff --git a/libvirt.spec.in b/libvirt.spec.in
> index 325566f329..2a4324b974 100644
> --- a/libvirt.spec.in
> +++ b/libvirt.spec.in
> @@ -990,6 +990,13 @@ Libvirt plugin for NSS for translating domain names into IP addresses.
>  %autosetup -S git_am
>  
>  %build
> +
> +%if 0%{?fedora} == 34
> +    # binutils change in F34 broke linking of tests
> +    # https://bugzilla.redhat.com/show_bug.cgi?id=1889763
> +    %define _lto_cflags %{nil}
> +%endif
> +
>  %if ! %{supported_platform}
>  echo "This RPM requires either Fedora >= %{min_fedora} or RHEL >= %{min_rhel}"
>  exit 1
> -- 
> 2.26.2
> 

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

Re: [libvirt PATCH] rpm: disable LTO in Fedora 34
Posted by Laine Stump 3 years, 6 months ago
On 10/21/20 8:19 AM, Daniel P. Berrangé wrote:
> A binutils change has caused breakage when linking the tests
>
> /usr/bin/ld: tests/libtest_qemu_driver.so: undefined reference to `__open_missing_mode'
>
> This is probably a regression in binutils, so disable LTO until we get
> more clarity on the root cause and whether binutils or libvirt will need
> changing.
>
>    https://bugzilla.redhat.com/show_bug.cgi?id=1889763
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


post-partem


Reviewed-by: Laine Stump <laine@redhat.com>


(I had been waiting for my CI to complete too :-)


> ---
>   libvirt.spec.in | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/libvirt.spec.in b/libvirt.spec.in
> index 325566f329..2a4324b974 100644
> --- a/libvirt.spec.in
> +++ b/libvirt.spec.in
> @@ -990,6 +990,13 @@ Libvirt plugin for NSS for translating domain names into IP addresses.
>   %autosetup -S git_am
>   
>   %build
> +
> +%if 0%{?fedora} == 34
> +    # binutils change in F34 broke linking of tests
> +    # https://bugzilla.redhat.com/show_bug.cgi?id=1889763
> +    %define _lto_cflags %{nil}
> +%endif
> +
>   %if ! %{supported_platform}
>   echo "This RPM requires either Fedora >= %{min_fedora} or RHEL >= %{min_rhel}"
>   exit 1