478dd7f
Description: Fix test-rwlock1 when --as-needed is the default.
478dd7f
Author: Michael Hudson-Doyle <michael.hudson@ubuntu.com>
478dd7f
Forwarded: no
478dd7f
Last-Update: 2018-07-25
478dd7f
---
478dd7f
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
478dd7f
--- a/libmissing/tests/test-rwlock1.c
478dd7f
+++ b/libmissing/tests/test-rwlock1.c
478dd7f
@@ -54,7 +54,10 @@
478dd7f
 
478dd7f
 #define SUCCEED() exit (0)
478dd7f
 #define FAILURE() exit (1)
478dd7f
-#define UNEXPECTED(n) (fprintf (stderr, "Unexpected outcome %d\n", n), abort ())
478dd7f
+/* The pointless reference to errno below is to ensure that the test binary
478dd7f
+ * gets a DT_NEEDED for libpthread even if the link is done with --as-needed
478dd7f
+ * (which is the default in Ubuntu) */
478dd7f
+#define UNEXPECTED(n) (fprintf (stderr, "Unexpected outcome %d errno %d\n", n, errno), abort ())
478dd7f
 
478dd7f
 /* The main thread creates the waiting writer and the requesting reader threads
478dd7f
    in the default way; this guarantees that they have the same priority.