From 387597a4a4fa816896a07215e8e099abd35d67c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 19 Nov 2020 14:41:47 +0100 Subject: [PATCH] OSX: Fix linking with osxcross for arm64 For some reason the `-target` option on the `LINKFLAGS` was causing a weird issue where osxcross' clang wrapper would attempt using the system `/bin/ld` instead of the osxcross version (which is Apple's `ld64`). The error message would be: ``` /bin/ld: unrecognized option '-dynamic' ``` Also removed from `CCFLAGS` for consistency, it seems to work fine with only `-mmacosx-version-min`. (cherry picked from commit dbbbb53927652f6ae49a6174eb8f49af5cacd1db) --- platform/osx/detect.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/osx/detect.py b/platform/osx/detect.py index c441fe201d5..26517e308e5 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -85,8 +85,8 @@ def configure(env): if env["arch"] == "arm64": print("Building for macOS 10.15+, platform arm64.") - env.Append(CCFLAGS=["-arch", "arm64", "-mmacosx-version-min=10.15", "-target", "arm64-apple-macos10.15"]) - env.Append(LINKFLAGS=["-arch", "arm64", "-mmacosx-version-min=10.15", "-target", "arm64-apple-macos10.15"]) + env.Append(CCFLAGS=["-arch", "arm64", "-mmacosx-version-min=10.15"]) + env.Append(LINKFLAGS=["-arch", "arm64", "-mmacosx-version-min=10.15"]) else: print("Building for macOS 10.9+, platform x86-64.") env.Append(CCFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.9"])