Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debian patch: do not propagate -lpthread #532

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

Debian patch: do not propagate -lpthread #532

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

SDLBugzilla commented Feb 10, 2021

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 2.0.0
Reported for operating system, platform: Linux, Other

Comments on the original bug report:

On 2012-01-22 10:33:54 +0000, wrote:

Created attachment 795
dont_propagate_lpthread.diff

Hello,

Since the bug report[1] in 2006 Debian is shipping the patch attached.

[1] http://bugs.debian.org/375822

Maybe nowadays you don't propagate that library for linking, so maybe the patch should be dropped, but at the moment I do not have an easy/quick way to check it.

So I am submitting this report in the case that you consider it useful (even if maybe the patch itself has to be reworked), or otherwise learn if the patch is unneeded or even harmful.

Regards.

On 2012-01-22 10:54:21 +0000, Sam Lantinga wrote:

At some point it was required that multi-threaded programs using pthreads on Linux link directly to the pthread library. I don't remember all the details, but it had something to do with initializing C runtime variables correctly.

I'm sure it's not an issue anymore, but I'd rather not apply this patch in 1.2. I'll go ahead and make this change in 1.3 though.

Thanks!

On 2013-10-19 23:48:31 +0000, wrote:

This affects SDL2, it seems that it was not fixed, or the fix reverted.

Comparing the current Debian packages for SDL2 (patched) and the one removing the patch:


$ diff -u /usr/bin/sdl2-config /tmp/libsdl2_next/usr/bin/sdl2-config
--- /usr/bin/sdl2-config 2013-08-30 19:23:38.000000000 +0100
+++ /tmp/libsdl2_next/usr/bin/sdl2-config 2013-10-19 22:09:40.000000000 +0100
@@ -45,7 +45,7 @@
echo -I${prefix}/include/SDL2 -D_REENTRANT
;;
--libs)

  •  echo -L${prefix}/lib/x86_64-linux-gnu  -lSDL2
    
  •  echo -L${prefix}/lib/x86_64-linux-gnu  -lSDL2  -lpthread
     ;;
    
    --static-libs)

--libs|--static-libs)


Same for pkg-config files:


--- /usr/lib/x86_64-linux-gnu/pkgconfig/sdl2.pc 2013-08-30 19:23:38.000000000 +0100
+++ /tmp/libsdl2_next/usr/lib/x86_64-linux-gnu/pkgconfig/sdl2.pc 2013-10-19 22:09:40.000000000 +0100
@@ -13 +13 @@
-Libs: -L${libdir} -lSDL2
+Libs: -L${libdir} -lSDL2 -lpthread

The patch (attached) that we're applying is the same, but adapted for SDL2.

On 2013-10-19 23:49:21 +0000, wrote:

Created attachment 1381
SDL2_dont_propagate_lpthread.diff

On 2013-10-20 17:20:31 +0000, Sam Lantinga wrote:

I'm applying this patch. We'll see if we get any reports of issues on modern systems.
http://hg.libsdl.org/SDL/rev/b5d893a07471

Thanks!

On 2013-10-20 17:21:05 +0000, Sam Lantinga wrote:

Closing bug.

On 2013-10-21 16:18:50 +0000, Jānis Rūcis wrote:

Reopening as this patch broke linking under MinGW due to missing -lSDLmain and -mwindows.

A better solution is probably to remove $pthread_lib from SDL_LIBS in configure.in rather than to modify the generated scripts.

On 2013-10-21 17:35:03 +0000, Sam Lantinga wrote:

Reverted and awaiting a better fix.

Thanks Jānis!

On 2015-05-26 13:33:21 +0000, Sam Lantinga wrote:

Fixed, thanks!
https://hg.libsdl.org/SDL/rev/2a9739ca6440

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant