Skip to content

fix: duplicate symbol _ntlm_md4_digest with securetransport backend - #23

Merged
Parzival-3141 merged 1 commit into
allyourcodebase:mainfrom
aecsar:fix_duplicated_ntlm
Oct 23, 2026
Merged

Parzival-3141 merged 1 commit into
allyourcodebase:mainfrom
aecsar:fix_duplicated_ntlm

Conversation

@aecsar

@aecsar aecsar commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Building with zig 0.17.0 on macOS fails at link time:

error: duplicate symbol definition: _ntlm_md4_digest
note: defined by .../libntlmclient.a(crypt_builtin_md4.o)
note: defined by .../libntlmclient.a(crypt_commoncrypto.o)

build.zig compiles the ntlmclient static library from two lists:

  • tls-backend specific file (crypt_openssl.c, crypt_mbedtls.c, or crypt_commoncrypto.c).
  • ntlm_sources, which unconditionally contained crypt_builtin_md4.c.

crypt_commoncrypto.c already defines ntlm_md4_digest
(https://github.com/libgit2/libgit2/blob/42a89d7cc9374a19e72fa57011e5fe3a99c7b3bf/deps/ntlmclient/crypt_commoncrypto.c#L76),
and crypt_builtin_md4.c defines the same function (https://github.com/libgit2/libgit2/blob/42a89d7cc9374a19e72fa57011e5fe3a99c7b3bf/deps/ntlmclient/crypt_builtin_md4.c#L293).

On the securetransport backend
both objects end up in libntlmclient.a, so the symbol is defined twice.

Upstream libgit2's CMake only adds crypt_builtin_md4.c to the mbedtsl backend https://github.com/libgit2/libgit2/blob/42a89d7cc9374a19e72fa57011e5fe3a99c7b3bf/deps/ntlmclient/CMakeLists.txt#L34

I guess older zig version tolerated the duplicate.

@Parzival-3141

Copy link
Copy Markdown
Collaborator

CI failures seem to be unrelated. I'll test again after updating the repo and CI to 0.17.0.

@Parzival-3141

Parzival-3141 commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

The patch passes CI for 0.17.0 (the windows failure seems unrelated). Since this patch is technically version agnostic I'll merge it now before updating to 0.17.0.

@Parzival-3141
Parzival-3141 merged commit d3ae031 into allyourcodebase:main Oct 23, 2026
@aecsar
aecsar deleted the fix_duplicated_ntlm branch October 23, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants