Skip to content

Commit 5c3c384

Browse files
committed
fix(NODE-7395): do not export mech_oid symbols
As described in the ticket, this fixes mongosh's build on x64 macOS with Node.js 24, even though we haven't fully investigated why that is the case. Making these variables `static` is a good idea anyway since they are not meant to be used by other compilation units or loaded from the kerberos addon. Without this patch, we receive: [2026/01/15 12:18:50.271] ld: warning: alignment (2) of atom '__ZN13node_kerberos15spnego_mech_oidE' is too small and may result in unaligned pointers [2026/01/15 12:18:50.271] ld: warning: alignment (2) of atom '__ZN13node_kerberos13krb5_mech_oidE' is too small and may result in unaligned pointers [2026/01/15 12:18:50.946] ld: warning: pointer not aligned at address 0x10945A92E ('node_kerberos::krb5_mech_oid' + 4 from /private/tmp/m/boxednode/<REDACTED:notary_signing_key_name>/node-v24.12.0/out/Release/kerberos.a(kerberos_unix.o)) [2026/01/15 12:18:50.946] ld: warning: pointer not aligned at address 0x10945A942 ('node_kerberos::spnego_mech_oid' + 4 from /private/tmp/m/boxednode/<REDACTED:notary_signing_key_name>/node-v24.12.0/out/Release/kerberos.a(kerberos_unix.o)) [2026/01/15 12:18:51.115] ld: unaligned pointer(s) for architecture x86_64 [2026/01/15 12:18:51.115] clang++: error: linker command failed with exit code 1 (use -v to see invocation)
1 parent 687aaf1 commit 5c3c384

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/unix/kerberos_unix.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ using namespace Napi;
1111
#define GSS_MECH_OID_SPNEGO 6
1212

1313
static char krb5_mech_oid_bytes[] = "\x2a\x86\x48\x86\xf7\x12\x01\x02\x02";
14-
gss_OID_desc krb5_mech_oid = {9, &krb5_mech_oid_bytes};
14+
static gss_OID_desc krb5_mech_oid = {9, &krb5_mech_oid_bytes};
1515

1616
static char spnego_mech_oid_bytes[] = "\x2b\x06\x01\x05\x05\x02";
17-
gss_OID_desc spnego_mech_oid = {6, &spnego_mech_oid_bytes};
17+
static gss_OID_desc spnego_mech_oid = {6, &spnego_mech_oid_bytes};
1818

1919
/// KerberosClient
2020
void KerberosClient::Step(const CallbackInfo& info) {

0 commit comments

Comments
 (0)