From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 71D62385828D for ; Thu, 19 Jan 2023 21:53:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 71D62385828D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.97,230,1669104000"; d="scan'208";a="97701628" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 19 Jan 2023 13:53:27 -0800 IronPort-SDR: lZbbHL0c+EIYqqH8kyAQ8rp5PyV/lGazRvWuaUbFaqWO9B0CAtQBfcBnZMW9qtzDn7HbvIckqO RwryU+KQyzCBL7foCbFubWiJMj7KL7Gf07MadTeNBov7yaeBakullWYGvkWM6iwIu/07uMUEq8 UoYHJhg7/F2airLD6B5c8FGhkmhKVnZGWyp+KrwYmQGqY1uEGJdG7H/bGXtM7J0bJt6Xzr7vOy VYBai+qCJB5QrwvWCGK0t++b/Q1jvhlYBZxyAh70il6qfdT+BHg4Ux4GlpmXmKsJfPr+rWQ02f yNo= From: Thomas Schwinge To: CC: , , Thomas Schwinge Subject: [PATCH 1/2] nvptx: Don't use global constructor for SSP setup Date: Thu, 19 Jan 2023 22:53:16 +0100 Message-ID: <20230119215317.2001873-1-thomas@codesourcery.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,SPF_HELO_PASS,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: Given that nvptx newlib currently restricts itself to ELIX level 1, this is not already a problem. However, in the following we'd like to lift that restriction, and then run into: [...]/newlib/libc/ssp/stack_protector.c: In function =E2=80=98__stack_c= hk_init=E2=80=99: [...]/newlib/libc/ssp/stack_protector.c:31:1: sorry, unimplemented: glo= bal constructors not supported on this target 31 | } | ^ GCC patch "nvptx: Support global constructors/destructors via 'collect2'" has been posted, but not yet accepted. Until that is resolved, use the same manual SSP setup as for GCN. --- newlib/libc/ssp/stack_protector.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/newlib/libc/ssp/stack_protector.c b/newlib/libc/ssp/stack_prot= ector.c index cd51543f0..5e9d75f0f 100644 --- a/newlib/libc/ssp/stack_protector.c +++ b/newlib/libc/ssp/stack_protector.c @@ -5,8 +5,8 @@ #include #include -#if defined(__AMDGCN__) -/* GCN does not support constructors, yet. */ +#if defined(__AMDGCN__) || defined(__nvptx__) +/* Global constructors not supported on this target, yet. */ uintptr_t __stack_chk_guard =3D 0x00000aff; /* 0, 0, '\n', 255 */ #else -- 2.25.1 ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955