]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Darwin, CTF, BTF: Do not run the DWARF debug link for BTF/CTF [PR101283].
authorIain Sandoe <iain@sandoe.co.uk>
Fri, 2 Jul 2021 08:51:57 +0000 (09:51 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Fri, 2 Jul 2021 14:50:16 +0000 (15:50 +0100)
Darwin uses an efficient two-stage process for debug linking.
The static linker (ld64) notes the inputs required but does not
link the debug.  When required / on demand the debug is linked
into a separate package by the debug linker (dsymutil).  At
present none of the Darwin tools consume or understand BTF/CTF.
The static linker silently accepts the sections (but will not
act on them as containing anything to be processed).

However, the debug linker produces a warning that it has been
presented with input with no [DWARF] debug content:
warning: no debug symbols in executable (-arch x86_64).

This causes several testsuite fails with excess errors.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR debug/101283 - Several tests fail on Darwin with -gctf/gbtf

PR debug/101283

gcc/ChangeLog:

* config/darwin.h (DSYMUTIL_SPEC): Do not try to run
dsymutil for BTF/CTF.

gcc/config/darwin.h

index 6840aebe794676b8e2e226b8de17f5550411700e..5f1197899732d154d2c4a5777a1d19d769583dbc 100644 (file)
@@ -250,10 +250,10 @@ extern GTY(()) int darwin_ms_struct;
 #define DSYMUTIL_SPEC \
    "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
     %{v} \
-    %{g*:%{!gstabs*:%{%:debug-level-gt(0): -idsym}}}\
+    %{g*:%{!gctf:%{!gbtf:%{!gstabs*:%{%:debug-level-gt(0): -idsym}}}}}\
     %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm|.s|.f|.f90|\
       .f95|.f03|.f77|.for|.F|.F90|.F95|.F03: \
-    %{g*:%{!gstabs*:%{%:debug-level-gt(0): -dsym}}}}}}}}}}}"
+    %{g*:%{!gctf:%{!gbtf:%{!gstabs*:%{%:debug-level-gt(0): -dsym}}}}}}}}}}}}}"
 
 #define LINK_COMMAND_SPEC LINK_COMMAND_SPEC_A DSYMUTIL_SPEC