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

Linux build fails with --disable-threads #3073

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

Linux build fails with --disable-threads #3073

SDLBugzilla opened this issue Feb 11, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 2.0.9
Reported for operating system, platform: Linux, x86_64

Comments on the original bug report:

On 2018-11-20 04:04:22 +0000, Daniel Scharrer wrote:

$ ./configure --disable-threads
$ make
[...]
LTLINK build/libSDL2.la
/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: build/.libs/SDL_dynapi.o: in function initialize_jumptable': /home/dscharrer/SDL2-2.0.9/src/dynapi/SDL_dynapi_procs.h:34: undefined reference to SDL_LinuxSetThreadPriority_REAL'
/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: build/.libs/SDL_waylanddatamanager.o: in function write_pipe': /home/dscharrer/SDL2-2.0.9/src/video/wayland/SDL_waylanddatamanager.c:56: undefined reference to pthread_sigmask'
/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /home/dscharrer/SDL2-2.0.9/src/video/wayland/SDL_waylanddatamanager.c:73: undefined reference to `pthread_sigmask'
collect2: error: ld returned 1 exit status
make: *** [Makefile:147: build/libSDL2.la] Error 1

On 2018-11-23 21:20:19 +0000, Fabrice Fontaine wrote:

Created attachment 3502
fix build with --disable-threads

On 2018-11-23 21:21:55 +0000, Fabrice Fontaine wrote:

This issue is raised by SDL_LinuxSetThreadPriority() which has been added since version 2.0.9 and SDL-mirror/SDL@f25a7fa

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:

On 2018-11-23 22:21:45 +0000, Ryan C. Gordon wrote:

(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.

On 2018-12-01 15:37:37 +0000, Ryan C. Gordon wrote:

This is fixed in https://hg.libsdl.org/SDL/rev/fa17d3d76431, thanks!

--ryan.

On 2018-12-03 06:41:55 +0000, Ozkan Sezer wrote:

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);
^~~~~~~~~~~~~~~~~~~~~~~~~~

On 2018-12-03 07:17:00 +0000, Ryan C. Gordon wrote:

I have this fixed locally, will clean up and commit in the morning.

--ryan.

On 2019-03-01 00:14:48 +0000, Ryan C. Gordon wrote:

(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.

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