From nobody Tue Apr 28 01:05:45 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 4g4Mgj47kVz6Zykg for ; Tue, 28 Apr 2026 01:05:53 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic313-21.consmr.mail.gq1.yahoo.com (sonic313-21.consmr.mail.gq1.yahoo.com [98.137.65.84]) (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) by mx1.freebsd.org (Postfix) with ESMTPS id 4g4Mgj0Nxcz45hP for ; Tue, 28 Apr 2026 01:05:52 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1777338348; bh=/QXc98CFTKJ7ReyBRE65grb02WbAgyTCBIriP7ci1Ys=; h=Date:Subject:To:References:From:In-Reply-To:From:Subject:Reply-To; b=P/041n4/zUGZGd0h4G0j5s4BrWNJW0uU1quYM9P3HEfcLTAwmLxhx7dglSnw+WP9GF3HtGdznPIOto7PxDSmrk7j5s41zBIC91Ktq1UlG9B/EfZUVMaBeUbstFAL3Gf3Dg2dJPqtS2mzBWGmZHMAwLhj08YUptOU3SoTXFDL89hEI7G1BBg1kZmPjgtnKL6/ftutn3yTrfot1mT0VzWQZXyL/wZc0UX4AjmxosroZ0olifaCf5jkuQA3F1juAJFcvrYkiD6/wlwOqg/DsW2h7l9FiEPJjqa0KGV4vNCv0NRrt1ObdBJa7L3XCCKXNHLnPdgy6C64joDPmpuD8BLwFQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1777338348; bh=r/N0OpV3DUAgDYdnxQexqrwhh4ooF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vasS t_5dcYPThMAP46jBUBOyLg.zSU4K3U1fM96CdT2ROj9ekh4pu650yAMWYooHhLjuTDVBQDREovzs j0XxpQ5qdpEch82dZ0HGauiVvHw04hZpKpdEJn6JJPuAwFRaA3ruDwynWGsI1MmztjTAkHC.AxP8 TblzI4T4WwJ8GcIGD8KaPCq4z7t0K0MW6txysPErF47LeBm8hNusodx_8gyE7TRljihShg8MzYtF xLZH767KFEPGZwVcm4EbBPlVeT.6PAYPksCInDXahihI9u8HmY8znkBy_a3NV6r2nebiVu1o3fBP T12WnliW5mqbNDFStzVAsG6C6Taq8iNFUVQ.BWCWH_zBb2yz6N.noFdVpTeZfUOduXJT2OQsQ7vJ GzvfOO.Jj45wfhOB17_H.vPpyyjCTDb8Tun5Luw1W7r2Y.Hkzxy.d0SlxwNM9GASsFLxDPPC.fvH qxgQaoer_0EAew8LjsNOvs5tPo4SxLLVF26OQ9gwsqt4h1UFeOVypiy3dTdxcxUHmjEvnhi49zks bKXRS3oCLuPhM38vAr4NAQzrw_ANB312XB7MB3ABWa4QtXD2Xgj7YHQHEdDtX9zBHmg7XFN_D3oR a.Mk_Ss1.hEEhG0PNL9360IzEIBWF2GhXyH.zWuuDYpbMRrzFDmS9cTn4St7dWEcd_y17 X-Sonic-MF: X-Sonic-ID: 41ee3861-e11b-40cf-b429-4c4a713943cd Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.gq1.yahoo.com with HTTP; Tue, 28 Apr 2026 01:05:48 +0000 Received: by hermes--production-gq1-7bb7df5c46-cpn2t (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 8668192475fd0d1fc924693bb2a687b2; Tue, 28 Apr 2026 01:05:46 +0000 (UTC) Message-ID: Date: Mon, 27 Apr 2026 18:05:45 -0700 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 To: John Baldwin , Andrew Turner , dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <69ef4ad1.1c7d4.4b8c5d49@gitrepo.freebsd.org> <30459007-56a1-4edf-8b20-2921e8e2e420@FreeBSD.org> Content-Language: en-US From: Mark Millard In-Reply-To: <30459007-56a1-4edf-8b20-2921e8e2e420@FreeBSD.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Mailer: WebService/1.1.25559 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US] X-Rspamd-Queue-Id: 4g4Mgj0Nxcz45hP X-Spamd-Bar: ---- On 4/27/26 06:52, John Baldwin wrote: > 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. An oddity is that the lang/gcc*'s libgcc_s.so.1 and the FreeBSD system libgcc_s.so.1 do not match, FreeBSD having many symbols missing compared to GCC --and the other way around as well. It can be required to use something like -Wl,-rpath=... to force use of the appropriate lang/gcc*'s libgcc_s.so when using the gcc* or g++* compiler in order to avoid failures from missing symbols. modern amd64 examples are listed in: modern aarch64 examples are listed in: There are also mismatches like (aarch64 context): (-: FreeBSD OS, +: lang/gcc15) +GCC_4.5.0 __unordtf2 -GCC_4.6.0 __unordtf2 and: +GCC_3.0 __addtf3 -GCC_4.6.0 __addtf3 Even: int main() { } compiled/linked via g++15 gets: # ./trivial ld-elf.so.1: /lib/libgcc_s.so.1: version GCC_4.5.0 required by /usr/local/lib/gcc15/libstdc++.so.6 not found So there is more to the mismatches in this general area than just -lgcc being used vs. not. (I've never checked for -lgcc mismatches.) > 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. > -- === Mark Millard marklmi at yahoo.com