From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by sourceware.org (Postfix) with ESMTP id EDA003857824 for ; Tue, 15 Sep 2020 18:41:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EDA003857824 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-456-wLJBrtnbNaiik2x_EGJzqQ-1; Tue, 15 Sep 2020 14:41:00 -0400 X-MC-Unique: wLJBrtnbNaiik2x_EGJzqQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 04A7310BBEC6; Tue, 15 Sep 2020 18:40:58 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-113-252.ams2.redhat.com [10.36.113.252]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2B58660BE5; Tue, 15 Sep 2020 18:40:57 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id 08FIenTX032330; Tue, 15 Sep 2020 20:40:49 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id 08FIelXa032329; Tue, 15 Sep 2020 20:40:47 +0200 Date: Tue, 15 Sep 2020 20:40:47 +0200 From: Jakub Jelinek To: Jason Merrill , Mark Wielaard Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] debug: Pass --gdwarf-N to assembler if fixed gas is detected during configure Message-ID: <20200915184047.GE2913@tucnak> Reply-To: Jakub Jelinek References: <20200824125658.22526-1-mark@klomp.org> <2707e3e008d96fc5e60fbd32ca4175b951fad7dd.camel@klomp.org> <20200909195754.GA3734@wildebeest.org> <20200910111657.GY18149@tucnak> <20200910114550.GZ18149@tucnak> MIME-Version: 1.0 In-Reply-To: <20200910114550.GZ18149@tucnak> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 18:41:23 -0000 On Thu, Sep 10, 2020 at 01:45:50PM +0200, Jakub Jelinek wrote: > On Thu, Sep 10, 2020 at 01:16:57PM +0200, Jakub Jelinek via Gcc-patches wrote: > > As for the test assembly, I'd say we should take > > #define F void foo (void) {} > > F > > compile it with > > gcc -S -O2 -g1 -dA -gno-as-loc-support -fno-merge-debug-strings > > remove .cfi_* directives, remove the ret instruction, change @function > > and @progbits to %function and %progbits, change .uleb128 to just .byte, > > I think all the values should be small enough, maybe change .value to > > .2byte and .long to .4byte (whatever is most portable across different > > arches and gas versions), simplify (shorten) strings and adjust > > sizes, and do something with the .quad directives, that is dependent on > > the address size, perhaps just take those attributes out and adjust > > .debug_abbrev? Finally, remove all comments (emit them in the first case > > just to better understand the debug info). > > I'm afraid it is hard to avoid the .quad or .8byte. > Here is a 64-bit address version that assembles fine by both x86_64 and > aarch64 as. > Unfortunately doesn't fail with broken gas versions with -gdwarf-2 without > the nop, so we'll need at least a nop in there. > Fortunately gcc/configure.ac already determines the right nop insn for the > target, in $insn. > So I guess what we want next is have the 32-bit version of this with .4byte > instead of .8byte and just let's try to assemble both versions, first > without -gdwarf-2 and the one that succeeds assemble again with -gdwarf-2 > and check for the duplicate .debug_line sections error. > What do you think? Ok, here it is in patch form. I've briefly tested it, with the older binutils I have around (no --gdwarf-N support), with latest gas (--gdwarf-N that can be passed to as even when compiling C/C++ etc. code and emitting .debug_line) and latest gas with Mark's fix reverted (--gdwarf-N support, but can only pass it to as when assembling user .s/.S files, not when compiling C/C++ etc.). Will bootstrap/regtest (with the older binutils) later tonight. 2020-09-15 Jakub Jelinek * configure.ac (HAVE_AS_GDWARF_5_DEBUG_FLAG, HAVE_AS_WORKING_DWARF_4_FLAG): New tests. * gcc.c (ASM_DEBUG_DWARF_OPTION): Define. (ASM_DEBUG_SPEC): Use ASM_DEBUG_DWARF_OPTION instead of "--gdwarf2". Use %{cond:opt1;:opt2} style. (ASM_DEBUG_OPTION_DWARF_OPT): Define. (ASM_DEBUG_OPTION_SPEC): Define. (asm_debug_option): New variable. (asm_options): Add "%(asm_debug_option)". (static_specs): Add asm_debug_option entry. (static_spec_functions): Add dwarf-version-gt. (debug_level_greater_than_spec_func): New function. * config/darwin.h (ASM_DEBUG_OPTION_SPEC): Define. * config/darwin9.h (ASM_DEBUG_OPTION_SPEC): Redefine. * config.in: Regenerated. * configure: Regenerated. --- gcc/configure.ac.jj 2020-09-08 16:48:32.377900856 +0200 +++ gcc/configure.ac 2020-09-15 18:07:23.292249972 +0200 @@ -5192,6 +5192,194 @@ if test x"$insn" != x; then [AC_DEFINE(HAVE_AS_GDWARF2_DEBUG_FLAG, 1, [Define if your assembler supports the --gdwarf2 option.])]) + gcc_GAS_CHECK_FEATURE([--gdwarf-5 option], + gcc_cv_as_gdwarf_5_flag, + [elf,2,36,0], [--gdwarf-5], [$insn],, + [AC_DEFINE(HAVE_AS_GDWARF_5_DEBUG_FLAG, 1, +[Define if your assembler supports the --gdwarf-5 option.])]) + + dwarf4_debug_info_size=0x46 + dwarf4_high_pc_form=7 + dwarf4_debug_aranges_size=0x2c + dwarf4_line_sz=9 + for dwarf4_addr_size in 8 4; do + conftest_s="\ + .file \"a.c\" + .text +.Ltext0: + .p2align 4 + .globl foo + .type foo, %function +foo: +.LFB0: +.LM1: + $insn +.LM2: +.LFE0: + .size foo, .-foo +.Letext0: + .section .debug_info,\"\",%progbits +.Ldebug_info0: + .4byte $dwarf4_debug_info_size + .2byte 0x4 + .4byte .Ldebug_abbrev0 + .byte 0x$dwarf4_addr_size + .byte 0x1 + .ascii \"GNU C17\\0\" + .byte 0xc + .ascii \"a.c\\0\" + .ascii \"/\\0\" + .${dwarf4_addr_size}byte .Ltext0 + .${dwarf4_addr_size}byte .Letext0-.Ltext0 + .4byte .Ldebug_line0 + .byte 0x2 + .ascii \"foo\\0\" + .byte 0x1 + .byte 0x2 + .byte 0x1 + .${dwarf4_addr_size}byte .LFB0 + .${dwarf4_addr_size}byte .LFE0-.LFB0 + .byte 0x1 + .byte 0x9c + .byte 0 + .section .debug_abbrev,\"\",%progbits +.Ldebug_abbrev0: + .byte 0x1 + .byte 0x11 + .byte 0x1 + .byte 0x25 + .byte 0x8 + .byte 0x13 + .byte 0xb + .byte 0x3 + .byte 0x8 + .byte 0x1b + .byte 0x8 + .byte 0x11 + .byte 0x1 + .byte 0x12 + .byte 0x$dwarf4_high_pc_form + .byte 0x10 + .byte 0x17 + .byte 0 + .byte 0 + .byte 0x2 + .byte 0x2e + .byte 0 + .byte 0x3f + .byte 0x19 + .byte 0x3 + .byte 0x8 + .byte 0x3a + .byte 0xb + .byte 0x3b + .byte 0xb + .byte 0x39 + .byte 0xb + .byte 0x11 + .byte 0x1 + .byte 0x12 + .byte 0x$dwarf4_high_pc_form + .byte 0x40 + .byte 0x18 + .byte 0 + .byte 0 + .byte 0 + .section .debug_aranges,\"\",%progbits + .4byte $dwarf4_debug_aranges_size + .2byte 0x2 + .4byte .Ldebug_info0 + .byte 0x8 + .byte 0 + .2byte 0 + .2byte 0 + .${dwarf4_addr_size}byte .Ltext0 + .${dwarf4_addr_size}byte .Letext0-.Ltext0 + .${dwarf4_addr_size}byte 0 + .${dwarf4_addr_size}byte 0 + .section .debug_line,\"\",%progbits +.Ldebug_line0: + .4byte .LELT0-.LSLT0 +.LSLT0: + .2byte 0x4 + .4byte .LELTP0-.LASLTP0 +.LASLTP0: + .byte 0x1 + .byte 0x1 + .byte 0x1 + .byte 0xf6 + .byte 0xf2 + .byte 0xd + .byte 0 + .byte 0x1 + .byte 0x1 + .byte 0x1 + .byte 0x1 + .byte 0 + .byte 0 + .byte 0 + .byte 0x1 + .byte 0 + .byte 0 + .byte 0x1 + .byte 0 + .ascii \"a.c\\0\" + .byte 0 + .byte 0 + .byte 0 + .byte 0 +.LELTP0: + .byte 0 + .byte 0x$dwarf4_line_sz + .byte 0x2 + .${dwarf4_addr_size}byte .LM1 + .byte 0x18 + .byte 0x5 + .byte 0x1 + .byte 0 + .byte 0x$dwarf4_line_sz + .byte 0x2 + .${dwarf4_addr_size}byte .LM2 + .byte 0x1 + .byte 0x5 + .byte 0x1 + .byte 0 + .byte 0x$dwarf4_line_sz + .byte 0x2 + .${dwarf4_addr_size}byte .Letext0 + .byte 0 + .byte 0x1 + .byte 0x1 +.LELT0: + .section .debug_str,\"\",%progbits + .ident \"GCC\" +" + dwarf4_success=no + if test $dwarf4_addr_size = 4; then + gcc_GAS_CHECK_FEATURE([assembly of compiler generated 32-bit .debug_line], + gcc_cv_as_debug_line_32_flag, + [elf,2,36,0], [], [$conftest_s],, + [success=yes]) + else + gcc_GAS_CHECK_FEATURE([assembly of compiler generated 64-bit .debug_line], + gcc_cv_as_debug_line_64_flag, + [elf,2,36,0], [], [$conftest_s],, + [dwarf4_success=yes]) + fi + if test $dwarf4_success = yes; then + gcc_GAS_CHECK_FEATURE([--gdwarf-4 not refusing compiler generated .debug_line], + gcc_cv_as_dwarf_4_debug_line_flag, + [elf,2,36,0], [--gdwarf-4], [$conftest_s],, + [AC_DEFINE(HAVE_AS_WORKING_DWARF_4_FLAG, 1, +[Define if your assembler supports --gdwarf-4 even with compiler generated .debug_line])]) + break + fi + dwarf4_debug_info_size=0x36 + dwarf4_high_pc_form=6 + dwarf4_debug_aranges_size=0x1c + dwarf4_line_sz=5 + done + gcc_GAS_CHECK_FEATURE([--gstabs option], gcc_cv_as_gstabs_flag, [elf,2,11,0], [--gstabs], [$insn],, --- gcc/gcc.c.jj 2020-08-27 18:42:35.549712947 +0200 +++ gcc/gcc.c 2020-09-15 20:20:29.905707498 +0200 @@ -430,6 +430,7 @@ static const char *pass_through_libs_spe static const char *dumps_spec_func (int, const char **); static const char *greater_than_spec_func (int, const char **); static const char *debug_level_greater_than_spec_func (int, const char **); +static const char *dwarf_version_greater_than_spec_func (int, const char **); static const char *find_fortran_preinclude_file (int, const char **); static char *convert_white_space (char *); static char *quote_spec (char *); @@ -876,22 +877,39 @@ proper position among the other output f #endif /* HAVE_LD_COMPRESS_DEBUG >= 2 */ /* Define ASM_DEBUG_SPEC to be a spec suitable for translating '-g' - to the assembler. */ + to the assembler, when compiling assembly sources only. */ #ifndef ASM_DEBUG_SPEC +# if defined(HAVE_AS_GDWARF_5_DEBUG_FLAG) && defined(HAVE_AS_WORKING_DWARF_4_FLAG) +/* If --gdwarf-N is supported and as can handle even compiler generated + .debug_line with it, supply --gdwarf-N in ASM_DEBUG_OPTION_SPEC rather + than in ASM_DEBUG_SPEC, so that it applies to both .s and .c etc. + compilations. */ +# define ASM_DEBUG_DWARF_OPTION "" +# elif defined(HAVE_AS_GDWARF_5_DEBUG_FLAG) +# define ASM_DEBUG_DWARF_OPTION "%{%:dwarf-version-gt(4):--gdwarf-5;" \ + "%:dwarf-version-gt(3):--gdwarf-4;" \ + "%:dwarf-version-gt(2):--gdwarf-3;" \ + ":--gdwarf2}" +# else +# define ASM_DEBUG_DWARF_OPTION "--gdwarf2" +# endif # if defined(DBX_DEBUGGING_INFO) && defined(DWARF2_DEBUGGING_INFO) \ && defined(HAVE_AS_GDWARF2_DEBUG_FLAG) && defined(HAVE_AS_GSTABS_DEBUG_FLAG) # define ASM_DEBUG_SPEC \ (PREFERRED_DEBUGGING_TYPE == DBX_DEBUG \ ? "%{%:debug-level-gt(0):" \ - "%{gdwarf*:--gdwarf2}%{!gdwarf*:%{g*:--gstabs}}}" ASM_MAP \ + "%{gdwarf*:" ASM_DEBUG_DWARF_OPTION "};" \ + ":%{g*:--gstabs}}" ASM_MAP \ : "%{%:debug-level-gt(0):" \ - "%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}}" ASM_MAP) + "%{gstabs*:--gstabs;" \ + ":%{g*:" ASM_DEBUG_DWARF_OPTION "}}}" ASM_MAP) # else # if defined(DBX_DEBUGGING_INFO) && defined(HAVE_AS_GSTABS_DEBUG_FLAG) # define ASM_DEBUG_SPEC "%{g*:%{%:debug-level-gt(0):--gstabs}}" ASM_MAP # endif # if defined(DWARF2_DEBUGGING_INFO) && defined(HAVE_AS_GDWARF2_DEBUG_FLAG) -# define ASM_DEBUG_SPEC "%{g*:%{%:debug-level-gt(0):--gdwarf2}}" ASM_MAP +# define ASM_DEBUG_SPEC "%{g*:%{%:debug-level-gt(0):" \ + ASM_DEBUG_DWARF_OPTION "}}" ASM_MAP # endif # endif #endif @@ -899,6 +917,32 @@ proper position among the other output f # define ASM_DEBUG_SPEC "" #endif +/* Define ASM_DEBUG_OPTION_SPEC to be a spec suitable for translating '-g' + to the assembler when compiling all sources. */ +#ifndef ASM_DEBUG_OPTION_SPEC +# if defined(HAVE_AS_GDWARF_5_DEBUG_FLAG) && defined(HAVE_AS_WORKING_DWARF_4_FLAG) +# define ASM_DEBUG_OPTION_DWARF_OPT \ + "%{%:dwarf-version-gt(4):--gdwarf-5 ;" \ + "%:dwarf-version-gt(3):--gdwarf-4 ;" \ + "%:dwarf-version-gt(2):--gdwarf-3 ;" \ + ":--gdwarf2 }" +# if defined(DBX_DEBUGGING_INFO) && defined(DWARF2_DEBUGGING_INFO) +# define ASM_DEBUG_OPTION_SPEC \ + (PREFERRED_DEBUGGING_TYPE == DBX_DEBUG \ + ? "%{%:debug-level-gt(0):" \ + "%{gdwarf*:" ASM_DEBUG_OPTION_DWARF_OPT "}}" \ + : "%{%:debug-level-gt(0):" \ + "%{!gstabs*:%{g*:" ASM_DEBUG_OPTION_DWARF_OPT "}}}") +# elif defined(DWARF2_DEBUGGING_INFO) +# define ASM_DEBUG_OPTION_SPEC "%{g*:%{%:debug-level-gt(0):" \ + ASM_DEBUG_OPTION_DWARF_OPT "}}" +# endif +# endif +#endif +#ifndef ASM_DEBUG_OPTION_SPEC +# define ASM_DEBUG_OPTION_SPEC "" +#endif + /* Here is the spec for running the linker, after compiling all files. */ /* This is overridable by the target in case they need to specify the @@ -1113,6 +1157,7 @@ proper position among the other output f #endif static const char *asm_debug = ASM_DEBUG_SPEC; +static const char *asm_debug_option = ASM_DEBUG_OPTION_SPEC; static const char *cpp_spec = CPP_SPEC; static const char *cc1_spec = CC1_SPEC; static const char *cc1plus_spec = CC1PLUS_SPEC; @@ -1212,6 +1257,7 @@ static const char *asm_options = to the assembler equivalents. */ "%{v} %{w:-W} %{I*} " #endif +"%(asm_debug_option)" ASM_COMPRESS_DEBUG_SPEC "%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}"; @@ -1608,6 +1654,7 @@ static struct spec_list static_specs[] = { INIT_STATIC_SPEC ("asm", &asm_spec), INIT_STATIC_SPEC ("asm_debug", &asm_debug), + INIT_STATIC_SPEC ("asm_debug_option", &asm_debug_option), INIT_STATIC_SPEC ("asm_final", &asm_final_spec), INIT_STATIC_SPEC ("asm_options", &asm_options), INIT_STATIC_SPEC ("invoke_as", &invoke_as), @@ -1690,6 +1737,7 @@ static const struct spec_function static { "dumps", dumps_spec_func }, { "gt", greater_than_spec_func }, { "debug-level-gt", debug_level_greater_than_spec_func }, + { "dwarf-version-gt", dwarf_version_greater_than_spec_func }, { "fortran-preinclude-file", find_fortran_preinclude_file}, #ifdef EXTRA_SPEC_FUNCTIONS EXTRA_SPEC_FUNCTIONS @@ -10612,6 +10660,27 @@ debug_level_greater_than_spec_func (int return ""; return NULL; +} + +/* Returns "" if dwarf_version is greater than ARGV[ARGC-1]. + Otherwise, return NULL. */ + +static const char * +dwarf_version_greater_than_spec_func (int argc, const char **argv) +{ + char *converted; + + if (argc != 1) + fatal_error (input_location, + "wrong number of arguments to %%:dwarf-version-gt"); + + long arg = strtol (argv[0], &converted, 10); + gcc_assert (converted != argv[0]); + + if (dwarf_version > arg) + return ""; + + return NULL; } static void --- gcc/config/darwin.h.jj 2020-08-03 22:54:51.362532456 +0200 +++ gcc/config/darwin.h 2020-09-15 20:22:36.206955619 +0200 @@ -476,6 +476,7 @@ extern GTY(()) int darwin_ms_struct; debugging data. */ #define ASM_DEBUG_SPEC "%{g*:%{%:debug-level-gt(0):%{!gdwarf*:--gstabs}}}" +#define ASM_DEBUG_OPTION_SPEC "" #define ASM_FINAL_SPEC \ "%{gsplit-dwarf:%ngsplit-dwarf is not supported on this platform} %&5 +$as_echo_n "checking assembler for --gdwarf-5 option... " >&6; } +if ${gcc_cv_as_gdwarf_5_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + gcc_cv_as_gdwarf_5_flag=no + if test $in_tree_gas = yes; then + if test $in_tree_gas_is_elf = yes \ + && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 36 \) \* 1000 + 0` + then gcc_cv_as_gdwarf_5_flag=yes +fi + elif test x$gcc_cv_as != x; then + $as_echo "$insn" > conftest.s + if { ac_try='$gcc_cv_as $gcc_cv_as_flags --gdwarf-5 -o conftest.o conftest.s >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then + gcc_cv_as_gdwarf_5_flag=yes + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_gdwarf_5_flag" >&5 +$as_echo "$gcc_cv_as_gdwarf_5_flag" >&6; } +if test $gcc_cv_as_gdwarf_5_flag = yes; then + +$as_echo "#define HAVE_AS_GDWARF_5_DEBUG_FLAG 1" >>confdefs.h + +fi + + + dwarf4_debug_info_size=0x46 + dwarf4_high_pc_form=7 + dwarf4_debug_aranges_size=0x2c + dwarf4_line_sz=9 + for dwarf4_addr_size in 8 4; do + conftest_s="\ + .file \"a.c\" + .text +.Ltext0: + .p2align 4 + .globl foo + .type foo, %function +foo: +.LFB0: +.LM1: + $insn +.LM2: +.LFE0: + .size foo, .-foo +.Letext0: + .section .debug_info,\"\",%progbits +.Ldebug_info0: + .4byte $dwarf4_debug_info_size + .2byte 0x4 + .4byte .Ldebug_abbrev0 + .byte 0x$dwarf4_addr_size + .byte 0x1 + .ascii \"GNU C17\\0\" + .byte 0xc + .ascii \"a.c\\0\" + .ascii \"/\\0\" + .${dwarf4_addr_size}byte .Ltext0 + .${dwarf4_addr_size}byte .Letext0-.Ltext0 + .4byte .Ldebug_line0 + .byte 0x2 + .ascii \"foo\\0\" + .byte 0x1 + .byte 0x2 + .byte 0x1 + .${dwarf4_addr_size}byte .LFB0 + .${dwarf4_addr_size}byte .LFE0-.LFB0 + .byte 0x1 + .byte 0x9c + .byte 0 + .section .debug_abbrev,\"\",%progbits +.Ldebug_abbrev0: + .byte 0x1 + .byte 0x11 + .byte 0x1 + .byte 0x25 + .byte 0x8 + .byte 0x13 + .byte 0xb + .byte 0x3 + .byte 0x8 + .byte 0x1b + .byte 0x8 + .byte 0x11 + .byte 0x1 + .byte 0x12 + .byte 0x$dwarf4_high_pc_form + .byte 0x10 + .byte 0x17 + .byte 0 + .byte 0 + .byte 0x2 + .byte 0x2e + .byte 0 + .byte 0x3f + .byte 0x19 + .byte 0x3 + .byte 0x8 + .byte 0x3a + .byte 0xb + .byte 0x3b + .byte 0xb + .byte 0x39 + .byte 0xb + .byte 0x11 + .byte 0x1 + .byte 0x12 + .byte 0x$dwarf4_high_pc_form + .byte 0x40 + .byte 0x18 + .byte 0 + .byte 0 + .byte 0 + .section .debug_aranges,\"\",%progbits + .4byte $dwarf4_debug_aranges_size + .2byte 0x2 + .4byte .Ldebug_info0 + .byte 0x8 + .byte 0 + .2byte 0 + .2byte 0 + .${dwarf4_addr_size}byte .Ltext0 + .${dwarf4_addr_size}byte .Letext0-.Ltext0 + .${dwarf4_addr_size}byte 0 + .${dwarf4_addr_size}byte 0 + .section .debug_line,\"\",%progbits +.Ldebug_line0: + .4byte .LELT0-.LSLT0 +.LSLT0: + .2byte 0x4 + .4byte .LELTP0-.LASLTP0 +.LASLTP0: + .byte 0x1 + .byte 0x1 + .byte 0x1 + .byte 0xf6 + .byte 0xf2 + .byte 0xd + .byte 0 + .byte 0x1 + .byte 0x1 + .byte 0x1 + .byte 0x1 + .byte 0 + .byte 0 + .byte 0 + .byte 0x1 + .byte 0 + .byte 0 + .byte 0x1 + .byte 0 + .ascii \"a.c\\0\" + .byte 0 + .byte 0 + .byte 0 + .byte 0 +.LELTP0: + .byte 0 + .byte 0x$dwarf4_line_sz + .byte 0x2 + .${dwarf4_addr_size}byte .LM1 + .byte 0x18 + .byte 0x5 + .byte 0x1 + .byte 0 + .byte 0x$dwarf4_line_sz + .byte 0x2 + .${dwarf4_addr_size}byte .LM2 + .byte 0x1 + .byte 0x5 + .byte 0x1 + .byte 0 + .byte 0x$dwarf4_line_sz + .byte 0x2 + .${dwarf4_addr_size}byte .Letext0 + .byte 0 + .byte 0x1 + .byte 0x1 +.LELT0: + .section .debug_str,\"\",%progbits + .ident \"GCC\" +" + dwarf4_success=no + if test $dwarf4_addr_size = 4; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for assembly of compiler generated 32-bit .debug_line" >&5 +$as_echo_n "checking assembler for assembly of compiler generated 32-bit .debug_line... " >&6; } +if ${gcc_cv_as_debug_line_32_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + gcc_cv_as_debug_line_32_flag=no + if test $in_tree_gas = yes; then + if test $in_tree_gas_is_elf = yes \ + && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 36 \) \* 1000 + 0` + then gcc_cv_as_debug_line_32_flag=yes +fi + elif test x$gcc_cv_as != x; then + $as_echo "$conftest_s" > conftest.s + if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then + gcc_cv_as_debug_line_32_flag=yes + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_debug_line_32_flag" >&5 +$as_echo "$gcc_cv_as_debug_line_32_flag" >&6; } +if test $gcc_cv_as_debug_line_32_flag = yes; then + success=yes +fi + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for assembly of compiler generated 64-bit .debug_line" >&5 +$as_echo_n "checking assembler for assembly of compiler generated 64-bit .debug_line... " >&6; } +if ${gcc_cv_as_debug_line_64_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + gcc_cv_as_debug_line_64_flag=no + if test $in_tree_gas = yes; then + if test $in_tree_gas_is_elf = yes \ + && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 36 \) \* 1000 + 0` + then gcc_cv_as_debug_line_64_flag=yes +fi + elif test x$gcc_cv_as != x; then + $as_echo "$conftest_s" > conftest.s + if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then + gcc_cv_as_debug_line_64_flag=yes + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_debug_line_64_flag" >&5 +$as_echo "$gcc_cv_as_debug_line_64_flag" >&6; } +if test $gcc_cv_as_debug_line_64_flag = yes; then + dwarf4_success=yes +fi + + fi + if test $dwarf4_success = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for --gdwarf-4 not refusing compiler generated .debug_line" >&5 +$as_echo_n "checking assembler for --gdwarf-4 not refusing compiler generated .debug_line... " >&6; } +if ${gcc_cv_as_dwarf_4_debug_line_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + gcc_cv_as_dwarf_4_debug_line_flag=no + if test $in_tree_gas = yes; then + if test $in_tree_gas_is_elf = yes \ + && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 36 \) \* 1000 + 0` + then gcc_cv_as_dwarf_4_debug_line_flag=yes +fi + elif test x$gcc_cv_as != x; then + $as_echo "$conftest_s" > conftest.s + if { ac_try='$gcc_cv_as $gcc_cv_as_flags --gdwarf-4 -o conftest.o conftest.s >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then + gcc_cv_as_dwarf_4_debug_line_flag=yes + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_dwarf_4_debug_line_flag" >&5 +$as_echo "$gcc_cv_as_dwarf_4_debug_line_flag" >&6; } +if test $gcc_cv_as_dwarf_4_debug_line_flag = yes; then + +$as_echo "#define HAVE_AS_WORKING_DWARF_4_FLAG 1" >>confdefs.h + +fi + + break + fi + dwarf4_debug_info_size=0x36 + dwarf4_high_pc_form=6 + dwarf4_debug_aranges_size=0x1c + dwarf4_line_sz=5 + done + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for --gstabs option" >&5 $as_echo_n "checking assembler for --gstabs option... " >&6; } if ${gcc_cv_as_gstabs_flag+:} false; then : Jakub