From nobody Fri Feb 27 21:45:03 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 4fN21Z1bzNz6TMNV for ; Fri, 27 Feb 2026 21:45:22 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 4fN21Y5bRWz3jNg 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-f42.google.com with SMTP id ffacd0b85a97d-43991064db8so2555823f8f.2 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=NSknBaTO88TiV6dQeJu3zqmn5/rpNIWm/7jmALz16N9tJunjU7e3R7+1UPNTnOyUCn I/GTC153WXfcwMsocsO5OGpcdlgvOTtGp81TxSbPF+YsGWTygpwKOCY6MQ1zpBgXsZOd clDqcS1NRXVyupVsuONJSP1JxRke0Ns1B3ThjfCBT+XoIczSuR7DNoxij65nArWJJ8Vj jCumIOQeCK3GSIS5Br3ykNeY6tuGCCrxDh8qZ7x9QWbR+gBth/KWo4ucAZ9hTCnBkizJ TFOJn5BZWnoxjnHNwu/qui1fsXuNkj5ns9CFZqgOAdp1fi6gnpGx4Xo7xRnwfk3pl3Ws bmKw== X-Forwarded-Encrypted: i=1; AJvYcCUhIuq15xbvsYV/gQ3LB1M8FSpdXJGjko4k+Zc4fxwWSzfHE1JpheJfo226dE3g4I5F1GFxjI9aTzAUCXjzEF61o2jE@freebsd.org X-Gm-Message-State: AOJu0Yy0TOAa9wvTv91FaSKaKWhP1fNonn3q/n7COrTn6K7e8SIySrw+ POm+6GzdRKfSXkES3JM8QBL8VhmLo9nGwZXpAdvoIdjNUhhGVzzpeugb43TLDd+QBHY= X-Gm-Gg: ATEYQzwqCPiVuID/DDkV4HElMjGyB7a1OQ1W6e7E3kdm6XHJBjF68IodOQaXvBWW/cR WjMc+nwV0knPzNxp5FM78bnRi8pzKRtUD0cFCASvZhvQJWZIJZtrlJNKHiz1CSI4sxTZ7ZuzJ6s Mp0SplEzetDXfzuuAoIWs3yDbXUW/KomFT7T4SlabG49hxtv2aebzy0VQREOc3269g3L7LMVlbz oO1YJerQVdE18SJbDVE/iq/6yoCJ3wuA6xvrFfLiSlC+uvqfkd59vkUQil4c5niq2qt0MjqcfsA Vwzw3XIYF9kvG9SV9NsOKwhQLoGy8WInFwSoww7GRoLLHS6kfSMGLPVC7DdnYP4g3ZWta1uOnBP RcuM+vFai3VO3r7r1hagpbFR3N1VHHxOdGwJbhnHvy6ATkgO9FW42GgNY+TAe4vPrIDf3D3w6gW aMKOQ3UjUnCQB3alrVHZLJ7MQbIAU0Tk45FUxUO2XFLsWo0mkqx/dZr4hnQjYq2xlr 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 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 (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: 4fN21Y5bRWz3jNg 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