Bug 26856 - Selftest FAILs for gdb build with -O2 -flto
Summary: Selftest FAILs for gdb build with -O2 -flto
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: testsuite (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: 12.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-09 16:27 UTC by Tom de Vries
Modified: 2023-07-18 06:35 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
Tentative patch (779 bytes, patch)
2020-11-11 19:05 UTC, Tom de Vries
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tom de Vries 2020-11-09 16:27:10 UTC
When building gdb with -O2 -flto=auto, we run into a few testsuite failures:
...
FAIL: gdb.gdb/complaints.exp: clear complaints
FAIL: gdb.gdb/selftest.exp: breakpoint in captured_main (got interactive prompt)
FAIL: gdb.gdb/selftest.exp: run until breakpoint at captured_main
...

Fi.i, we have:
...
call clear_complaints()^M
No symbol "clear_complaints" in current context.^M
(gdb) FAIL: gdb.gdb/complaints.exp: clear complaints
...
Comment 1 Tom Tromey 2020-11-11 18:58:50 UTC
IMO basically the only selftest worth preserving is the one
that runs the internal unit tests.  The others have been
an ongoing source of problems like this.
Comment 2 Tom de Vries 2020-11-11 19:05:45 UTC
Created attachment 12951 [details]
Tentative patch
Comment 3 Tom de Vries 2021-09-02 06:14:47 UTC
(In reply to Tom de Vries from comment #0)
> FAIL: gdb.gdb/selftest.exp: breakpoint in captured_main (got interactive
> prompt)
> FAIL: gdb.gdb/selftest.exp: run until breakpoint at captured_main

Patch submitted here (https://sourceware.org/pipermail/gdb-patches/2021-September/181786.html ) to handle this with UNTESTED.
Comment 4 Tom de Vries 2021-09-02 13:44:36 UTC
(In reply to Tom Tromey from comment #1)
> IMO basically the only selftest worth preserving is the one
> that runs the internal unit tests.  The others have been
> an ongoing source of problems like this.

Submitted "[gdb/testsuite] Reimplement complaints selftest as unittest" here ( https://sourceware.org/pipermail/gdb-patches/2021-September/181789.html ).
Comment 5 Tom de Vries 2023-07-18 06:35:05 UTC
Fixed since 12.1.