From nobody Mon Apr 27 13:52:12 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4g44kP1Fn8z6b75G; Mon, 27 Apr 2026 13:52:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g44kN5vRzz3Rb5; Mon, 27 Apr 2026 13:52:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777297932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QXfk5/lw/nNm6K4/KzIGgu60OKmk0XmqkG9GuRTpRsI=; b=JDLs+ldAy6hnmo+UJIf3dUxXNmWYtzIuSIH2USqGRTzWB6rAE/oXYwZcFOByBj6zgm6T54 zqgIFXN2xbtOtKgSJCjA6dVDjAP8eZRD7g228uD/1NRxdG5uy1rIORb0FeAv1NmU+mp7RG Z8AKV5ZDwisxpEyk7MG29GkwsZggj0UzKI2U24lXYUzkh8P+wwgkn0NKa++sfMduzFnGt8 Nz36De/AAtq8Ao9dYpsX4oN0tacYYMy6oaEqHRZ2f4Ojz4igI07ZCsrtA2CvPUVmIPuWYz DP5/jDZrgKM81OFajeZbQmtfFxlEOzCB2JQfuidSA/yvATfjX2oOMKmlwcbMcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777297932; a=rsa-sha256; cv=none; b=L9AEznY3bLDScUDf6zykutG5aRB62h9f9CxRks7z+uNVn/GQFKKsYJvKQZ+2+KvnxOFw4w HMcWdqmCnUd2llwyCNP0LZaLkERv1ElaJkZML+W1YbfIh7k/rsP06ArPxLV+NI4FjW/zgR g/oIVxkd2OvvufjcKKHBDCBlCiNH4wa0MAh2pxg2OUupalMu9E/o1LwIjRKIUxA/PlzLBu kHZNuvRA1BMHIAYbR3XicwmHIBID7PwXIZ6B8dFzDF6a3Jhjuv7ifj3txzCDQJpN3FxfSD fxmQi5JTu2hC8/A+w4vyeDqxVxrklQTdk2KhnSrC06vzNIs/+7BE7tUSydkLAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777297932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QXfk5/lw/nNm6K4/KzIGgu60OKmk0XmqkG9GuRTpRsI=; b=KmELwlnQKsaVeXbBnh/Qt0XgXazIGybKZO1Ur+P6IGnID5zlGYFlxEgArcKJgmMAZ/CznX Otew+ZQmtI3gsaWCHywlwNAt1LG54ekPxjDDBEFgrtvB5TPt85rZXGukrT5I+rUTLvizlE ToIGgwjDgCKBL9e2Qxn05EJNQ71ZBEQSvTUo9IX/AgAwTuRFkUfyxOgaWDrZIlJmzoQKqX ZEqIHES8j+rHe8b1xbBqGkensNycXw18kZxz6YuPBdJDCAclUqlie5kkXf7xoI9dcABp8P sNmAtQ5DbQRM7a6gVRezYEzKSmv4Vy96PNQLjO5hRdmHchJ40LtCBz1GNQ000w== Received: from [IPV6:2601:5c0:4202:5670:b0ee:e944:825e:91ed] (unknown [IPv6:2601:5c0:4202:5670:b0ee:e944:825e:91ed]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4g44kN4FCTz13T6; Mon, 27 Apr 2026 13:52:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <30459007-56a1-4edf-8b20-2921e8e2e420@FreeBSD.org> Date: Mon, 27 Apr 2026 09:52:12 -0400 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: e63eee84cad5 - main - libgcc_s: Add a linker script to link to libgcc Content-Language: en-US To: Andrew Turner , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <69ef4ad1.1c7d4.4b8c5d49@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <69ef4ad1.1c7d4.4b8c5d49@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/27/26 07:38, Andrew Turner wrote: > The branch main has been updated by andrew: > > URL: https://cgit.FreeBSD.org/src/commit/?id=e63eee84cad59f63338a539e73bed07917932088 > > commit e63eee84cad59f63338a539e73bed07917932088 > Author: Andrew Turner > AuthorDate: 2026-04-27 10:54:18 +0000 > Commit: Andrew Turner > CommitDate: 2026-04-27 11:37:53 +0000 > > libgcc_s: Add a linker script to link to libgcc > > When using outline atomics on arm64 the compiler will create a call to > a function that performs the atomic operation. This allows us to use > the fastest operation depending on the hardware. > > As these functions are implemented in libgcc create a linker script > so libraries that link against libgcc_s will include libgcc to pull > them in. Some additional notes: GCC only links with -lgcc_s (the shared library) when linking C++ executables and libraries, but links with both -lgcc_s and -lgcc when linking C executables and libraries. clang does the same on most libgcc-using platforms like Linux, except that for FreeBSD, clang treats C++ like C and links in both libraries (this is probably an accidental bug in clang's FreeBSD toolchain driver, but kind of moot). Linux distributions use an ldscript for libgcc_s on all architectures (not just aarch64) to handle this weirdness of GCC. This is all pretty sad as GCC ships with libgcc and should "know" if libgcc_s needs symbols from libgcc, but matching Linux is probably the path of least friction going forward. It would only be worth fixing the toolchain driver in clang if it meant removing the custom libgcc code, but I suspect we will always need it for existing FreeBSD versions, so it's not clear to me that it is worth doing. -- John Baldwin