aboutsummaryrefslogtreecommitdiffstats
path: root/testing/flightgear/musl-fixes.patch
diff options
context:
space:
mode:
Diffstat (limited to 'testing/flightgear/musl-fixes.patch')
-rw-r--r--testing/flightgear/musl-fixes.patch129
1 files changed, 63 insertions, 66 deletions
diff --git a/testing/flightgear/musl-fixes.patch b/testing/flightgear/musl-fixes.patch
index 00ef78d3b7..c72ea90c78 100644
--- a/testing/flightgear/musl-fixes.patch
+++ b/testing/flightgear/musl-fixes.patch
@@ -1,51 +1,10 @@
-diff --git a/3rdparty/hts_engine_API/lib/HTS_misc.c b/3rdparty/hts_engine_API/lib/HTS_misc.c
-index b0d112d..6de47ee 100644
---- a/3rdparty/hts_engine_API/lib/HTS_misc.c
-+++ b/3rdparty/hts_engine_API/lib/HTS_misc.c
-@@ -247,8 +247,10 @@ size_t HTS_ftell(HTS_File * fp)
- fgetpos((FILE *) fp->pointer, &pos);
- #if defined(_WIN32) || defined(__CYGWIN__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__ANDROID__)
- return (size_t) pos;
--#else
-+#elif defined(__GLIBC__)
- return (size_t) pos.__pos;
-+#else
-+ return (size_t) ftell(fp->pointer);
- #endif /* _WIN32 || __CYGWIN__ || __APPLE__ || __ANDROID__ */
- } else if (fp->type == HTS_DATA) {
- HTS_Data *d = (HTS_Data *) fp->pointer;
-diff --git a/3rdparty/iaxclient/lib/libiax2/src/iax.c b/3rdparty/iaxclient/lib/libiax2/src/iax.c
-index 0bfd2e4..39eea99 100644
---- a/3rdparty/iaxclient/lib/libiax2/src/iax.c
-+++ b/3rdparty/iaxclient/lib/libiax2/src/iax.c
-@@ -75,7 +75,7 @@
- // FlightGear: Modified to include FreeBSD
- #if !defined(MACOSX) && !defined(__OpenBSD__) && !defined(__FreeBSD__)
- #include <malloc.h>
--#if !defined(SOLARIS)
-+#if !defined(SOLARIS) && defined(__GLIBC__)
- #include <error.h>
- #endif
- #endif
-diff --git a/src/FDM/JSBSim/JSBSim.cpp b/src/FDM/JSBSim/JSBSim.cpp
-index 87b5e6e..ea39ca6 100644
---- a/src/FDM/JSBSim/JSBSim.cpp
-+++ b/src/FDM/JSBSim/JSBSim.cpp
-@@ -287,7 +287,7 @@ int main(int argc, char* argv[])
- _clearfp();
- _controlfp(_controlfp(0, 0) & ~(_EM_INVALID | _EM_ZERODIVIDE | _EM_OVERFLOW),
- _MCW_EM);
--#elif defined(__GNUC__) && !defined(sgi) && !defined(__APPLE__)
-+#elif defined(__GLIBC__)
- feenableexcept(FE_DIVBYZERO | FE_INVALID);
- #endif
-
-diff --git a/src/Main/bootstrap.cxx b/src/Main/bootstrap.cxx
-index 550d028..db369ea 100644
---- a/src/Main/bootstrap.cxx
-+++ b/src/Main/bootstrap.cxx
-@@ -93,12 +93,16 @@ static void handleFPE(int);
- static void
+Simply disabling the code which enables floating point exceptions
+is probably wrong, but I don't have a replacement for the
+non-posix functions fegetexcept(3) and feenableexcept(3).
+
+--- a/src/Main/bootstrap.cxx 2015-02-18 21:10:05.000000000 +0100
++++ b/src/Main/bootstrap.cxx 2015-11-01 01:25:56.665212195 +0100
+@@ -96,8 +96,12 @@
initFPE (bool fpeAbort)
{
+#if defined(__GLIBC__)
@@ -58,29 +17,67 @@ index 550d028..db369ea 100644
+#else
+ signal(SIGFPE, handleFPE);
+#endif
- }
-
- static void handleFPE(int)
-@@ -137,7 +141,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
+There is no <error.h> in musl libc, thus enable the
+include only if __GLIB__ is defined.
+
+--- a/3rdparty/iaxclient/lib/libiax2/src/iax.c 2015-02-18 21:10:05.000000000 +0100
++++ b/3rdparty/iaxclient/lib/libiax2/src/iax.c 2015-10-31 17:14:55.477461723 +0100
+@@ -75,7 +75,7 @@
+ // FlightGear: Modified to include FreeBSD
+ #if !defined(MACOSX) && !defined(__OpenBSD__) && !defined(__FreeBSD__)
+ #include <malloc.h>
+-#if !defined(SOLARIS)
++#if !defined(SOLARIS) && defined(__GLIBC__)
+ #include <error.h>
+ #endif
+ #endif
+--- a/src/Main/bootstrap.cxx 2017-03-17 09:52:07.474706542 +0100
++++ b/src/Main/bootstrap.cxx 2017-03-17 09:53:40.361793507 +0100
+@@ -141,7 +141,7 @@
}
#endif
-#if defined(__GNUC__)
-+#if defined(__GLIBC__)
++#if defined(__GNUC__) && defined(__GLIBC__)
#include <execinfo.h>
#include <cxxabi.h>
void segfault_handler(int signo) {
-@@ -182,7 +186,12 @@ void segfault_handler(int signo) {
- free(fname);
- free(list);
- }
--
-+ exit(1);
-+}
-+#else
-+/* musl doesn't have execinfo */
-+void segfault_handler(int signo) {
-+ fprintf(stderr, "Error: caught signal %d:\n", signo);
- exit(1);
- }
+@@ -244,8 +244,10 @@
+
+ signal(SIGPIPE, SIG_IGN);
+ # ifndef NDEBUG
++# ifdef __GLIBC__
+ signal(SIGSEGV, segfault_handler);
+ # endif
++# endif
#endif
+
+ _bootstrap_OSInit = 0;
+--- a/src/FDM/JSBSim/JSBSim.cpp 2017-03-01 21:06:31.000000000 +0100
++++ b/src/FDM/JSBSim/JSBSim.cpp 2017-03-17 09:49:13.115544107 +0100
+@@ -287,7 +287,7 @@
+ _clearfp();
+ _controlfp(_controlfp(0, 0) & ~(_EM_INVALID | _EM_ZERODIVIDE | _EM_OVERFLOW),
+ _MCW_EM);
+-#elif defined(__GNUC__) && !defined(sgi) && !defined(__APPLE__)
++#elif defined(__GNUC__) && !defined(sgi) && !defined(__APPLE__) && defined(__GLIBC__)
+ feenableexcept(FE_DIVBYZERO | FE_INVALID);
+ #endif
+
+For musl libc return the file position using
+ftell(3) because fpos_t is opaque.
+
+--- a/3rdparty/hts_engine_API/lib/HTS_misc.c 2015-02-18 21:10:05.000000000 +0100
++++ b/3rdparty/hts_engine_API/lib/HTS_misc.c 2015-10-31 17:33:53.946349145 +0100
+@@ -247,8 +247,10 @@
+ fgetpos((FILE *) fp->pointer, &pos);
+ #if defined(_WIN32) || defined(__CYGWIN__) || defined(__APPLE__) || defined(__ANDROID__) || defined(__FreeBSD__)
+ return (size_t) pos;
+-#else
++#elif defined(__GLIBC__)
+ return (size_t) pos.__pos;
++#else
++ return (size_t) ftell(fp->pointer);
+ #endif /* _WIN32 || __CYGWIN__ || __APPLE__ || __ANDROID__ */
+ }
+ HTS_error(0, "HTS_ftell: Unknown file type.\n");