From 2318ed1c707a4a19014007b4338bb30cd26c55e6 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Thu, 12 Jul 2018 02:01:01 +0200 Subject: testing/sbcl: fix and enable threads support --- testing/sbcl/APKBUILD | 6 +- testing/sbcl/ignore-test-failure.patch | 10 -- testing/sbcl/musl-fix-threads.patch | 180 +++++++++++++++++++++++++++++++++ 3 files changed, 183 insertions(+), 13 deletions(-) delete mode 100644 testing/sbcl/ignore-test-failure.patch create mode 100644 testing/sbcl/musl-fix-threads.patch (limited to 'testing/sbcl') diff --git a/testing/sbcl/APKBUILD b/testing/sbcl/APKBUILD index 92dacd1e2c..a44a8d0498 100644 --- a/testing/sbcl/APKBUILD +++ b/testing/sbcl/APKBUILD @@ -11,8 +11,8 @@ makedepends="clisp linux-headers paxmark zlib-dev" subpackages="$pkgname-doc" source="$pkgname-$pkgver.tar.bz2::http://prdownloads.sourceforge.net/$pkgname/$pkgname-$pkgver-source.tar.bz2 pax-genesis-stage-two.patch - ignore-test-failure.patch musl-fixes.patch + musl-fix-threads.patch sbcl_prefix.patch fix-generate-version.patch " @@ -23,7 +23,7 @@ build() { GNUMAKE=make ./make.sh clisp \ --prefix=/usr \ - --without-sb-thread \ + --with-sb-thread \ --without-sb-test \ --with-sb-unicode \ --with-sb-core-compression @@ -48,7 +48,7 @@ package() { sha512sums="e0248f460f9737d47653dd520732062d2637813b550df356ecc90aa6d21fbdd74f03182d1e890c09c1da742f7d57b4fbd04a4e6dc36999aca51bb6c2952ac236 sbcl-1.4.9.tar.bz2 cda5c7268b314145a1bdb8293c7970e077aebf3cce5dace12542bf18beb7b124bf97f4754906f2f681428869ca3060300b88cab80055a3d5881dfcdcfbe51d6d pax-genesis-stage-two.patch -fcaf0754084d705b263cbca20988e2cacc96470d4f0f2e15b812678ba8d15a43de2b3ebd87648f6540833615fdbde0011f72ce7800b02dcbd8055229eb439ec3 ignore-test-failure.patch 19bb9dac5997366c9778e349b707970832c5020ac55f0099dd652a8cc8c43336d34a33db2e4f7f190ab8212b064718f6999b832c249a4de7d24eae2186d6acea musl-fixes.patch +86b8a51d518d71a3c4d3069f80bc00cccd4b97edc6c96ff12875a0727cc2b96208f35c3a11044d98881b5e6c2e607fc65506020b7ff990b257edae55eb6a1c59 musl-fix-threads.patch bfb6bef3b6512e487e45bc8c9cf36aa519e470690b6c7036bba7d28269bd899c60a4dfa09b5aba44830b8c002e7191276f2cf6f8f134b163d05af7b46f9849ff sbcl_prefix.patch acd6a154e539dde5c8c6726cc553cc79b1ba98670f61596a3f7754126de35fae1656c98963169ec5dff1551d33632e00e1a40fa65aec73a729317d814825c6a1 fix-generate-version.patch" diff --git a/testing/sbcl/ignore-test-failure.patch b/testing/sbcl/ignore-test-failure.patch deleted file mode 100644 index a3e6e7f6a4..0000000000 --- a/testing/sbcl/ignore-test-failure.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff -upr sbcl-1.3.1.orig/make-target-contrib.sh sbcl-1.3.1/make-target-contrib.sh ---- sbcl-1.3.1.orig/make-target-contrib.sh 2016-04-06 13:29:37.339769604 +0200 -+++ sbcl-1.3.1/make-target-contrib.sh 2016-04-06 13:29:51.246113373 +0200 -@@ -130,5 +130,5 @@ EOF - done - - if [ $HEADER_HAS_BEEN_PRINTED = true ]; then -- exit 1 -+ exit 0 - fi diff --git a/testing/sbcl/musl-fix-threads.patch b/testing/sbcl/musl-fix-threads.patch new file mode 100644 index 0000000000..f9705bdcfb --- /dev/null +++ b/testing/sbcl/musl-fix-threads.patch @@ -0,0 +1,180 @@ +Patch-Source: https://bugs.launchpad.net/sbcl/+bug/1768368 + +diff --git a/contrib/sb-bsd-sockets/constants.lisp b/contrib/sb-bsd-sockets/constants.lisp +index 88f5bb7c4..23fd87277 100644 +--- a/contrib/sb-bsd-sockets/constants.lisp ++++ b/contrib/sb-bsd-sockets/constants.lisp +@@ -93,8 +93,8 @@ + (:integer EAFNOSUPPORT "EAFNOSUPPORT") + (:integer EINPROGRESS "EINPROGRESS") + +- (:integer NETDB-INTERNAL #+hpux "h_NETDB_INTERNAL" #-hpux "NETDB_INTERNAL" "See errno.") +- (:integer NETDB-SUCCESS #+hpux "h_NETDB_SUCCESS" #-hpux "NETDB_SUCCESS" "No problem.") ++ (:integer-no-check NETDB-INTERNAL #-os-provides-netdb-internal "-1" #+(and os-provides-netdb-internal hpux) "h_NETDB_INTERNAL" #+(and os-provides-netdb-internal (not hpux)) "NETDB_INTERNAL" "See errno.") ++ (:integer-no-check NETDB-SUCCESS #-os-provides-netdb-internal "0" #+(and os-provides-netdb-internal hpux) "h_NETDB_SUCCESS" #+(and os-provides-netdb-internal (not hpux)) "NETDB_SUCCESS" "No problem.") + (:integer HOST-NOT-FOUND "HOST_NOT_FOUND" "Authoritative Answer Host not found.") + (:integer TRY-AGAIN "TRY_AGAIN" "Non-Authoritative Host not found, or SERVERFAIL.") + (:integer NO-RECOVERY "NO_RECOVERY" "Non recoverable errors, FORMERR, REFUSED, NOTIMP.") +diff --git a/src/runtime/linux-os.c b/src/runtime/linux-os.c +index fa4f5e490..60b5fea4e 100644 +--- a/src/runtime/linux-os.c ++++ b/src/runtime/linux-os.c +@@ -187,8 +187,15 @@ isnptl (void) + if (strstr (buf, "NPTL")) { + return 1; + } ++ else { ++ return 0; ++ } ++ } ++ else { ++ /* If the configuration variable is empty, just assume we have a ++ * good enough thread implementation. */ ++ return 1; + } +- return 0; + } + #endif + +diff --git a/tests/foreign.test.sh b/tests/foreign.test.sh +index 7fb757813..9ba8ed3cf 100755 +--- a/tests/foreign.test.sh ++++ b/tests/foreign.test.sh +@@ -248,16 +248,20 @@ cat > $TEST_FILESTEM.test.lisp < $TEST_FILESTEM.test.lisp < ++#include ++ ++int main () ++{ ++ void * handle = dlopen("./dlclose-is-noop-test-helper.so", RTLD_NOW | RTLD_GLOBAL); ++ dlclose(handle); ++ ++ handle = dlopen("./dlclose-is-noop-test-helper.so", RTLD_NOW | RTLD_NOLOAD); ++ ++ if (handle != NULL) { ++ return 104; ++ } else { ++ return 0; ++ } ++} +diff --git a/tools-for-build/grovel-features.sh b/tools-for-build/grovel-features.sh +index ffc4307eb..bf1448a6a 100644 +--- a/tools-for-build/grovel-features.sh ++++ b/tools-for-build/grovel-features.sh +@@ -33,4 +33,13 @@ featurep os-provides-getprotoby-r + + featurep os-provides-poll + ++featurep os-provides-netdb-internal ++ + featurep arm-softfp ++ ++# We need a helper shared library to test dlclose-is-noop ++$GNUMAKE dlclose-is-noop-test-helper.so > /dev/null 2>&1 ++ ++featurep dlclose-is-noop ++ ++rm -f dlclose-is-noop-test-helper.so +diff --git a/tools-for-build/os-provides-netdb-internal-test.c b/tools-for-build/os-provides-netdb-internal-test.c +new file mode 100644 +index 000000000..cab08cc41 +--- /dev/null ++++ b/tools-for-build/os-provides-netdb-internal-test.c +@@ -0,0 +1,12 @@ ++#include ++ ++int main () ++{ ++#if defined NETDB_INTERNAL && defined NETDB_SUCCESS ++ return 104; ++#elif defined h_NETDB_INTERNAL && defined h_NETDB_SUCCESS ++ return 104; ++#else ++ return 0; ++#endif ++} -- cgit v1.2.3