diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2018-07-12 02:01:01 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2018-07-12 12:59:30 +0200 |
commit | 2318ed1c707a4a19014007b4338bb30cd26c55e6 (patch) | |
tree | 391d5a10653b9830d0a52dfd6bfdbe116849dcd5 /testing/sbcl | |
parent | 064b9721df5ea108e8f0011b238bb19b0b620730 (diff) | |
download | aports-2318ed1c707a4a19014007b4338bb30cd26c55e6.tar.bz2 aports-2318ed1c707a4a19014007b4338bb30cd26c55e6.tar.xz |
testing/sbcl: fix and enable threads support
Diffstat (limited to 'testing/sbcl')
-rw-r--r-- | testing/sbcl/APKBUILD | 6 | ||||
-rw-r--r-- | testing/sbcl/ignore-test-failure.patch | 10 | ||||
-rw-r--r-- | testing/sbcl/musl-fix-threads.patch | 180 |
3 files changed, 183 insertions, 13 deletions
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 <<EOF + (assert (= 13 foo)) + (assert (= 42 (bar))) + (note "/original definitions ok") +- (rename-file "$TEST_FILESTEM-b.so" "$TEST_FILESTEM-b.bak") +- (rename-file "$TEST_FILESTEM-b2.so" "$TEST_FILESTEM-b.so") +- (load-shared-object (truename "$TEST_FILESTEM-b.so")) +- (note "/reloading ok") +- (assert (= 42 foo)) +- (assert (= 13 (bar))) +- (note "/redefined versions ok") +- (rename-file "$TEST_FILESTEM-b.so" "$TEST_FILESTEM-b2.so") +- (rename-file "$TEST_FILESTEM-b.bak" "$TEST_FILESTEM-b.so") +- (note "/renamed back to originals") ++ #+dlclose-is-noop ++ (note "/skipping reloading tests") ++ #-dlclose-is-noop ++ (progn ++ (rename-file "$TEST_FILESTEM-b.so" "$TEST_FILESTEM-b.bak") ++ (rename-file "$TEST_FILESTEM-b2.so" "$TEST_FILESTEM-b.so") ++ (load-shared-object (truename "$TEST_FILESTEM-b.so")) ++ (note "/reloading ok") ++ (assert (= 42 foo)) ++ (assert (= 13 (bar))) ++ (note "/redefined versions ok") ++ (rename-file "$TEST_FILESTEM-b.so" "$TEST_FILESTEM-b2.so") ++ (rename-file "$TEST_FILESTEM-b.bak" "$TEST_FILESTEM-b.so") ++ (note "/renamed back to originals")) + + ;; test late resolution + #+linkage-table +@@ -274,13 +278,17 @@ cat > $TEST_FILESTEM.test.lisp <<EOF + (load-shared-object (truename "$TEST_FILESTEM-c.so")) + (assert (= 43 late-foo)) + (assert (= 14 (late-bar))) +- (unload-shared-object (truename "$TEST_FILESTEM-c.so")) +- (multiple-value-bind (val err) (ignore-errors late-foo) +- (assert (not val)) +- (assert (typep err 'undefined-alien-error))) +- (multiple-value-bind (val err) (ignore-errors (late-bar)) +- (assert (not val)) +- (assert (typep err 'undefined-alien-error))) ++ #+dlclose-is-noop ++ (note "/skipping unloading tests") ++ #-dlclose-is-noop ++ (progn ++ (unload-shared-object (truename "$TEST_FILESTEM-c.so")) ++ (multiple-value-bind (val err) (ignore-errors late-foo) ++ (assert (not val)) ++ (assert (typep err 'undefined-alien-error))) ++ (multiple-value-bind (val err) (ignore-errors (late-bar)) ++ (assert (not val)) ++ (assert (typep err 'undefined-alien-error)))) + (note "/linkage table ok")) + + (sb-ext:exit :code $EXIT_LISP_WIN) ; success convention for Lisp program +diff --git a/tools-for-build/Makefile b/tools-for-build/Makefile +index 3f6e4ecf9..39bab2b92 100644 +--- a/tools-for-build/Makefile ++++ b/tools-for-build/Makefile +@@ -16,6 +16,9 @@ LDLIBS:=$(OS_LIBS) + + all: grovel-headers determine-endianness where-is-mcontext + ++dlclose-is-noop-test-helper.so: dlclose-is-noop-test-helper.c ++ @$(CC) $(LDFLAGS) -shared $< -o $@ $(LOADLIBES) $(LDLIBS) ++ + clean: + rm -f *.o grovel-headers determine-endianness where-is-mcontext + rm -f *.exe +diff --git a/tools-for-build/dlclose-is-noop-test-helper.c b/tools-for-build/dlclose-is-noop-test-helper.c +new file mode 100644 +index 000000000..4be7a8e5b +--- /dev/null ++++ b/tools-for-build/dlclose-is-noop-test-helper.c +@@ -0,0 +1 @@ ++int sbcl_dl_close_test = 42; +diff --git a/tools-for-build/dlclose-is-noop-test.c b/tools-for-build/dlclose-is-noop-test.c +new file mode 100644 +index 000000000..f4eab26a5 +--- /dev/null ++++ b/tools-for-build/dlclose-is-noop-test.c +@@ -0,0 +1,19 @@ ++/* test to build and run so that we know if we have a noop dlclose ++ */ ++ ++#include <dlfcn.h> ++#include <stddef.h> ++ ++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 <netdb.h> ++ ++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 ++} |