From 4a4ae4c2640041ed6d80d93edf9f82559b770dbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Wed, 25 Jan 2023 14:59:54 +0100 Subject: [PATCH] allow building shared library on M1 Macs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Seems like this wasn't supported in the past, but should work now. Signed-off-by: Jakub SokoĊ‚owski --- Makefile | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index ec715cef4..6fcd6d5c4 100644 --- a/Makefile +++ b/Makefile @@ -17,14 +17,10 @@ endif ifeq ($(detected_OS),Darwin) GOBIN_SHARED_LIB_EXT := dylib - # Building on M1 is still not supported, so in the meantime we crosscompile by default to amd64 - ifeq ("$(shell sysctl -nq hw.optional.arm64)","1") - FORCE_ARCH ?= amd64 - GOBIN_SHARED_LIB_CFLAGS=CGO_ENABLED=1 GOOS=darwin GOARCH=$(FORCE_ARCH) - endif + GOBIN_SHARED_LIB_CFLAGS := CGO_ENABLED=1 GOOS=darwin else ifeq ($(detected_OS),Windows) - GOBIN_SHARED_LIB_CGO_LDFLAGS := CGO_LDFLAGS="" GOBIN_SHARED_LIB_EXT := dll + GOBIN_SHARED_LIB_CGO_LDFLAGS := CGO_LDFLAGS="" else GOBIN_SHARED_LIB_EXT := so GOBIN_SHARED_LIB_CGO_LDFLAGS := CGO_LDFLAGS="-Wl,-soname,libstatus.so.0"