[pushed,gdb/testsuite] Fix untested in gdb.base/frame-view.exp

Message ID 20230123075939.1771-1-tdevries@suse.de
State Committed
Headers
Series [pushed,gdb/testsuite] Fix untested in gdb.base/frame-view.exp |

Commit Message

Tom de Vries Jan. 23, 2023, 7:59 a.m. UTC
  When running test-case gdb.base/frame-view.exp, I see:
...
gdb compile failed, ld: frame-view0.o: in function `main':
frame-view.c:73: undefined reference to `pthread_create'
ld: frame-view.c:76: undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
UNTESTED: gdb.base/frame-view.exp: failed to prepare
...

Fix this by adding pthreads to the compilation flags.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/frame-view.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 7e538762c2c1f2e5c4be31b9ec7d99cc4fbabf7f
  

Comments

Simon Marchi Jan. 23, 2023, 4:12 p.m. UTC | #1
On 1/23/23 02:59, Tom de Vries via Gdb-patches wrote:
> When running test-case gdb.base/frame-view.exp, I see:
> ...
> gdb compile failed, ld: frame-view0.o: in function `main':
> frame-view.c:73: undefined reference to `pthread_create'
> ld: frame-view.c:76: undefined reference to `pthread_join'
> collect2: error: ld returned 1 exit status
> UNTESTED: gdb.base/frame-view.exp: failed to prepare
> ...
> 
> Fix this by adding pthreads to the compilation flags.

Thanks for fixing this.  I suppose it worked on my machines because they
use newer glibcs where pthread is integrated into libc?

Simon
  
Tom de Vries Jan. 23, 2023, 4:29 p.m. UTC | #2
On 1/23/23 17:12, Simon Marchi wrote:
> 
> 
> On 1/23/23 02:59, Tom de Vries via Gdb-patches wrote:
>> When running test-case gdb.base/frame-view.exp, I see:
>> ...
>> gdb compile failed, ld: frame-view0.o: in function `main':
>> frame-view.c:73: undefined reference to `pthread_create'
>> ld: frame-view.c:76: undefined reference to `pthread_join'
>> collect2: error: ld returned 1 exit status
>> UNTESTED: gdb.base/frame-view.exp: failed to prepare
>> ...
>>
>> Fix this by adding pthreads to the compilation flags.
> 
> Thanks for fixing this.  I suppose it worked on my machines because they
> use newer glibcs where pthread is integrated into libc?

Np, and ack, that's also what I suppose what happened.

Thanks,
- Tom
  

Patch

diff --git a/gdb/testsuite/gdb.base/frame-view.exp b/gdb/testsuite/gdb.base/frame-view.exp
index edae16735ab..72955bd1aff 100644
--- a/gdb/testsuite/gdb.base/frame-view.exp
+++ b/gdb/testsuite/gdb.base/frame-view.exp
@@ -18,7 +18,7 @@ 
 standard_testfile
 
 if { [build_executable "failed to prepare" \
-	${testfile} ${srcfile}] } {
+	  ${testfile} ${srcfile} {debug pthreads}] } {
     return
 }