From: Patrick Steinhardt <ps@pks.im>
To: Shardul Natu <shardul.27591@gmail.com>
Cc: Shardul Natu via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org,
Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>,
Shnatu <snatu@google.com>, Koji Nakamaru <koji.nakamaru@gree.net>
Subject: Re: [PATCH v2] Makefile: link osxkeychain & support universal Rust
Date: Fri, 3 Jul 2026 07:15:22 +0200 [thread overview]
Message-ID: <akdFarZgYhhFehGo@pks.im> (raw)
In-Reply-To: <CABw8Y3H7P3JKwaSrUGjifcDh7rMR2nCFgqPjw8q6vfZnLc730w@mail.gmail.com>
On Thu, Jul 02, 2026 at 03:30:15PM -0700, Shardul Natu wrote:
> > Can we assume lipo to be generally available on macOS? Also, is it
> > sufficient to just do this for the library? I would have expected that
> > binaries would also need some treatment there.
> >
> > In other words: what does it help us to have the Rust treated this way
> > if the rest isn't?
>
> Yes, "lipo" is part of the Apple Xcode CLT, which
> is already a hard prerequisite for invoking clang or make on macOS.
> The reason only Rust needs special treatment in the Makefile is due to
> how the respective toolchains handle multi-architecture builds:
> 1. Apple's C toolchain (clang) natively supports universal builds via
> CFLAGS and LDFLAGS. When "-arch x86_64 -arch arm64" is passed, clang
> automatically compiles and links universal binaries for all C object
> files and executables out of the box.
> 2. Cargo and rustc, however, do not support multiple "-arch" flags or
> emitting universal binaries in a single invocation. Instead, Cargo must
> be invoked separately for each target triple ("--target x86_64-apple-darwin"
> and "--target aarch64-apple-darwin").
>
> By using "lipo" to combine those target-specific Rust static libraries
> into a single universal archive at "target/release/libgitcore.a", we
> bridge this gap. Once $(RUST_LIB) is a universal archive, the standard C
> linker seamlessly links it with the C object files to produce the final
> universal Git executables.
Okay, that makes sense. This information should definitely be part of
the commit message to give reviewers a bit more context.
Thanks!
Patrick
next prev parent reply other threads:[~2026-07-03 5:15 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-05 17:26 [PATCH] Makefile: link osxkeychain helper against Rust Shardul Natu via GitGitGadget
2026-05-05 19:08 ` Kristoffer Haugsbakk
2026-05-07 0:39 ` Shnatu
2026-05-08 2:54 ` Junio C Hamano
2026-05-08 9:33 ` Koji Nakamaru
2026-05-08 17:44 ` Shnatu
2026-07-01 22:01 ` [PATCH v2] Makefile: link osxkeychain & support universal Rust Shardul Natu via GitGitGadget
2026-07-02 1:35 ` Junio C Hamano
2026-07-02 11:50 ` Patrick Steinhardt
2026-07-02 22:30 ` Shardul Natu
2026-07-03 5:15 ` Patrick Steinhardt [this message]
2026-07-03 12:02 ` lipo availability [was: [PATCH v2] Makefile: link osxkeychain & support universal Rust] Ben Knoble
2026-07-02 22:22 ` [PATCH v3 0/2] Makefile: link osxkeychain helper against Rust Shardul Natu via GitGitGadget
2026-07-02 22:22 ` [PATCH v3 1/2] Makefile: add $(RUST_LIB) prerequisite to osxkeychain Shardul Natu via GitGitGadget
2026-07-02 22:22 ` [PATCH v3 2/2] Makefile: support universal macOS builds via RUST_TARGETS Shardul Natu via GitGitGadget
2026-07-03 5:36 ` Junio C Hamano
2026-07-03 17:37 ` Shardul Natu
2026-07-04 18:05 ` [PATCH v4 0/2] Makefile: link osxkeychain helper against Rust Shardul Natu via GitGitGadget
2026-07-04 18:05 ` [PATCH v4 1/2] Makefile: add $(RUST_LIB) prerequisite to osxkeychain Shardul Natu via GitGitGadget
2026-07-06 10:49 ` Patrick Steinhardt
2026-07-04 18:05 ` [PATCH v4 2/2] Makefile: support universal macOS builds via RUST_TARGETS Shardul Natu via GitGitGadget
2026-07-06 10:49 ` Patrick Steinhardt
2026-07-05 4:08 ` [PATCH v4 0/2] Makefile: link osxkeychain helper against Rust Junio C Hamano
2026-07-05 17:38 ` Shardul Natu
2026-07-06 17:14 ` [PATCH v5 " Shardul Natu via GitGitGadget
2026-07-06 17:14 ` [PATCH v5 1/2] Makefile: add $(GITLIBS) prerequisite to osxkeychain Shardul Natu via GitGitGadget
2026-07-06 19:52 ` Junio C Hamano
2026-07-06 17:14 ` [PATCH v5 2/2] Makefile: support universal macOS builds via RUST_TARGETS Shardul Natu via GitGitGadget
2026-07-06 22:52 ` [PATCH v6 0/3] Makefile: link osxkeychain helper against Rust Shardul Natu via GitGitGadget
2026-07-06 22:52 ` [PATCH v6 1/3] Makefile: add $(RUST_LIB) prerequisite to osxkeychain Shardul Natu via GitGitGadget
2026-07-06 22:52 ` [PATCH v6 2/3] Makefile: support universal macOS builds via RUST_TARGETS Shardul Natu via GitGitGadget
2026-07-06 22:52 ` [PATCH v6 3/3] contrib: wire up osxkeychain in contrib/Makefile on macOS Shardul Natu via GitGitGadget
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=akdFarZgYhhFehGo@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=koji.nakamaru@gree.net \
--cc=kristofferhaugsbakk@fastmail.com \
--cc=shardul.27591@gmail.com \
--cc=snatu@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox