[Darwin,config] Check for DWARF debug line support with otool.

Message ID E5E16D50-9BA8-4D44-986E-77432F3715DD@sandoe.co.uk
State New
Headers show
Series
  • [Darwin,config] Check for DWARF debug line support with otool.
Related show

Commit Message

Iain Sandoe Dec. 23, 2018, 11:53 a.m.
Hi,

This corrects a long-standing misconfiguration for Darwin.
The assembler supports the “.file” and “.loc” directives, but
the GCC configury was not detecting this because it was 
using objdump, which does not exist on most Darwin installations.

We added support for “otool” to GCC and now we can use that to
make the check that’s done with objdump on ELF targets.

OK for trunk?
Iain

gcc/

	* configure.ac (dwarf2_debug_line): Check for the debug_line
	section using otool when there’s no objdump available.
	* configure: Regenerate.

-- 
2.17.1

Comments

Jeff Law Dec. 23, 2018, 4:24 p.m. | #1
On 12/23/18 4:53 AM, Iain Sandoe wrote:
> Hi,

> 

> This corrects a long-standing misconfiguration for Darwin.

> The assembler supports the “.file” and “.loc” directives, but

> the GCC configury was not detecting this because it was 

> using objdump, which does not exist on most Darwin installations.

> 

> We added support for “otool” to GCC and now we can use that to

> make the check that’s done with objdump on ELF targets.

> 

> OK for trunk?

> Iain

> 

> gcc/

> 

> 	* configure.ac (dwarf2_debug_line): Check for the debug_line

> 	section using otool when there’s no objdump available.

> 	* configure: Regenerate.

OK
jeff

Patch

diff --git a/gcc/configure.ac b/gcc/configure.ac
index 7fce52a319..a101232589 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -4926,6 +4926,10 @@  if test x"$insn" != x; then
    && $gcc_cv_objdump -h conftest.o 2> /dev/null \
       | grep debug_line > /dev/null 2>&1; then
      gcc_cv_as_dwarf2_debug_line=yes
+   elif test x$gcc_cv_otool != x \
+   && $gcc_cv_otool -l conftest.o 2> /dev/null \
+      | grep debug_line > /dev/null 2>&1; then
+     gcc_cv_as_dwarf2_debug_line=yes
    fi])
 
 # The .debug_line file table must be in the exact order that