| Summary: | Debian patch: do not propagate -lpthread | ||
|---|---|---|---|
| Product: | SDL | Reporter: | manuel.montezelo |
| Component: | *don't know* | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | parasti+libsdl |
| Version: | 2.0.0 | ||
| Hardware: | Other | ||
| OS: | Linux | ||
| Attachments: |
dont_propagate_lpthread.diff
SDL2_dont_propagate_lpthread.diff |
||
|
Description
manuel.montezelo
2012-01-22 10:33:54 UTC
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! 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.
Created attachment 1381 [details]
SDL2_dont_propagate_lpthread.diff
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! Closing bug. 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. Reverted and awaiting a better fix. Thanks Jānis! Fixed, thanks! https://hg.libsdl.org/SDL/rev/2a9739ca6440 |