Merge pull request !785 from fangting/B
This commit is contained in:
openharmony_ci 2024-08-07 20:54:10 +00:00 committed by Gitee
commit a825641095
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
9 changed files with 734 additions and 433 deletions

View File

@ -19,8 +19,22 @@ config("gtest_private_config") {
include_dirs = [ "$googletest_dir" ] include_dirs = [ "$googletest_dir" ]
} }
config("gtest_private_config_rtti") {
visibility = [ ":*" ]
include_dirs = [ "googletest" ]
cflags = [ "-frtti" ]
cflags_objcc = [ "-frtti" ]
cflags_cc = [ "-frtti" ]
}
config("gtest_config") { config("gtest_config") {
include_dirs = [ "$googletest_dir/include" ] include_dirs = [ "$googletest_dir/include" ]
cflags_cc = [
"-std=c++17",
"-Wno-float-equal",
"-Wno-sign-compare",
"-Wno-reorder-init-list",
]
if (is_mingw) { if (is_mingw) {
cflags_cc = [ cflags_cc = [
"-Wno-unused-const-variable", "-Wno-unused-const-variable",
@ -29,57 +43,74 @@ config("gtest_config") {
} }
} }
sources_files = [
"$googletest_dir/include/gtest/gtest-death-test.h",
"$googletest_dir/include/gtest/gtest-matchers.h",
"$googletest_dir/include/gtest/gtest-message.h",
"$googletest_dir/include/gtest/gtest-param-test.h",
"$googletest_dir/include/gtest/gtest-printers.h",
"$googletest_dir/include/gtest/gtest-test-part.h",
"$googletest_dir/include/gtest/gtest-typed-test.h",
"$googletest_dir/include/gtest/gtest_pred_impl.h",
"$googletest_dir/include/gtest/gtest_prod.h",
"$googletest_dir/include/gtest/hwext/gtest-ext.h",
"$googletest_dir/include/gtest/hwext/gtest-filter.h",
"$googletest_dir/include/gtest/hwext/gtest-multithread.h",
"$googletest_dir/include/gtest/hwext/gtest-tag.h",
"$googletest_dir/include/gtest/hwext/utils.h",
"$googletest_dir/include/gtest/internal/custom/gtest-port.h",
"$googletest_dir/include/gtest/internal/custom/gtest-printers.h",
"$googletest_dir/include/gtest/internal/custom/gtest.h",
"$googletest_dir/include/gtest/internal/gtest-death-test-internal.h",
"$googletest_dir/include/gtest/internal/gtest-filepath.h",
"$googletest_dir/include/gtest/internal/gtest-internal.h",
"$googletest_dir/include/gtest/internal/gtest-param-util.h",
"$googletest_dir/include/gtest/internal/gtest-port-arch.h",
"$googletest_dir/include/gtest/internal/gtest-port.h",
"$googletest_dir/include/gtest/internal/gtest-string.h",
"$googletest_dir/include/gtest/internal/gtest-type-util.h",
"$googletest_dir/src/gtest-all.cc",
"$googletest_dir/src/gtest-assertion-result.cc",
"$googletest_dir/src/gtest-death-test.cc",
"$googletest_dir/src/gtest-filepath.cc",
"$googletest_dir/src/gtest-internal-inl.h",
"$googletest_dir/src/gtest-matchers.cc",
"$googletest_dir/src/gtest-port.cc",
"$googletest_dir/src/gtest-printers.cc",
"$googletest_dir/src/gtest-test-part.cc",
"$googletest_dir/src/gtest-typed-test.cc",
"$googletest_dir/src/gtest.cc",
"$googletest_dir/src/hwext/gtest-ext.cc",
"$googletest_dir/src/hwext/gtest-filter.cc",
"$googletest_dir/src/hwext/gtest-multithread.cpp",
"$googletest_dir/src/hwext/gtest-tag.cc",
"$googletest_dir/src/hwext/gtest-utils.cc",
]
static_library("gtest") { static_library("gtest") {
testonly = true testonly = true
public = [ public = [
"$googletest_dir/include/gtest/gtest-spi.h", "$googletest_dir/include/gtest/gtest-spi.h",
"$googletest_dir/include/gtest/gtest.h", "$googletest_dir/include/gtest/gtest.h",
] ]
sources = [ sources = sources_files
"$googletest_dir/include/gtest/gtest-death-test.h",
"$googletest_dir/include/gtest/gtest-matchers.h",
"$googletest_dir/include/gtest/gtest-message.h",
"$googletest_dir/include/gtest/gtest-param-test.h",
"$googletest_dir/include/gtest/gtest-printers.h",
"$googletest_dir/include/gtest/gtest-test-part.h",
"$googletest_dir/include/gtest/gtest-typed-test.h",
"$googletest_dir/include/gtest/gtest_pred_impl.h",
"$googletest_dir/include/gtest/gtest_prod.h",
"$googletest_dir/include/gtest/hwext/gtest-ext.h",
"$googletest_dir/include/gtest/hwext/gtest-filter.h",
"$googletest_dir/include/gtest/hwext/gtest-tag.h",
"$googletest_dir/include/gtest/hwext/utils.h",
"$googletest_dir/include/gtest/internal/custom/gtest-port.h",
"$googletest_dir/include/gtest/internal/custom/gtest-printers.h",
"$googletest_dir/include/gtest/internal/custom/gtest.h",
"$googletest_dir/include/gtest/internal/gtest-death-test-internal.h",
"$googletest_dir/include/gtest/internal/gtest-filepath.h",
"$googletest_dir/include/gtest/internal/gtest-internal.h",
"$googletest_dir/include/gtest/internal/gtest-param-util.h",
"$googletest_dir/include/gtest/internal/gtest-port-arch.h",
"$googletest_dir/include/gtest/internal/gtest-port.h",
"$googletest_dir/include/gtest/internal/gtest-string.h",
"$googletest_dir/include/gtest/internal/gtest-type-util.h",
"$googletest_dir/src/gtest-all.cc",
"$googletest_dir/src/gtest-death-test.cc",
"$googletest_dir/src/gtest-filepath.cc",
"$googletest_dir/src/gtest-internal-inl.h",
"$googletest_dir/src/gtest-matchers.cc",
"$googletest_dir/src/gtest-port.cc",
"$googletest_dir/src/gtest-printers.cc",
"$googletest_dir/src/gtest-test-part.cc",
"$googletest_dir/src/gtest-typed-test.cc",
"$googletest_dir/src/gtest.cc",
"$googletest_dir/src/hwext/gtest-ext.cc",
"$googletest_dir/src/hwext/gtest-filter.cc",
"$googletest_dir/src/hwext/gtest-tag.cc",
"$googletest_dir/src/hwext/gtest-utils.cc",
]
sources -= [ "$googletest_dir/src/gtest-all.cc" ] sources -= [ "$googletest_dir/src/gtest-all.cc" ]
public_configs = [ ":gtest_config" ] public_configs = [ ":gtest_config" ]
configs += [ ":gtest_private_config" ] configs += [ ":gtest_private_config" ]
} }
static_library("gtest_rtti") {
testonly = true
public = [
"$googletest_dir/include/gtest/gtest-spi.h",
"$googletest_dir/include/gtest/gtest.h",
]
sources = sources_files
sources -= [ "$googletest_dir/src/gtest-all.cc" ]
public_configs = [ ":gtest_config" ]
configs += [ ":gtest_private_config_rtti" ]
}
static_library("gtest_main") { static_library("gtest_main") {
testonly = true testonly = true
sources = [ "$googletest_dir/src/gtest_main.cc" ] sources = [ "$googletest_dir/src/gtest_main.cc" ]
@ -91,6 +122,14 @@ config("gmock_private_config") {
include_dirs = [ "$googlemock_dir" ] include_dirs = [ "$googlemock_dir" ]
} }
config("gmock_private_config_rtti") {
visibility = [ ":*" ]
include_dirs = [ "googlemock_dir/include" ]
cflags = [ "-frtti" ]
cflags_objcc = [ "-frtti" ]
cflags_cc = [ "-frtti" ]
}
config("gmock_config") { config("gmock_config") {
include_dirs = [ "$googlemock_dir/include" ] include_dirs = [ "$googlemock_dir/include" ]
@ -104,37 +143,49 @@ config("gmock_config") {
] ]
} }
gmock_sources_files = [
"$googlemock_dir/include/gmock/gmock-actions.h",
"$googlemock_dir/include/gmock/gmock-cardinalities.h",
"$googlemock_dir/include/gmock/gmock-function-mocker.h",
"$googlemock_dir/include/gmock/gmock-matchers.h",
"$googlemock_dir/include/gmock/gmock-more-actions.h",
"$googlemock_dir/include/gmock/gmock-more-matchers.h",
"$googlemock_dir/include/gmock/gmock-nice-strict.h",
"$googlemock_dir/include/gmock/gmock-spec-builders.h",
"$googlemock_dir/include/gmock/internal/custom/gmock-generated-actions.h",
"$googlemock_dir/include/gmock/internal/custom/gmock-matchers.h",
"$googlemock_dir/include/gmock/internal/custom/gmock-port.h",
"$googlemock_dir/include/gmock/internal/gmock-internal-utils.h",
"$googlemock_dir/include/gmock/internal/gmock-port.h",
"$googlemock_dir/include/gmock/internal/gmock-pp.h",
"$googlemock_dir/src/gmock-all.cc",
"$googlemock_dir/src/gmock-cardinalities.cc",
"$googlemock_dir/src/gmock-internal-utils.cc",
"$googlemock_dir/src/gmock-matchers.cc",
"$googlemock_dir/src/gmock-spec-builders.cc",
"$googlemock_dir/src/gmock.cc",
]
static_library("gmock") { static_library("gmock") {
testonly = true testonly = true
public = [ "$googlemock_dir/include/gmock/gmock.h" ] public = [ "$googlemock_dir/include/gmock/gmock.h" ]
sources = [ sources = gmock_sources_files
"$googlemock_dir/include/gmock/gmock-actions.h",
"$googlemock_dir/include/gmock/gmock-cardinalities.h",
"$googlemock_dir/include/gmock/gmock-function-mocker.h",
"$googlemock_dir/include/gmock/gmock-matchers.h",
"$googlemock_dir/include/gmock/gmock-more-actions.h",
"$googlemock_dir/include/gmock/gmock-more-matchers.h",
"$googlemock_dir/include/gmock/gmock-nice-strict.h",
"$googlemock_dir/include/gmock/gmock-spec-builders.h",
"$googlemock_dir/include/gmock/internal/custom/gmock-generated-actions.h",
"$googlemock_dir/include/gmock/internal/custom/gmock-matchers.h",
"$googlemock_dir/include/gmock/internal/custom/gmock-port.h",
"$googlemock_dir/include/gmock/internal/gmock-internal-utils.h",
"$googlemock_dir/include/gmock/internal/gmock-port.h",
"$googlemock_dir/include/gmock/internal/gmock-pp.h",
"$googlemock_dir/src/gmock-all.cc",
"$googlemock_dir/src/gmock-cardinalities.cc",
"$googlemock_dir/src/gmock-internal-utils.cc",
"$googlemock_dir/src/gmock-matchers.cc",
"$googlemock_dir/src/gmock-spec-builders.cc",
"$googlemock_dir/src/gmock.cc",
]
sources -= [ "$googlemock_dir/src/gmock-all.cc" ] sources -= [ "$googlemock_dir/src/gmock-all.cc" ]
public_configs = [ ":gmock_config" ] public_configs = [ ":gmock_config" ]
configs += [ ":gmock_private_config" ] configs += [ ":gmock_private_config" ]
deps = [ ":gtest" ] deps = [ ":gtest" ]
} }
static_library("gmock_rtti") {
testonly = true
public = [ "$googlemock_dir/include/gmock/gmock.h" ]
sources = gmock_sources_files
sources -= [ "$googlemock_dir/src/gmock-all.cc" ]
public_configs = [ ":gmock_config" ]
configs += [ ":gmock_private_config_rtti" ]
deps = [ ":gtest_rtti" ]
}
static_library("gmock_main") { static_library("gmock_main") {
testonly = true testonly = true
sources = [ "$googlemock_dir/src/gmock_main.cc" ] sources = [ "$googlemock_dir/src/gmock_main.cc" ]

View File

@ -499,13 +499,7 @@ ohos_shared_library("shared_icuuc") {
"-shared", "-shared",
"-lm", "-lm",
] ]
if (current_os == "ios") {
ldflags += [
"-Wl",
"-install_name",
"@rpath/libhmicuuc.framework/libhmicuuc",
]
}
configs = [ configs = [
":icu_config", ":icu_config",
"$build_root/config/compiler:rtti", "$build_root/config/compiler:rtti",
@ -552,14 +546,6 @@ ohos_shared_library("shared_icuuc") {
install_enable = true install_enable = true
} }
if (current_os == "ios") {
ohos_combine_darwin_framework("libhmicuuc") {
deps = [ ":shared_icuuc" ]
subsystem_name = "thirdparty"
part_name = "icu"
}
}
ohos_shared_library("shared_icui18n") { ohos_shared_library("shared_icui18n") {
ldflags = [ ldflags = [
"-shared", "-shared",

View File

@ -20,6 +20,7 @@ common_source = [
"//third_party/libuv/src/random.c", "//third_party/libuv/src/random.c",
"//third_party/libuv/src/strscpy.c", "//third_party/libuv/src/strscpy.c",
"//third_party/libuv/src/threadpool.c", "//third_party/libuv/src/threadpool.c",
"//third_party/libuv/src/thread-common.c",
"//third_party/libuv/src/timer.c", "//third_party/libuv/src/timer.c",
"//third_party/libuv/src/uv-common.c", "//third_party/libuv/src/uv-common.c",
"//third_party/libuv/src/uv-data-getter-setters.c", "//third_party/libuv/src/uv-data-getter-setters.c",
@ -28,7 +29,6 @@ common_source = [
] ]
if (!is_mingw && !is_win) { if (!is_mingw && !is_win) {
nonwin_srcs = [ nonwin_srcs = [
"//third_party/libuv/src/unix/epoll.c",
"//third_party/libuv/src/unix/async.c", "//third_party/libuv/src/unix/async.c",
"//third_party/libuv/src/unix/core.c", "//third_party/libuv/src/unix/core.c",
"//third_party/libuv/src/unix/dl.c", "//third_party/libuv/src/unix/dl.c",
@ -57,6 +57,7 @@ config("libuv_config") {
"//third_party/libuv/src", "//third_party/libuv/src",
"//third_party/libuv/src/unix", "//third_party/libuv/src/unix",
] ]
defines = []
cflags = [ "-Wno-unused-parameter" ] cflags = [ "-Wno-unused-parameter" ]
if (is_linux || is_ohos) { if (is_linux || is_ohos) {
cflags += [ cflags += [
@ -68,7 +69,7 @@ config("libuv_config") {
# Adding NDEBUG macro manually to avoid compilation # Adding NDEBUG macro manually to avoid compilation
# error in debug version, FIX ME # error in debug version, FIX ME
# https://gitee.com/openharmony/build/pulls/1206/files # https://gitee.com/openharmony/build/pulls/1206/files
defines = [ "NDEBUG" ] defines += [ "NDEBUG" ]
} else if (is_mingw || is_win) { } else if (is_mingw || is_win) {
cflags += [ cflags += [
"-Wno-missing-braces", "-Wno-missing-braces",
@ -79,7 +80,7 @@ config("libuv_config") {
"-Wno-error=unknown-pragmas", "-Wno-error=unknown-pragmas",
"-Wno-unused-variable", "-Wno-unused-variable",
] ]
defines = [ defines += [
"WIN32_LEAN_AND_MEAN", "WIN32_LEAN_AND_MEAN",
"_WIN32_WINNT=0x0600", "_WIN32_WINNT=0x0600",
] ]
@ -98,7 +99,7 @@ config("libuv_config") {
"ws2_32", "ws2_32",
] ]
} else if (is_android) { } else if (is_android) {
defines = [ "_GNU_SOURCE" ] defines += [ "_GNU_SOURCE" ]
} }
} }
@ -122,7 +123,7 @@ ohos_source_set("libuv_source") {
stack_protector_ret = false stack_protector_ret = false
configs = [ ":libuv_config" ] configs = [ ":libuv_config" ]
sources = common_source sources = common_source
external_deps = []
if (is_mac || (defined(is_ios) && is_ios)) { if (is_mac || (defined(is_ios) && is_ios)) {
sources += nonwin_srcs + [ sources += nonwin_srcs + [
"//third_party/libuv/src/unix/bsd-ifaddrs.c", "//third_party/libuv/src/unix/bsd-ifaddrs.c",
@ -132,8 +133,9 @@ ohos_source_set("libuv_source") {
"//third_party/libuv/src/unix/darwin.c", "//third_party/libuv/src/unix/darwin.c",
"//third_party/libuv/src/unix/fsevents.c", "//third_party/libuv/src/unix/fsevents.c",
"//third_party/libuv/src/unix/os390-proctitle.c", "//third_party/libuv/src/unix/os390-proctitle.c",
"//third_party/libuv/src/unix/log_unix.c",
"//third_party/libuv/src/unix/trace_unix.c",
] ]
sources -= [ "//third_party/libuv/src/unix/epoll.c" ]
} else if (is_mingw || is_win) { } else if (is_mingw || is_win) {
sources += [ sources += [
"//third_party/libuv/src/win/async.c", "//third_party/libuv/src/win/async.c",
@ -146,6 +148,7 @@ ohos_source_set("libuv_source") {
"//third_party/libuv/src/win/getaddrinfo.c", "//third_party/libuv/src/win/getaddrinfo.c",
"//third_party/libuv/src/win/getnameinfo.c", "//third_party/libuv/src/win/getnameinfo.c",
"//third_party/libuv/src/win/handle.c", "//third_party/libuv/src/win/handle.c",
"//third_party/libuv/src/win/log_win.c",
"//third_party/libuv/src/win/loop-watcher.c", "//third_party/libuv/src/win/loop-watcher.c",
"//third_party/libuv/src/win/pipe.c", "//third_party/libuv/src/win/pipe.c",
"//third_party/libuv/src/win/poll.c", "//third_party/libuv/src/win/poll.c",
@ -156,6 +159,7 @@ ohos_source_set("libuv_source") {
"//third_party/libuv/src/win/stream.c", "//third_party/libuv/src/win/stream.c",
"//third_party/libuv/src/win/tcp.c", "//third_party/libuv/src/win/tcp.c",
"//third_party/libuv/src/win/thread.c", "//third_party/libuv/src/win/thread.c",
"//third_party/libuv/src/win/trace_win.c",
"//third_party/libuv/src/win/tty.c", "//third_party/libuv/src/win/tty.c",
"//third_party/libuv/src/win/udp.c", "//third_party/libuv/src/win/udp.c",
"//third_party/libuv/src/win/util.c", "//third_party/libuv/src/win/util.c",
@ -164,31 +168,30 @@ ohos_source_set("libuv_source") {
] ]
} else if (is_ohos || (defined(is_android) && is_android)) { } else if (is_ohos || (defined(is_android) && is_android)) {
sources += nonwin_srcs + [ sources += nonwin_srcs + [
"//third_party/libuv/src/unix/linux-core.c", "//third_party/libuv/src/unix/linux.c",
"//third_party/libuv/src/unix/linux-inotify.c",
"//third_party/libuv/src/unix/linux-syscalls.c",
"//third_party/libuv/src/unix/procfs-exepath.c", "//third_party/libuv/src/unix/procfs-exepath.c",
"//third_party/libuv/src/unix/pthread-fixes.c",
"//third_party/libuv/src/unix/random-getentropy.c", "//third_party/libuv/src/unix/random-getentropy.c",
"//third_party/libuv/src/unix/random-getrandom.c", "//third_party/libuv/src/unix/random-getrandom.c",
"//third_party/libuv/src/unix/random-sysctl-linux.c", "//third_party/libuv/src/unix/random-sysctl-linux.c",
"//third_party/libuv/src/unix/proctitle.c", "//third_party/libuv/src/unix/proctitle.c",
] ]
sources += [
"src/log_ohos.c",
"src/trace_ohos.c",
]
} else if (is_linux) { } else if (is_linux) {
sources += nonwin_srcs + [ sources += nonwin_srcs + [
"//third_party/libuv/src/unix/linux-core.c", "//third_party/libuv/src/unix/linux.c",
"//third_party/libuv/src/unix/linux-inotify.c",
"//third_party/libuv/src/unix/linux-syscalls.c",
"//third_party/libuv/src/unix/procfs-exepath.c", "//third_party/libuv/src/unix/procfs-exepath.c",
"//third_party/libuv/src/unix/random-getrandom.c", "//third_party/libuv/src/unix/random-getrandom.c",
"//third_party/libuv/src/unix/random-sysctl-linux.c", "//third_party/libuv/src/unix/random-sysctl-linux.c",
"//third_party/libuv/src/unix/proctitle.c", "//third_party/libuv/src/unix/proctitle.c",
"//third_party/libuv/src/unix/log_unix.c",
"//third_party/libuv/src/unix/trace_unix.c",
] ]
} else { } else {
sources += nonwin_srcs + [ sources += nonwin_srcs + [
"//third_party/libuv/src/unix/linux-core.c", "//third_party/libuv/src/unix/linux.c",
"//third_party/libuv/src/unix/linux-inotify.c",
"//third_party/libuv/src/unix/linux-syscalls.c",
"//third_party/libuv/src/unix/procfs-exepath.c", "//third_party/libuv/src/unix/procfs-exepath.c",
"//third_party/libuv/src/unix/random-getrandom.c", "//third_party/libuv/src/unix/random-getrandom.c",
"//third_party/libuv/src/unix/random-sysctl-linux.c", "//third_party/libuv/src/unix/random-sysctl-linux.c",

View File

@ -0,0 +1,20 @@
/*
* Copyright (c) 2023 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.
*/
#include "uv_log.h"
int uv__log_impl(enum uv__log_level level, const char* fmt, ...)
{
return 0;
}

View File

@ -0,0 +1,19 @@
/*
* 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.
*/
#include <stdint.h>
#define UV_TRACE_TAG (1ULL << 30)
void uv_start_trace(uint64_t tag, const char* name) {}
void uv_end_trace(uint64_t tag) {}

View File

@ -39,41 +39,46 @@ action("create_porting_src") {
outdir = [ "${target_out_dir}/${musl_ported_dir}" ] outdir = [ "${target_out_dir}/${musl_ported_dir}" ]
src_files = musl_src_arch_file src_files = musl_src_arch_file
src_files += musl_inc_root_files
src_files += musl_inc_fortify_files
src_files += musl_inc_sys_files
src_files += musl_inc_scsi_files
src_files += musl_inc_netpacket_files
src_files += musl_inc_netinet_files
src_files += musl_inc_net_files
src_files += musl_inc_arpa_files
src_files += musl_inc_bits_files
src_files += musl_src_ldso
src_files += musl_src_file src_files += musl_src_file
src_files += musl_src_ldso
src_files += musl_inc_bits_files
src_files += musl_inc_arpa_files
src_files += musl_inc_net_files
src_files += musl_inc_netinet_files
src_files += musl_inc_netpacket_files
src_files += musl_inc_scsi_files
src_files += musl_inc_sys_files
src_files += musl_inc_fortify_files
src_files += musl_inc_root_files
src_files += musl_inc_info_files
src_files += musl_inc_trace_files
src_files += [ src_files += [
"scripts/create_syscall.sh",
"scripts/create_vesion.sh",
"scripts/create_alltypes.sh",
"scripts/install.py",
"tools/install.sh",
"tools/version.sh",
"VERSION",
"include/alltypes.h.in",
"arch/${musl_arch}/bits/syscall.h.in",
"arch/${musl_arch}/bits/alltypes.h.in",
"tools/mkalltypes.sed",
"crt/rcrt1.c",
"crt/crt1.c",
"crt/Scrt1.c", "crt/Scrt1.c",
"crt/${musl_arch}/crtn.s", "crt/crt1.c",
"crt/${musl_arch}/crti.s", "crt/rcrt1.c",
"tools/mkalltypes.sed",
"arch/${musl_arch}/bits/alltypes.h.in",
"arch/${musl_arch}/bits/syscall.h.in",
"include/alltypes.h.in",
"VERSION",
"tools/version.sh",
"tools/install.sh",
"scripts/install.py",
"scripts/create_alltypes.sh",
"scripts/create_vesion.sh",
"scripts/create_syscall.sh",
] ]
src_files += [
"crt/${musl_arch}/crti.s",
"crt/${musl_arch}/crtn.s",
]
args = [ "-i" ] + rebase_path(sources_dir) args = [ "-i" ] + rebase_path(sources_dir)
args += [ "-o" ] + rebase_path(outdir) args += [ "-o" ] + rebase_path(outdir)
args += [ "-p" ] + [ "${musl_target_os}" ] args += [ "-p" ] + [ "${musl_target_os}" ]
foreach(i, src_files) { foreach(i, src_files) {
foreach(s, musl_src_porting_file) { foreach(s, musl_src_files_ext) {
if (i == s) { if (i == s) {
src_files -= [ "${s}" ] src_files -= [ "${s}" ]
} }
@ -85,16 +90,24 @@ action("create_porting_src") {
outputs += [ "${target_out_dir}/${musl_ported_dir}/${s}" ] outputs += [ "${target_out_dir}/${musl_ported_dir}/${s}" ]
} }
foreach(s, musl_src_porting_file) { foreach(s, musl_src_files_ext) {
outputs += [ "${target_out_dir}/${musl_ported_dir}/${s}" ] outputs += [ "${target_out_dir}/${musl_ported_dir}/${s}" ]
} }
inputs = [] inputs = []
foreach(i, src_files) {
foreach(s, musl_src_linux_files) {
if (i == s) {
src_files -= [ "${s}" ]
}
}
}
foreach(s, src_files) { foreach(s, src_files) {
inputs += [ "${musl_dir}/${s}" ] inputs += [ "${musl_dir}/${s}" ]
} }
foreach(s, musl_src_porting_file) { foreach(s, musl_src_files_ext) {
inputs += [ "${musl_porting_dir}/${s}" ] inputs += [ "${musl_dir}/${s}" ]
} }
} }

View File

@ -14,6 +14,7 @@
import("//third_party/FreeBSD/FreeBSD.gni") import("//third_party/FreeBSD/FreeBSD.gni")
import("$build_root/third_party_gn/musl/musl_config.gni") import("$build_root/third_party_gn/musl/musl_config.gni")
OPTRTDIR = "//third_party/optimized-routines/"
if (musl_arch == "arm") { if (musl_arch == "arm") {
musl_src_arch_file = [ musl_src_arch_file = [
"src/exit/arm/__aeabi_atexit.c", "src/exit/arm/__aeabi_atexit.c",
@ -21,7 +22,6 @@ if (musl_arch == "arm") {
"src/fenv/arm/fenv.c", "src/fenv/arm/fenv.c",
"src/ldso/arm/dlsym.s", "src/ldso/arm/dlsym.s",
"src/ldso/arm/dlsym_time64.S", "src/ldso/arm/dlsym_time64.S",
"src/ldso/arm/dlvsym.s",
"src/ldso/arm/find_exidx.c", "src/ldso/arm/find_exidx.c",
"src/ldso/arm/tlsdesc.S", "src/ldso/arm/tlsdesc.S",
"src/math/arm/fabs.c", "src/math/arm/fabs.c",
@ -44,6 +44,7 @@ if (musl_arch == "arm") {
"src/thread/arm/atomics.s", "src/thread/arm/atomics.s",
"src/thread/arm/clone.s", "src/thread/arm/clone.s",
"src/thread/arm/syscall_cp.s", "src/thread/arm/syscall_cp.s",
"src/linux/arm/flock.s",
"compat/time32/adjtime32.c", "compat/time32/adjtime32.c",
"compat/time32/adjtimex_time32.c", "compat/time32/adjtimex_time32.c",
"compat/time32/aio_suspend_time32.c", "compat/time32/aio_suspend_time32.c",
@ -113,7 +114,6 @@ if (musl_arch == "arm") {
musl_src_arch_file = [ musl_src_arch_file = [
"src/fenv/aarch64/fenv.s", "src/fenv/aarch64/fenv.s",
"src/ldso/aarch64/dlsym.s", "src/ldso/aarch64/dlsym.s",
"src/ldso/aarch64/dlvsym.s",
"src/ldso/aarch64/tlsdesc.s", "src/ldso/aarch64/tlsdesc.s",
"src/math/aarch64/ceil.c", "src/math/aarch64/ceil.c",
"src/math/aarch64/ceilf.c", "src/math/aarch64/ceilf.c",
@ -152,15 +152,58 @@ if (musl_arch == "arm") {
"src/thread/aarch64/__set_thread_area.s", "src/thread/aarch64/__set_thread_area.s",
"src/thread/aarch64/__unmapself.s", "src/thread/aarch64/__unmapself.s",
"src/thread/aarch64/clone.s", "src/thread/aarch64/clone.s",
"src/misc/aarch64/fstat.s",
"src/thread/aarch64/syscall_cp.s", "src/thread/aarch64/syscall_cp.s",
"src/misc/aarch64/syscall.s", "src/linux/aarch64/flock.s",
]
} else if (musl_arch == "mips") {
musl_src_arch_file = [
"src/fenv/mips/fenv-sf.c",
"src/fenv/mips/fenv.S",
"src/ldso/mips/dlsym_time64.S",
"src/ldso/mips/dlsym.s",
"src/math/mips/fabs.c",
"src/math/mips/fabsf.c",
"src/math/mips/sqrt.c",
"src/math/mips/sqrtf.c",
"src/setjmp/mips/longjmp.S",
"src/setjmp/mips/setjmp.S",
"src/signal/mips/sigsetjmp.s",
"src/thread/mips/__unmapself.s",
"src/thread/mips/clone.s",
"src/thread/mips/syscall_cp.s",
"src/unistd/mips/pipe.s",
]
} else if (musl_arch == "riscv64") {
musl_src_arch_file = [
"src/fenv/riscv64/fenv-sf.c",
"src/fenv/riscv64/fenv.S",
"src/ldso/riscv64/dlsym.s",
"src/ldso/riscv64/tlsdesc.s",
"src/math/riscv64/copysign.c",
"src/math/riscv64/copysignf.c",
"src/math/riscv64/fabs.c",
"src/math/riscv64/fabsf.c",
"src/math/riscv64/fma.c",
"src/math/riscv64/fmaf.c",
"src/math/riscv64/fmax.c",
"src/math/riscv64/fmaxf.c",
"src/math/riscv64/fmin.c",
"src/math/riscv64/fminf.c",
"src/math/riscv64/sqrt.c",
"src/math/riscv64/sqrtf.c",
"src/setjmp/riscv64/longjmp.S",
"src/setjmp/riscv64/setjmp.S",
"src/signal/riscv64/restore.s",
"src/signal/riscv64/sigsetjmp.s",
"src/thread/riscv64/__set_thread_area.s",
"src/thread/riscv64/__unmapself.s",
"src/thread/riscv64/clone.s",
"src/thread/riscv64/syscall_cp.s",
] ]
} else if (musl_arch == "x86_64") { } else if (musl_arch == "x86_64") {
musl_src_arch_file = [ musl_src_arch_file = [
"src/fenv/x86_64/fenv.s", "src/fenv/x86_64/fenv.s",
"src/ldso/x86_64/dlsym.s", "src/ldso/x86_64/dlsym.s",
"src/ldso/x86_64/dlvsym.s",
"src/ldso/x86_64/tlsdesc.s", "src/ldso/x86_64/tlsdesc.s",
"src/math/x86_64/__invtrigl.s", "src/math/x86_64/__invtrigl.s",
"src/math/x86_64/acosl.s", "src/math/x86_64/acosl.s",
@ -205,38 +248,32 @@ if (musl_arch == "arm") {
"src/thread/x86_64/__unmapself.s", "src/thread/x86_64/__unmapself.s",
"src/thread/x86_64/clone.s", "src/thread/x86_64/clone.s",
"src/thread/x86_64/syscall_cp.s", "src/thread/x86_64/syscall_cp.s",
"src/linux/x86_64/flock.s",
] ]
} else if (musl_arch == "mips") { } else if (musl_arch == "loongarch64") {
musl_src_arch_file = [ musl_src_arch_file = [
"src/fenv/mips/fenv.S", "src/fenv/loongarch64/fenv.S",
"src/fenv/mips/fenv-sf.c", "src/ldso/loongarch64/dlsym.s",
"src/ldso/mips/dlsym.s", "src/ldso/loongarch64/tlsdesc.s",
"src/ldso/mips/dlsym_time64.S", "src/setjmp/loongarch64/longjmp.S",
"src/math/mips/fabs.c", "src/setjmp/loongarch64/setjmp.S",
"src/math/mips/fabsf.c", "src/signal/loongarch64/restore.s",
"src/math/mips/sqrt.c", "src/signal/loongarch64/sigsetjmp.s",
"src/math/mips/sqrtf.c", "src/thread/loongarch64/__set_thread_area.s",
"src/setjmp/mips/longjmp.S", "src/thread/loongarch64/__unmapself.s",
"src/setjmp/mips/setjmp.S", "src/thread/loongarch64/clone.s",
"src/signal/mips/restore.s", "src/thread/loongarch64/syscall_cp.s",
"src/signal/mips/sigsetjmp.s",
"src/thread/mips/__unmapself.s",
"src/thread/mips/clone.s",
"src/thread/mips/syscall_cp.s",
] ]
} }
musl_src_file = [ musl_src_file = [
"src/thread/pthread_cond_clockwait.c",
"src/thread/pthread_cond_timedwait_monotonic_np.c",
"src/thread/pthread_cond_timeout_np.c",
"src/internal/pthread_impl.h", "src/internal/pthread_impl.h",
"src/internal/locale_impl.h", "src/internal/locale_impl.h",
"src/thread/pthread_rwlock_clockrdlock.c", "src/internal/locale_impl.c",
"src/internal/stdio_impl.h",
"src/internal/unsupported_api.h",
"src/internal/syscall_hooks.h",
"src/thread/pthread_rwlock_timedrdlock.c", "src/thread/pthread_rwlock_timedrdlock.c",
"src/thread/pthread_rwlock_timedrdlock_monotonic_np.c",
"src/thread/pthread_rwlock_clockwrlock.c",
"src/thread/pthread_rwlock_timedwrlock_monotonic_np.c",
"src/thread/pthread_rwlock_timedwrlock.c", "src/thread/pthread_rwlock_timedwrlock.c",
"src/aio/aio.c", "src/aio/aio.c",
"src/aio/aio_suspend.c", "src/aio/aio_suspend.c",
@ -391,6 +428,7 @@ musl_src_file = [
"src/exit/at_quick_exit.c", "src/exit/at_quick_exit.c",
"src/exit/atexit.c", "src/exit/atexit.c",
"src/exit/exit.c", "src/exit/exit.c",
"src/exit/cxa_thread_atexit_impl.c",
"src/exit/quick_exit.c", "src/exit/quick_exit.c",
"src/fcntl/creat.c", "src/fcntl/creat.c",
"src/fcntl/fcntl.c", "src/fcntl/fcntl.c",
@ -398,6 +436,7 @@ musl_src_file = [
"src/fcntl/openat.c", "src/fcntl/openat.c",
"src/fcntl/posix_fadvise.c", "src/fcntl/posix_fadvise.c",
"src/fcntl/posix_fallocate.c", "src/fcntl/posix_fallocate.c",
"src/fdsan/fdsan.c",
"src/fenv/__flt_rounds.c", "src/fenv/__flt_rounds.c",
"src/fenv/fegetexceptflag.c", "src/fenv/fegetexceptflag.c",
"src/fenv/feholdexcept.c", "src/fenv/feholdexcept.c",
@ -406,6 +445,8 @@ musl_src_file = [
"src/fenv/fesetround.c", "src/fenv/fesetround.c",
"src/fenv/feupdateenv.c", "src/fenv/feupdateenv.c",
"src/fortify/fortify.c", "src/fortify/fortify.c",
"src/gwp_asan/gwp_asan.c",
"src/gwp_asan/gwp_asan.h",
"src/internal/defsysinfo.c", "src/internal/defsysinfo.c",
"src/internal/floatscan.c", "src/internal/floatscan.c",
"src/internal/intscan.c", "src/internal/intscan.c",
@ -413,9 +454,7 @@ musl_src_file = [
"src/internal/procfdname.c", "src/internal/procfdname.c",
"src/internal/shgetc.c", "src/internal/shgetc.c",
"src/internal/syscall_ret.c", "src/internal/syscall_ret.c",
"src/internal/vdso.c",
"src/internal/version.c", "src/internal/version.c",
"src/internal/network_conf_function.c",
"src/hilog/hilog_adapter.c", "src/hilog/hilog_adapter.c",
"src/hilog/vsnprintf_s_p.c", "src/hilog/vsnprintf_s_p.c",
"src/ipc/ftok.c", "src/ipc/ftok.c",
@ -488,15 +527,14 @@ musl_src_file = [
"src/linux/open_by_handle_at.c", "src/linux/open_by_handle_at.c",
"src/linux/personality.c", "src/linux/personality.c",
"src/linux/pivot_root.c", "src/linux/pivot_root.c",
"src/linux/ppoll.c",
"src/linux/prctl.c", "src/linux/prctl.c",
"src/linux/preadv2.c",
"src/linux/prlimit.c", "src/linux/prlimit.c",
"src/linux/process_vm.c", "src/linux/process_vm.c",
"src/linux/ptrace.c", "src/linux/ptrace.c",
"src/linux/quotactl.c", "src/linux/quotactl.c",
"src/linux/readahead.c", "src/linux/readahead.c",
"src/linux/reboot.c", "src/linux/reboot.c",
"src/linux/tgkill.c",
"src/linux/remap_file_pages.c", "src/linux/remap_file_pages.c",
"src/linux/sbrk.c", "src/linux/sbrk.c",
"src/linux/sendfile.c", "src/linux/sendfile.c",
@ -508,6 +546,7 @@ musl_src_file = [
"src/linux/settimeofday.c", "src/linux/settimeofday.c",
"src/linux/signalfd.c", "src/linux/signalfd.c",
"src/linux/splice.c", "src/linux/splice.c",
"src/linux/statx.c",
"src/linux/stime.c", "src/linux/stime.c",
"src/linux/swap.c", "src/linux/swap.c",
"src/linux/sync_file_range.c", "src/linux/sync_file_range.c",
@ -521,6 +560,7 @@ musl_src_file = [
"src/linux/vmsplice.c", "src/linux/vmsplice.c",
"src/linux/wait3.c", "src/linux/wait3.c",
"src/linux/wait4.c", "src/linux/wait4.c",
"src/linux/pwritev2.c",
"src/linux/xattr.c", "src/linux/xattr.c",
"src/locale/__lctrans.c", "src/locale/__lctrans.c",
"src/locale/__mo_lookup.c", "src/locale/__mo_lookup.c",
@ -542,6 +582,7 @@ musl_src_file = [
"src/locale/setlocale.c", "src/locale/setlocale.c",
"src/locale/strcoll.c", "src/locale/strcoll.c",
"src/locale/strtod_l.c", "src/locale/strtod_l.c",
"src/locale/wcstod_l.c",
"src/locale/strfmon.c", "src/locale/strfmon.c",
"src/locale/strxfrm.c", "src/locale/strxfrm.c",
"src/locale/textdomain.c", "src/locale/textdomain.c",
@ -556,8 +597,6 @@ musl_src_file = [
"src/malloc/mallocng/malloc.c", "src/malloc/mallocng/malloc.c",
"src/malloc/mallocng/meta.h", "src/malloc/mallocng/meta.h",
"src/malloc/mallocng/realloc.c", "src/malloc/mallocng/realloc.c",
"src/malloc/stats.c",
"src/malloc/calloc.c",
"src/malloc/free.c", "src/malloc/free.c",
"src/malloc/libc_calloc.c", "src/malloc/libc_calloc.c",
"src/malloc/lite_malloc.c", "src/malloc/lite_malloc.c",
@ -1029,6 +1068,7 @@ musl_src_file = [
"src/regex/regerror.c", "src/regex/regerror.c",
"src/regex/regexec.c", "src/regex/regexec.c",
"src/regex/tre-mem.c", "src/regex/tre-mem.c",
"src/syscall_hooks/syscall_hooks.c",
"src/sched/sched_cpualloc.c", "src/sched/sched_cpualloc.c",
"src/sched/affinity.c", "src/sched/affinity.c",
"src/sched/sched_cpucount.c", "src/sched/sched_cpucount.c",
@ -1049,6 +1089,7 @@ musl_src_file = [
"src/search/tsearch.c", "src/search/tsearch.c",
"src/search/twalk.c", "src/search/twalk.c",
"src/select/poll.c", "src/select/poll.c",
"src/select/ppoll.c",
"src/select/pselect.c", "src/select/pselect.c",
"src/select/select.c", "src/select/select.c",
"src/setjmp/longjmp.c", "src/setjmp/longjmp.c",
@ -1091,7 +1132,6 @@ musl_src_file = [
"src/signal/sigtimedwait.c", "src/signal/sigtimedwait.c",
"src/signal/sigwait.c", "src/signal/sigwait.c",
"src/signal/sigwaitinfo.c", "src/signal/sigwaitinfo.c",
"src/sigchain/sigchain.c",
"src/stat/__xstat.c", "src/stat/__xstat.c",
"src/stat/chmod.c", "src/stat/chmod.c",
"src/stat/fchmod.c", "src/stat/fchmod.c",
@ -1250,6 +1290,7 @@ musl_src_file = [
"src/stdlib/strtol.c", "src/stdlib/strtol.c",
"src/stdlib/wcstod.c", "src/stdlib/wcstod.c",
"src/stdlib/wcstol.c", "src/stdlib/wcstol.c",
"src/string/strcspn.c",
"src/string/bcmp.c", "src/string/bcmp.c",
"src/string/bcopy.c", "src/string/bcopy.c",
"src/string/bzero.c", "src/string/bzero.c",
@ -1268,13 +1309,11 @@ musl_src_file = [
"src/string/stpcpy.c", "src/string/stpcpy.c",
"src/string/stpncpy.c", "src/string/stpncpy.c",
"src/string/strcasecmp.c", "src/string/strcasecmp.c",
"src/string/strcasestr.c",
"src/string/strcat.c", "src/string/strcat.c",
"src/string/strchr.c", "src/string/strchr.c",
"src/string/strchrnul.c", "src/string/strchrnul.c",
"src/string/strcmp.c", "src/string/strcmp.c",
"src/string/strcpy.c", "src/string/strcpy.c",
"src/string/strcspn.c",
"src/string/strdup.c", "src/string/strdup.c",
"src/string/strerror_r.c", "src/string/strerror_r.c",
"src/string/strlcat.c", "src/string/strlcat.c",
@ -1415,9 +1454,6 @@ musl_src_file = [
"src/thread/pthread_mutex_lock.c", "src/thread/pthread_mutex_lock.c",
"src/thread/pthread_mutex_setprioceiling.c", "src/thread/pthread_mutex_setprioceiling.c",
"src/thread/pthread_mutex_timedlock.c", "src/thread/pthread_mutex_timedlock.c",
"src/thread/pthread_mutex_clocklock.c",
"src/thread/pthread_mutex_timedlock_monotonic_np.c",
"src/thread/pthread_mutex_lock_timeout_np.c",
"src/thread/pthread_mutex_trylock.c", "src/thread/pthread_mutex_trylock.c",
"src/thread/pthread_mutex_unlock.c", "src/thread/pthread_mutex_unlock.c",
"src/thread/pthread_mutexattr_destroy.c", "src/thread/pthread_mutexattr_destroy.c",
@ -1596,6 +1632,39 @@ musl_src_file = [
"src/info/application_target_sdk_version.c", "src/info/application_target_sdk_version.c",
"src/info/device_api_version.c", "src/info/device_api_version.c",
"src/info/fatal_message.c", "src/info/fatal_message.c",
"arch/generic/crtbrand.s",
"crt/crtplus.c",
"ldso/namespace.h",
"ldso/ns_config.h",
"ldso/strops.h",
"ldso/cfi.h",
"ldso/ld_log.h",
"ldso/dynlink_rand.h",
"src/internal/vdso.c",
"src/internal/emulate_wait4.c",
"src/internal/malloc_config.h",
"src/internal/malloc_random.h",
"src/internal/hilog_adapter.h",
"src/internal/musl_log.h",
"src/internal/musl_log.c",
"src/internal/network_conf_function.c",
"src/internal/network_conf_function.h",
"src/internal/services.h",
"src/internal/proc_xid_impl.h",
"src/linux/tgkill.c",
"src/malloc/calloc.c",
"src/malloc/stats.c",
"src/sigchain/sigchain.c",
"src/thread/pthread_cond_clockwait.c",
"src/thread/pthread_cond_timedwait_monotonic_np.c",
"src/thread/pthread_cond_timeout_np.c",
"src/thread/pthread_mutex_clocklock.c",
"src/thread/pthread_mutex_timedlock_monotonic_np.c",
"src/thread/pthread_mutex_lock_timeout_np.c",
"src/thread/pthread_rwlock_clockrdlock.c",
"src/thread/pthread_rwlock_timedrdlock_monotonic_np.c",
"src/thread/pthread_rwlock_clockwrlock.c",
"src/thread/pthread_rwlock_timedwrlock_monotonic_np.c",
] ]
if (musl_arch == "arm") { if (musl_arch == "arm") {
@ -1718,13 +1787,54 @@ if (musl_arch == "arm") {
musl_src_filterout = [ musl_src_filterout = [
"src/fenv/fenv.c", "src/fenv/fenv.c",
"src/ldso/dlsym.c", "src/ldso/dlsym.c",
"src/ldso/tlsdesc.c",
"src/math/fabs.c", "src/math/fabs.c",
"src/math/fabsf.c", "src/math/fabsf.c",
"src/math/fmaf.c",
"src/math/sqrt.c", "src/math/sqrt.c",
"src/math/sqrtf.c", "src/math/sqrtf.c",
"src/setjmp/longjmp.c",
"src/setjmp/setjmp.c", "src/setjmp/setjmp.c",
"src/signal/restore.c", "src/signal/restore.c",
"src/signal/sigsetjmp.c",
"src/thread/__unmapself.c",
"src/thread/clone.c",
"src/thread/syscall_cp.c",
"src/unistd/pipe.c",
]
} else if (musl_arch == "riscv64") {
musl_src_filterout = [
"src/fenv/fenv.c",
"src/ldso/dlsym.c",
"src/ldso/tlsdesc.c",
"src/math/fabs.c",
"src/math/fabsf.c",
"src/math/fma.c",
"src/math/fmaf.c",
"src/math/fmax.c",
"src/math/fmaxf.c",
"src/math/fmin.c",
"src/math/fminf.c",
"src/math/sqrt.c",
"src/math/sqrtf.c",
"src/setjmp/longjmp.c",
"src/setjmp/setjmp.c",
"src/signal/restore.c",
"src/signal/sigsetjmp.c",
"src/thread/__set_thread_area.c",
"src/thread/__unmapself.c",
"src/thread/clone.c",
"src/thread/syscall_cp.c",
]
} else if (musl_arch == "loongarch64") {
musl_src_filterout = [
"src/fenv/fenv.c",
"src/ldso/dlsym.c",
"src/ldso/tlsdesc.c",
"src/setjmp/longjmp.c",
"src/setjmp/setjmp.c",
"src/signal/restore.c",
"src/signal/sigsetjmp.c",
"src/thread/__set_thread_area.c",
"src/thread/__unmapself.c", "src/thread/__unmapself.c",
"src/thread/clone.c", "src/thread/clone.c",
"src/thread/syscall_cp.c", "src/thread/syscall_cp.c",
@ -1828,7 +1938,6 @@ if (musl_arch == "arm") {
"arch/x86_64/bits/stat.h", "arch/x86_64/bits/stat.h",
"arch/x86_64/bits/stdint.h", "arch/x86_64/bits/stdint.h",
"arch/x86_64/bits/user.h", "arch/x86_64/bits/user.h",
"arch/generic/bits/dirent.h", "arch/generic/bits/dirent.h",
"arch/generic/bits/errno.h", "arch/generic/bits/errno.h",
"arch/generic/bits/hwcap.h", "arch/generic/bits/hwcap.h",
@ -1855,40 +1964,115 @@ if (musl_arch == "arm") {
] ]
} else if (musl_arch == "mips") { } else if (musl_arch == "mips") {
musl_inc_bits_files = [ musl_inc_bits_files = [
"arch/mips/bits/errno.h", "arch/generic/bits/fcntl.h",
"arch/mips/bits/fcntl.h",
"arch/mips/bits/fenv.h", "arch/mips/bits/fenv.h",
"arch/mips/bits/float.h", "arch/mips/bits/float.h",
"arch/mips/bits/hwcap.h",
"arch/mips/bits/ioctl.h",
"arch/mips/bits/ipcstat.h",
"arch/mips/bits/mman.h",
"arch/mips/bits/msg.h",
"arch/mips/bits/poll.h",
"arch/mips/bits/posix.h", "arch/mips/bits/posix.h",
"arch/mips/bits/ptrace.h",
"arch/mips/bits/reg.h", "arch/mips/bits/reg.h",
"arch/mips/bits/resource.h",
"arch/mips/bits/sem.h",
"arch/mips/bits/setjmp.h", "arch/mips/bits/setjmp.h",
"arch/mips/bits/shm.h",
"arch/mips/bits/signal.h", "arch/mips/bits/signal.h",
"arch/mips/bits/socket.h",
"arch/mips/bits/stat.h", "arch/mips/bits/stat.h",
"arch/mips/bits/statfs.h",
"arch/mips/bits/stdint.h", "arch/mips/bits/stdint.h",
"arch/mips/bits/termios.h",
"arch/mips/bits/user.h", "arch/mips/bits/user.h",
"arch/generic/bits/dirent.h", "arch/generic/bits/dirent.h",
"arch/generic/bits/errno.h",
"arch/generic/bits/hwcap.h",
"arch/generic/bits/ioctl_fix.h", "arch/generic/bits/ioctl_fix.h",
"arch/generic/bits/ioctl.h",
"arch/generic/bits/io.h", "arch/generic/bits/io.h",
"arch/generic/bits/ipc.h", "arch/generic/bits/ipc.h",
"arch/generic/bits/ipcstat.h",
"arch/generic/bits/kd.h", "arch/generic/bits/kd.h",
"arch/generic/bits/limits.h", "arch/generic/bits/limits.h",
"arch/generic/bits/link.h", "arch/generic/bits/link.h",
"arch/generic/bits/mman.h",
"arch/generic/bits/msg.h",
"arch/generic/bits/poll.h",
"arch/generic/bits/ptrace.h",
"arch/generic/bits/resource.h",
"arch/generic/bits/sem.h",
"arch/generic/bits/shm.h",
"arch/generic/bits/socket.h",
"arch/generic/bits/soundcard.h", "arch/generic/bits/soundcard.h",
"arch/generic/bits/statfs.h",
"arch/generic/bits/termios.h",
"arch/generic/bits/vt.h", "arch/generic/bits/vt.h",
] ]
} else if (musl_arch == "riscv64") {
musl_inc_bits_files = [
"arch/generic/bits/fcntl.h",
"arch/riscv64/bits/fenv.h",
"arch/riscv64/bits/float.h",
"arch/riscv64/bits/posix.h",
"arch/riscv64/bits/reg.h",
"arch/riscv64/bits/setjmp.h",
"arch/riscv64/bits/signal.h",
"arch/riscv64/bits/stat.h",
"arch/riscv64/bits/stdint.h",
"arch/riscv64/bits/user.h",
"arch/generic/bits/dirent.h",
"arch/generic/bits/errno.h",
"arch/generic/bits/hwcap.h",
"arch/generic/bits/ioctl_fix.h",
"arch/generic/bits/ioctl.h",
"arch/generic/bits/io.h",
"arch/generic/bits/ipc.h",
"arch/generic/bits/ipcstat.h",
"arch/generic/bits/kd.h",
"arch/generic/bits/limits.h",
"arch/generic/bits/link.h",
"arch/generic/bits/mman.h",
"arch/generic/bits/msg.h",
"arch/generic/bits/poll.h",
"arch/generic/bits/ptrace.h",
"arch/generic/bits/resource.h",
"arch/generic/bits/sem.h",
"arch/generic/bits/shm.h",
"arch/generic/bits/socket.h",
"arch/generic/bits/soundcard.h",
"arch/generic/bits/statfs.h",
"arch/generic/bits/termios.h",
"arch/generic/bits/vt.h",
]
} else if (musl_arch == "loongarch64") {
musl_inc_bits_files = [
"arch/loongarch64/bits/fenv.h",
"arch/loongarch64/bits/float.h",
"arch/loongarch64/bits/posix.h",
"arch/loongarch64/bits/reg.h",
"arch/loongarch64/bits/setjmp.h",
"arch/loongarch64/bits/signal.h",
"arch/loongarch64/bits/stat.h",
"arch/loongarch64/bits/stdint.h",
"arch/loongarch64/bits/user.h",
"arch/generic/bits/dirent.h",
"arch/generic/bits/errno.h",
"arch/generic/bits/hwcap.h",
"arch/generic/bits/ioctl_fix.h",
"arch/generic/bits/ioctl.h",
"arch/generic/bits/io.h",
"arch/generic/bits/ipc.h",
"arch/generic/bits/ipcstat.h",
"arch/generic/bits/kd.h",
"arch/generic/bits/link.h",
"arch/generic/bits/mman.h",
"arch/generic/bits/msg.h",
"arch/generic/bits/poll.h",
"arch/generic/bits/sem.h",
"arch/generic/bits/shm.h",
"arch/generic/bits/socket.h",
"arch/generic/bits/soundcard.h",
"arch/generic/bits/termios.h",
"arch/generic/bits/vt.h",
"arch/generic/bits/statfs.h",
"arch/generic/bits/ptrace.h",
"arch/generic/bits/resource.h",
"arch/generic/bits/fcntl.h",
"arch/generic/bits/limits.h",
]
} }
musl_inc_arpa_files = [ musl_inc_arpa_files = [
@ -2117,239 +2301,245 @@ musl_inc_root_files = [
"include/wchar.h", "include/wchar.h",
"include/wctype.h", "include/wctype.h",
"include/wordexp.h", "include/wordexp.h",
"include/syscall_hooks.h",
"include/pthread_ffrt.h",
] ]
musl_src_porting_file = [ musl_src_files_ext = [
"arch/aarch64/syscall_arch.h", "src/internal/linux/musl_log.c",
"arch/arm/bits/fenv.h", "src/internal/linux/vdso.c",
"arch/generic/bits/shm.h", "src/hook/linux/malloc_common.c",
"arch/generic/crtbrand.s", "src/hook/linux/musl_preinit.c",
"arch/x86_64/bits/float.h", "src/hook/linux/musl_socket_preinit.c",
"include/ctype.h", "src/hook/linux/socket_common.c",
"include/info/application_target_sdk_version.h", "src/hook/linux/memory_trace.c",
"include/info/device_api_version.h", "src/hook/linux/musl_fdtrack.c",
"include/info/fatal_message.h", "src/hook/linux/musl_fdtrack_load.c",
"include/malloc.h", "src/hook/linux/musl_preinit_common.c",
"include/pthread.h", "src/hook/linux/musl_socket_preinit_common.c",
"include/fcntl.h", "crt/linux/crtplus.c",
"include/poll.h", "src/linux/arm/linux/flock.s",
"include/stdio.h", "src/linux/aarch64/linux/flock.s",
"include/stdlib.h", "src/linux/x86_64/linux/flock.s",
"include/string.h", "src/exit/linux/assert.c",
"include/sys/stat.h", "src/exit/linux/atexit.c",
"include/sys/sspret.h", "src/fdsan/linux/fdsan.c",
"include/sys/cdefs.h", "src/fortify/linux/fortify.c",
"include/fortify/fcntl.h", "src/gwp_asan/linux/gwp_asan.c",
"include/fortify/fortify.h", "src/gwp_asan/linux/gwp_asan.h",
"include/fortify/poll.h", "src/hilog/linux/hilog_adapter.c",
"include/fortify/socket.h", "src/hilog/linux/hilog_common.h",
"include/fortify/stat.h", "src/hilog/linux/output_p.inl",
"include/fortify/stdlib.h", "src/hilog/linux/vsnprintf_s_p.c",
"include/fortify/string.h", "src/hilog/linux/vsnprintf_s_p.h",
"include/fortify/unistd.h", "src/linux/linux/clone.c",
"include/fortify/stdio.h", "src/linux/linux/getprocpid.c",
"src/fortify/fortify.c", "src/network/linux/getaddrinfo.c",
"include/sys/capability.h", "src/syscall_hooks/linux/syscall_hooks.c",
"include/sys/reboot.h", "src/signal/linux/sigaction.c",
"include/sys/socket.h", "src/thread/linux/pthread_create.c",
"include/sys/sysinfo.h", "src/trace/linux/trace_marker.c",
"include/signal.h", "include/trace/linux/trace_marker.h",
"include/sigchain.h", "src/info/linux/application_target_sdk_version.c",
"include/sched.h", "src/info/linux/device_api_version.c",
"src/internal/dynlink.h", "src/info/linux/fatal_message.c",
"include/sys/tgkill.h", "ldso/linux/cfi.c",
"include/trace/trace_marker.h", "ldso/linux/dynlink.c",
"include/unistd.h", "ldso/linux/dynlink_rand.h",
"include/dlfcn.h", "ldso/linux/ld_log.h",
"include/dlfcn_ext.h", "ldso/linux/namespace.h",
"src/fcntl/open.c", "ldso/linux/ns_config.h",
"src/hilog/hilog_common.h", "ldso/linux/strops.c",
"src/hilog/vsnprintf_s_p.h", "ldso/linux/zip_archive.h",
"src/internal/hilog_adapter.h", "ldso/linux/cfi.h",
"ldso/linux/dynlink_rand.c",
"ldso/linux/ld_log.c",
"ldso/linux/namespace.c",
"ldso/linux/ns_config.c",
"ldso/linux/strops.h",
"include/sys/linux/capability.h",
"include/sys/linux/cdefs.h",
"include/sys/linux/sspret.h",
"include/info/linux/application_target_sdk_version.h",
"include/info/linux/device_api_version.h",
"include/info/linux/fatal_message.h",
"include/fortify/linux/fcntl.h",
"include/fortify/linux/poll.h",
"include/fortify/linux/stat.h",
"include/fortify/linux/stdlib.h",
"include/fortify/linux/unistd.h",
"include/fortify/linux/fortify.h",
"include/fortify/linux/socket.h",
"include/fortify/linux/stdio.h",
"include/fortify/linux/string.h",
"include/linux/dlfcn_ext.h",
"include/linux/sigchain.h",
"include/linux/syscall_hooks.h",
"src/ldso/arm/linux/dlvsym.s",
"src/ldso/aarch64/linux/dlvsym.s",
"src/ldso/x86_64/linux/dlvsym.s",
"src/misc/aarch64/linux/fstat.s",
"src/misc/aarch64/linux/syscall.s",
"src/malloc/linux/calloc.c",
"src/malloc/linux/stats.c",
"src/sigchain/linux/sigchain.c",
"src/internal/linux/malloc_config.h",
"src/internal/linux/proc_xid_impl.h",
"src/internal/linux/malloc_random.h",
"src/internal/linux/musl_log.h",
"src/internal/linux/syscall_hooks.h",
"src/hook/linux/common_def.h",
"src/hook/linux/musl_fdtrack.h",
"src/hook/linux/musl_fdtrack_hook.h",
"src/hook/linux/musl_malloc_dispatch.h",
"src/hook/linux/musl_malloc_dispatch_table.h",
"src/hook/linux/musl_preinit_common.h",
"src/hook/linux/musl_malloc.h",
"src/hook/linux/musl_socket_dispatch.h",
"src/hook/linux/musl_socket_preinit_common.h",
"src/hook/linux/memory_trace.h",
"src/hook/linux/musl_socket.h",
]
musl_src_linux_files = [
"src/internal/malloc_config.h",
"src/internal/proc_xid_impl.h",
"src/internal/malloc_random.h",
"src/internal/musl_log.h", "src/internal/musl_log.h",
"src/internal/syscall_hooks.h",
"src/hook/common_def.h",
"src/hook/musl_fdtrack.h",
"src/hook/musl_fdtrack_hook.h",
"src/hook/musl_malloc_dispatch.h",
"src/hook/musl_malloc_dispatch_table.h",
"src/hook/musl_preinit_common.h",
"src/hook/musl_malloc.h",
"src/hook/musl_socket_dispatch.h",
"src/hook/musl_socket_preinit_common.h",
"src/hook/memory_trace.h",
"src/hook/musl_socket.h",
"src/internal/musl_log.c",
"src/internal/vdso.c",
"src/hook/malloc_common.c",
"src/hook/musl_preinit.c",
"src/hook/musl_socket_preinit.c",
"src/hook/socket_common.c",
"src/hook/memory_trace.c",
"src/hook/musl_fdtrack.c",
"src/hook/musl_fdtrack_load.c",
"src/hook/musl_preinit_common.c",
"src/hook/musl_socket_preinit_common.c",
"crt/crtplus.c",
"src/linux/arm/flock.s",
"src/linux/aarch64/flock.s",
"src/linux/x86_64/flock.s",
"src/exit/assert.c",
"src/exit/atexit.c",
"src/fdsan/fdsan.c",
"src/fortify/fortify.c",
"src/gwp_asan/gwp_asan.c",
"src/gwp_asan/gwp_asan.h",
"src/hilog/hilog_adapter.c",
"src/hilog/hilog_common.h",
"src/hilog/output_p.inl",
"src/hilog/vsnprintf_s_p.c",
"src/hilog/vsnprintf_s_p.h",
"src/linux/clone.c",
"src/linux/getprocpid.c",
"src/network/getaddrinfo.c",
"src/syscall_hooks/syscall_hooks.c",
"src/signal/sigaction.c",
"src/thread/pthread_create.c",
"src/trace/trace_marker.c",
"include/trace/trace_marker.h",
"src/info/application_target_sdk_version.c", "src/info/application_target_sdk_version.c",
"src/info/device_api_version.c", "src/info/device_api_version.c",
"src/info/fatal_message.c", "src/info/fatal_message.c",
"src/env/__init_tls.c", "ldso/cfi.c",
"src/env/__libc_start_main.c", "ldso/dynlink.c",
"src/internal/pthread_impl.h", "ldso/dynlink_rand.h",
"src/internal/locale_impl.h", "ldso/ld_log.h",
"src/internal/syscall.h",
"src/internal/services.h",
"src/internal/network_conf_function.h",
"src/internal/network_conf_function.c",
"src/internal/proc_xid_impl.h",
"ldso/namespace.h", "ldso/namespace.h",
"ldso/ns_config.h", "ldso/ns_config.h",
"ldso/strops.h", "ldso/strops.c",
"src/legacy/ulimit.c", "ldso/zip_archive.h",
"src/linux/clone.c",
"src/linux/getprocpid.c",
"src/linux/reboot.c",
"src/linux/tgkill.c",
"src/malloc/mallocng/malloc_usable_size.c",
"src/malloc/mallocng/malloc.c",
"src/malloc/mallocng/meta.h",
"src/malloc/mallocng/donate.c",
"src/malloc/mallocng/aligned_alloc.c",
"src/malloc/lite_malloc.c",
"src/malloc/stats.c",
"src/malloc/calloc.c",
"src/malloc/free.c",
"src/network/getnameinfo.c",
"src/malloc/libc_calloc.c",
"src/malloc/realloc.c",
"src/network/inet_legacy.c",
"src/network/lookup_name.c",
"src/network/lookup_serv.c",
"src/network/resolvconf.c",
"src/network/socket.c",
"src/passwd/getspnam_r.c",
"src/sched/sched_setparam.c",
"src/sched/sched_getparam.c",
"src/sched/sched_setscheduler.c",
"src/sched/sched_getscheduler.c",
"src/thread/arm/clone.s",
"src/thread/arm/syscall_cp.s",
"src/thread/pthread_mutex_clocklock.c",
"src/thread/pthread_mutex_timedlock.c",
"src/thread/pthread_mutex_lock.c",
"src/thread/pthread_mutex_timedlock_monotonic_np.c",
"src/thread/pthread_mutex_lock_timeout_np.c",
"src/thread/pthread_mutex_init.c",
"src/thread/pthread_rwlock_clockrdlock.c",
"src/thread/pthread_rwlock_timedrdlock.c",
"src/thread/pthread_rwlock_timedrdlock_monotonic_np.c",
"src/thread/pthread_rwlock_init.c",
"src/thread/pthread_cond_timedwait.c",
"src/thread/pthread_cond_timedwait_monotonic_np.c",
"src/thread/pthread_cond_timeout_np.c",
"src/thread/pthread_cond_clockwait.c",
"src/thread/pthread_cond_init.c",
"src/thread/pthread_create.c",
"src/thread/pthread_rwlock_clockwrlock.c",
"src/thread/pthread_rwlock_timedwrlock_monotonic_np.c",
"src/thread/pthread_rwlock_timedwrlock.c",
"src/thread/pthread_sigmask.c",
"src/trace/trace_marker.c",
"src/ldso/dlclose.c",
"src/ldso/dlerror.c",
"ldso/dynlink.c",
"src/exit/atexit.c",
"crt/arm/crti.s",
"crt/aarch64/crti.s",
"crt/crtplus.c",
"ldso/cfi.h", "ldso/cfi.h",
"ldso/ld_log.h", "ldso/dynlink_rand.c",
"ldso/ld_log.c", "ldso/ld_log.c",
"ldso/namespace.c", "ldso/namespace.c",
"ldso/ns_config.c", "ldso/ns_config.c",
"ldso/strops.c", "ldso/strops.h",
"ldso/cfi.c", "include/sys/capability.h",
"ldso/dynlink_rand.c", "include/sys/cdefs.h",
"ldso/dynlink_rand.h", "include/sys/sspret.h",
"src/sched/sched_cpualloc.c", "include/info/application_target_sdk_version.h",
"src/signal/signal.c", "include/info/device_api_version.h",
"src/signal/sigaction.c", "include/info/fatal_message.h",
"src/signal/siginterrupt.c", "include/fortify/fcntl.h",
"include/langinfo.h", "include/fortify/poll.h",
"include/locale.h", "include/fortify/stat.h",
"src/hilog/hilog_adapter.c", "include/fortify/stdlib.h",
"src/hilog/vsnprintf_s_p.c", "include/fortify/unistd.h",
"src/internal/libc.h", "include/fortify/fortify.h",
"src/locale/dcngettext.c", "include/fortify/socket.h",
"src/locale/locale_map.c", "include/fortify/stdio.h",
"src/locale/langinfo.c", "include/fortify/string.h",
"src/locale/newlocale.c", "include/dlfcn_ext.h",
"src/time/__tz.c", "include/sigchain.h",
"src/time/gmtime_r.c", "include/syscall_hooks.h",
"src/time/strftime.c",
"src/time/strptime.c",
"src/time/time_impl.h",
"src/ldso/aarch64/dlvsym.s",
"src/ldso/arm/dlvsym.s", "src/ldso/arm/dlvsym.s",
"src/ldso/riscv64/dlvsym.s", "src/ldso/aarch64/dlvsym.s",
"src/ldso/x86_64/dlvsym.s", "src/ldso/x86_64/dlvsym.s",
"src/stdio/__fdopen.c",
"src/stdio/vfprintf.c",
"src/stdio/__stdio_read.c",
"src/stdio/__stdio_write.c",
"src/stdio/__stdout_write.c",
"src/stdio/fread.c",
"src/stdio/fmemopen.c",
"src/stdio/freopen.c",
"src/stdio/stdin.c",
"src/stdio/__fmodeflags.c",
"src/stdio/fopen.c",
"src/stdio/ofl.c",
"src/stdio/fclose.c",
"src/stdio/__toread.c",
"src/stdio/__towrite.c",
"src/stdio/stderr.c",
"src/stdio/fgets.c",
"src/stdio/vsnprintf.c",
"src/stdio/vsscanf.c",
"src/internal/stdio_impl.h",
"src/internal/vdso.c",
"src/time/clock_gettime.c",
"src/time/clock_getres.c",
"src/time/gettimeofday.c",
"src/time/time.c",
"src/unistd/getpid.c",
"src/process/_Fork.c",
"src/process/vfork.c",
"src/process/arm/__vfork.s",
"src/process/x86_64/__vfork.s",
"src/linux/cache.c",
"src/sched/sched_getcpu.c",
"src/sigchain/sigchain.c",
"src/conf/legacy.c",
"src/conf/sysconf.c",
"src/env/getenv.c",
"src/string/strcasecmp.c",
"src/string/strncasecmp.c",
"src/string/strncat.c",
"src/string/stpncpy.c",
"src/string/strncpy.c",
"src/stat/fstat.c",
"src/string/strcspn.c",
"src/thread/pthread_once.c",
"src/thread/pthread_cancel.c",
"src/mq/mq_notify.c",
"src/aio/aio.c",
"src/misc/aarch64/fstat.s", "src/misc/aarch64/fstat.s",
"src/misc/aarch64/syscall.s", "src/misc/aarch64/syscall.s",
"src/stdlib/strtol.c", "src/malloc/calloc.c",
"src/stdlib/strtod.c", "src/malloc/stats.c",
"src/thread/sem_timedwait.c", "src/sigchain/sigchain.c",
"src/stdio/vfscanf.c",
"src/stdio/fileno.c",
] ]
if (musl_arch == "arm") {
musl_src_file += [
"src/process/arm/__vfork.s",
"src/ldso/arm/dlvsym.s",
]
} else if (musl_arch == "aarch64") {
musl_src_file += [
"arch/aarch64/syscall_arch.h",
"src/misc/aarch64/fstat.s",
"src/misc/aarch64/syscall.s",
"src/ldso/aarch64/dlvsym.s",
]
} else if (musl_arch == "loongarch64") {
musl_src_file += [ "arch/loongarch64/syscall_arch.h" ]
} else if (musl_arch == "x86_64") {
musl_src_file += [
"src/process/x86_64/__vfork.s",
"src/ldso/x86_64/dlvsym.s",
]
}
musl_inc_hook_files = [ musl_inc_hook_files = [
"//third_party/musl/porting/linux/user/src/internal/hilog_adapter.h", "//third_party/musl/src/internal/hilog_adapter.h",
"//third_party/musl/porting/linux/user/src/internal/musl_log.h", "//third_party/musl/src/internal/linux/musl_log.h",
"//third_party/musl/porting/linux/user/src/hook/memory_trace.h", "//third_party/musl/src/hook/linux/memory_trace.h",
"//third_party/musl/porting/linux/user/src/hook/musl_malloc_dispatch_table.h", "//third_party/musl/src/hook/linux/musl_fdtrack.h",
"//third_party/musl/porting/linux/user/src/hook/musl_malloc_dispatch.h", "//third_party/musl/src/hook/linux/musl_fdtrack_hook.h",
"//third_party/musl/porting/linux/user/src/hook/musl_preinit_common.h", "//third_party/musl/src/hook/linux/musl_malloc_dispatch_table.h",
"//third_party/musl/src/hook/linux/musl_malloc_dispatch.h",
"//third_party/musl/src/hook/linux/musl_preinit_common.h",
"//third_party/musl/src/hook/linux/musl_socket_dispatch.h",
] ]
added_freebsd_files = [ added_freebsd_files = [
"$FREEBSD_DIR/contrib/gdtoa/strtod.c", "$FREEBSD_DIR/contrib/tcp_wrappers/strcasecmp.c",
"$FREEBSD_DIR/contrib/gdtoa/gethex.c", "$FREEBSD_DIR/lib/libc/gen/arc4random.c",
"$FREEBSD_DIR/contrib/gdtoa/smisc.c", "$FREEBSD_DIR/lib/libc/gen/arc4random_uniform.c",
"$FREEBSD_DIR/contrib/gdtoa/misc.c", "$FREEBSD_DIR/lib/libc/stdlib/qsort.c",
"$FREEBSD_DIR/contrib/gdtoa/strtord.c", "$FREEBSD_DIR/lib/libc/stdlib/strtoimax.c",
"$FREEBSD_DIR/contrib/gdtoa/hexnan.c", "$FREEBSD_DIR/lib/libc/stdlib/strtoul.c",
"$FREEBSD_DIR/contrib/gdtoa/gmisc.c", "$FREEBSD_DIR/lib/libc/stdlib/strtoumax.c",
"$FREEBSD_DIR/contrib/gdtoa/hd_init.c",
"$FREEBSD_DIR/contrib/gdtoa/strtodg.c",
"$FREEBSD_DIR/contrib/gdtoa/ulp.c",
"$FREEBSD_DIR/contrib/gdtoa/strtof.c",
"$FREEBSD_DIR/contrib/gdtoa/sum.c",
"$FREEBSD_DIR/lib/libc/gdtoa/glue.c",
"$FREEBSD_DIR/lib/libc/stdio/parsefloat.c",
] ]
freebsd_headers = [ "$FREEBSD_DIR/contrib/libexecinfo/execinfo.h" ]
freebsd_sys_headers = [ "$FREEBSD_DIR/sys/sys/queue.h" ] freebsd_sys_headers = [ "$FREEBSD_DIR/sys/sys/queue.h" ]

View File

@ -302,6 +302,7 @@ template("musl_libs") {
"//third_party/jemalloc/include/", "//third_party/jemalloc/include/",
"//third_party/jemalloc/include/jemalloc/internal", "//third_party/jemalloc/include/jemalloc/internal",
"//third_party/jemalloc/include/jemalloc", "//third_party/jemalloc/include/jemalloc",
"//third_party/FreeBSD/contrib/libexecinfo",
] ]
} }
@ -333,25 +334,43 @@ template("musl_libs") {
source_set("soft_musl_src") { source_set("soft_musl_src") {
sources_orig = [] sources_orig = []
sources = [] sources = []
include_dirs = []
sources_orig = musl_src_arch_file + musl_src_file sources_orig = musl_src_arch_file + musl_src_file
sources_orig -= musl_src_filterout
sources_orig -= [ sources_orig -= [
"src/env/__stack_chk_fail.c",
"src/env/__libc_start_main.c",
"src/env/__init_tls.c",
"src/string/memset.c",
"src/string/mempcpy.c", "src/string/mempcpy.c",
"src/string/memset.c",
"src/env/__init_tls.c",
"src/env/__libc_start_main.c",
"src/env/__stack_chk_fail.c",
"src/stdlib/qsort.c", "src/stdlib/qsort.c",
"src/stdlib/qsort_nr.c", "src/stdlib/qsort_nr.c",
"src/string/strncpy.c",
] ]
if (musl_arch == "mips") {
sources_orig += [ "src/string/memset.c" ]
}
sources_orig -= musl_src_filterout
sources += [ freebsd_files = [
"$FREEBSD_DIR/contrib/tcp_wrappers/strcasecmp.c", "//third_party/FreeBSD/contrib/gdtoa/strtod.c",
"$FREEBSD_DIR/lib/libc/stdlib/qsort.c", "//third_party/FreeBSD/contrib/gdtoa/gethex.c",
"//third_party/FreeBSD/contrib/gdtoa/smisc.c",
"//third_party/FreeBSD/contrib/gdtoa/misc.c",
"//third_party/FreeBSD/contrib/gdtoa/strtord.c",
"//third_party/FreeBSD/contrib/gdtoa/hexnan.c",
"//third_party/FreeBSD/contrib/gdtoa/gmisc.c",
"//third_party/FreeBSD/contrib/gdtoa/hd_init.c",
"//third_party/FreeBSD/contrib/gdtoa/strtodg.c",
"//third_party/FreeBSD/contrib/gdtoa/ulp.c",
"//third_party/FreeBSD/contrib/gdtoa/strtof.c",
"//third_party/FreeBSD/contrib/gdtoa/sum.c",
"//third_party/FreeBSD/lib/libc/gdtoa/glue.c",
"//third_party/FreeBSD/lib/libc/stdio/parsefloat.c",
"//third_party/FreeBSD/contrib/tcp_wrappers/strcasecmp.c",
"//third_party/FreeBSD/lib/libc/gen/arc4random.c",
"//third_party/FreeBSD/lib/libc/gen/arc4random_uniform.c",
"//third_party/FreeBSD/lib/libc/stdlib/qsort.c",
"//third_party/FreeBSD/lib/libc/stdlib/strtoimax.c",
"//third_party/FreeBSD/lib/libc/stdlib/strtoul.c",
"//third_party/FreeBSD/lib/libc/stdlib/strtoumax.c",
"//third_party/musl/third_party/openbsd/lib/libc/string/strncpy.c",
] ]
if (musl_arch == "arm") { if (musl_arch == "arm") {
@ -382,6 +401,7 @@ template("musl_libs") {
"src/math/powl.c", "src/math/powl.c",
"src/math/sinf.c", "src/math/sinf.c",
"src/math/cosf.c", "src/math/cosf.c",
"src/linux/flock.c",
] ]
} else if (musl_arch == "aarch64") { } else if (musl_arch == "aarch64") {
sources_orig -= [ sources_orig -= [
@ -416,12 +436,23 @@ template("musl_libs") {
"src/math/sincos.c", "src/math/sincos.c",
"src/math/pow.c", "src/math/pow.c",
"src/math/powf.c", "src/math/powf.c",
"src/linux/flock.c",
] ]
} else if (musl_arch == "x86_64") { } else if (musl_arch == "x86_64") {
sources_orig -= [ "src/thread/${musl_arch}/__set_thread_area.s" ] sources_orig -= [
"src/thread/${musl_arch}/__set_thread_area.s",
"src/linux/flock.c",
]
} }
defines = [] defines = []
defines += [ "FEATURE_ICU_LOCALE" ]
# There are two ways to implement cxa_thread_atexit_impl:
# - CXA_THREAD_USE_TSD(default): use pthread_key_xxx to implement cxa_thread_atexit_impl.
# - CXA_THREAD_USE_TLS: put dtors in pthread to implement cxa_thread_atexit_impl.
defines += [ "CXA_THREAD_USE_TSD" ]
if (musl_arch == "arm") { if (musl_arch == "arm") {
defines += [ "MUSL_ARM_ARCH" ] defines += [ "MUSL_ARM_ARCH" ]
} }
@ -477,8 +508,7 @@ template("musl_libs") {
"$OPTRTDIR/string/arm/strcmp.S", "$OPTRTDIR/string/arm/strcmp.S",
"$OPTRTDIR/string/arm/strlen-armv6t2.S", "$OPTRTDIR/string/arm/strlen-armv6t2.S",
] ]
sources += freebsd_files
sources += added_freebsd_files
asmflags = [ asmflags = [
"-D__memcpy_arm = memcpy", "-D__memcpy_arm = memcpy",
"-D__memchr_arm = memchr", "-D__memchr_arm = memchr",
@ -487,6 +517,7 @@ template("musl_libs") {
"-D__strlen_armv6t2 = strlen", "-D__strlen_armv6t2 = strlen",
] ]
} else if (musl_arch == "aarch64") { } else if (musl_arch == "aarch64") {
sources += freebsd_files
if (defined(ARM_FEATURE_SVE)) { if (defined(ARM_FEATURE_SVE)) {
sources += [ sources += [
"$OPTRTDIR/string/aarch64/memchr-sve.S", "$OPTRTDIR/string/aarch64/memchr-sve.S",
@ -565,7 +596,6 @@ template("musl_libs") {
"$OPTRTDIR/string/aarch64/strnlen.S", "$OPTRTDIR/string/aarch64/strnlen.S",
"$OPTRTDIR/string/aarch64/strrchr.S", "$OPTRTDIR/string/aarch64/strrchr.S",
] ]
sources += added_freebsd_files
asmflags = [ asmflags = [
"-D__memmove_aarch64 = memmove", "-D__memmove_aarch64 = memmove",
"-D__memcpy_aarch64 = memcpy", "-D__memcpy_aarch64 = memcpy",
@ -588,37 +618,19 @@ template("musl_libs") {
cflags = [ cflags = [
"-O3", "-O3",
"-fPIC", "-fPIC",
"-ffreestanding",
"-fstack-protector-strong", "-fstack-protector-strong",
"-flto",
] ]
if (use_jemalloc) {
defines += [ "USE_JEMALLOC" ]
if (use_jemalloc_dfx_intf) {
defines += [ "USE_JEMALLOC_DFX_INTF" ]
}
include_dirs = [ "//third_party/jemalloc/include/jemalloc" ]
}
if (!defined(include_dirs)) {
if (musl_arch == "aarch64") {
include_dirs = [ "//third_party/FreeBSD/lib/libc/aarch64" ]
}
if (musl_arch == "arm") {
include_dirs = [ "//third_party/FreeBSD/lib/libc/arm" ]
}
} else {
if (musl_arch == "aarch64") {
include_dirs += [ "//third_party/FreeBSD/lib/libc/aarch64" ]
}
if (musl_arch == "arm") {
include_dirs += [ "//third_party/FreeBSD/lib/libc/arm" ]
}
}
configs -= musl_inherited_configs configs -= musl_inherited_configs
configs += [ ":soft_musl_config" ] configs += [ ":soft_musl_config" ]
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" ]
if (!defined(defines)) { if (!defined(defines)) {
defines = [] defines = []
@ -633,7 +645,8 @@ template("musl_libs") {
defines += [ "TARGET_GUARD_SIZE=${_product_config.device_guard_size}" ] defines += [ "TARGET_GUARD_SIZE=${_product_config.device_guard_size}" ]
} }
} }
external_deps = []
external_deps += [ "FreeBSD:libc_static" ]
deps = porting_deps deps = porting_deps
} }
@ -827,6 +840,8 @@ template("musl_libs") {
":soft_musl_src_nossp", ":soft_musl_src_nossp",
":soft_musl_src_optimize", ":soft_musl_src_optimize",
] ]
external_deps = []
external_deps = [ "FreeBSD:libc_static" ]
output_name = "libc" output_name = "libc"
complete_static_lib = true complete_static_lib = true
} }

View File

@ -636,6 +636,10 @@ libdefault_common_sources = [
"//third_party/openssl/providers/implementations/ciphers/cipher_cts.c", "//third_party/openssl/providers/implementations/ciphers/cipher_cts.c",
"//third_party/openssl/providers/implementations/ciphers/cipher_null.c", "//third_party/openssl/providers/implementations/ciphers/cipher_null.c",
"//third_party/openssl/providers/implementations/ciphers/cipher_sm4.c", "//third_party/openssl/providers/implementations/ciphers/cipher_sm4.c",
"//third_party/openssl/providers/implementations/ciphers/cipher_sm4_ccm.c",
"//third_party/openssl/providers/implementations/ciphers/cipher_sm4_ccm_hw.c",
"//third_party/openssl/providers/implementations/ciphers/cipher_sm4_gcm.c",
"//third_party/openssl/providers/implementations/ciphers/cipher_sm4_gcm_hw.c",
"//third_party/openssl/providers/implementations/ciphers/cipher_sm4_hw.c", "//third_party/openssl/providers/implementations/ciphers/cipher_sm4_hw.c",
"//third_party/openssl/providers/implementations/ciphers/cipher_tdes.c", "//third_party/openssl/providers/implementations/ciphers/cipher_tdes.c",
"//third_party/openssl/providers/implementations/ciphers/cipher_tdes_common.c", "//third_party/openssl/providers/implementations/ciphers/cipher_tdes_common.c",