[PATCH 0/3] Makefile update libgit.a: Include xdiff and reftable in libgit.a
- From
Ezekiel Newren via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Oct 1, 2025, 18:02 UTC
- Message-ID
- <pull.2065.git.git.1759341748.gitgitgadget@gmail.com>
Add xdiff and reftable to the static library libgit.a that Makefile produces. Meson does not require any changes since it already includes those libraries. The motivation is to simplify Rust's job of linking against the C code by requiring it to only link against a single static library (libgit.a).
The Rust compiler only needs to know how to link against libgit.a in 2 cases that I can think of:
* Rust unit tests * Rust defining the main function
Otherwise Rust can be compiled without linking, and then Makefile and Meson can use Cargo's produced static lib files to build Git.
Note: The flag -fPIE or -fPIC is required for Makefile to build libgit.a in a way that Cargo can use. It has been deliberately omitted from the Makefile, for now, since Rust isn't part of Git (yet).
Ezekiel Newren (3): make: move xdiff and reftable objects before GITLIBS make: delete XDIFF_LIB, add xdiff to LIB_OBJS make: delete REFTABLE_LIB, add reftable to LIB_OBJS
Makefile | 66 +++++++++++++++++++++++--------------------------------- 1 file changed, 27 insertions(+), 39 deletions(-)
base-commit: a91ca5db0318b6fda5a6721ee843f56e7e2fadfc Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2065%2Fezekielnewren%2Fmerge_xdiff_and_reftable_with_libgit-v1 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2065/ezekielnewren/merge_xdiff_and_reftable_with_libgit-v1 Pull-Request: https://github.com/git/git/pull/2065
-- gitgitgadget