Bug 2129639

Summary: sdl12-compat: pkg-config contains invalid 'Libs.private' entry leading to compilation failures
Product: [Fedora] Fedora Reporter: Solomon Peachy <pizza>
Component: sdl12-compatAssignee: Neal Gompa <ngompa13>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: 36CC: icculus, igor.raits, ngompa13
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: All   
Whiteboard:
Fixed In Version: sdl12-compat-1.2.60-1.fc36 sdl12-compat-1.2.60-1.fc35 sdl12-compat-1.2.60-1.fc37 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-04 10:45:14 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:
Attachments:
Description Flags
Upstream fix for this issue none

Description Solomon Peachy 2022-09-25 18:20:44 UTC
Description of problem:

sdl12_compat.pc has an invalid entry:

   Libs.private: -L${libdir} -lSDL dl

This causes compilation errors when trying to generate static builds using libsdl12_compat. 

Version-Release number of selected component (if applicable):

sdl12-compat-devel-1.2.56-1.fc36.x86_64

How reproducible:

Look at the file.  It's clearly wrong.

Expected results:

This should presumably say '-lSDL -ldl'

Additional info:

This problem does not exist in the sdl12-compat-1.2.52 RPMs!

This problem appears to be unique to Fedora, as doing a clean build of upstream sdl12-compat 1.2.56 doesn't generate this invalid Libs.private line.

Comment 1 Neal Gompa 2022-09-25 21:42:03 UTC
We're not doing anything special in sdl12-compat. The change between 1.2.52 and 1.2.56 that caused this problem is this: https://github.com/libsdl-org/sdl12-compat/commit/49e6ea8a8327a311edd5eddf3ebfd13da53b1cd5

The CMake documentation implies that "${CMAKE_DL_LIBS}" returns "-ldl", but that's clearly not what it does...

I'm not sure what to do here to fix it, though. Is this a CMake bug?

Comment 2 Solomon Peachy 2022-09-26 02:55:08 UTC
I grabbed the current github master (and the 1.2.56 release tag) and built that, and it doesn't misbehave.  That's why I reported it here vs upstream.

But it does seem that Fedora uses -DSTATICBUILD=true which causes upstream to break too, so... okay, I'll report it upstream. 

</grumble>

Comment 3 Solomon Peachy 2022-09-26 03:05:49 UTC
Reported upstream.

Comment 4 Solomon Peachy 2022-09-27 13:03:33 UTC
Created attachment 1914583 [details]
Upstream fix for this issue

Upstream has merged a fix:

https://github.com/libsdl-org/sdl12-compat/pull/224/commits

I squashed the commits into a single patch vs 1.2.56; it's attached.  It appears to solve the problem when manually building on the cmdline.

Comment 5 Fedora Update System 2022-10-30 22:48:43 UTC
FEDORA-2022-9400b16a0a has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-9400b16a0a

Comment 6 Fedora Update System 2022-10-30 22:48:49 UTC
FEDORA-2022-e4559c8ed0 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-e4559c8ed0

Comment 7 Fedora Update System 2022-10-30 22:48:54 UTC
FEDORA-2022-4b844fbebe has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-4b844fbebe

Comment 8 Fedora Update System 2022-10-31 08:06:22 UTC
FEDORA-2022-e4559c8ed0 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-e4559c8ed0`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-e4559c8ed0

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2022-10-31 10:28:32 UTC
FEDORA-2022-4b844fbebe has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-4b844fbebe`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-4b844fbebe

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2022-10-31 10:30:18 UTC
FEDORA-2022-9400b16a0a has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-9400b16a0a`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-9400b16a0a

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2022-11-04 10:45:14 UTC
FEDORA-2022-4b844fbebe has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 12 Fedora Update System 2022-11-07 22:00:16 UTC
FEDORA-2022-9400b16a0a has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2022-11-10 22:28:43 UTC
FEDORA-2022-e4559c8ed0 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.