Skip to content

Commit 1db7040

Browse files
committed
fix: correct dylib install name after creating universal binary
After lipo combines arm64 and amd64 dylibs, the resulting universal binary inherits the install name from the first input (nhp-agent-arm64.dylib). Use install_name_tool -id to set the correct install name (nhp-agent.dylib).
1 parent 6b87cd2 commit 1db7040

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ build-sdk-macos:
8080
@# Combine into universal binary using lipo
8181
@echo "[StealthDNS] Creating universal binary..."
8282
@lipo -create -output sdk/nhp-agent.dylib sdk/nhp-agent-arm64.dylib sdk/nhp-agent-amd64.dylib
83+
@# Fix the install name (lipo preserves the first input's install name which is nhp-agent-arm64.dylib)
84+
@install_name_tool -id nhp-agent.dylib sdk/nhp-agent.dylib
8385
@rm -f sdk/nhp-agent-arm64.dylib sdk/nhp-agent-amd64.dylib sdk/nhp-agent-arm64.h sdk/nhp-agent-amd64.h
8486
@echo "[StealthDNS] macOS SDK (universal) built successfully!"
8587
@cd $(OPENNHP_DIR)/nhp && git restore go.mod go.sum 2>/dev/null || git checkout go.mod go.sum 2>/dev/null || true

0 commit comments

Comments
 (0)