Skip to content

Commit 522ea8e

Browse files
dschogitster
authored andcommitted
osxkeychain: fix build with Rust
Without NO_RUST defined, the varint encoder/decoder lives in the RUST_LIB, which needs to be linked. Symptom: cc [... -o contrib/credential/osxkeychain/git-credential-osxkeychain [...] Undefined symbols for architecture x86_64: "_decode_varint", referenced from: _read_untracked_extension in libgit.a[x86_64][63](dir.o) _read_untracked_extension in libgit.a[x86_64][63](dir.o) _read_one_dir in libgit.a[x86_64][63](dir.o) _read_one_dir in libgit.a[x86_64][63](dir.o) _load_cache_entry_block in libgit.a[x86_64][174](read-cache.o) "_encode_varint", referenced from: _write_untracked_extension in libgit.a[x86_64][63](dir.o) _write_untracked_extension in libgit.a[x86_64][63](dir.o) _write_untracked_extension in libgit.a[x86_64][63](dir.o) _write_one_dir in libgit.a[x86_64][63](dir.o) _write_one_dir in libgit.a[x86_64][63](dir.o) _do_write_index in libgit.a[x86_64][174](read-cache.o) ld: symbol(s) not found for architecture x86_64 While it is curious why these functions are needed at all (osxkeychain does not read or write the index), the compile error is a real problem. Instead of trying to play games to add `GITLIBS` while filtering out `common-main.o`, replace the `$(LIB_FILE) $(EXTLIBS)` construct with the much shorter `$(LIBS)` construct that _already_ filters out `common-main.o` and adds the Rust library when needed. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 94f0577 commit 522ea8e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4084,7 +4084,7 @@ contrib/libgit-sys/libgitpub.a: $(LIBGIT_HIDDEN_EXPORT)
40844084

40854085
contrib/credential/osxkeychain/git-credential-osxkeychain: contrib/credential/osxkeychain/git-credential-osxkeychain.o $(LIB_FILE) GIT-LDFLAGS
40864086
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \
4087-
$(filter %.o,$^) $(LIB_FILE) $(EXTLIBS) -framework Security -framework CoreFoundation
4087+
$(filter %.o,$^) $(LIBS) -framework Security -framework CoreFoundation
40884088

40894089
contrib/credential/osxkeychain/git-credential-osxkeychain.o: contrib/credential/osxkeychain/git-credential-osxkeychain.c GIT-CFLAGS
40904090
$(QUIET_LINK)$(CC) -o $@ -c $(dep_args) $(compdb_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<

0 commit comments

Comments
 (0)