From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 04BA1386187E; Mon, 15 Jan 2024 17:24:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 04BA1386187E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705339464; bh=bo3qwBykY2mxKz6igtm9cGXZX9YI/RtZxoCBKh18dqE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=W69dbRJeaffljw3RbtxB1y3cISqcqtRYBZDBJN3ToVBqFGAtQqtw0ExT4y8HzjMoY eEoxk4l8spp2P7+oK4CfsO+mHfxTlze10W0ojyoWMBqmLD1TKr9NctUSJLfW3pMCfL vYA7OV6eGun4zTcTjJ/5xTZhVnuktG8JM/6+QhWw= From: "iains at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libgcc/113403] __builtin_nested_func_ptr_created, __builtin_nested_func_ptr should be dynamically linked by default Date: Mon, 15 Jan 2024 17:24:22 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libgcc X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: iains at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113403 --- Comment #3 from Iain Sandoe --- (In reply to Florian Weimer from comment #2) > Weak symbols have no meaning for ELF DSOs, so this wouldn't work for > libgcc_s on ELF targets. Instead we automatically link against dynamic > libgcc_s if certain symbols not in libgcc.a are referenced. Sources built > with -ftrampoline-impl=3Dheap -fexceptions can already trigger such a > dependency for _Unwind_Resume because it's used in the cleanup handler, f= or > example. So if we remove these symbols from libgcc.a and then the user builds with -static-libgcc - that would just be an error (presumably at runtime if ld allows undefined symbols). I'm not clear about what the scope of "we automatically link against dynamic libgcc_s" is in that case. Assuming that omitting the symbols from libgcc.a means either linking again= st libgcc_s or providing them from some other source when -static-libgcc is gi= ven: - we could use a CRT for that. - I suppose we could also add these symbols to libgcc_eh for that case - b= ut that proved to be a bad choice for emuTLS, so it would also need to be configured per platform. On platforms like Mach-O, the strategy I outlined will work OK (this is configurable per target, so should be OK).=