From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by sourceware.org (Postfix) with ESMTPS id 6A7263858D38 for ; Fri, 30 Sep 2022 09:40:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6A7263858D38 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-x432.google.com with SMTP id u10so5843205wrq.2 for ; Fri, 30 Sep 2022 02:40:40 -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=VzZ1eQYnjmo0GRnN9upwPbWGGNHIF5z9zyCPG9O8tzs=; b=cSYsCE+eEEwgXAHsEmoz6s8bSlzXnjCjz2fmk+kzbzDT9bG8GA5xlI9EX39zkh7jU5 KWH30+wyzeCfRsCfVO8AptnwWCTKuVrdTd5o5xN4yXha5v9DAjO14bjvFvYev45PR9Xq +cExkrYPejejbmgIp9XvzwH9rfBEWjH+GSNrtBNCfSgaxMbf+59wf2s/AFm48myu2McQ NLKskVDSqbdy4sY1uj5CbOJTzaY8jO7GlAF9AXWpZLAnSGS5/MfSYL6FztFvPBwlLOX9 draV3EPLgC+V3rliETmBHK229vJ9VOyZoITlV2YQHs9nA+XL6f69akCZlVSWdXcimEhG Mw7Q== 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=VzZ1eQYnjmo0GRnN9upwPbWGGNHIF5z9zyCPG9O8tzs=; b=hOxp+rM+WPgcQL3or2pcWZCf8KPADRllsaocUCIF824yGKnEkMb9uXJ3m3cviqhLKB W36w00Kc7uGmwOS37MV/tfSuRgqNYLd19874i7HXd3NJsp+hW3saBI6OPH6F4BCIqYCi iYKOOThquOUK1jXwsJ5f1TWb1q3F5GKLaX+hgoFqipTm0niMSQyG3iDKYBie49nfVjXD 3aadMkYhZFrPF1mUDw+PY1cgfIhvqY8vpfQCbXHnHQCRpLTupIpDGt3uU9hPO1oAIO4P 2RrAWkTMm26USy6vmQYBbhWVFxjZvotpgl9XhJ5ufy3vfAQXCOxgXAV0cJmd5LSrFmH8 2VRw== X-Gm-Message-State: ACrzQf09LS7x3OYfnqjh14J1QR/Bf7+xUrmg56sbZGU3jojy7S+xLvwk zZAIV6wocyHlKdDZ3kS0Ul2xZVDc0v57+g== X-Google-Smtp-Source: AMsMyM7SkfQ8+iB29ckuI5RrTEsJFI8RfU3bd1HEyvS+rt5xtrMfBWL3rGtZFUFSKaK/D5+78fkASw== X-Received: by 2002:a05:6000:144f:b0:22a:7098:6472 with SMTP id v15-20020a056000144f00b0022a70986472mr5263593wrx.685.1664530839095; Fri, 30 Sep 2022 02:40:39 -0700 (PDT) Received: from smtpclient.apple ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id iv16-20020a05600c549000b003b4c40378casm7148560wmb.39.2022.09.30.02.40.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Sep 2022 02:40:37 -0700 (PDT) From: Olivier Hainque Content-Type: multipart/mixed; boundary="Apple-Mail=_103EA7E5-F5B5-4691-961C-6C102E34D5F0" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: =?utf-8?Q?=5Bpatch=5D=C2=A0Refine_INITFINI_condition_for_vxworks_?= =?utf-8?Q?crtstuff_spec?= Message-Id: Date: Fri, 30 Sep 2022 11:40:36 +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=_103EA7E5-F5B5-4691-961C-6C102E34D5F0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Hello, Working on the reintroduction of shared libraries support (and of modules depending on shared libraries) exposed a few test failures of simple c++ constructor tests on arm-vxworks7r2. Investigation revealed that we were not linking the crtstuff objects as needed from a compiler configured not to have shared libs support, because of the ENABLE_SHARED_LIBGCC guard in this piece of vxworks.h: /* Setup the crtstuff begin/end we might need for dwarf EH registration and/or INITFINI_ARRAY support for shared libs. */ #if (HAVE_INITFINI_ARRAY_SUPPORT && defined(ENABLE_SHARED_LIBGCC)) \ || (DWARF2_UNWIND_INFO && !defined(CONFIG_SJLJ_EXCEPTIONS)) #define VX_CRTBEGIN_SPEC "%{!shared:vx_crtbegin.o%s;:vx_crtbeginS.o%s}" crtstuff initfini array support is meant to be leveraged for constructors regardless of whether the compiler also happens to be configured with shared library support, so the guard on ENABLE_SHARED_LIBGCC here is inappropriate. This change just removes it, which cured the test c++ contructor test failures we were observing and didn't produce adverse effect on the rest of our builds/runs (gcc-11 based toolchains for vxowkrs7r2 on a variety of architectures). Tested further with a gcc-12 build + basic test cycle on both arm and ppc64 vxworks7r2, as well as ppc vxworks 6.9. Will commit to mainline shortly. Cheers, Olivier 2022-09-30 Olivier Hainque gcc/ * config/vxworks.h (VX_CRTBEGIN_SPEC, VX_CRTEND_SPEC): If HAVE_INITFINI_ARRAY_SUPPORT, pick crtstuff objects regardless of ENABLE_SHARED_LIBGCC. --Apple-Mail=_103EA7E5-F5B5-4691-961C-6C102E34D5F0 Content-Disposition: attachment; filename=0005-Refine-INITFINI-condition-for-vxworks-crtstuff-spec.patch Content-Type: application/octet-stream; x-unix-mode=0640; name="0005-Refine-INITFINI-condition-for-vxworks-crtstuff-spec.patch" Content-Transfer-Encoding: quoted-printable =46rom=206faee7bc168c8cc3fbb57ceeababf00de91c97d8=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Olivier=20Hainque=20=0A= Date:=20Thu,=2010=20Mar=202022=2011:02:11=20+0000=0ASubject:=20[PATCH=20= 05/18]=20Refine=20INITFINI=20condition=20for=20vxworks=20crtstuff=20spec=0A= =0A=0A2022-03-10=20=20Olivier=20Hainque=20=0A=0A= gcc/=0A=09*=20config/vxworks.h=20(VX_CRTBEGIN_SPEC,=20VX_CRTEND_SPEC):=20= If=0A=09HAVE_INITFINI_ARRAY_SUPPORT,=20pick=20crtstuff=20objects=20= regardless=0A=09of=20ENABLE_SHARED_LIBGCC.=0A---=0A=20= gcc/config/vxworks.h=20|=209=20++++-----=0A=201=20file=20changed,=204=20= insertions(+),=205=20deletions(-)=0A=0Adiff=20--git=20= a/gcc/config/vxworks.h=20b/gcc/config/vxworks.h=0Aindex=20= 6a5f2f8f2ec..c18a0f65529=20100644=0A---=20a/gcc/config/vxworks.h=0A+++=20= b/gcc/config/vxworks.h=0A@@=20-115,7=20+115,7=20@@=20along=20with=20GCC;=20= see=20the=20file=20COPYING3.=20=20If=20not=20see=0A=20=20=20=20=20=20= -lc_internal=20after=20-lc=20-lgcc.=0A=20=0A=20=20=20=20-=20= libc_internal=20also=20contains=20__init/__fini=20functions=20for=0A-=20=20= =20=20=20USE_INITFINI_ARRAY=20support.=20However,=20the=20system=20= expects=20these=20in=0A+=20=20=20=20=20INITFINI_ARRAY=20support.=20= However,=20the=20system=20expects=20these=20in=0A=20=20=20=20=20=20every=20= shared=20lib=20as=20well,=20with=20slightly=20different=20names,=20and=20= it=20is=0A=20=20=20=20=20=20simpler=20for=20us=20to=20provide=20our=20= own=20versions=20through=20vxcrtstuff.=0A=20=0A@@=20-220,10=20+220,9=20= @@=20along=20with=20GCC;=20see=20the=20file=20COPYING3.=20=20If=20not=20= see=0A=20#endif=0A=20=0A=20/*=20Setup=20the=20crtstuff=20begin/end=20we=20= might=20need=20for=20dwarf=20EH=20registration=0A-=20=20=20and/or=20= INITFINI_ARRAY=20support=20for=20shared=20libs.=20=20*/=0A-=0A-#if=20= (HAVE_INITFINI_ARRAY_SUPPORT=20&&=20defined(ENABLE_SHARED_LIBGCC))=20\=0A= -=20=20=20=20||=20(DWARF2_UNWIND_INFO=20&&=20= !defined(CONFIG_SJLJ_EXCEPTIONS))=0A+=20=20=20and/or=20INITFINI_ARRAY=20= support.=20=20*/=0A+#if=20(HAVE_INITFINI_ARRAY_SUPPORT=09=09=09=09=09\=0A= +=20=20=20=20=20||=20(DWARF2_UNWIND_INFO=20&&=20= !defined(CONFIG_SJLJ_EXCEPTIONS)))=0A=20#define=20VX_CRTBEGIN_SPEC=20= "%{!shared:vx_crtbegin.o%s;:vx_crtbeginS.o%s}"=0A=20#define=20= VX_CRTEND_SPEC=20=20=20"%{!shared:vx_crtend.o%s;:vx_crtendS.o%s}"=0A=20= #else=0A--=20=0A2.25.1=0A=0A= --Apple-Mail=_103EA7E5-F5B5-4691-961C-6C102E34D5F0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii --Apple-Mail=_103EA7E5-F5B5-4691-961C-6C102E34D5F0--