Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1899620

Summary: meson builds QEMU with PIC objects instead of PIE
Product: Red Hat Enterprise Linux 8 Reporter: Paolo Bonzini <pbonzini>
Component: mesonAssignee: Danilo de Paula <ddepaula>
Status: CLOSED ERRATA QA Contact: Tomas Pelka <tpelka>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: ---CC: jinzhao, juzhang, pbonzini, tpelka, wtaymans, zhguo
Target Milestone: rcKeywords: Triaged
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: meson-0.55.3-3.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 16:27:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1899619    

Description Paolo Bonzini 2020-11-19 17:08:34 UTC
QEMU uses lots of static libraries to group parts of the build.  Unless those libraries are compiled as position-independent executable (PIE) code and not position-independent shared library (PIC) code, there will be a substantial performance hit.

In theory, b_staticpic is meant for libraries that are never installed and only linked to executables.  However, Meson right now uses position-*dependent* code unconditionally if b_staticpic=false, even if b_pie=true.  Thus b_staticpic=false causes the build to fail.

We can backport a patch from Meson 0.56 in order to fix this case and let QEMU compile with b_staticpic=false.

The patch is at https://github.com/mesonbuild/meson/commit/021d242f9ce8e.patch and it applies cleanly with context changes only.

Comment 6 Paolo Bonzini 2020-12-10 14:28:04 UTC
Tomas, are you willing to qa-ack it?

Comment 7 Tomas Pelka 2020-12-10 18:36:29 UTC
(In reply to Paolo Bonzini from comment #6)
> Tomas, are you willing to qa-ack it?

I did already 

Tomas Pelka 2020-12-02 15:36:43 UTC
Flags: qa_ack? → qa_ack+

Comment 8 Danilo de Paula 2020-12-15 00:52:06 UTC
@Paolo: I got a minor conflict when dealing with the proposed patch.

@tpelka are you able to test this change?
Actually, what actually do you do when you test it? Can we automate it and include it on the gating stuff?

Comment 11 Tomas Pelka 2021-01-08 21:06:42 UTC
(In reply to Danilo Cesar Lemes de Paula from comment #8)
> @Paolo: I got a minor conflict when dealing with the proposed patch.
> 
> @tpelka are you able to test this change?
> Actually, what actually do you do when you test it? Can we automate it and
> include it on the gating stuff?

I thought I know but I don't pbonzini idea?

Thanks
in advance
-Tom

Comment 12 Paolo Bonzini 2021-01-08 22:08:32 UTC
Rebuilding some of Mesa, systemd and QEMU would be a pretty good gating.  Considering changes to Meson are pretty rare, it's probably not a big deal if it takes some time.

Comment 13 Tomas Pelka 2021-01-11 19:20:00 UTC
(In reply to Paolo Bonzini from comment #12)
> Rebuilding some of Mesa, systemd and QEMU would be a pretty good gating. 
> Considering changes to Meson are pretty rare, it's probably not a big deal
> if it takes some time.

Thanks Paolo, make sense from my point of view.

Comment 14 Tomas Pelka 2021-01-12 21:32:19 UTC
Mesa build was fine so I think it should be fine.

Comment 16 errata-xmlrpc 2021-05-18 16:27:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (meson bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1962