1 Star 0 Fork 116

仇玉加/third_party_FreeBSD

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
BUILD.gn 4.11 KB
一键复制 编辑 原始数据 按行查看 历史
wenyu 提交于 2024-07-11 06:22 . 适配linux arm host OpenHarmony编译
#
# Copyright (c) 2024 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import("//build/ohos.gni")
import("FreeBSD.gni")
config("free_bsd_config") {
include_dirs = [ "//third_party/FreeBSD" ]
}
ohos_static_library("libfreebsd_static") {
output_name = "libfreebsd_static"
sources = [ "lib/libc/gen/fts.c" ]
if (use_libfuzzer && !is_mac) {
cflags = []
} else {
cflags = [
"-fno-emulated-tls",
"-fno-lto",
"-fno-whole-program-vtables",
]
cflags += [
"-D_GNU_SOURCE",
"-DHAVE_REALLOCARRAY",
"-w",
]
}
if (host_cpu == "arm64" && host_os == "linux") {
cflags += [
"-DWITH_FREEBSD"
]
}
public_configs = [ ":free_bsd_config" ]
}
if (is_standard_system) {
static_library("ld128_static") {
sources = [
"lib/msun/ld128/e_lgammal_r.c",
"lib/msun/ld128/e_powl.c",
"lib/msun/ld128/k_cosl.c",
"lib/msun/ld128/k_sinl.c",
"lib/msun/ld128/s_erfl.c",
"lib/msun/ld128/s_expl.c",
"lib/msun/ld128/s_logl.c",
"lib/msun/src/e_acoshl.c",
"lib/msun/src/e_coshl.c",
"lib/msun/src/e_lgammal.c",
"lib/msun/src/e_sinhl.c",
"lib/msun/src/s_asinhl.c",
"lib/msun/src/s_tanhl.c",
]
defines = [ "LD128_ENABLE" ]
include_dirs = [
"//third_party/FreeBSD/lib/msun/ld128",
"//third_party/FreeBSD/lib/msun/src",
"//third_party/FreeBSD/lib/libc/include",
"//third_party/FreeBSD/sys",
]
configs -= build_inherited_configs
configs += [ "//build/config/components/musl:soft_musl_config" ]
cflags = [
"-mllvm",
"-instcombine-max-iterations=0",
"-ffp-contract=fast",
"-O3",
"-fPIC",
"-fstack-protector-strong",
]
}
freebsd_files = [
"contrib/gdtoa/strtod.c",
"contrib/gdtoa/gethex.c",
"contrib/gdtoa/smisc.c",
"contrib/gdtoa/misc.c",
"contrib/gdtoa/strtord.c",
"contrib/gdtoa/hexnan.c",
"contrib/gdtoa/gmisc.c",
"contrib/gdtoa/hd_init.c",
"contrib/gdtoa/strtodg.c",
"contrib/gdtoa/ulp.c",
"contrib/gdtoa/strtof.c",
"contrib/gdtoa/sum.c",
"lib/libc/gdtoa/glue.c",
"lib/libc/stdio/parsefloat.c",
]
static_library("libc_static") {
sources = [
"contrib/tcp_wrappers/strcasecmp.c",
"lib/libc/gen/arc4random.c",
"lib/libc/gen/arc4random_uniform.c",
"lib/libc/stdlib/qsort.c",
"lib/libc/stdlib/strtoimax.c",
"lib/libc/stdlib/strtoul.c",
"lib/libc/stdlib/strtoumax.c",
]
if (!is_llvm_build) {
sources += [ "contrib/libexecinfo/unwind.c" ]
}
if (musl_arch == "arm") {
sources += freebsd_files
} else if (musl_arch == "aarch64") {
sources += [ "lib/msun/src/s_frexpl.c" ]
if (!defined(ARM_FEATURE_SVE) && !defined(ARM_FEATURE_MTE)) {
sources += freebsd_files
}
} else {
not_needed([ "freebsd_files" ])
}
cflags = [
"-O3",
"-fPIC",
"-fstack-protector-strong",
]
if (!(use_libfuzzer || is_mac || is_asan || use_clang_coverage)) {
cflags += [ "-flto" ]
}
if (!defined(include_dirs)) {
include_dirs = []
}
if (musl_arch == "aarch64") {
include_dirs += [ "//third_party/FreeBSD/lib/libc/aarch64" ]
} else if (musl_arch == "arm") {
include_dirs += [ "//third_party/FreeBSD/lib/libc/arm" ]
}
include_dirs += [ "//third_party/FreeBSD/lib/libc/include" ]
include_dirs += [ "//third_party/FreeBSD/contrib/libexecinfo" ]
include_dirs += [ "//third_party/FreeBSD/crypto/openssh/openbsd-compat" ]
configs -= build_inherited_configs
configs += [ "//build/config/components/musl:soft_musl_config" ]
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/qiu_yu_jia/third_party_FreeBSD.git
git@gitee.com:qiu_yu_jia/third_party_FreeBSD.git
qiu_yu_jia
third_party_FreeBSD
third_party_FreeBSD
master

搜索帮助