Bug 1516513 - Part 1. Add linux/aarch64 config to libvpx. r=jya
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Mon, 21 Jan 2019 04:55:02 +0000
changeset 454640 6357f5d3428de6bc2d91971b6d950d9f7564e701
parent 454632 f1694d9e640bd1768178e121a5d6fb73565bd32c
child 454641 0c399483d8198a9080712efd742ff510b2fd0b01
push id35409
push userrmaries@mozilla.com
push dateMon, 21 Jan 2019 17:48:45 +0000
treeherdermozilla-central@4977d02e1191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1516513
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1516513 - Part 1. Add linux/aarch64 config to libvpx. r=jya To use NEON on Linux/aarch64 and Android/aarch64, I would like to add it to libvpx. libvpx has a configuration as arm64-linux-gcc. Differential Revision: https://phabricator.services.mozilla.com/D15400
media/libvpx/generate_sources_mozbuild.sh
media/libvpx/moz.build
--- a/media/libvpx/generate_sources_mozbuild.sh
+++ b/media/libvpx/generate_sources_mozbuild.sh
@@ -194,27 +194,29 @@ cp -R $LIBVPX_SRC_DIR $TEMP_DIR
 cd $TEMP_DIR
 
 echo "Generate config files."
 all_platforms="--enable-external-build --disable-examples --disable-install-docs --disable-unit-tests"
 all_platforms="${all_platforms} --enable-multi-res-encoding --size-limit=8192x4608 --enable-pic"
 all_platforms="${all_platforms} --disable-avx512"
 x86_platforms="--enable-postproc --enable-vp9-postproc --as=yasm"
 arm_platforms="--enable-runtime-cpu-detect --enable-realtime-only"
+arm64_platforms="--enable-realtime-only"
 
 gen_config_files linux/x64 "--target=x86_64-linux-gcc ${all_platforms} ${x86_platforms}"
 gen_config_files linux/ia32 "--target=x86-linux-gcc ${all_platforms} ${x86_platforms}"
 gen_config_files mac/x64 "--target=x86_64-darwin9-gcc ${all_platforms} ${x86_platforms}"
 gen_config_files mac/ia32 "--target=x86-darwin9-gcc ${all_platforms} ${x86_platforms}"
 gen_config_files win/x64 "--target=x86_64-win64-vs12 ${all_platforms} ${x86_platforms}"
 gen_config_files win/ia32 "--target=x86-win32-gcc ${all_platforms} ${x86_platforms}"
 gen_config_files win/mingw32 "--target=x86-win32-gcc ${all_platforms} ${x86_platforms}"
 gen_config_files win/aarch64 "--target=aarch64-win64-vs12 ${all_platforms}"
 
 gen_config_files linux/arm "--target=armv7-linux-gcc ${all_platforms} ${arm_platforms}"
+gen_config_files linux/arm64 "--target=arm64-linux-gcc ${all_platforms} ${arm64_platforms}"
 
 gen_config_files generic "--target=generic-gnu ${all_platforms}"
 
 # vpx doesn't know if mingw32 has winpthreads or not, and doesn't try to detect it.
 sed -i 's/HAVE_PTHREAD_H 0/HAVE_PTHREAD_H 1/' $BASE_DIR/$LIBVPX_CONFIG_DIR/win/mingw32/vpx_config.asm
 sed -i 's/HAVE_PTHREAD_H 0/HAVE_PTHREAD_H 1/' $BASE_DIR/$LIBVPX_CONFIG_DIR/win/mingw32/vpx_config.h
 
 echo "Remove temporary directory."
@@ -233,16 +235,17 @@ gen_rtcd_header mac/x64 x86_64
 gen_rtcd_header mac/ia32 x86
 gen_rtcd_header win/x64 x86_64
 gen_rtcd_header win/ia32 x86
 gen_rtcd_header win/mingw32 x86
 gen_rtcd_header win/aarch64 aarch64
 
 
 gen_rtcd_header linux/arm armv7
+gen_rtcd_header linux/arm64 arm64
 
 gen_rtcd_header generic generic
 
 echo "Prepare Makefile."
 ./configure --target=generic-gnu > /dev/null
 make_clean
 
 # Remove existing source files.
@@ -266,16 +269,22 @@ make libvpx_srcs.txt target=libs $config
 convert_srcs_to_project_files libvpx_srcs.txt IA32
 
 echo "Generate ARM source list."
 config=$(print_config linux/arm)
 make_clean
 make libvpx_srcs.txt target=libs $config > /dev/null
 convert_srcs_to_project_files libvpx_srcs.txt ARM
 
+echo "Generate ARM64 source list."
+config=$(print_config linux/arm64)
+make_clean
+make libvpx_srcs.txt target=libs $config > /dev/null
+convert_srcs_to_project_files libvpx_srcs.txt ARM64
+
 echo "Generate generic source list."
 config=$(print_config generic)
 make_clean
 make libvpx_srcs.txt target=libs $config > /dev/null
 convert_srcs_to_project_files libvpx_srcs.txt GENERIC
 
 echo "}" >> $BASE_DIR/sources.mozbuild
 
--- a/media/libvpx/moz.build
+++ b/media/libvpx/moz.build
@@ -76,16 +76,21 @@ elif CONFIG['CPU_ARCH'] == 'arm':
             '-no-integrated-as',
         ]
 elif CONFIG['CPU_ARCH'] == 'aarch64' and CONFIG['OS_TARGET'] == 'WINNT':
     # Generic C-only configuration
     EXPORTS.vpx += files['GENERIC_EXPORTS']
     SOURCES += files['GENERIC_SOURCES']
     ASFLAGS += [ '-I%s/media/libvpx/config/win/aarch64/' % TOPSRCDIR ]
     LOCAL_INCLUDES += [ '/media/libvpx/config/win/aarch64/' ]
+elif CONFIG['CPU_ARCH'] == 'aarch64':
+    EXPORTS.vpx += files['ARM64_EXPORTS']
+    SOURCES += files['ARM64_SOURCES']
+    ASFLAGS += [ '-I%s/media/libvpx/config/linux/arm64/' % TOPSRCDIR ]
+    LOCAL_INCLUDES += [ '/media/libvpx/config/linux/arm64/' ]
 else:
     # Generic C-only configuration
     EXPORTS.vpx += files['GENERIC_EXPORTS']
     SOURCES += files['GENERIC_SOURCES']
     ASFLAGS += [ '-I%s/media/libvpx/config/generic/' % TOPSRCDIR ]
     LOCAL_INCLUDES += [ '/media/libvpx/config/generic/' ]
 
 # We allow warnings for third-party code that can be updated from upstream.