From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1298) id 1FB1F3858439; Sun, 2 Oct 2022 09:13:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1FB1F3858439 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664702024; bh=hu+9IjkWSy5cQyoVh0KmHUMgHe7T/Bi3j+4LqA34ufc=; h=From:To:Subject:Date:From; b=LZFQB7bEoGCeTHrAIvdbqjqjw7OfabBYyKATmbckijVGrfp0Btd+QsQevRJ3Mxljb LmiXjfBiypfg1/xZYgh+2pePSFIDwZ0IMzNy4h0xinVYzZ+WyajwyDgMQnfv94uDCs SEYWFDpKbO7l68Fs+ENqNhmfamCsOcayo6tyN2zU= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Olivier Hainque To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3016] Refine guard for vxworks crtstuff spec X-Act-Checkin: gcc X-Git-Author: Olivier Hainque X-Git-Refname: refs/heads/master X-Git-Oldrev: 3290dcf14994cee3f86abd8cc7d38ddedaaec062 X-Git-Newrev: 6ed7eee30f4c5e7a4ae0119bbc93a1487751cbc7 Message-Id: <20221002091344.1FB1F3858439@sourceware.org> Date: Sun, 2 Oct 2022 09:13:44 +0000 (GMT) List-Id: https://gcc.gnu.org/g:6ed7eee30f4c5e7a4ae0119bbc93a1487751cbc7 commit r13-3016-g6ed7eee30f4c5e7a4ae0119bbc93a1487751cbc7 Author: Olivier Hainque Date: Thu Mar 10 11:02:11 2022 +0000 Refine guard for vxworks crtstuff spec 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, 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. Diff: --- gcc/config/vxworks.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gcc/config/vxworks.h b/gcc/config/vxworks.h index 6a88fb27e8a..f2103def448 100644 --- a/gcc/config/vxworks.h +++ b/gcc/config/vxworks.h @@ -120,7 +120,7 @@ along with GCC; see the file COPYING3. If not see -lc_internal after -lc -lgcc. - libc_internal also contains __init/__fini functions for - USE_INITFINI_ARRAY support. However, the system expects these in + INITFINI_ARRAY support. However, the system expects these in every shared lib as well, with slightly different names, and it is simpler for us to provide our own versions through vxcrtstuff. @@ -225,10 +225,9 @@ along with GCC; see the file COPYING3. If not see #endif /* 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)) + and/or INITFINI_ARRAY support. */ +#if (HAVE_INITFINI_ARRAY_SUPPORT \ + || (DWARF2_UNWIND_INFO && !defined(CONFIG_SJLJ_EXCEPTIONS))) #define VX_CRTBEGIN_SPEC "%{!shared:vx_crtbegin.o%s;:vx_crtbeginS.o%s}" #define VX_CRTEND_SPEC "%{!shared:vx_crtend.o%s;:vx_crtendS.o%s}" #else