Description: Fix test-rwlock1 when --as-needed is the default. Author: Michael Hudson-Doyle Forwarded: no Last-Update: 2018-07-25 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- 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.