diff options
author | Jon Kunkee <jkunkee@microsoft.com> | 2018-11-15 01:27:42 -0800 |
---|---|---|
committer | Jon Kunkee <jkunkee@microsoft.com> | 2018-11-16 22:27:18 +0000 |
commit | 3a56c238ee82604b2d420d858f4edfa28af4e6eb (patch) | |
tree | a26223802b205a79cf6866820862b78f2077432c /build/make | |
parent | fa1e85b095d08d7a5408652c86dd50700114d36a (diff) | |
download | libvpx-3a56c238ee82604b2d420d858f4edfa28af4e6eb.tar libvpx-3a56c238ee82604b2d420d858f4edfa28af4e6eb.tar.gz libvpx-3a56c238ee82604b2d420d858f4edfa28af4e6eb.tar.bz2 libvpx-3a56c238ee82604b2d420d858f4edfa28af4e6eb.zip |
Work around ARM64 Windows SDK arm_neon.h quirk
Since the Windows SDK has an ARM32-only arm_neon.h, files including it
during ARM64 Windows builds need to be redirected to arm64_neon.h.
Instead of editing many files to include ARM64-Windows-specific ifdef
logic, this commit introduces an ARM64-Windows-specific version of
arm_neon.h that performs the needed redirection and lands earlier in
the header search path than the ARM32-only arm_neon.h.
Change-Id: Idc63947a238ca1bd0c479d8f4ad68950487947c6
Diffstat (limited to 'build/make')
-rw-r--r-- | build/make/Makefile | 1 | ||||
-rw-r--r-- | build/make/configure.sh | 33 |
2 files changed, 33 insertions, 1 deletions
diff --git a/build/make/Makefile b/build/make/Makefile index f6b3f0630..c070cd0e0 100644 --- a/build/make/Makefile +++ b/build/make/Makefile @@ -99,6 +99,7 @@ distclean: clean rm -f Makefile; \ rm -f config.log config.mk; \ rm -f vpx_config.[hc] vpx_config.asm; \ + rm -f arm_neon.h; \ else \ rm -f $(target)-$(TOOLCHAIN).mk; \ fi diff --git a/build/make/configure.sh b/build/make/configure.sh index 179359e5d..262204053 100644 --- a/build/make/configure.sh +++ b/build/make/configure.sh @@ -546,6 +546,24 @@ EOF cmp "$1" ${TMP_H} >/dev/null 2>&1 || mv ${TMP_H} "$1" } +write_win_arm64_neon_h_workaround() { + print_webm_license ${TMP_H} "/*" " */" + cat >> ${TMP_H} << EOF +/* This file automatically generated by configure. Do not edit! */ +#ifndef VPX_WIN_ARM_NEON_H_WORKAROUND +#define VPX_WIN_ARM_NEON_H_WORKAROUND +/* The Windows SDK has arm_neon.h, but unlike on other platforms it is + * ARM32-only. ARM64 NEON support is provided by arm64_neon.h, a proper + * superset of arm_neon.h. Work around this by providing a more local + * arm_neon.h that simply #includes arm64_neon.h. + */ +#include <arm64_neon.h> +#endif /* VPX_WIN_ARM_NEON_H_WORKAROUND */ +EOF + mkdir -p `dirname "$1"` + cmp "$1" ${TMP_H} >/dev/null 2>&1 || mv ${TMP_H} "$1" +} + process_common_cmdline() { for opt in "$@"; do optval="${opt#*=}" @@ -1027,12 +1045,25 @@ EOF disable_feature examples disable_feature tools fi - #else + else # Windows 10 on ARM, on the other hand, has full Windows SDK support # for building Win32 ARM64 applications in addition to ARM64 # Windows Store apps. It is the only 64-bit ARM ABI that # Windows supports, so it is the default definition of 'win64'. # ARM64 build support officially shipped in Visual Studio 15.9.0. + + # Because the ARM64 Windows SDK's arm_neon.h is ARM32-specific + # while LLVM's is not, probe its validity. + if enabled neon; then + if [ -n "${CC}" ]; then + check_header arm_neon.h || check_header arm64_neon.h && \ + enable_feature win_arm64_neon_h_workaround + else + # If a probe is not possible, assume this is the pure Windows + # SDK and so the workaround is necessary. + enable_feature win_arm64_neon_h_workaround + fi + fi fi ;; rvct) |