Bug 1975096

Summary: cmake: FTBFS because it assumes libdl.so exists and can be loaded
Product: Red Hat Enterprise Linux 9 Reporter: Florian Weimer <fweimer>
Component: cmakeAssignee: serge_sans_paille <sguelton>
Status: CLOSED CURRENTRELEASE QA Contact: Michal Kolar <mkolar>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: besser82, tschelle
Target Milestone: betaKeywords: Bugfix, Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: cmake-3.20.2-4.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: 1972535 Environment:
Last Closed: 2021-12-07 21:42:00 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: 1972535    
Bug Blocks:    

Description Florian Weimer 2021-06-23 06:37:25 UTC
This issue will start impacting cmake in Red Hat Enterprise Linux 9 once we switch to glibc 2.34.

You can test a fix before glibc 2.34 is merged using this command:

koji -p stream build --scratch c9s-build-side-102-stack-gate git+https://gitlab.com/redhat/centos-stream/rpms/cmake#origin/c9s

+++ This bug was initially created as a clone of Bug #1972535 +++

A build-time test fails:

test 13
        Start  13: kwsys.testDynamicLoader
13: Test command: /builddir/build/BUILD/cmake-3.20.3/x86_64-redhat-linux-gnu/Source/kwsys/cmsysTestsCxx "testDynamicLoader"
13: Test timeout computed to be: 1500
13: Testing: azerty_
13: Testing: /builddir/build/BUILD/cmake-3.20.3/Source/kwsys/testSystemTools.bin
13: Testing: foobar.lib
13: Testing: libdl.so
13: OpenLibrary: libdl.so: cannot open shared object file: No such file or directory
13: Testing: libdl.so
13: OpenLibrary: libdl.so: cannot open shared object file: No such file or directory
13: Testing: /builddir/build/BUILD/cmake-3.20.3/x86_64-redhat-linux-gnu/Source/kwsys/libcmsysTestDynload.so
13: Testing: /builddir/build/BUILD/cmake-3.20.3/x86_64-redhat-linux-gnu/Source/kwsys/libcmsysTestDynload.so
13: Testing: /builddir/build/BUILD/cmake-3.20.3/x86_64-redhat-linux-gnu/Source/kwsys/libcmsysTestDynload.so
13: Testing: /builddir/build/BUILD/cmake-3.20.3/x86_64-redhat-linux-gnu/Source/kwsys/libcmsysTestDynload.so
13: Testing: /builddir/build/BUILD/cmake-3.20.3/x86_64-redhat-linux-gnu/Source/kwsys/libcmsysTestDynload.so
 33/645 Test  #13: kwsys.testDynamicLoader ............................***Failed    0.00 sec

The test probably should include <gnu/lib-names.h> and use the LIBDL_SO macro defined there.

--- Additional comment from Rex Dieter on 2021-06-18 20:13:17 CEST ---

Submitted upstream,

https://gitlab.kitware.com/cmake/cmake/-/issues/22321

--- Additional comment from Rex Dieter on 2021-06-18 23:14:51 CEST ---

I think this should do it,

https://src.fedoraproject.org/rpms/cmake/c/f52c15acca5c2d43cf386b0491ba9df0704d6f99?branch=rawhide

Comment 1 Björn 'besser82' Esser 2021-06-28 21:11:01 UTC
@fweimer You can find the complete patch, as it was upstreamed here [1].


[1]  https://src.fedoraproject.org/rpms/cmake/raw/b5ab4110144a3e0d9d55a0a65c51748ad66e0968/f/cmake-3.20.4-glibc_libdl.patch

Comment 2 Florian Weimer 2021-06-28 21:33:46 UTC
Patch looks good, thanks.

Comment 3 Björn 'besser82' Esser 2021-06-28 21:40:46 UTC
You're welcome.  =)

Comment 4 Michal Kolar 2021-07-29 20:26:39 UTC
Verified against cmake-3.20.2-6.el9.