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 2193406

Summary: redhat-rpm-config should require llvm
Product: Red Hat Enterprise Linux 9 Reporter: Jesus Checa <jchecahi>
Component: redhat-rpm-configAssignee: Nikita Popov <npopov>
Status: CLOSED ERRATA QA Contact: Jesus Checa <jchecahi>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.3CC: codonell, fberat, fweimer, npopov, tstellar
Target Milestone: rcKeywords: Bugfix, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: redhat-rpm-config-201-1.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-07 08:29:31 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: 2188418    
Deadline: 2023-06-12   

Description Jesus Checa 2023-05-05 14:46:08 UTC
Description of problem:
redhat-rpm-config contains a script (brp-llvm-compile-lto-elf) which requires the llvm-strings binary. This is provided by llvm package, however redhat-rpm-config doesn't require it. This can lead to builds like https://kojihub.stream.rdu2.redhat.com/kojifiles/work/tasks/9853/2189853/build.log

Version-Release number of selected component (if applicable):
redhat-rpm-config-200-1.el9


Additional info:
The package in Fedora does require llvm: https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/rawhide/f/redhat-rpm-config.spec#_131

Comment 1 Florian Weimer 2023-05-05 14:53:46 UTC
Doing this unconditionally is too invasive for the default buildroot.

Requires: (llvm if clang)

as in Fedora should work, though.

Comment 3 Jesus Checa 2023-05-17 09:46:19 UTC
Tested with redhat-rpm-config-201-1.el9. The llvm dependency is correctly handled now. From a system that has not clang installed, redhat-rpm-config only requires llvm-libs as dependency:

----------
[root@localhost ~]# dnf install redhat-rpm-config-201-1.el9.noarch.rpm --assumeno | grep llvm                                           
 llvm-libs                x86_64    16.0.1-1.el9        rhel-AppStream     44 M                                                         
Operation aborted.    
----------

After installing clang, it redhat-rpm-config-201-1.el9 correctly requires llvm, while redhat-rpm-config-200-1.el9 doesn't:
----------
[root@localhost ~]# dnf -q -y install clang

Installed:
  clang-16.0.1-2.el9.x86_64                                                                         
  clang-libs-16.0.1-2.el9.x86_64                                                                    
  clang-resource-filesystem-16.0.1-2.el9.x86_64                                                     
  compiler-rt-16.0.1-1.el9.x86_64                                                                   
  gcc-c++-11.3.1-4.4.el9.x86_64                                                                     
  gcc-toolset-12-gcc-12.2.1-7.4.el9.x86_64                                                          
  gcc-toolset-12-gcc-c++-12.2.1-7.4.el9.x86_64                                                      
  gcc-toolset-12-libstdc++-devel-12.2.1-7.4.el9.x86_64                                              
  libatomic-11.3.1-4.4.el9.x86_64                                                                   
  libomp-16.0.1-1.el9.x86_64                                                                        
  libomp-devel-16.0.1-1.el9.x86_64                                                                  
  libstdc++-devel-11.3.1-4.4.el9.x86_64                                                             
  llvm-libs-16.0.1-1.el9.x86_64                                                                     

[root@localhost ~]# dnf install redhat-rpm-config-201-1.el9.noarch.rpm --assumeno | grep llvm
 llvm                     x86_64    16.0.1-1.el9        rhel-AppStream     21 M
Operation aborted.
[root@localhost ~]# dnf install redhat-rpm-config-200-1.el9.noarch.rpm --assumeno | grep llvm
Operation aborted.
---------

The dependency works from clang's side as well. If one installs first redhat-rpm-config, and then clang, the latter will process the llvm dependency correctly:
---------
[root@localhost ~]# dnf remove -y clang > /dev/null
[root@localhost ~]# dnf install clang --assumeno | grep llvm                                                                                                                                                                                                                    
 llvm-libs                       x86_64  16.0.1-1.el9     rhel-AppStream   44 M
[root@localhost ~]# dnf install redhat-rpm-config-201-1.el9.noarch.rpm -y > /dev/null 
[root@localhost ~]# dnf install clang --assumeno | grep llvm
 llvm                            x86_64  16.0.1-1.el9     rhel-AppStream   21 M
Operation aborted.
---------

Updated /CoreOS/redhat-rpm-config/Sanity/bz2022522-brp-llvm-compile-lto-elf testcase to build objects with lto so brp-llvm-compile-lto-elf needs to use llvm-strings.

Comment 9 errata-xmlrpc 2023-11-07 08:29:31 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 (redhat-rpm-config 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-2023:6389