build: silence duplicate -lobjc linker warning on Xcode 15+
Add -Wl,-no_warn_duplicate_libraries to the darwin cgo LDFLAGS and allow it through the cgo flag allowlist via CGO_LDFLAGS_ALLOW in the build scripts, so the ld-prime duplicate -lobjc note no longer clutters build output.
This commit is contained in:
@@ -5,6 +5,12 @@ package main
|
||||
/*
|
||||
#cgo CFLAGS: -x objective-c -fobjc-arc
|
||||
#cgo LDFLAGS: -framework AppKit
|
||||
// Silence the "ignoring duplicate libraries: '-lobjc'" note emitted by the
|
||||
// Xcode 15+ linker (ld-prime): cgo links -lobjc for our Objective-C code and
|
||||
// the Go darwin runtime pulls it in as well, which the new linker flags as a
|
||||
// duplicate. Suppressing it here keeps the build output clean; the flag is a
|
||||
// no-op on the legacy ld64 path.
|
||||
#cgo LDFLAGS: -Wl,-no_warn_duplicate_libraries
|
||||
#include <dispatch/dispatch.h>
|
||||
#import <AppKit/AppKit.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user