| Summary: | broken recursive mutexes checks in configury | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Ozkan Sezer <sezeroz> |
| Component: | build | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | icculus |
| Version: | HG 2.0 | Keywords: | triage-2.0.4 |
| Hardware: | All | ||
| OS: | Linux | ||
| Attachments: |
configury fix for recursive mutex checks
recursive mutex patch for SDL-1.2 branch |
||
Additional note: The configure.in part of the patch also applies to SDL-1.2 branch. It _is_ needed there too, because the SDL-1.2 branch of hg removed the _GNU_SOURCE definition from its common CFLAGS. Created attachment 1900 [details] recursive mutex patch for SDL-1.2 branch Went ahead and attached a patch for the SDL-1.2 branch. I also suggest that the _GNU_SOURCE definition removal (commit 7b87c1773b3e: http://hg.libsdl.org/SDL/rev/7b87c1773b3e) to be reverted from the SDL-1.2 branch. Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry if you got a lot of email from this. This is to help me sort through some bugs in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4, though! On my Linux system (Ubuntu 14.04), this is working without this patch. Can you see what the error you get in your config.log without this patch? --ryan. (In reply to Ryan C. Gordon from comment #4) > On my Linux system (Ubuntu 14.04), this is working without this patch. Can > you see what the error you get in your config.log without this patch? > > --ryan. configure:21912: checking for recursive mutexes configure:21932: gcc -c -g -O2 -Iinclude -I/home/ozzie/Download/SDL2/include -D_REENTRANT -Iinclude -I/home/ozzie/Download/SDL2/include conftest.c >&5 conftest.c: In function 'main': conftest.c:149: error: 'PTHREAD_MUTEX_RECURSIVE' undeclared (first use in this function) conftest.c:149: error: (Each undeclared identifier is reported only once conftest.c:149: error: for each function it appears in.) configure:21932: $? = 1 configure: failed program was: [...snip...] | | #include <pthread.h> | | int | main () | { | | pthread_mutexattr_t attr; | pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); | | ; | return 0; | } configure:21959: gcc -c -g -O2 -Iinclude -I/home/ozzie/Download/SDL2/include -D_REENTRANT -Iinclude -I/home/ozzie/Download/SDL2/include conftest.c >&5 configure:21959: $? = 0 configure:21969: result: yes In the generated SDL_config.h, I have: /* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX */ #define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1 This is with glibc-2.8. The SDL2 patch is now https://hg.libsdl.org/SDL/rev/a3344156e514, thanks! SDL-1.2: https://hg.libsdl.org/SDL/rev/d2bc9b3760fb and https://hg.libsdl.org/SDL/rev/c238763e1228 --ryan. |
Created attachment 1899 [details] configury fix for recursive mutex checks The configury checks for pthread_mutexattr_settype/PTHREAD_MUTEX_RECURSIVE without defining _GNU_SOURCE so the check would fail even if it is present. (The corresponding *.c file does define _GNU_SOURCE, so that side is just fine.) Besides, the check is done using _TRY_COMPILE instead of _TRY_LINK, so the result is not safe enough either. The attached small patch fixes these issues.