Skip to content

Commit a44a87f

Browse files
cmagliesilvanocerza
authored andcommitted
Fixed macOS_64bit build
1 parent 620f769 commit a44a87f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

DistTasks.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,20 @@ tasks:
229229
PLATFORM_DIR: "{{ .PROJECT_NAME }}_osx_darwin_amd64"
230230
BUILD_COMMAND: "go build -o {{ .DIST_DIR }}/{{ .PLATFORM_DIR }}/{{ .PROJECT_NAME }} {{ .LDFLAGS }}"
231231
BUILD_PLATFORM: "darwin/amd64"
232-
CONTAINER_TAG: "{{ .GO_VERSION }}-darwin"
232+
# We are experiencing the following error with macOS_64bit build:
233+
#
234+
# Undefined symbols for architecture x86_64:
235+
# "_clock_gettime", referenced from:
236+
# _runtime.walltime_trampoline in go.o
237+
# ld: symbol(s) not found for architecture x86_64
238+
# clang: error: linker command failed with exit code 1 (use -v to see invocation)
239+
#
240+
# The reason seems that go 1.16.x use a macos API which is available since 10.12
241+
# https://github.com/techknowlogick/xgo/issues/100#issuecomment-780894190
242+
#
243+
# To compile it we need an SDK >=10.12 so we use the debian10 based container that
244+
# has the SDK 10.14 installed.
245+
CONTAINER_TAG: "{{ .GO_VERSION }}-darwin-debian10"
233246
PACKAGE_PLATFORM: "macOS_64bit"
234247
PACKAGE_NAME: "{{ .PROJECT_NAME }}_{{ .VERSION }}_{{ .PACKAGE_PLATFORM }}.tar.gz"
235248

0 commit comments

Comments
 (0)