From 779806dbf03d4307e7081be24ce3f018f8ed0c11 Mon Sep 17 00:00:00 2001 From: klzgrad Date: Thu, 6 Feb 2020 03:07:31 +0800 Subject: [PATCH] build: Add OpenWrt toolchain definitions --- src/build/toolchain/linux/BUILD.gn | 42 ++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/build/toolchain/linux/BUILD.gn b/src/build/toolchain/linux/BUILD.gn index fa8b17e9db..2e7913a4fa 100644 --- a/src/build/toolchain/linux/BUILD.gn +++ b/src/build/toolchain/linux/BUILD.gn @@ -21,6 +21,16 @@ clang_toolchain("clang_arm") { } } +clang_toolchain("clang_arm_openwrt") { + extra_cppflags = "--target=arm-openwrt-linux-muslgnueabi -D_LIBCPP_HAS_MUSL_LIBC -D__UCLIBC__" + extra_ldflags = "--target=arm-openwrt-linux-muslgnueabi" + extra_asmflags = "--target=arm-openwrt-linux-muslgnueabi" + toolchain_args = { + current_cpu = "arm" + current_os = "linux" + } +} + clang_toolchain("clang_arm64") { toolprefix = "aarch64-linux-gnu-" toolchain_args = { @@ -29,6 +39,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" + extra_asmflags = "--target=aarch64-openwrt-linux-musl" + toolchain_args = { + current_cpu = "arm64" + current_os = "linux" + } +} + gcc_toolchain("arm64") { toolprefix = "aarch64-linux-gnu-" @@ -128,6 +148,18 @@ clang_toolchain("clang_x64") { } } +clang_toolchain("clang_x64_openwrt") { + # Output linker map files for binary size analysis. + enable_linker_map = true + extra_cppflags = "--target=x86_64-openwrt-linux-musl -D_LIBCPP_HAS_MUSL_LIBC -D__UCLIBC__" + extra_ldflags = "--target=x86_64-openwrt-linux-musl" + + toolchain_args = { + current_cpu = "x64" + current_os = "linux" + } +} + clang_toolchain("clang_x64_v8_arm64") { toolchain_args = { current_cpu = "x64" @@ -178,6 +210,16 @@ clang_toolchain("clang_mipsel") { } } +clang_toolchain("clang_mipsel_openwrt") { + extra_cppflags = "--target=mipsel-openwrt-linux-musl -D_LIBCPP_HAS_MUSL_LIBC -D__UCLIBC__" + extra_ldflags = "--target=mipsel-openwrt-linux-musl" + + toolchain_args = { + current_cpu = "mipsel" + current_os = "linux" + } +} + clang_toolchain("clang_mips64el") { toolchain_args = { current_cpu = "mips64el"