diff mbox series

Darwin, testsuite : Prune 'object file not found for object'.

Message ID C61ED79E-6725-4408-A313-2EF4B572651F@sandoe.co.uk
State New
Headers show
Series Darwin, testsuite : Prune 'object file not found for object'. | expand

Commit Message

Iain Sandoe Feb. 24, 2021, 8:14 p.m. UTC
Hi,

This is not a GCC problem, but a fault in the static linker where,
when a source file is used multiple times, with conditional compilation
the source file is only referenced by the linker for the first object.
Then, when dsymutil tries to find the source file for next object based
off that source there is no record for it.

I’ve had this patch kicking around for some time, in the hope that the
problem would be fixed in the XCode tools, but it’s still present in the
XC12.5b2 (and will never be fixed in older toolkits).

tested on *-darwin* and x86_64-linux-gnu,
OK for master?
Iain
(if were not in stage 4, I’d have applied it as obvious).

gcc/testsuite/ChangeLog:

	* lib/prune.exp: Prune useless output caused by a linker bug.
---
 gcc/testsuite/lib/prune.exp | 3 +++
 1 file changed, 3 insertions(+)

Comments

Iain Sandoe March 3, 2021, 7:39 p.m. UTC | #1
Iain Sandoe <iain@sandoe.co.uk> wrote:

> This is not a GCC problem, but a fault in the static linker where,
> when a source file is used multiple times, with conditional compilation
> the source file is only referenced by the linker for the first object.
> Then, when dsymutil tries to find the source file for next object based
> off that source there is no record for it.
>
> I’ve had this patch kicking around for some time, in the hope that the
> problem would be fixed in the XCode tools, but it’s still present in the
> XC12.5b2 (and will never be fixed in older toolkits).
>
> tested on *-darwin* and x86_64-linux-gnu,
> OK for master?
> Iain
> (if were not in stage 4, I’d have applied it as obvious).

^^^
>
> gcc/testsuite/ChangeLog:
>
> 	* lib/prune.exp: Prune useless output caused by a linker bug.
> ---
> gcc/testsuite/lib/prune.exp | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/gcc/testsuite/lib/prune.exp b/gcc/testsuite/lib/prune.exp
> index a349c8ace3e..2809f88b16f 100644
> --- a/gcc/testsuite/lib/prune.exp
> +++ b/gcc/testsuite/lib/prune.exp
> @@ -84,6 +84,9 @@ proc prune_gcc_output { text } {
>     # Ignore harmless warnings from Xcode 4.0.
>     regsub -all "(^|\n)\[^\n\]*ld: warning: could not create compact unwind for\[^\n\]*" $text "" text
>
> +    # Ignore dsymutil warning (tool bug is actually linker)
> +    regsub -all "(^|\n)\[^\n\]*could not find object file symbol for  
> symbol\[^\n\]*" $text "" text
> +
>     # If dg-enable-nn-line-numbers was provided, then obscure source-margin
>     # line numbers by converting them to "NN" form.
>     set text [maybe-handle-nn-line-numbers $text]
> -- 
> 2.24.1
Jeff Law March 3, 2021, 9:14 p.m. UTC | #2
On 3/3/21 12:39 PM, Iain Sandoe wrote:
> Iain Sandoe <iain@sandoe.co.uk> wrote:
>
>> This is not a GCC problem, but a fault in the static linker where,
>> when a source file is used multiple times, with conditional compilation
>> the source file is only referenced by the linker for the first object.
>> Then, when dsymutil tries to find the source file for next object based
>> off that source there is no record for it.
>>
>> I’ve had this patch kicking around for some time, in the hope that the
>> problem would be fixed in the XCode tools, but it’s still present in the
>> XC12.5b2 (and will never be fixed in older toolkits).
>>
>> tested on *-darwin* and x86_64-linux-gnu,
>> OK for master?
>> Iain
>> (if were not in stage 4, I’d have applied it as obvious).
>
> ^^^
Then I'll give it an explicit OK :-)
jeff
diff mbox series

Patch

diff --git a/gcc/testsuite/lib/prune.exp b/gcc/testsuite/lib/prune.exp
index a349c8ace3e..2809f88b16f 100644
--- a/gcc/testsuite/lib/prune.exp
+++ b/gcc/testsuite/lib/prune.exp
@@ -84,6 +84,9 @@  proc prune_gcc_output { text } {
     # Ignore harmless warnings from Xcode 4.0.
     regsub -all "(^|\n)\[^\n\]*ld: warning: could not create compact unwind for\[^\n\]*" $text "" text
 
+    # Ignore dsymutil warning (tool bug is actually linker)
+    regsub -all "(^|\n)\[^\n\]*could not find object file symbol for symbol\[^\n\]*" $text "" text
+
     # If dg-enable-nn-line-numbers was provided, then obscure source-margin
     # line numbers by converting them to "NN" form.
     set text [maybe-handle-nn-line-numbers $text]