mirror of https://github.com/EdgeVPNio/evio.git
parent
f83b47801d
commit
ee68f8a632
|
@ -357,7 +357,7 @@ config("compiler") {
|
|||
asmflags += cflags_c
|
||||
}
|
||||
|
||||
if (is_linux && is_clang && target_cpu == "x64"){
|
||||
if (is_linux && is_clang) {
|
||||
defines += [
|
||||
# "USE_GLIB=1",
|
||||
# "USE_NSS_CERTS=1",
|
||||
|
@ -382,20 +382,18 @@ config("compiler") {
|
|||
]
|
||||
cflags += [
|
||||
"--param=ssp-buffer-size=4",
|
||||
"-funwind-tables",
|
||||
#"-funwind-tables",
|
||||
"-fmerge-all-constants",
|
||||
"-fcrash-diagnostics-dir=../../tools/clang/crashreports",
|
||||
#"-fcrash-diagnostics-dir=../../tools/clang/crashreports",
|
||||
"-Xclang",
|
||||
"-mllvm",
|
||||
"-Xclang",
|
||||
"-instcombine-lower-dbg-declare=0",
|
||||
"-fcomplete-member-pointers",
|
||||
"-Wno-builtin-macro-redefined",
|
||||
|
||||
#"-Wno-builtin-macro-redefined",
|
||||
"-Xclang",
|
||||
"-fdebug-compilation-dir",
|
||||
"-Xclang",
|
||||
|
||||
"-no-canonical-prefixes",
|
||||
"-Wall",
|
||||
"-Wextra",
|
||||
|
@ -431,10 +429,16 @@ config("compiler") {
|
|||
]
|
||||
ldflags += ["-rdynamic"]
|
||||
ldflags += ["-nostdlib++"]
|
||||
|
||||
if (target_cpu == "x64"){
|
||||
ldflags += ["-L../../../../external/debian_sid_amd64-sysroot/lib/x86_64-linux-gnu"]
|
||||
ldflags += ["-L../../../../external/debian_sid_amd64-sysroot/usr/lib/x86_64-linux-gnu"]
|
||||
}
|
||||
|
||||
if (target_cpu == "arm"){
|
||||
ldflags += ["-L../../../../external/debian_sid_arm-sysroot/lib/arm-linux-gnueabihf"]
|
||||
ldflags += ["-L../../../../external/debian_sid_arm-sysroot/usr/lib/arm-linux-gnueabihf"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
config("extra_flags") {
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
import("//build/config/sanitizers/sanitizers.gni")
|
||||
import("//build/toolchain/cc_wrapper.gni")
|
||||
import("//build/toolchain/toolchain.gni")
|
||||
import("//build/toolchain/clang.gni")
|
||||
|
||||
# This template defines a toolchain for something that works like gcc
|
||||
# (including clang).
|
||||
|
@ -459,3 +460,37 @@ template("gcc_toolchain") {
|
|||
forward_variables_from(invoker, [ "deps" ])
|
||||
}
|
||||
}
|
||||
|
||||
template("clang_toolchain") {
|
||||
if (defined(invoker.toolprefix)) {
|
||||
toolprefix = invoker.toolprefix
|
||||
} else {
|
||||
toolprefix = ""
|
||||
}
|
||||
|
||||
gcc_toolchain(target_name) {
|
||||
prefix = rebase_path("$clang_base_path", root_build_dir)
|
||||
cc = "$prefix/clang"
|
||||
cxx = "$prefix/clang++"
|
||||
ld = cxx
|
||||
readelf = "${toolprefix}readelf"
|
||||
ar = "${prefix}/llvm-ar"
|
||||
nm = "${toolprefix}nm"
|
||||
|
||||
forward_variables_from(invoker,
|
||||
[
|
||||
"strip",
|
||||
"default_shlib_subdir",
|
||||
"enable_linker_map",
|
||||
"use_unstripped_as_runtime_outputs",
|
||||
])
|
||||
|
||||
toolchain_args = {
|
||||
if (defined(invoker.toolchain_args)) {
|
||||
forward_variables_from(invoker.toolchain_args, "*")
|
||||
}
|
||||
is_clang = true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,22 @@
|
|||
import("//build/toolchain/gcc_toolchain.gni")
|
||||
import("//build/toolchain/posix/settings.gni")
|
||||
|
||||
clang_toolchain("clang_arm") {
|
||||
toolprefix = "arm-linux-gnueabihf-"
|
||||
toolchain_args = {
|
||||
current_cpu = "arm"
|
||||
current_os = target_os
|
||||
}
|
||||
}
|
||||
|
||||
clang_toolchain("clang_arm64") {
|
||||
toolprefix = "aarch64-linux-gnu-"
|
||||
toolchain_args = {
|
||||
current_cpu = "arm64"
|
||||
current_os = "linux"
|
||||
}
|
||||
}
|
||||
|
||||
gcc_toolchain("clang_x86") {
|
||||
cc = clang_cc
|
||||
cxx = clang_cxx
|
||||
|
@ -29,7 +45,7 @@ gcc_toolchain("x86") {
|
|||
toolchain_args = {
|
||||
current_cpu = "x86"
|
||||
current_os = target_os
|
||||
is_clang = false
|
||||
is_clang = true
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -61,66 +77,38 @@ gcc_toolchain("x64") {
|
|||
toolchain_args = {
|
||||
current_cpu = "x64"
|
||||
current_os = target_os
|
||||
is_clang = false
|
||||
is_clang = true
|
||||
}
|
||||
}
|
||||
|
||||
gcc_toolchain("arm") {
|
||||
cc = gcc_cc
|
||||
cxx = gcc_cxx
|
||||
ld = cxx
|
||||
cc = arm_cc
|
||||
cxx = arm_cxx
|
||||
ar = arm_ar
|
||||
|
||||
readelf = readelf
|
||||
ar = ar
|
||||
nm = nm
|
||||
ld = cxx
|
||||
readelf = arm_readelf
|
||||
nm = arm_nm
|
||||
|
||||
toolchain_args = {
|
||||
current_cpu = "arm"
|
||||
current_os = target_os
|
||||
is_clang = false
|
||||
is_clang = true
|
||||
}
|
||||
}
|
||||
|
||||
gcc_toolchain("arm64") {
|
||||
cc = gcc_cc
|
||||
cxx = gcc_cxx
|
||||
ld = cxx
|
||||
cc = arm64_cc
|
||||
cxx = arm64_cxx
|
||||
ar = arm64_ar
|
||||
|
||||
readelf = readelf
|
||||
ar = ar
|
||||
nm = nm
|
||||
ld = cxx
|
||||
readelf = arm64_readelf
|
||||
nm = arm64_nm
|
||||
|
||||
toolchain_args = {
|
||||
current_cpu = "arm64"
|
||||
current_os = target_os
|
||||
is_clang = false
|
||||
}
|
||||
}
|
||||
|
||||
gcc_toolchain("clang_arm") {
|
||||
cc = clang_cc
|
||||
cxx = clang_cxx
|
||||
ld = cxx
|
||||
|
||||
readelf = readelf
|
||||
ar = ar
|
||||
nm = nm
|
||||
toolchain_args = {
|
||||
current_cpu = "arm"
|
||||
current_os = target_os
|
||||
}
|
||||
}
|
||||
|
||||
gcc_toolchain("clang_arm64") {
|
||||
cc = clang_cc
|
||||
cxx = clang_cxx
|
||||
ld = cxx
|
||||
|
||||
readelf = readelf
|
||||
ar = ar
|
||||
nm = nm
|
||||
toolchain_args = {
|
||||
current_cpu = "arm64"
|
||||
current_os = "linux"
|
||||
is_clang = true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,21 @@ declare_args() {
|
|||
|
||||
# Path of the 'nm' utility.
|
||||
nm = "nm"
|
||||
|
||||
arm64_toolprefix = "aarch64-linux-gnu-"
|
||||
arm64_cc = "aarch64-linux-gnu-gcc"
|
||||
arm64_cxx = "aarch64-linux-gnu-g++"
|
||||
arm64_ar = "aarch64-linux-gnu-ar"
|
||||
arm64_readelf = "aarch64-linux-gnu-readelf"
|
||||
arm64_nm = "aarch64-linux-gnu-nm"
|
||||
|
||||
arm_toolprefix = "arm-linux-gnueabihf-"
|
||||
arm_cc = "arm-linux-gnueabihf-gcc"
|
||||
arm_cxx = "arm-linux-gnueabihf-g++"
|
||||
arm_ar = "arm-linux-gnueabihf-ar"
|
||||
arm_readelf = "arm-linux-gnueabihf-readelf"
|
||||
arm_nm = "arm-linux-gnueabihf-nm"
|
||||
|
||||
}
|
||||
|
||||
if (is_clang && clang_cc == 0) {
|
||||
|
|
Loading…
Reference in New Issue