public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Olivier Hainque <hainque@adacore.com>
To: gcc-patches <gcc-patches@gcc.gnu.org>
Cc: Olivier Hainque <hainque@adacore.com>
Subject: [patch] Robustify DWARF2_UNWIND_INFO handling in vx-common.h
Date: Thu, 29 Sep 2022 16:09:03 +0200	[thread overview]
Message-ID: <57E94BDD-BF4A-4E97-A8A2-AE126E08CC2F@adacore.com> (raw)

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

Hello,

This adjusts vx-common.h to #define DWARF2_UNWIND_INFO to 0
when ARM_UNWIND_INFO is set, preventing defaults.h from
possibly setting DWARF2_UNWIND_INFO to 1 (as well) on its own
afterwards if the macro isn't defined.

We have been using this for a while in gcc-11 development
toolchains for a variety of VxWorks targets, including arm
and aarch64, and I have performed a couple of sanity check
build for ppc64-vx7r2 and arm-vx7r2 with gcc-12. 

Committing to mainline where the patch applies as-is and
where the close context (defaults.h defining DWARF2_UNWIND_INFO)
hasn't changed.

Cheers,

Olivier

2022-03-10  Olivier Hainque  <hainque@adacore.com>

gcc/
        * config/vx-common.h (DWARF2_UNWIND_INFO): #define to 0
        when ARM_UNWIND_INFO is set.


[-- Attachment #2: 0015-Robustify-DWARF_UNWIND_INFO-handling-in-vx-common.h.patch --]
[-- Type: application/octet-stream, Size: 1818 bytes --]

From 012574d2e129a8fd11c571d56df29ad21cd2665c Mon Sep 17 00:00:00 2001
From: Olivier Hainque <hainque@adacore.com>
Date: Thu, 10 Mar 2022 10:46:19 +0000
Subject: [PATCH 15/18] Robustify DWARF_UNWIND_INFO handling in vx-common.h

This adjusts vx-common.h to #define DWARF2_UNWIND_INFO to 0
when ARM_UNWIND_INFO is set, preventing defaults.h from
possibly setting DWARF2_UNWIND_INFO to 1 (as well) on its own
afterwards if the macro isn't defined.

2022-03-10  Olivier Hainque  <hainque@adacore.com>

gcc/
	* config/vx-common.h (DWARF2_UNWIND_INFO): #define to 0
	when ARM_UNWIND_INFO is set.
---
 gcc/config/vx-common.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gcc/config/vx-common.h b/gcc/config/vx-common.h
index bc27684375a..bf5823af6bf 100644
--- a/gcc/config/vx-common.h
+++ b/gcc/config/vx-common.h
@@ -74,7 +74,8 @@ along with GCC; see the file COPYING3.  If not see
 /* ---------------------- Debug and unwind info formats ------------------  */
 
 /* Dwarf2 unwind info is supported, unless overriden by a request for a target
-   specific format.
+   specific format.  Always #define DWARF2_UNWIND_INFO to prevent defaults.h
+   from picking a possibly different value.
 
    Taking care of this here allows using DWARF2_UNWIND_INFO in #if conditions
    from the common config/vxworks.h files, included before the cpu
@@ -84,8 +85,10 @@ along with GCC; see the file COPYING3.  If not see
    #if point.  Since <cpu>/vxworks.h. is typically included after
    config/vxworks.h, #if expressions in the latter can't rely on possible
    redefinitions in the former.  */
-#if !ARM_UNWIND_INFO
 #undef DWARF2_UNWIND_INFO
+#if ARM_UNWIND_INFO
+#define DWARF2_UNWIND_INFO 0
+#else
 #define DWARF2_UNWIND_INFO 1
 #endif
 
-- 
2.25.1


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

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=57E94BDD-BF4A-4E97-A8A2-AE126E08CC2F@adacore.com \
    --to=hainque@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).