We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3296 - Build failure of SDL1.2 on Linux
Summary: Build failure of SDL1.2 on Linux
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: main (show other bugs)
Version: HG 1.2
Hardware: ARM Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
: 3294 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-03-22 21:57 UTC by Ben Avison
Modified: 2017-05-25 00:20 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Avison 2016-03-22 21:57:53 UTC
Specifically, I'm using Raspbian, though I suspect any Linux distro is probably affected. Build log:

$ make
/bin/bash ./libtool --mode=compile gcc -g  -I./include -D_GNU_SOURCE=1 -fvisibility=hidden  -DXTHREADS -D_REENTRANT -DHAVE_LINUX_VERSION_H -Wall -c ./src/stdlib/SDL_qsort.c  -o build/SDL_qsort.lo
libtool: compile:  gcc -g -I./include -D_GNU_SOURCE=1 -fvisibility=hidden -DXTHREADS -D_REENTRANT -DHAVE_LINUX_VERSION_H -Wall -c ./src/stdlib/SDL_qsort.c  -fPIC -DPIC -o build/.libs/SDL_qsort.o
./src/stdlib/SDL_qsort.c:349:61: error: unknown type name ‘size_t’
 static char * pivot_big(char *first, char *mid, char *last, size_t size,
                                                             ^
./src/stdlib/SDL_qsort.c:390:42: error: unknown type name ‘size_t’
 static void qsort_nonaligned(void *base, size_t nmemb, size_t size,
                                          ^
./src/stdlib/SDL_qsort.c:390:56: error: unknown type name ‘size_t’
 static void qsort_nonaligned(void *base, size_t nmemb, size_t size,
                                                        ^
./src/stdlib/SDL_qsort.c:421:39: error: unknown type name ‘size_t’
 static void qsort_aligned(void *base, size_t nmemb, size_t size,
                                       ^
./src/stdlib/SDL_qsort.c:421:53: error: unknown type name ‘size_t’
 static void qsort_aligned(void *base, size_t nmemb, size_t size,
                                                     ^
./src/stdlib/SDL_qsort.c:452:37: error: unknown type name ‘size_t’
 static void qsort_words(void *base, size_t nmemb,
                                     ^
./src/stdlib/SDL_qsort.c:504:32: error: unknown type name ‘size_t’
 extern void qsortG(void *base, size_t nmemb, size_t size,
                                ^
./src/stdlib/SDL_qsort.c:504:46: error: unknown type name ‘size_t’
 extern void qsortG(void *base, size_t nmemb, size_t size,
                                              ^
build-deps:462: recipe for target 'build/SDL_qsort.lo' failed
make: *** [build/SDL_qsort.lo] Error 1


The only problem is the failure to pick up a typedef for size_t. This can be solved by #include <stddef.h> but I see that it's only a few revisions back that #include "SDL_stdinc.h" was removed, which does it indirectly, so I guess that's the better solution?

diff -r 2f1eb5fa26ea src/stdlib/SDL_qsort.c
--- a/src/stdlib/SDL_qsort.c	Fri Mar 11 08:30:18 2016 -0800
+++ b/src/stdlib/SDL_qsort.c	Tue Mar 22 21:17:46 2016 +0000
@@ -21,6 +21,8 @@
 
 #ifndef HAVE_QSORT
 
+#include "SDL_stdinc.h"
+
 #ifdef assert
 #undef assert
 #endif
Comment 1 Philipp Wiesemann 2016-03-23 20:53:09 UTC
Bug 3294 has a similar patch.
Comment 2 Philipp Wiesemann 2016-03-31 21:47:03 UTC
This was maybe fixed here (with a different patch):
https://hg.libsdl.org/SDL/rev/8ab0633c9d43
Comment 3 Ryan C. Gordon 2017-05-24 22:40:32 UTC
Yes, this should be fixed in revision control.

--ryan.
Comment 4 Ryan C. Gordon 2017-05-25 00:20:07 UTC
*** Bug 3294 has been marked as a duplicate of this bug. ***