From 0b3ef999a86605ba102b153d03cf2d28e83708eb Mon Sep 17 00:00:00 2001 From: klzgrad Date: Sat, 7 Mar 2020 14:25:26 +0800 Subject: [PATCH] Add OpenWrt arm64 build --- .travis.yml | 8 ++++++++ src/build/toolchain/linux/BUILD.gn | 10 ++++++++++ src/get-openwrt.sh | 4 ++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 83fdd897fb..ffce7f20aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,6 +39,14 @@ matrix: use_allocator="none" use_allocator_shim=false custom_toolchain="//build/toolchain/linux:clang_x64_openwrt"' OPENWRT_FLAGS='arch=x86_64 release=19.07.1 gcc_ver=7.5.0 target=x86 subtarget=64' + - name: "openwrt-arm64" + os: linux + dist: bionic + env: EXTRA_FLAGS=' + target_cpu="arm64" + use_allocator="none" use_allocator_shim=false + custom_toolchain="//build/toolchain/linux:clang_arm64_openwrt"' + OPENWRT_FLAGS='arch=aarch64 release=19.07.1 gcc_ver=7.5.0 target=armvirt subtarget=64' - name: "osx" os: osx osx_image: xcode10.2 diff --git a/src/build/toolchain/linux/BUILD.gn b/src/build/toolchain/linux/BUILD.gn index 75376f5f49..a73b279c1a 100644 --- a/src/build/toolchain/linux/BUILD.gn +++ b/src/build/toolchain/linux/BUILD.gn @@ -29,6 +29,16 @@ clang_toolchain("clang_arm64") { } } +clang_toolchain("clang_arm64_openwrt") { + extra_cppflags = "--target=aarch64-openwrt-linux-musl -D_LIBCPP_HAS_MUSL_LIBC -D__UCLIBC__" + extra_ldflags = "--target=aarch64-openwrt-linux-musl" + toolprefix = "aarch64-linux-gnu-" + toolchain_args = { + current_cpu = "arm64" + current_os = "linux" + } +} + gcc_toolchain("arm64") { toolprefix = "aarch64-linux-gnu-" diff --git a/src/get-openwrt.sh b/src/get-openwrt.sh index 0ce461c018..4378e7bc38 100755 --- a/src/get-openwrt.sh +++ b/src/get-openwrt.sh @@ -23,8 +23,8 @@ for flag in ALL_NONSHARED ALL_KMODS ALL SIGNED_PACKAGES; do done make oldconfig make -full_root=staging_dir/toolchain-${arch}_gcc-${gcc_ver}_musl -cp -r staging_dir/target-${arch}_musl/usr $full_root +full_root=staging_dir/toolchain-*_gcc-${gcc_ver}_musl +cp -r staging_dir/target-*_musl/usr $full_root echo ' ./include ./lib/*.o