From 95e4816ccece9b274cb67029c6b3d0e57d30c3e0 Mon Sep 17 00:00:00 2001 From: James Nugent Date: Thu, 27 Jul 2017 17:16:27 -0500 Subject: [PATCH] disk: Remove -mmacosx-version-min from darwin+cgo The presence of the -mmacosx-version-min flag in disk_darwin_cgo.go makes it impossible to build the other cgo components on modern Mac OS X (10.12), since the object files with which they must link are not built with that flag. Errors present from Go Tip (1.9, effectively) in the form: ld: warning: object file (whatever.o) was built for newer OSX version (10.12) than being linked (10.10) This commit removes the minimum version flag, instead targeting the version of OS X on which a binary is compiled as the minimum. Without this, I believe (though have not verified it actually works) that the only way to build without without warnings/undefined behaviour if the OS X 10.10 headers and objects are installed and configured correctly. --- disk/disk_darwin_cgo.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/disk/disk_darwin_cgo.go b/disk/disk_darwin_cgo.go index 2f5e22b6..f75ac9b2 100644 --- a/disk/disk_darwin_cgo.go +++ b/disk/disk_darwin_cgo.go @@ -4,8 +4,7 @@ package disk /* -#cgo CFLAGS: -mmacosx-version-min=10.10 -DMACOSX_DEPLOYMENT_TARGET=10.10 -#cgo LDFLAGS: -mmacosx-version-min=10.10 -lobjc -framework Foundation -framework IOKit +#cgo LDFLAGS: -lobjc -framework Foundation -framework IOKit #include // ### enough?