Blob Blame History Raw
--- a/libmissing/tests/test-rwlock1.c
+++ b/libmissing/tests/test-rwlock1.c
@@ -54,7 +54,10 @@
 
 #define SUCCEED() exit (0)
 #define FAILURE() exit (1)
-#define UNEXPECTED(n) (fprintf (stderr, "Unexpected outcome %d\n", n), abort ())
+/* The pointless reference to errno below is to ensure that the test binary
+ * gets a DT_NEEDED for libpthread even if the link is done with --as-needed
+ * (which is the default in Ubuntu) */
+#define UNEXPECTED(n) (fprintf (stderr, "Unexpected outcome %d errno %d\n", n, errno), abort ())
 
 /* The main thread creates the waiting writer and the requesting reader threads
    in the default way; this guarantees that they have the same priority.