public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: David Edelsohn <dje.gcc@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	Richard Biener <richard.guenther@gmail.com>
Subject: Re: [PATCH] Restore XCOFF for DWARF on AIX.
Date: Wed, 7 Sep 2022 16:37:07 +0200	[thread overview]
Message-ID: <e3891de0-ce89-7401-4ce3-fe7c37b08aa2@suse.cz> (raw)
In-Reply-To: <CAGWvnyksWx6BBkiCHkOQmWtEZqZ7wtGjZQG+97wkM7hyNwuzEg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2175 bytes --]

On 9/7/22 15:43, David Edelsohn wrote:
> On Wed, Sep 7, 2022 at 7:45 AM Martin Liška <mliska@suse.cz <mailto:mliska@suse.cz>> wrote:
> 
>     Hi.
> 
>     The patch restores DWARF support for AIX target where XCOFF file container is used.
>     Verified before and after the patch, gcc119 machine (AIX) could not build any run-time library,
>     now it can.
> 
>     Ready to be installed?
>     Thanks,
>     Martin
> 
>             PR bootstrap/106855
> 
>     gcc/ChangeLog:
> 
>             * collect2.cc (scan_prog_file): Restore if XCOFF_DEBUGGING_INFO.
>             * config/rs6000/rs6000.cc (rs6000_option_override_internal):
>               Restore usage of XCOFF_DEBUGGING_INFO.
>             * config/rs6000/xcoff.h (XCOFF_DEBUGGING_INFO): Restore.
>             * dwarf2asm.cc (XCOFF_DEBUGGING_INFO): Restore support for
>               XCOFF_DEBUGGING_INFO.
>             (dw2_asm_output_nstring): Likewise.
>             (USE_LINKONCE_INDIRECT): Likewise.
>             * dwarf2out.cc (XCOFF_DEBUGGING_INFO): Likewise.
>             (HAVE_XCOFF_DWARF_EXTRAS): Likewise.
>             (output_fde): Likewise.
>             (output_call_frame_info): Likewise.
>             (have_macinfo): Likewise.
>             (add_AT_loc_list): Likewise.
>             (add_AT_view_list): Likewise.
>             (output_compilation_unit_header): Likewise.
>             (output_pubnames): Likewise.
>             (output_aranges): Likewise.
>             (output_line_info): Likewise.
>             (output_macinfo): Likewise.
>             (dwarf2out_finish): Likewise.
>             (dwarf2out_early_finish): Likewise.
> 
> 
> Hi, Martin
> 
> Thanks for the quick patch to fix this.  This restores bootstrap, but does not completely restore functionality.  This patch did not restore the gcc/configure test for AIX assembler XCOFF feature support that defines HAVE_XCOFF_DWARF_EXTRAS.  That part of the removal patch also needs to be reverted.

Ohh! Sorry about that, should be restored by the following patch.

Ready for master?
Thanks,
Martin

> 
> Thanks, David
>  

[-- Attachment #2: 0001-Restore-detection-of-HAVE_XCOFF_DWARF_EXTRAS.patch --]
[-- Type: text/x-patch, Size: 3417 bytes --]

From d5f346c60157c4d2461ad9a77a47c9c5feebfaf2 Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Wed, 7 Sep 2022 16:33:59 +0200
Subject: [PATCH] Restore detection of HAVE_XCOFF_DWARF_EXTRAS

gcc/ChangeLog:

	* configure.ac: Restore detection of  HAVE_XCOFF_DWARF_EXTRAS.
	* config/rs6000/rs6000.cc (HAVE_XCOFF_DWARF_EXTRAS): Reset it.
	* configure: Regenerate.
	* config.in: Regenerate.
---
 gcc/config.in               |  7 +++++++
 gcc/config/rs6000/rs6000.cc |  5 +++++
 gcc/configure               | 35 +++++++++++++++++++++++++++++++++++
 gcc/configure.ac            |  9 +++++++++
 4 files changed, 56 insertions(+)

diff --git a/gcc/config.in b/gcc/config.in
index 9c53319b544..6ac17be189e 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -2099,6 +2099,13 @@
 #endif
 
 
+/* Define if your assembler supports AIX debug frame section label reference.
+   */
+#ifndef USED_FOR_TARGET
+#undef HAVE_XCOFF_DWARF_EXTRAS
+#endif
+
+
 /* Define if you have a working <zstd.h> header file. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_ZSTD_H
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index 7623d69a8c0..a656cb32a47 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -20946,6 +20946,11 @@ rs6000_elf_file_end (void)
 
 #if TARGET_XCOFF
 
+#ifndef HAVE_XCOFF_DWARF_EXTRAS
+#define HAVE_XCOFF_DWARF_EXTRAS 0
+#endif
+
+
 /* Names of bss and data sections.  These should be unique names for each
    compilation unit.  */
 
diff --git a/gcc/configure b/gcc/configure
index 39f7ed129a4..817d765568e 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -28142,6 +28142,41 @@ if test $gcc_cv_as_aix_ref = yes; then
 
 $as_echo "#define HAVE_AS_REF 1" >>confdefs.h
 
+fi
+
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for AIX DWARF location lists section support" >&5
+$as_echo_n "checking assembler for AIX DWARF location lists section support... " >&6; }
+if ${gcc_cv_as_aix_dwloc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  gcc_cv_as_aix_dwloc=no
+  if test x$gcc_cv_as != x; then
+    $as_echo '	.dwsect 0xA0000
+	Lframe..0:
+		.vbyte 4,Lframe..0
+	  ' > 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_aix_dwloc=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_aix_dwloc" >&5
+$as_echo "$gcc_cv_as_aix_dwloc" >&6; }
+if test $gcc_cv_as_aix_dwloc = yes; then
+
+$as_echo "#define HAVE_XCOFF_DWARF_EXTRAS 1" >>confdefs.h
+
 fi
 
 	;;
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 50bb61c1b61..59f205a1781 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -5066,6 +5066,15 @@ LCF0:
 	  ],,
 	  [AC_DEFINE(HAVE_AS_REF, 1,
 	    [Define if your assembler supports .ref])])
+
+	gcc_GAS_CHECK_FEATURE([AIX DWARF location lists section support],
+	  gcc_cv_as_aix_dwloc,,
+	  [	.dwsect 0xA0000
+	Lframe..0:
+		.vbyte 4,Lframe..0
+	  ],,
+	  [AC_DEFINE(HAVE_XCOFF_DWARF_EXTRAS, 1,
+	    [Define if your assembler supports AIX debug frame section label reference.])])
 	;;
     esac
     ;;
-- 
2.37.3


  reply	other threads:[~2022-09-07 14:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-07 11:45 Martin Liška
2022-09-07 12:04 ` Richard Biener
2022-09-07 13:43 ` David Edelsohn
2022-09-07 14:37   ` Martin Liška [this message]
2022-09-07 15:49     ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e3891de0-ce89-7401-4ce3-fe7c37b08aa2@suse.cz \
    --to=mliska@suse.cz \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).