| Summary: | Linux build fails with --disable-threads | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Daniel Scharrer <daniel> |
| Component: | thread | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | fontaine.fabrice, icculus, sezeroz |
| Version: | 2.0.9 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: | fix build with --disable-threads | ||
|
Description
Daniel Scharrer
2018-11-20 04:04:22 UTC
Created attachment 3502 [details]
fix build with --disable-threads
This issue is raised by SDL_LinuxSetThreadPriority() which has been added since version 2.0.9 and https://github.com/SDL-mirror/SDL/commit/f25a7fa870bdceb339e5105973f689606bcb9086 This function is used in src/dynapi/SDL_dynapi_procs.h even when SDL_THREADS_DISABLED However, when SDL_THREADS_DISABLED is set, SDL_LinuxSetThreadPriority is not defined because thread/pthread/SDL_systhread.c is not built So SDL_THREADS_DISABLED should be checked in addition to __LINUX__ (see attachment for a patch) Fixes: - http://autobuild.buildroot.org/results/539cb9ab6c605dc6be73ebe90debab1a998f2451 (In reply to Fabrice Fontaine from comment #2) > This function is used in src/dynapi/SDL_dynapi_procs.h even > when SDL_THREADS_DISABLED This needs to be in SDL_dynapi_procs.h even if the subsystem is disabled; the function must still exist for binary compatibility, but it can just "return SDL_Unsupported();" or whatever if threads are disabled. --ryan. This is fixed in https://hg.libsdl.org/SDL/rev/fa17d3d76431, thanks! --ryan. New warning:
In file included from src/thread/pthread/../../SDL_internal.h:45:0,
from src/thread/pthread/SDL_systhread.c:22:
src/thread/pthread/SDL_systhread.c: In function 'SDL_SYS_SetThreadPriority':
src/thread/pthread/../../dynapi/SDL_dynapi_overrides.h:673:36: warning: implicit declaration of function 'SDL_LinuxSetThreadPriority_REAL'; did you mean 'SDL_SetThreadPriority_REAL'? [-Wimplicit-function-declaration]
#define SDL_LinuxSetThreadPriority SDL_LinuxSetThreadPriority_REAL
^
src/thread/pthread/SDL_systhread.c:206:12: note: in expansion of macro 'SDL_LinuxSetThreadPriority'
return SDL_LinuxSetThreadPriority(thread, value);
^~~~~~~~~~~~~~~~~~~~~~~~~~
I have this fixed locally, will clean up and commit in the morning. --ryan. (In reply to Ryan C. Gordon from comment #6) > I have this fixed locally, will clean up and commit in the morning. ...and I did, but forgot to resolve this bug. Fixed in https://hg.libsdl.org/SDL/rev/f8041c025fd3 and https://hg.libsdl.org/SDL/rev/5d56e3a2a3e4 --ryan. |