From nobody Fri Feb 27 21:45:03 2026 X-Original-To: dev-commits-src-main@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 4fN21T24jbz6TMQr for ; Fri, 27 Feb 2026 21:45:17 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fN21S6YKZz3hh5 for ; Fri, 27 Feb 2026 21:45:16 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-436e87589e8so2457605f8f.3 for ; Fri, 27 Feb 2026 13:45:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772228715; x=1772833515; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=2ye6tXD7zZVpPE136iNUh5Bxu4/pOGU32xkcdk0l9Gg=; b=NAH0/nfUh7ziTDF0FzoHwb/8tB9TuBjg9ebZNLziB6IzWxb3aIIcEoLzg0r/AmM7fZ CY2EJ3iLIBWk42kfoICH88OyS6cuQF8XroETJS25BO76GuLazbCMR/TUzQZ5+71sdahi tYqB6YzIeA6IPhR7P9hLLJNw5iZZgURqNWqovlnWiGHdp+2p31WKvXtOSy9osfSse9ff MI2l3aY10F/EaVsUJ4JESv1eIVD7KEpfLtWZ7a6JIV5AA6H33wXblyijGmeSN2kc6J5K Owk/YazqwgPKi4oeC/nR7lFEViTvtZ1EZeaOek6FwbtsF1DrqPRLBX2ikkxnS5BDSf2n bBmg== X-Forwarded-Encrypted: i=1; AJvYcCV9w1BgS9E2OoqzW/rM0xIMBjny8BnQIhcyQo+WvL0n1QJR069LDCkF2aswmEAQlQMyahyX1aGSp1tso/sefeuPJXjs+g==@freebsd.org X-Gm-Message-State: AOJu0YyOwU/acg+OLE2DD5vmkicTTy1PXW4McxvrsX/SONrf47hAlZ3S XmXvmafPGMj0R0bmqInAO0/7rKpUimo/mrrm/baI4lXeRMGp32uQ5OGUS9aQ8xsK9Qs= X-Gm-Gg: ATEYQzzZzue85ed2qEu76Byd7UF3ldV0NO+XE46k9IFLw7jri2bUZkpPHl7EibsCr3C y6zBAlOg5SaxguAh+xzzIkYOgWDSpB/dQksPZHgmqBB6fjBU9aZKWpywGxgghhNZzFJC/xKuEB0 R6WjkqgFt5L5ZHEzshUF6WS/oIzDVFfi0T36P41u5J8eKo673j9kSgp6VJ2tYnMYcs3tAekTNFA QYb3CbzaCjR3yK41x1d/A5vD0kdRmpaXw9drD1jSkuldFgr8hV/UbmuYNBkg5EXfxc6yaO3/Kn2 /NO1txUWPUjw3s7uqW+MxWRKyVrtyJo/1VnTVlnhbYfa1Cm9AJCdcx2fBF7hza5/Dfte2dIiXRP W1hyXJ6fO/Ieg89vkc6Y4rIAh2vQEyVW9XhQsRBtsb/4C0sjHTinVAC+wnD0q5+M6zpaN5SGfQ+ PjZE0CQArlOfBAzWkDE6OY1o6qr6hYJNeruQFco/CGx+kiGgy5Y+30e3cAGYlpyZT3 X-Received: by 2002:a05:6000:2c10:b0:439:9225:3378 with SMTP id ffacd0b85a97d-4399ddfc322mr7096342f8f.24.1772228714464; Fri, 27 Feb 2026 13:45:14 -0800 (PST) Received: from smtpclient.apple (nat-184-7.net.cam.ac.uk. [131.111.184.7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4399c71b498sm9663359f8f.15.2026.02.27.13.45.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Feb 2026 13:45:13 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.400.21\)) Subject: Re: git: ee73475119ff - main - llvm: Link private LLVM libraries against compiler_rt for aarch64 From: Jessica Clarke In-Reply-To: Date: Fri, 27 Feb 2026 21:45:03 +0000 Cc: Mark Millard , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , Andrew Turner Content-Transfer-Encoding: quoted-printable Message-Id: References: <698a0b1e.1d294.40e36519@gitrepo.freebsd.org> <23acebb1-f71c-46e6-9eea-3fa44316335d@FreeBSD.org> <720e4cb6-fd13-4686-93d9-ef095ad611c2@yahoo.com> To: John Baldwin X-Mailer: Apple Mail (2.3864.400.21) 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:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4fN21S6YKZz3hh5 X-Spamd-Bar: ---- On 27 Feb 2026, at 21:24, John Baldwin wrote: > On 2/27/26 15:55, Mark Millard wrote: >> On 2/27/26 09:27, John Baldwin wrote: >>> On 2/9/26 11:47, John Baldwin wrote: >>>> On 2/9/26 11:40, Jessica Clarke wrote: >>>>> On 9 Feb 2026, at 16:28, John Baldwin wrote: >>>>>>=20 >>>>>> The branch main has been updated by jhb: >>>>>>=20 >>>>>> URL: https://cgit.FreeBSD.org/src/commit/? >>>>>> id=3Dee73475119ff7aa98bd11828625d524f6ab87f06 >>>>>>=20 >>>>>> commit ee73475119ff7aa98bd11828625d524f6ab87f06 >>>>>> Author: John Baldwin >>>>>> AuthorDate: 2026-02-09 16:26:52 +0000 >>>>>> Commit: John Baldwin >>>>>> CommitDate: 2026-02-09 16:26:52 +0000 >>>>>>=20 >>>>>> llvm: Link private LLVM libraries against compiler_rt for = aarch64 >>>>>>=20 >>>>>> This is required for GCC which uses libcalls for outlined = atomics. >>>>>=20 >>>>> This doesn=E2=80=99t seem right, they=E2=80=99re provided by = libgcc.a, so why aren=E2=80=99t >>>>> they being pulled in? libcompiler_rt.a doesn=E2=80=99t even have = the symbols. >>>>=20 >>>> My guess is that we don't link libraries against libgcc by default, = only >>>> binaries (maybe this is a GCC feature/bug vs clang)? I have = another >>>> review >>>> open for a couple of google test libraries which similarly fail to = link. >>>=20 >>> So after some more digging (along with Jessica), it seems that GCC = only >>> uses -lgcc_s (and not -lgcc) for C++ (but not C) on both Linux and = FreeBSD. >>> clang's FreeBSD toolchain driver is supposed to mimic GCC but = doesn't, it >>> applies the C rules even for C++ linking, so clang is implicitly = adding >>> both -lgcc and -lgcc_s for C++. >>>=20 >>> On Linux, libgcc.so is a linker script that includes both the = dynamic >>> library and -lgcc which is how the static libgcc (including outline = atomics >>> for aarch64) is effectively linked into C++ shared libraries on = Linux. >>> (Note: libgcc.so is a linker script on seemingly all arches on = Linux, not >>> just aarch64) >>>=20 >>> So I think we have a couple of choices here. I can patch the devel/ >>> freebsd-gccN >>> ports to stop passing -shared-libgcc to cc1plus which will cause GCC = to >>> follow >>> the same rules as clang on FreeBSD (passing -lgcc -as-needed -lgcc_s = - >>> no-as-needed >>> instead of -lgcc_s), or we could change libgcc.so to be a linker = script >>> to match >>> Linux (and then eventually fix the FreeBSD driver in clang to only = pass >>> -lgcc_s for C++ linking) (I think Andrew already has a review to = make >>> libgcc.so >>> a linker script). >>>=20 >>> I can see arguments both ways. Using a linker script seems kind of = dumb >>> given >>> all the hoops GCC goes to internally to decide whether or not to = link only >>> shared or static or both. (Esp given libgcc is in theory part of = the >>> compiler, >>> so the compiler should know that libgcc_s should depend on libgcc = and be >>> able >>> to encode that in the default drivers.) OTOH, the linker script >>> approach would >>> mean we would more closely align with Linux. I think Jess favors >>> patching GCC. >>> Does anyone else have any strong opinions? >>>=20 >> Is the question limited to devel/freebsd-gcc* ? Or does it span >> lang/gcc* use as well? >=20 > We don't really support building the base system with lang/gcc* > (it's why devel/freebsd-gcc* exist) as the base system builds require > various changes like kernel printf support, defaulting to libc++, etc. Third-party software still needs to be buildable with it though. Jessica