Message ID | 51E7A8BB.1050908@linaro.org |
---|---|
State | Accepted |
Headers | show |
>>>>> "Will" == Will Newton <will.newton@linaro.org> writes:
Will> 2013-07-18 Will Newton <will.newton@linaro.org>
Will> * gdb.threads/tls-nodebug.c: Call pthread_testcancel
Will> to ensure the test is linked against pthreads.
Will> * gdb.threads/tls-var-main.c: Likewise.
Will> * gdb.threads/tls-shared.c: Likewise.
This is ok. Thanks.
Tom
diff --git a/gdb/testsuite/gdb.threads/tls-nodebug.c b/gdb/testsuite/gdb.threads/tls-nodebug.c index 73d96f0..d3b31b7 100644 --- a/gdb/testsuite/gdb.threads/tls-nodebug.c +++ b/gdb/testsuite/gdb.threads/tls-nodebug.c @@ -6,5 +6,7 @@ __thread int thread_local = 42; int main(void) { + /* Ensure we link against pthreads even with --as-needed. */ + pthread_testcancel(); return 0; } diff --git a/gdb/testsuite/gdb.threads/tls-shared.c b/gdb/testsuite/gdb.threads/tls-shared.c index d4f8e5c..02b1308 100644 --- a/gdb/testsuite/gdb.threads/tls-shared.c +++ b/gdb/testsuite/gdb.threads/tls-shared.c @@ -1,6 +1,11 @@ + +#include <pthread.h> + __thread int i_tls = 1; int foo () { + /* Ensure we link against pthreads even with --as-needed. */ + pthread_testcancel(); return i_tls; } diff --git a/gdb/testsuite/gdb.threads/tls-var-main.c b/gdb/testsuite/gdb.threads/tls-var-main.c index 34a2522..afad945 100644 --- a/gdb/testsuite/gdb.threads/tls-var-main.c +++ b/gdb/testsuite/gdb.threads/tls-var-main.c @@ -15,8 +15,12 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <pthread.h> + int main (void) { + /* Ensure we link against pthreads even with --as-needed. */ + pthread_testcancel(); return 0; }