Merge pull request #62587 from bruvzg/fix_m1_build

This commit is contained in:
Rémi Verschelde 2022-07-01 12:48:11 +02:00 committed by GitHub
commit 03765b2985
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View File

@ -129,9 +129,8 @@ if env["builtin_zstd"]:
"decompress/zstd_decompress_block.c", "decompress/zstd_decompress_block.c",
"decompress/zstd_decompress.c", "decompress/zstd_decompress.c",
] ]
if env["platform"] in ["android", "linuxbsd", "osx"]: if env["platform"] in ["android", "iphone", "linuxbsd", "osx"]:
# Match platforms with ZSTD_ASM_SUPPORTED in common/portability_macros.h # Match platforms with ZSTD_ASM_SUPPORTED in common/portability_macros.h
# iOS x86_64 should be supported in theory, but it fails arm64 build, seems to use host S_compiler.
thirdparty_zstd_sources.append("decompress/huf_decompress_amd64.S") thirdparty_zstd_sources.append("decompress/huf_decompress_amd64.S")
thirdparty_zstd_sources = [thirdparty_zstd_dir + file for file in thirdparty_zstd_sources] thirdparty_zstd_sources = [thirdparty_zstd_dir + file for file in thirdparty_zstd_sources]

View File

@ -98,10 +98,12 @@ def configure(env):
if env["ios_simulator"]: if env["ios_simulator"]:
detect_darwin_sdk_path("iphonesimulator", env) detect_darwin_sdk_path("iphonesimulator", env)
env.Append(ASFLAGS=["-mios-simulator-version-min=13.0"])
env.Append(CCFLAGS=["-mios-simulator-version-min=13.0"]) env.Append(CCFLAGS=["-mios-simulator-version-min=13.0"])
env.extra_suffix = ".simulator" + env.extra_suffix env.extra_suffix = ".simulator" + env.extra_suffix
else: else:
detect_darwin_sdk_path("iphone", env) detect_darwin_sdk_path("iphone", env)
env.Append(ASFLAGS=["-miphoneos-version-min=11.0"])
env.Append(CCFLAGS=["-miphoneos-version-min=11.0"]) env.Append(CCFLAGS=["-miphoneos-version-min=11.0"])
if env["arch"] == "x86_64": if env["arch"] == "x86_64":
@ -113,6 +115,7 @@ def configure(env):
" -fasm-blocks -isysroot $IPHONESDK" " -fasm-blocks -isysroot $IPHONESDK"
).split() ).split()
) )
env.Append(ASFLAGS=["-arch", "x86_64"])
elif env["arch"] == "arm64": elif env["arch"] == "arm64":
env.Append( env.Append(
CCFLAGS=( CCFLAGS=(
@ -122,6 +125,7 @@ def configure(env):
" -isysroot $IPHONESDK".split() " -isysroot $IPHONESDK".split()
) )
) )
env.Append(ASFLAGS=["-arch", "arm64"])
env.Append(CPPDEFINES=["NEED_LONG_INT"]) env.Append(CPPDEFINES=["NEED_LONG_INT"])
# Disable exceptions on non-tools (template) builds # Disable exceptions on non-tools (template) builds

View File

@ -79,10 +79,12 @@ def configure(env):
if env["arch"] == "arm64": if env["arch"] == "arm64":
print("Building for macOS 11.0+, platform arm64.") print("Building for macOS 11.0+, platform arm64.")
env.Append(ASFLAGS=["-arch", "arm64", "-mmacosx-version-min=11.0"])
env.Append(CCFLAGS=["-arch", "arm64", "-mmacosx-version-min=11.0"]) env.Append(CCFLAGS=["-arch", "arm64", "-mmacosx-version-min=11.0"])
env.Append(LINKFLAGS=["-arch", "arm64", "-mmacosx-version-min=11.0"]) env.Append(LINKFLAGS=["-arch", "arm64", "-mmacosx-version-min=11.0"])
else: else:
print("Building for macOS 10.12+, platform x86_64.") print("Building for macOS 10.12+, platform x86_64.")
env.Append(ASFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.12"])
env.Append(CCFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.12"]) env.Append(CCFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.12"])
env.Append(LINKFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.12"]) env.Append(LINKFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.12"])