Use clang as assembler to ensure preprocessing is done, and add assembler "target" flag.

(cherry picked from commit e873778561)
This commit is contained in:
bruvzg 2022-07-07 13:26:31 +03:00 committed by Rémi Verschelde
parent b7c9eb1a3c
commit c4885c8be8
2 changed files with 3 additions and 7 deletions

View file

@ -312,7 +312,7 @@ if webm_cpu_arm:
or env["platform"] == "x11" or env["platform"] == "x11"
or env["platform"] == "server" or env["platform"] == "server"
): ):
env_libvpx["ASFLAGS"] = "-mfpu=neon" env_libvpx["ASFLAGS"] += "-mfpu=neon"
elif env["platform"] == "uwp": elif env["platform"] == "uwp":
env_libvpx["AS"] = "armasm" env_libvpx["AS"] = "armasm"
env_libvpx["ASFLAGS"] = "" env_libvpx["ASFLAGS"] = ""

View file

@ -100,25 +100,22 @@ def configure(env):
if env["android_arch"] == "armv7": if env["android_arch"] == "armv7":
target_triple = "armv7a-linux-androideabi" target_triple = "armv7a-linux-androideabi"
bin_utils = "arm-linux-androideabi"
if env["android_neon"]: if env["android_neon"]:
env.extra_suffix = ".armv7.neon" + env.extra_suffix env.extra_suffix = ".armv7.neon" + env.extra_suffix
else: else:
env.extra_suffix = ".armv7" + env.extra_suffix env.extra_suffix = ".armv7" + env.extra_suffix
elif env["android_arch"] == "arm64v8": elif env["android_arch"] == "arm64v8":
target_triple = "aarch64-linux-android" target_triple = "aarch64-linux-android"
bin_utils = target_triple
env.extra_suffix = ".armv8" + env.extra_suffix env.extra_suffix = ".armv8" + env.extra_suffix
elif env["android_arch"] == "x86": elif env["android_arch"] == "x86":
target_triple = "i686-linux-android" target_triple = "i686-linux-android"
bin_utils = target_triple
env.extra_suffix = ".x86" + env.extra_suffix env.extra_suffix = ".x86" + env.extra_suffix
elif env["android_arch"] == "x86_64": elif env["android_arch"] == "x86_64":
target_triple = "x86_64-linux-android" target_triple = "x86_64-linux-android"
bin_utils = target_triple
env.extra_suffix = ".x86_64" + env.extra_suffix env.extra_suffix = ".x86_64" + env.extra_suffix
target_option = ["-target", target_triple + str(get_min_sdk_version(env["ndk_platform"]))] target_option = ["-target", target_triple + str(get_min_sdk_version(env["ndk_platform"]))]
env.Append(ASFLAGS=[target_option, "-c"])
env.Append(CCFLAGS=target_option) env.Append(CCFLAGS=target_option)
env.Append(LINKFLAGS=target_option) env.Append(LINKFLAGS=target_option)
@ -159,13 +156,12 @@ def configure(env):
toolchain_path = ndk_root + "/toolchains/llvm/prebuilt/" + host_subpath toolchain_path = ndk_root + "/toolchains/llvm/prebuilt/" + host_subpath
compiler_path = toolchain_path + "/bin" compiler_path = toolchain_path + "/bin"
bin_utils_path = toolchain_path + "/" + bin_utils + "/bin"
env["CC"] = compiler_path + "/clang" env["CC"] = compiler_path + "/clang"
env["CXX"] = compiler_path + "/clang++" env["CXX"] = compiler_path + "/clang++"
env["AR"] = compiler_path + "/llvm-ar" env["AR"] = compiler_path + "/llvm-ar"
env["RANLIB"] = compiler_path + "/llvm-ranlib" env["RANLIB"] = compiler_path + "/llvm-ranlib"
env["AS"] = bin_utils_path + "/as" env["AS"] = compiler_path + "/clang"
# Disable exceptions and rtti on non-tools (template) builds # Disable exceptions and rtti on non-tools (template) builds
if env["tools"]: if env["tools"]: