From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id 414883858D39 for ; Thu, 29 Sep 2022 14:09:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 414883858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wr1-x42a.google.com with SMTP id h7so2370642wru.10 for ; Thu, 29 Sep 2022 07:09:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=to:cc:date:message-id:subject:mime-version:from:from:to:cc:subject :date; bh=6ciPIPDeZys1Nm45ARTIIcFnxggliHMmCWuQxIGCBFY=; b=Wy8AkxPpQplf3BWOJXMSGe/Nzj+s0Fzz7Uodh7R15E1kugs2Rm8GfZBfeb4qGZftf9 9ePh7kLhxPb6Ajmkt0A/Cz5NdUUBpqA5wk1R8AIpHZvcryi0fymo7Jj9WHeMCQ+Q1Vc0 ifDWV05qeT7+p4XRvqoVCjtexyLsA6MlxNQjKUCvBSKv2vxItcg2f7/ohBzYPnobp0nX 7XgdoZCDmVs4TCz9jBfbg4NgOg5uVq7CpoPmMAIg2TGAWspodE3zNOUwMs/r1Sq8Mp17 nbAgEnIsPVCJ4guokbo3lq2tKCNQkVy3FWaNFcKcQOBQjqCOrw8X/ngImKwaH3PUpA0l BPRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date; bh=6ciPIPDeZys1Nm45ARTIIcFnxggliHMmCWuQxIGCBFY=; b=Cf9alErzdwIjYHH9ykwGTbFMNiANYJ1L3i9SSiiloi8epF8qetqoTOj5HWo++cfV7A gzaxi48aZW00X35cVSFD4s4FXSxCDrLSKlvyilS61WcgJDx7grSPIjFq89HeagqVEQTv n9unuRi8StD4bViWJNyStFHkifx0VU0NqO3Iq9rurlqcp9dZat4oX97e8hfr1D/vLU8l yhtmKDPv6ulE92dh7JNiFMN6A+ooEbL/wjoljsQ9oQQM+WioQyPup9SrxrpVnLq9NNtI YaOzGL0MIx9442miEQ9p7LCGUMCvM0FzRaeKRXCF4narpcgkHrjJPdtzfEdXk9PuKbjA iFaw== X-Gm-Message-State: ACrzQf0l/mKdn+AOmYkpyf3pdM0SJRIYLD7aQZ+nb3UImdjjhqd4BO1D HtB7cC1/v5s17JMnnoKNKHIlvbtInkjHeg== X-Google-Smtp-Source: AMsMyM4pzHB0vXzvsVnkKpmr9gchF1Scp3UJ74iJvG0YVuC8Cso4EhRhWpPxpxEQhKMP9ki4D2eOOg== X-Received: by 2002:a5d:4388:0:b0:22c:cbd3:772a with SMTP id i8-20020a5d4388000000b0022ccbd3772amr2491357wrq.141.1664460571895; Thu, 29 Sep 2022 07:09:31 -0700 (PDT) Received: from smtpclient.apple ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id n43-20020a05600c502b00b003a83ca67f73sm4748013wmr.3.2022.09.29.07.09.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Sep 2022 07:09:23 -0700 (PDT) From: Olivier Hainque Content-Type: multipart/mixed; boundary="Apple-Mail=_FF0CFF82-A3A4-4B44-89CA-3D2F97871435" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: [patch] Robustify DWARF2_UNWIND_INFO handling in vx-common.h Message-Id: <57E94BDD-BF4A-4E97-A8A2-AE126E08CC2F@adacore.com> Date: Thu, 29 Sep 2022 16:09:03 +0200 Cc: Olivier Hainque To: gcc-patches X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --Apple-Mail=_FF0CFF82-A3A4-4B44-89CA-3D2F97871435 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii 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 gcc/ * config/vx-common.h (DWARF2_UNWIND_INFO): #define to 0 when ARM_UNWIND_INFO is set. --Apple-Mail=_FF0CFF82-A3A4-4B44-89CA-3D2F97871435 Content-Disposition: attachment; filename=0015-Robustify-DWARF_UNWIND_INFO-handling-in-vx-common.h.patch Content-Type: application/octet-stream; x-unix-mode=0640; name="0015-Robustify-DWARF_UNWIND_INFO-handling-in-vx-common.h.patch" Content-Transfer-Encoding: quoted-printable =46rom=20012574d2e129a8fd11c571d56df29ad21cd2665c=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Olivier=20Hainque=20=0A= Date:=20Thu,=2010=20Mar=202022=2010:46:19=20+0000=0ASubject:=20[PATCH=20= 15/18]=20Robustify=20DWARF_UNWIND_INFO=20handling=20in=20vx-common.h=0A=0A= This=20adjusts=20vx-common.h=20to=20#define=20DWARF2_UNWIND_INFO=20to=20= 0=0Awhen=20ARM_UNWIND_INFO=20is=20set,=20preventing=20defaults.h=20from=0A= possibly=20setting=20DWARF2_UNWIND_INFO=20to=201=20(as=20well)=20on=20= its=20own=0Aafterwards=20if=20the=20macro=20isn't=20defined.=0A=0A= 2022-03-10=20=20Olivier=20Hainque=20=20=0A=0Agcc/=0A= =09*=20config/vx-common.h=20(DWARF2_UNWIND_INFO):=20#define=20to=200=0A=09= when=20ARM_UNWIND_INFO=20is=20set.=0A---=0A=20gcc/config/vx-common.h=20|=20= 7=20+++++--=0A=201=20file=20changed,=205=20insertions(+),=202=20= deletions(-)=0A=0Adiff=20--git=20a/gcc/config/vx-common.h=20= b/gcc/config/vx-common.h=0Aindex=20bc27684375a..bf5823af6bf=20100644=0A= ---=20a/gcc/config/vx-common.h=0A+++=20b/gcc/config/vx-common.h=0A@@=20= -74,7=20+74,8=20@@=20along=20with=20GCC;=20see=20the=20file=20COPYING3.=20= =20If=20not=20see=0A=20/*=20----------------------=20Debug=20and=20= unwind=20info=20formats=20------------------=20=20*/=0A=20=0A=20/*=20= Dwarf2=20unwind=20info=20is=20supported,=20unless=20overriden=20by=20a=20= request=20for=20a=20target=0A-=20=20=20specific=20format.=0A+=20=20=20= specific=20format.=20=20Always=20#define=20DWARF2_UNWIND_INFO=20to=20= prevent=20defaults.h=0A+=20=20=20from=20picking=20a=20possibly=20= different=20value.=0A=20=0A=20=20=20=20Taking=20care=20of=20this=20here=20= allows=20using=20DWARF2_UNWIND_INFO=20in=20#if=20conditions=0A=20=20=20=20= from=20the=20common=20config/vxworks.h=20files,=20included=20before=20= the=20cpu=0A@@=20-84,8=20+85,10=20@@=20along=20with=20GCC;=20see=20the=20= file=20COPYING3.=20=20If=20not=20see=0A=20=20=20=20#if=20point.=20=20= Since=20/vxworks.h.=20is=20typically=20included=20after=0A=20=20=20=20= config/vxworks.h,=20#if=20expressions=20in=20the=20latter=20can't=20rely=20= on=20possible=0A=20=20=20=20redefinitions=20in=20the=20former.=20=20*/=0A= -#if=20!ARM_UNWIND_INFO=0A=20#undef=20DWARF2_UNWIND_INFO=0A+#if=20= ARM_UNWIND_INFO=0A+#define=20DWARF2_UNWIND_INFO=200=0A+#else=0A=20= #define=20DWARF2_UNWIND_INFO=201=0A=20#endif=0A=20=0A--=20=0A2.25.1=0A=0A= --Apple-Mail=_FF0CFF82-A3A4-4B44-89CA-3D2F97871435--