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

Iain Sandoe iain@sandoe.co.uk
Wed Feb 24 20:14:06 GMT 2021


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(+)

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




More information about the Gcc-patches mailing list