Bug 1133281 - LTO: qemu build fails
Summary: LTO: qemu build fails
Status: CONFIRMED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Martin Liška
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 1133084
  Show dependency treegraph
 
Reported: 2019-04-24 13:30 UTC by Martin Liška
Modified: 2023-10-13 14:30 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2019-04-24 13:30:35 UTC
Fails due to:

[  284s] /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: /tmp/curl.so.8gtd0D.ltrans0.ltrans.o: relocation R_X86_64_PC32 against undefined symbol `qemu_mutex_lock_func' can not be used when making a shared object; recompile with -fPIC
[  284s] /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: final link failed: bad value
[  284s] collect2: error: ld returned 1 exit status
[  284s] make: *** [/home/abuild/rpmbuild/BUILD/qemu-3.1.0/rules.mak:110: block/curl.so] Error 1
[  284s] make: *** Waiting for unfinished jobs....

We should disable LTO for such a low level package.
Comment 1 Bruce Rogers 2019-04-25 17:15:34 UTC
I'm curious about your comment about we should disable LTO for such a low level package. I would think anywhere LTO could reasonably apply, we would want it. What do you see in the qemu package which would make you make that blanket statement?
Comment 2 Martin Liška 2019-04-26 07:56:27 UTC
(In reply to Bruce Rogers from comment #1)
> I'm curious about your comment about we should disable LTO for such a low
> level package. I would think anywhere LTO could reasonably apply, we would
> want it. What do you see in the qemu package which would make you make that
> blanket statement?

I must agree that my analysis was very easygoing. I expect usage of an top level assembly which is a bit problematic for LTO.

Anyway I can debug the unresolved symbols in qemu package later.
Comment 3 Bruce Rogers 2019-05-13 14:31:50 UTC
Status update:
The qemu now in Factory (and Tumbleweed) have the suggested disabling. I've investigated most of the issues preventing LTO being enabled for qemu and the subpackages, and am working on resolving those, so I'll leave this bug open to track that effort.
Comment 4 Bruce Rogers 2019-05-13 20:58:44 UTC
The current blocker I see for enabling LTO for qemu has to do with runaway memory allocation by the compiler due to the __attribute__(flatten) used in qemu's target/arm/sve_helper.c.

In googling around it seems you have experienced this in previous work, and have worked on solutions in the compiler code. I get this both with gcc8 and gcc9. What is the solution from your perspective?
Comment 5 Martin Liška 2019-05-14 10:47:27 UTC
(In reply to Bruce Rogers from comment #4)
> The current blocker I see for enabling LTO for qemu has to do with runaway
> memory allocation by the compiler due to the __attribute__(flatten) used in
> qemu's target/arm/sve_helper.c.

At, flattening.

> 
> In googling around it seems you have experienced this in previous work, and
> have worked on solutions in the compiler code. I get this both with gcc8 and
> gcc9. What is the solution from your perspective?

Yes, I've seen it couple of times. My solution would be to remove it so it may cause huge code inlining.