Skip to content

build: deduplicate Objective-C runtime linkage#220

Open
steipete wants to merge 1 commit into
Code-Hex:mainfrom
steipete:codex/dedupe-objc-linker-flags
Open

build: deduplicate Objective-C runtime linkage#220
steipete wants to merge 1 commit into
Code-Hex:mainfrom
steipete:codex/dedupe-objc-linker-flags

Conversation

@steipete

@steipete steipete commented Jul 4, 2026

Copy link
Copy Markdown

Summary

  • Remove redundant explicit -lobjc flags from Darwin cgo directives.
  • Keep all existing Foundation, Virtualization, and Cocoa framework links unchanged.
  • Rely on cgo/clang's Objective-C runtime linkage, which already contributes the required single runtime link.

This removes the Apple linker warning:

ld: warning: ignoring duplicate libraries: '-lobjc'

The warning was visible downstream because each Objective-C source file contributed another explicit -lobjc to the package link command.

Verification

  • go test -run '^$' . ./internal/objc (clean compile; warning absent)
  • go test -run '^$' ./...
  • go vet ./...
  • git diff --check

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.

1 participant