Hello, The attached patch allows one to specify an option 'with_pthreads' when using 'prepare_for_testing' in tests. One could call gdb_compile_pthreads directly for such a purpose, but I think using 'prepare_for_testing' is the suggested approach. If my understanding or approach is wrong here, then what is the best way to make testcases to link with pthreads for c++ testcases? 2013-03-23 Siva Chandra Reddy Add option to link testcases with Pthreads library when using 'prepare_for_testing' in tests. testsuite/ * lib/gdb.exp (build_executable_from_specs): Use gdb_compile_pthreads to compile if option "with_pthreads" is specified. Thanks, Siva Chandra