提交 0c2d8bf9 编写于 作者: D dhy308

L1_linux workaround for musl v1.2.3

    Issue: I6I6WX
    Test: Build & Boot Devices
Signed-off-by: Ndhy308 <tony.gan@huawei.com>
上级 e6cb2bc0
#
# Makefile for musl (requires GNU make)
#
# This is how simple every makefile should be...
# No, I take that back - actually most should be less than half this size.
#
# Use config.mak to override any of the following variables.
# Do not make changes here.
#
srcdir = .
exec_prefix = /usr/local
bindir = $(exec_prefix)/bin
prefix = /usr/local/musl
includedir = $(prefix)/include
libdir = $(prefix)/lib
syslibdir = /lib
SRC_DIRS = $(addprefix $(srcdir)/,src/* crt ldso $(COMPAT_SRC_DIRS))
BASE_GLOBS = $(addsuffix /*.c,$(SRC_DIRS))
ARCH_GLOBS = $(addsuffix /$(ARCH)/*.[csS],$(SRC_DIRS))
BASE_SRCS = $(sort $(wildcard $(BASE_GLOBS)))
ARCH_SRCS = $(sort $(wildcard $(ARCH_GLOBS)))
BASE_OBJS = $(patsubst $(srcdir)/%,%.o,$(basename $(BASE_SRCS)))
ARCH_OBJS = $(patsubst $(srcdir)/%,%.o,$(basename $(ARCH_SRCS)))
REPLACED_OBJS = $(sort $(subst /$(ARCH)/,/,$(ARCH_OBJS)))
ALL_OBJS = $(addprefix obj/, $(filter-out $(REPLACED_OBJS), $(sort $(BASE_OBJS) $(ARCH_OBJS))))
LIBC_OBJS = $(filter obj/src/%,$(ALL_OBJS)) $(filter obj/compat/%,$(ALL_OBJS))
LDSO_OBJS = $(filter obj/ldso/%,$(ALL_OBJS:%.o=%.lo))
CRT_OBJS = $(filter obj/crt/%,$(ALL_OBJS))
AOBJS = $(LIBC_OBJS)
LOBJS = $(LIBC_OBJS:.o=.lo)
GENH = obj/include/bits/alltypes.h obj/include/bits/syscall.h
GENH_INT = obj/src/internal/version.h
IMPH = $(addprefix $(srcdir)/, src/internal/stdio_impl.h src/internal/pthread_impl.h src/internal/locale_impl.h src/internal/libc.h)
LDFLAGS =
LDFLAGS_AUTO =
LIBCC = -lgcc
CPPFLAGS =
CFLAGS =
CFLAGS_AUTO = -Os -pipe
CFLAGS_C99FSE = -std=c99 -ffreestanding -nostdinc
CFLAGS_ALL = $(CFLAGS_C99FSE)
CFLAGS_ALL += -D_XOPEN_SOURCE=700 -I$(srcdir)/arch/$(ARCH) -I$(srcdir)/arch/generic -Iobj/src/internal -I$(srcdir)/src/include -I$(srcdir)/src/internal -Iobj/include -I$(srcdir)/include
CFLAGS_ALL += $(CPPFLAGS) $(CFLAGS_AUTO) $(CFLAGS)
LDFLAGS_ALL = $(LDFLAGS_AUTO) $(LDFLAGS)
AR = $(CROSS_COMPILE)ar
RANLIB = $(CROSS_COMPILE)ranlib
INSTALL = $(srcdir)/tools/install.sh
ARCH_INCLUDES = $(wildcard $(srcdir)/arch/$(ARCH)/bits/*.h)
GENERIC_INCLUDES = $(wildcard $(srcdir)/arch/generic/bits/*.h)
INCLUDES = $(wildcard $(srcdir)/include/*.h $(srcdir)/include/*/*.h)
ALL_INCLUDES = $(sort $(INCLUDES:$(srcdir)/%=%) $(GENH:obj/%=%) $(ARCH_INCLUDES:$(srcdir)/arch/$(ARCH)/%=include/%) $(GENERIC_INCLUDES:$(srcdir)/arch/generic/%=include/%))
EMPTY_LIB_NAMES = m rt pthread crypt util xnet resolv dl
EMPTY_LIBS = $(EMPTY_LIB_NAMES:%=lib/lib%.a)
CRT_LIBS = $(addprefix lib/,$(notdir $(CRT_OBJS)))
STATIC_LIBS = lib/libc.a
SHARED_LIBS = lib/libc.so
TOOL_LIBS = lib/musl-gcc.specs
ALL_LIBS = $(CRT_LIBS) $(STATIC_LIBS) $(SHARED_LIBS) $(EMPTY_LIBS) $(TOOL_LIBS)
ALL_TOOLS = obj/musl-gcc
WRAPCC_GCC = gcc
WRAPCC_CLANG = clang
LDSO_PATHNAME = $(syslibdir)/ld-musl-$(ARCH)$(SUBARCH).so.1
-include config.mak
-include $(srcdir)/arch/$(ARCH)/arch.mak
ifeq ($(ARCH),)
all:
@echo "Please set ARCH in config.mak before running make."
@exit 1
else
all: $(ALL_LIBS) $(ALL_TOOLS)
OBJ_DIRS = $(sort $(patsubst %/,%,$(dir $(ALL_LIBS) $(ALL_TOOLS) $(ALL_OBJS) $(GENH) $(GENH_INT))) obj/include)
$(ALL_LIBS) $(ALL_TOOLS) $(ALL_OBJS) $(ALL_OBJS:%.o=%.lo) $(GENH) $(GENH_INT): | $(OBJ_DIRS)
$(OBJ_DIRS):
mkdir -p $@
obj/include/bits/alltypes.h: $(srcdir)/arch/$(ARCH)/bits/alltypes.h.in $(srcdir)/include/alltypes.h.in $(srcdir)/tools/mkalltypes.sed
sed -f $(srcdir)/tools/mkalltypes.sed $(srcdir)/arch/$(ARCH)/bits/alltypes.h.in $(srcdir)/include/alltypes.h.in > $@
obj/include/bits/syscall.h: $(srcdir)/arch/$(ARCH)/bits/syscall.h.in
cp $< $@
sed -n -e s/__NR_/SYS_/p < $< >> $@
obj/src/internal/version.h: $(wildcard $(srcdir)/VERSION $(srcdir)/.git)
printf '#define VERSION "%s"\n' "$$(cd $(srcdir); sh tools/version.sh)" > $@
obj/src/internal/version.o obj/src/internal/version.lo: obj/src/internal/version.h
obj/crt/rcrt1.o obj/ldso/dlstart.lo obj/ldso/dynlink.lo: $(srcdir)/src/internal/dynlink.h $(srcdir)/arch/$(ARCH)/reloc.h
obj/crt/crt1.o obj/crt/scrt1.o obj/crt/rcrt1.o obj/ldso/dlstart.lo: $(srcdir)/arch/$(ARCH)/crt_arch.h
obj/crt/rcrt1.o: $(srcdir)/ldso/dlstart.c
obj/crt/Scrt1.o obj/crt/rcrt1.o: CFLAGS_ALL += -fPIC
OPTIMIZE_SRCS = $(wildcard $(OPTIMIZE_GLOBS:%=$(srcdir)/src/%))
$(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.o) $(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.lo): CFLAGS += -O3
MEMOPS_OBJS = $(filter %/memcpy.o %/memmove.o %/memcmp.o %/memset.o, $(LIBC_OBJS))
$(MEMOPS_OBJS) $(MEMOPS_OBJS:%.o=%.lo): CFLAGS_ALL += $(CFLAGS_MEMOPS)
NOSSP_OBJS = $(CRT_OBJS) $(LDSO_OBJS) $(filter \
%/__libc_start_main.o %/__init_tls.o %/__stack_chk_fail.o \
%/__set_thread_area.o %/memset.o %/memcpy.o \
, $(LIBC_OBJS))
$(NOSSP_OBJS) $(NOSSP_OBJS:%.o=%.lo): CFLAGS_ALL += $(CFLAGS_NOSSP)
$(CRT_OBJS): CFLAGS_ALL += -DCRT
$(LOBJS) $(LDSO_OBJS): CFLAGS_ALL += -fPIC
CC_CMD = $(CC) $(CFLAGS_ALL) -c -o $@ $<
# Choose invocation of assembler to be used
ifeq ($(ADD_CFI),yes)
AS_CMD = LC_ALL=C awk -f $(srcdir)/tools/add-cfi.common.awk -f $(srcdir)/tools/add-cfi.$(ARCH).awk $< | $(CC) $(CFLAGS_ALL) -x assembler -c -o $@ -
else
AS_CMD = $(CC_CMD)
endif
obj/%.o: $(srcdir)/%.s
$(AS_CMD)
obj/%.o: $(srcdir)/%.S
$(CC_CMD)
obj/%.o: $(srcdir)/%.c $(GENH) $(IMPH)
$(CC_CMD)
obj/%.lo: $(srcdir)/%.s
$(AS_CMD)
obj/%.lo: $(srcdir)/%.S
$(CC_CMD)
obj/%.lo: $(srcdir)/%.c $(GENH) $(IMPH)
$(CC_CMD)
lib/libc.so: $(LOBJS) $(LDSO_OBJS)
$(CC) $(CFLAGS_ALL) $(LDFLAGS_ALL) -nostdlib -shared \
-Wl,-e,_dlstart -o $@ $(LOBJS) $(LDSO_OBJS) $(LIBCC)
lib/libc.a: $(AOBJS)
rm -f $@
$(AR) rc $@ $(AOBJS)
$(RANLIB) $@
$(EMPTY_LIBS):
rm -f $@
$(AR) rc $@
lib/%.o: obj/crt/$(ARCH)/%.o
cp $< $@
lib/%.o: obj/crt/%.o
cp $< $@
lib/musl-gcc.specs: $(srcdir)/tools/musl-gcc.specs.sh config.mak
sh $< "$(includedir)" "$(libdir)" "$(LDSO_PATHNAME)" > $@
obj/musl-gcc: config.mak
printf '#!/bin/sh\nexec "$${REALGCC:-$(WRAPCC_GCC)}" "$$@" -specs "%s/musl-gcc.specs"\n' "$(libdir)" > $@
chmod +x $@
obj/%-clang: $(srcdir)/tools/%-clang.in config.mak
sed -e 's!@CC@!$(WRAPCC_CLANG)!g' -e 's!@PREFIX@!$(prefix)!g' -e 's!@INCDIR@!$(includedir)!g' -e 's!@LIBDIR@!$(libdir)!g' -e 's!@LDSO@!$(LDSO_PATHNAME)!g' $< > $@
chmod +x $@
$(DESTDIR)$(bindir)/%: obj/%
$(INSTALL) -D $< $@
$(DESTDIR)$(libdir)/%.so: lib/%.so
$(INSTALL) -D -m 755 $< $@
$(DESTDIR)$(libdir)/%: lib/%
$(INSTALL) -D -m 644 $< $@
$(DESTDIR)$(includedir)/bits/%: $(srcdir)/arch/$(ARCH)/bits/%
$(INSTALL) -D -m 644 $< $@
$(DESTDIR)$(includedir)/bits/%: $(srcdir)/arch/generic/bits/%
$(INSTALL) -D -m 644 $< $@
$(DESTDIR)$(includedir)/bits/%: obj/include/bits/%
$(INSTALL) -D -m 644 $< $@
$(DESTDIR)$(includedir)/%: $(srcdir)/include/%
$(INSTALL) -D -m 644 $< $@
$(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so
$(INSTALL) -D -r $(DESTDIR)$(libdir)/libc.so $@ || true
install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),)
install-headers: $(ALL_INCLUDES:include/%=$(DESTDIR)$(includedir)/%)
install-tools: $(ALL_TOOLS:obj/%=$(DESTDIR)$(bindir)/%)
install: install-libs install-headers install-tools
musl-git-%.tar.gz: .git
git --git-dir=$(srcdir)/.git archive --format=tar.gz --prefix=$(patsubst %.tar.gz,%,$@)/ -o $@ $(patsubst musl-git-%.tar.gz,%,$@)
musl-%.tar.gz: .git
git --git-dir=$(srcdir)/.git archive --format=tar.gz --prefix=$(patsubst %.tar.gz,%,$@)/ -o $@ v$(patsubst musl-%.tar.gz,%,$@)
endif
clean:
rm -rf obj lib
distclean: clean
rm -f config.mak
.PHONY: all clean install install-libs install-headers install-tools
/*
* Copyright (c) 2022 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.
*/
#define __SYSCALL_LL_E(x) (x)
#define __SYSCALL_LL_O(x) (x)
#define __asm_syscall(...) do { \
__asm__ __volatile__ ( "svc 0" \
: "=r"(x0) : __VA_ARGS__ : "memory", "cc"); \
return x0; \
} while (0)
static inline long __syscall0(long n)
{
register long x8 __asm__("x8") = n;
register long x0 __asm__("x0");
__asm_syscall("r"(x8));
}
static inline long __syscall1(long n, long a)
{
register long x8 __asm__("x8") = n;
register long x0 __asm__("x0") = a;
__asm_syscall("r"(x8), "0"(x0));
}
static inline long __syscall2(long n, long a, long b)
{
register long x8 __asm__("x8") = n;
register long x0 __asm__("x0") = a;
register long x1 __asm__("x1") = b;
__asm_syscall("r"(x8), "0"(x0), "r"(x1));
}
static inline long __syscall3(long n, long a, long b, long c)
{
register long x8 __asm__("x8") = n;
register long x0 __asm__("x0") = a;
register long x1 __asm__("x1") = b;
register long x2 __asm__("x2") = c;
__asm_syscall("r"(x8), "0"(x0), "r"(x1), "r"(x2));
}
static inline long __syscall4(long n, long a, long b, long c, long d)
{
register long x8 __asm__("x8") = n;
register long x0 __asm__("x0") = a;
register long x1 __asm__("x1") = b;
register long x2 __asm__("x2") = c;
register long x3 __asm__("x3") = d;
__asm_syscall("r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3));
}
static inline long __syscall5(long n, long a, long b, long c, long d, long e)
{
register long x8 __asm__("x8") = n;
register long x0 __asm__("x0") = a;
register long x1 __asm__("x1") = b;
register long x2 __asm__("x2") = c;
register long x3 __asm__("x3") = d;
register long x4 __asm__("x4") = e;
__asm_syscall("r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3), "r"(x4));
}
static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
{
register long x8 __asm__("x8") = n;
register long x0 __asm__("x0") = a;
register long x1 __asm__("x1") = b;
register long x2 __asm__("x2") = c;
register long x3 __asm__("x3") = d;
register long x4 __asm__("x4") = e;
register long x5 __asm__("x5") = f;
__asm_syscall("r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3), "r"(x4), "r"(x5));
}
#define VDSO_USEFUL
#define VDSO_CGT_SYM "__kernel_clock_gettime"
#define VDSO_CGT_VER "LINUX_2.6.39"
#define VDSO_CGR_SYM "__kernel_clock_getres"
#define VDSO_CGR_VER "LINUX_2.6.39"
#define VDSO_GTD_SYM "__kernel_gettimeofday"
#define VDSO_GTD_VER "LINUX_2.6.39"
#define IPC_64 0
#ifndef __ARM_PCS_VFP
#define FE_ALL_EXCEPT 0
#define FE_TONEAREST 0
#else
#define FE_INVALID 1
#define FE_DIVBYZERO 2
#define FE_OVERFLOW 4
#define FE_UNDERFLOW 8
#define FE_INEXACT 16
#define FE_ALL_EXCEPT 31
#define FE_TONEAREST 0
#define FE_TOWARDZERO 0xc00000
#endif
#define FE_DOWNWARD 0x800000
#define FE_UPWARD 0x400000
typedef unsigned long fexcept_t;
typedef struct {
unsigned long __cw;
} fenv_t;
#define FE_DFL_ENV ((const fenv_t *) -1)
#define SHMLBA (4*4096)
struct shmid_ds {
struct ipc_perm shm_perm;
size_t shm_segsz;
time_t shm_atime;
time_t shm_dtime;
time_t shm_ctime;
pid_t shm_cpid;
pid_t shm_lpid;
unsigned long shm_nattch;
unsigned long __pad1;
unsigned long __pad2;
};
struct shminfo {
unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
};
struct shm_info {
int __used_ids;
unsigned long shm_tot, shm_rss, shm_swp;
unsigned long __swap_attempts, __swap_successes;
};
.section .note.ohos.ident,"a",%note
.balign 4
.type abitag, %object
abitag:
.long 2f-1f // int32_t namesz
.long 3f-2f // int32_t descsz
1:.ascii "OHOS\0" // char name[]
2:.long 1 // int32_t ohos_api
3:
.size abitag, .-abitag
#ifdef __FLT_EVAL_METHOD__
#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
#else
#define FLT_EVAL_METHOD 0
#endif
#define LDBL_TRUE_MIN 6.47517511943802511092443895822764655e-4966L
#define LDBL_MIN 3.36210314311209350626267781732175260e-4932L
#define LDBL_MAX 1.18973149535723176508575932662800702e+4932L
#define LDBL_EPSILON 1.92592994438723585305597794258492732e-34L
#define LDBL_MANT_DIG 113
#define LDBL_MIN_EXP (-16381)
#define LDBL_MAX_EXP 16384
#define LDBL_DIG 33
#define LDBL_MIN_10_EXP (-4931)
#define LDBL_MAX_10_EXP 4932
#define DECIMAL_DIG 36
## 简介
本目录放置了部分预置的musl linker配置文件。
关于musl linker配置文件可以参考其[README](../ldso/README.md)说明。
## 说明
1. musl linker加载的配置文件为:
```
/etc/ld-musl-namespace-$ARCH.ini
```
其中`$ARCH`为系统的CPU架构,比如`arm`或`aarch64`等。
2. 配置动态库查找路径:
配置文件中`namespace.default.lib.paths`项用于指定musl linker加载动态库时的查找路径,多个路径中间使用`:`号分隔。
配置文件中`namespace.default.asan.lib.paths`项用于指定musl asan linker加载动态库时的查找路径,多个路径中间使用`:`号分隔,判断是否为asan linker是看linker的名字中是否含有`-asan`,比如`ld-musl-aarch64.so.1`是正常版本的linker,`ld-musl-aarch64-asan.so.1`是asan版本的linker。
3. 关于asan双库版本中的动态库查找路径配置:
在asan双库版本构建脚本`build/common/asan/build_mixed_asan.sh`中,是通过将asan版本的lib和bin放到`/data`目录下,然后调整系统服务进程的配置文件(`/system/etc/init/*.cfg`及`/vendor/etc/init/*.cfg`)中相关路径来实现的,因此当前目录下的预置配置文件中的`namespace.default.asan.lib.paths`配置并未被使用,而是**自动生成**的。生成规则为将`namespace.default.lib.paths`中所有以`/system/`及`/vendor/`开头的路径换成以`/data/`开头。
## 常见问题说明
**如何构建asan双库版本?**
[参考wiki](https://gitee.com/caoruihong/build/wikis)
## 相关仓
编译构建子系统
[**build**](https://gitee.com/openharmony/build)
[section.dir.map]
acquiescence = /
test = /data/tests/libc-test/src/functionalext:/data/tests/libc-test/src/functionalext/dlns
[acquiescence]
namespace.default.lib.paths = /system/lib64:/vendor/lib64:/vendor/lib64/chipsetsdk:/system/lib64/ndk:/system/lib64/chipset-pub-sdk:/system/lib64/chipset-sdk:/system/lib64/platformsdk:/system/lib64/priv-platformsdk:/system/lib64/priv-module:/system/lib64/module:/system/lib64/module/data:/system/lib64/module/multimedia:/system/lib64/module/security:/system/lib:/vendor/lib:/system/lib/ndk:/system/lib/chipset-pub-sdk:/system/lib/chipset-sdk:/system/lib/platformsdk:/system/lib/priv-platformsdk:/system/lib/priv-module:/system/lib/module:/system/lib/module/data:/system/lib/module/multimedia:/lib64:/lib:/usr/local/lib:/usr/lib
namespace.default.asan.lib.paths = /system/lib64:/system/lib64/module:/vendor/lib64:/vendor/lib64/chipsetsdk:/system/lib64/module/data:/system/lib64/module/multimedia:/system/lib64/module/security:/system/lib:/system/lib/module:/system/lib/module/data:/system/lib/module/multimedia:/lib64:/lib:/usr/local/lib:/usr/lib
[test]
added.nslist=ns_no_allowed_libs,ns_normal,ns_wrong_lib_path,ns_wrong_allowed_path,for_inherit_A,for_inherit_AA,inherited_class,ns_separated_flase,ns_asan_lib_path,ns_asan_permit_path
#ns_no_allowed_libs ,allowed libs not configed
namespace.ns_no_allowed_libs.separated = true
namespace.ns_no_allowed_libs.lib.paths = /data/tests/libc-test/src/functionalext/dlns
#ns_normal ,normal namespace
namespace.ns_normal.separated = true
namespace.ns_normal.lib.paths = /data/tests/libc-test/src/functionalext/dlns
namespace.ns_normal.allowed.libs = libdlopen_ns_dso.so
#ns_wrong_lib_path ,path in allowed_libs,but not in env or lib or permitted Path
namespace.ns_wrong_lib_path.separated = true
namespace.ns_wrong_lib_path.lib.paths = src/common/
namespace.ns_wrong_lib_path.allowed.libs = libdlopen_ns_dso.so
namespace.ns_wrong_lib_path.permitted.paths = /data/tests
#ns_wrong_allowed_path ,path not in allowed_libs
namespace.ns_wrong_allowed_path.separated = true
namespace.ns_wrong_allowed_path.lib.paths = /data/tests/libc-test/src/functionalext/dlns
namespace.ns_wrong_allowed_path.allowed.libs = libdlopen_dso.so
#for testing inheritance
namespace.for_inherit_A.separated = true
#for testing inheritance
namespace.for_inherit_AA.separated = true
#inherited_class
namespace.inherited_class.separated = true
namespace.inherited_class.lib.paths = /data/tests/libc-test/src/functionalext/dlns
namespace.inherited_class.allowed.libs= libdlopen_ns_dso.so:sharedlibtest.so
#ns_separated_flase
namespace.ns_separated_flase.separated = false
namespace.ns_separated_flase.lib.paths = /data/tests/libc-test/src/functionalext/dlns
namespace.ns_separated_flase.allowed.libs = libdlopen_ns_dso.so
#ns_asan_lib_path ,testing asan.lib.paths
namespace.ns_asan_lib_path.separated = true
namespace.ns_asan_lib_path.lib.paths = /data/tests/libc-test/src/functionalext/dlns
namespace.ns_asan_lib_path.asan.lib.paths = /data/tests/libc-test/src/functionalext/dlns/B
#ns_asan_permit_path ,testing asan.permitted.paths
namespace.ns_asan_permit_path.separated =true
namespace.ns_asan_permit_path.permitted.paths = /data/tests/libc-test/src/functionalext/dlns/C
namespace.ns_asan_permit_path.asan.permitted.paths = /data/tests/libc-test/src/functionalext/dlns/B
[section.dir.map]
acquiescence = /
[acquiescence]
namespace.default.lib.paths = /system/lib64:/vendor/lib64:/vendor/lib64/chipsetsdk:/system/lib64/ndk:/system/lib64/chipset-pub-sdk:/system/lib64/chipset-sdk:/system/lib64/platformsdk:/system/lib64/priv-platformsdk:/system/lib64/priv-module:/system/lib64/module:/system/lib64/module/data:/system/lib64/module/multimedia:/system/lib64/module/security:/system/lib:/vendor/lib:/system/lib/ndk:/system/lib/chipset-pub-sdk:/system/lib/chipset-sdk:/system/lib/platformsdk:/system/lib/priv-platformsdk:/system/lib/priv-module:/system/lib/module:/system/lib/module/data:/system/lib/module/multimedia:/lib64:/lib:/usr/local/lib:/usr/lib:/vendor/lib64/hw
namespace.default.asan.lib.paths = /system/lib64:/system/lib64/module:/vendor/lib64:/vendor/lib64/chipsetsdk:/system/lib64/module/data:/system/lib64/module/multimedia:/system/lib64/module/security:/system/lib:/system/lib/module:/system/lib/module/data:/system/lib/module/multimedia:/lib64:/lib:/usr/local/lib:/usr/lib:/vendor/lib64/hw
[section.dir.map]
acquiescence = /
test = /data/tests/libc-test/src/functionalext:/data/tests/libc-test/src/functionalext/dlns
[acquiescence]
namespace.default.lib.paths = /system/lib:/vendor/lib:/vendor/lib/chipsetsdk:/system/lib/ndk:/system/lib/chipset-pub-sdk:/system/lib/chipset-sdk:/system/lib/platformsdk:/system/lib/priv-platformsdk:/system/lib/priv-module:/system/lib/module:/system/lib/module/data:/system/lib/module/multimedia:/system/lib/module/security:/lib:/usr/local/lib:/usr/lib
namespace.default.asan.lib.paths = /system/lib:/system/lib/module:/vendor/lib:/vendor/lib/chipsetsdk:/system/lib/module/data:/system/lib/module/multimedia:/system/lib/module/security:/lib:/usr/local/lib:/usr/lib
[test]
added.nslist=ns_no_allowed_libs,ns_normal,ns_wrong_lib_path,ns_wrong_allowed_path,for_inherit_A,for_inherit_AA,inherited_class,ns_separated_flase,ns_asan_lib_path,ns_asan_permit_path
#ns_no_allowed_libs ,allowed libs not configed
namespace.ns_no_allowed_libs.separated = true
namespace.ns_no_allowed_libs.lib.paths = /data/tests/libc-test/src/functionalext/dlns
#ns_normal ,normal namespace
namespace.ns_normal.separated = true
namespace.ns_normal.lib.paths = /data/tests/libc-test/src/functionalext/dlns
namespace.ns_normal.allowed.libs = libdlopen_ns_dso.so
#ns_wrong_lib_path ,path in allowed_libs,but not in env or lib or permitted Path
namespace.ns_wrong_lib_path.separated = true
namespace.ns_wrong_lib_path.lib.paths = src/common/
namespace.ns_wrong_lib_path.allowed.libs = libdlopen_ns_dso.so
namespace.ns_wrong_lib_path.permitted.paths = /data/tests
#ns_wrong_allowed_path ,path not in allowed_libs
namespace.ns_wrong_allowed_path.separated = true
namespace.ns_wrong_allowed_path.lib.paths = /data/tests/libc-test/src/functionalext/dlns
namespace.ns_wrong_allowed_path.allowed.libs = libdlopen_dso.so
#for testing inheritance
namespace.for_inherit_A.separated = true
#for testing inheritance
namespace.for_inherit_AA.separated = true
#inherited_class
namespace.inherited_class.separated = true
namespace.inherited_class.lib.paths = /data/tests/libc-test/src/functionalext/dlns
namespace.inherited_class.allowed.libs= libdlopen_ns_dso.so:sharedlibtest.so
#ns_separated_flase
namespace.ns_separated_flase.separated = false
namespace.ns_separated_flase.lib.paths = /data/tests/libc-test/src/functionalext/dlns
namespace.ns_separated_flase.allowed.libs = libdlopen_ns_dso.so
#ns_asan_lib_path ,testing asan.lib.paths
namespace.ns_asan_lib_path.separated = true
namespace.ns_asan_lib_path.lib.paths = /data/tests/libc-test/src/functionalext/dlns
namespace.ns_asan_lib_path.asan.lib.paths = /data/tests/libc-test/src/functionalext/dlns/B
#ns_asan_permit_path ,testing asan.permitted.paths
namespace.ns_asan_permit_path.separated =true
namespace.ns_asan_permit_path.permitted.paths = /data/tests/libc-test/src/functionalext/dlns/C
namespace.ns_asan_permit_path.asan.permitted.paths = /data/tests/libc-test/src/functionalext/dlns/B
[section.dir.map]
acquiescence = /
[acquiescence]
namespace.default.lib.paths = /system/lib:/vendor/lib:/vendor/lib/chipsetsdk:/system/lib/ndk:/system/lib/chipset-pub-sdk:/system/lib/chipset-sdk:/system/lib/platformsdk:/system/lib/priv-platformsdk:/system/lib/priv-module:/system/lib/module:/system/lib/module/data:/system/lib/module/multimedia:/system/lib/module/security:/lib:/usr/local/lib:/usr/lib
namespace.default.asan.lib.paths = /system/lib:/system/lib/module:/vendor/lib:/vendor/lib/chipsetsdk:/system/lib/module/data:/system/lib/module/multimedia:/system/lib/module/security:/lib:/usr/local/lib:/usr/lib
[section.dir.map]
acquiescence = /
test = /data/tests/libc-test/src/functionalext:/data/tests/libc-test/src/functionalext/dlns
[acquiescence]
namespace.default.lib.paths = /system/lib64:/vendor/lib64:/vendor/lib64/chipsetsdk:/system/lib64/ndk:/system/lib64/chipset-pub-sdk:/system/lib64/chipset-sdk:/system/lib64/platformsdk:/system/lib64/priv-platformsdk:/system/lib64/priv-module:/system/lib64/module:/system/lib64/module/data:/system/lib64/module/multimedia:/system/lib64/module/security:/lib64
namespace.default.asan.lib.paths = /system/lib64:/system/lib64/module:/vendor/lib64:/vendor/lib64/chipsetsdk:/system/lib64/module/data:/system/lib64/module/multimedia:/system/lib64/module/security:/lib64
[test]
added.nslist=ns_no_allowed_libs,ns_normal,ns_wrong_lib_path,ns_wrong_allowed_path,for_inherit_A,for_inherit_AA,inherited_class,ns_separated_flase,ns_asan_lib_path,ns_asan_permit_path
#ns_no_allowed_libs ,allowed libs not configed
namespace.ns_no_allowed_libs.separated = true
namespace.ns_no_allowed_libs.lib.paths = /data/tests/libc-test/src/functionalext/dlns
#ns_normal ,normal namespace
namespace.ns_normal.separated = true
namespace.ns_normal.lib.paths = /data/tests/libc-test/src/functionalext/dlns
namespace.ns_normal.allowed.libs = libdlopen_ns_dso.so
#ns_wrong_lib_path ,path in allowed_libs,but not in env or lib or permitted Path
namespace.ns_wrong_lib_path.separated = true
namespace.ns_wrong_lib_path.lib.paths = src/common/
namespace.ns_wrong_lib_path.allowed.libs = libdlopen_ns_dso.so
namespace.ns_wrong_lib_path.permitted.paths = /data/tests
#ns_wrong_allowed_path ,path not in allowed_libs
namespace.ns_wrong_allowed_path.separated = true
namespace.ns_wrong_allowed_path.lib.paths = /data/tests/libc-test/src/functionalext/dlns
namespace.ns_wrong_allowed_path.allowed.libs = libdlopen_dso.so
#for testing inheritance
namespace.for_inherit_A.separated = true
#for testing inheritance
namespace.for_inherit_AA.separated = true
#inherited_class
namespace.inherited_class.separated = true
namespace.inherited_class.lib.paths = /data/tests/libc-test/src/functionalext/dlns
namespace.inherited_class.allowed.libs= libdlopen_ns_dso.so:sharedlibtest.so
#ns_separated_flase
namespace.ns_separated_flase.separated = false
namespace.ns_separated_flase.lib.paths = /data/tests/libc-test/src/functionalext/dlns
namespace.ns_separated_flase.allowed.libs = libdlopen_ns_dso.so
#ns_asan_lib_path ,testing asan.lib.paths
namespace.ns_asan_lib_path.separated = true
namespace.ns_asan_lib_path.lib.paths = /data/tests/libc-test/src/functionalext/dlns
namespace.ns_asan_lib_path.asan.lib.paths = /data/tests/libc-test/src/functionalext/dlns/B
#ns_asan_permit_path ,testing asan.permitted.paths
namespace.ns_asan_permit_path.separated =true
namespace.ns_asan_permit_path.permitted.paths = /data/tests/libc-test/src/functionalext/dlns/C
namespace.ns_asan_permit_path.asan.permitted.paths = /data/tests/libc-test/src/functionalext/dlns/B
[section.dir.map]
acquiescence = /
[acquiescence]
namespace.default.lib.paths = /system/lib64:/vendor/lib64:/vendor/lib64/chipsetsdk:/system/lib64/ndk:/system/lib64/chipset-pub-sdk:/system/lib64/chipset-sdk:/system/lib64/platformsdk:/system/lib64/priv-platformsdk:/system/lib64/priv-module:/system/lib64/module:/system/lib64/module/data:/system/lib64/module/multimedia:/system/lib64/module/security:/lib64
namespace.default.asan.lib.paths = /system/lib64:/system/lib64/module:/vendor/lib64:/vendor/lib64/chipsetsdk:/system/lib64/module/data:/system/lib64/module/multimedia:/system/lib64/module/security:/lib64
.include "crtbrand.s"
.section .init
.global _init
.type _init,%function
.balign 4
_init:
stp x29,x30,[sp,-16]!
mov x29,sp
.section .fini
.global _fini
.type _fini,%function
.balign 4
_fini:
stp x29,x30,[sp,-16]!
mov x29,sp
.include "crtbrand.s"
.syntax unified
.section .init
.global _init
.type _init,%function
.balign 4
_init:
push {r0,lr}
.section .fini
.global _fini
.type _fini,%function
.balign 4
_fini:
push {r0,lr}
/*
* Copyright (c) 2022 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.
*/
__attribute__((weak, visibility("hidden")))
void __emutls_unregister_key(void)
{
}
__attribute__((destructor(0)))
static void __on_dlclose_late(void)
{
__emutls_unregister_key();
}
\ No newline at end of file
.include "crtbrand.s"
.section .init
.global _init
_init:
push %rax
.section .fini
.global _fini
_fini:
push %rax
# Copyright (c) 2022 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.
musl.log.enable=false
# ================================
# sample:
#
# * enable ld log for all apps
# musl.log.ld.all=true
#
# * enable ld log for specified app
# musl.log.ld.all=false
# musl.log.ld.app.your_app_name=true
#
# * enable ld log for apps excluding the specified app
# musl.log.ld.all=true
# musl.log.ld.app.your_app_name=false
# ================================
musl.log.ld.all=true
\ No newline at end of file
#define __LITTLE_ENDIAN 1234
#define __BIG_ENDIAN 4321
#define __USE_TIME_BITS64 1
TYPEDEF unsigned _Addr size_t;
TYPEDEF unsigned _Addr uintptr_t;
TYPEDEF _Addr ptrdiff_t;
TYPEDEF _Addr ssize_t;
TYPEDEF _Addr intptr_t;
TYPEDEF _Addr regoff_t;
TYPEDEF _Reg register_t;
TYPEDEF _Int64 time_t;
TYPEDEF _Int64 suseconds_t;
TYPEDEF signed char int8_t;
TYPEDEF signed short int16_t;
TYPEDEF signed int int32_t;
TYPEDEF signed _Int64 int64_t;
TYPEDEF signed _Int64 intmax_t;
TYPEDEF unsigned char uint8_t;
TYPEDEF unsigned short uint16_t;
TYPEDEF unsigned int uint32_t;
TYPEDEF unsigned _Int64 uint64_t;
TYPEDEF unsigned _Int64 u_int64_t;
TYPEDEF unsigned _Int64 uintmax_t;
TYPEDEF unsigned mode_t;
TYPEDEF unsigned _Reg nlink_t;
TYPEDEF _Int64 off_t;
TYPEDEF unsigned _Int64 ino_t;
TYPEDEF unsigned _Int64 dev_t;
TYPEDEF long blksize_t;
TYPEDEF _Int64 blkcnt_t;
TYPEDEF unsigned _Int64 fsblkcnt_t;
TYPEDEF unsigned _Int64 fsfilcnt_t;
TYPEDEF unsigned wint_t;
TYPEDEF unsigned long wctype_t;
TYPEDEF void * timer_t;
TYPEDEF int clockid_t;
TYPEDEF long clock_t;
STRUCT timeval { time_t tv_sec; suseconds_t tv_usec; };
STRUCT timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); };
TYPEDEF int pid_t;
TYPEDEF unsigned id_t;
TYPEDEF unsigned uid_t;
TYPEDEF unsigned gid_t;
TYPEDEF int key_t;
TYPEDEF unsigned useconds_t;
#ifdef __cplusplus
TYPEDEF unsigned long pthread_t;
#else
TYPEDEF struct __pthread * pthread_t;
#endif
TYPEDEF int pthread_once_t;
TYPEDEF unsigned pthread_key_t;
TYPEDEF int pthread_spinlock_t;
TYPEDEF struct { unsigned __attr; } pthread_mutexattr_t;
TYPEDEF struct { unsigned __attr; } pthread_condattr_t;
TYPEDEF struct { unsigned __attr; } pthread_barrierattr_t;
TYPEDEF struct { unsigned __attr[2]; } pthread_rwlockattr_t;
STRUCT _IO_FILE { char __x; };
TYPEDEF struct _IO_FILE FILE;
TYPEDEF __builtin_va_list va_list;
TYPEDEF __builtin_va_list __isoc_va_list;
TYPEDEF struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
TYPEDEF struct __locale_struct * locale_t;
TYPEDEF struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
STRUCT iovec { void *iov_base; size_t iov_len; };
TYPEDEF unsigned socklen_t;
TYPEDEF unsigned short sa_family_t;
TYPEDEF struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t;
TYPEDEF struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } pthread_mutex_t;
TYPEDEF struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t;
TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
TYPEDEF struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t;
TYPEDEF struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t;
#undef _Addr
#undef _Int64
#undef _Reg
#ifndef _CTYPE_H
#define _CTYPE_H
#ifdef __cplusplus
extern "C" {
#endif
#include <features.h>
int isalnum(int);
int isalpha(int);
int isblank(int);
int iscntrl(int);
int isdigit(int);
int isgraph(int);
int islower(int);
int isprint(int);
int ispunct(int);
int isspace(int);
int isupper(int);
int isxdigit(int);
int tolower(int);
int toupper(int);
#ifndef __cplusplus
static __inline int __isspace(int _c)
{
return _c == ' ' || (unsigned)_c-'\t' < 5;
}
#define isalpha(a) (0 ? isalpha(a) : (((unsigned)(a)|32)-'a') < 26)
#define isdigit(a) (0 ? isdigit(a) : ((unsigned)(a)-'0') < 10)
#define islower(a) (0 ? islower(a) : ((unsigned)(a)-'a') < 26)
#define isupper(a) (0 ? isupper(a) : ((unsigned)(a)-'A') < 26)
#define isprint(a) (0 ? isprint(a) : ((unsigned)(a)-0x20) < 0x5f)
#define isgraph(a) (0 ? isgraph(a) : ((unsigned)(a)-0x21) < 0x5e)
#define isspace(a) __isspace(a)
#endif
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
|| defined(_BSD_SOURCE)
#define __NEED_locale_t
#include <bits/alltypes.h>
int isalnum_l(int, locale_t);
int isalpha_l(int, locale_t);
int isblank_l(int, locale_t);
int iscntrl_l(int, locale_t);
int isdigit_l(int, locale_t);
int isgraph_l(int, locale_t);
int islower_l(int, locale_t);
int isprint_l(int, locale_t);
int ispunct_l(int, locale_t);
int isspace_l(int, locale_t);
int isupper_l(int, locale_t);
int isxdigit_l(int, locale_t);
int tolower_l(int, locale_t);
int toupper_l(int, locale_t);
int isascii(int);
int toascii(int);
#define _tolower(a) ((a)|0x20)
#define _toupper(a) ((a)&0x5f)
#define isascii(a) (0 ? isascii(a) : (unsigned)(a) < 128)
#include <stdint.h>
const int32_t **__ctype_tolower_loc(void);
const int32_t **__ctype_toupper_loc(void);
#endif
#ifdef __cplusplus
}
#endif
#endif
#ifndef _DLFCN_H
#define _DLFCN_H
#include <features.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
#define RTLD_LAZY 1
#define RTLD_NOW 2
#define RTLD_NOLOAD 4
#define RTLD_NODELETE 4096
#define RTLD_GLOBAL 256
#define RTLD_LOCAL 0
#define RTLD_NEXT ((void *)-1)
#define RTLD_DEFAULT ((void *)0)
#define RTLD_DI_LINKMAP 2
/* create flags for dlns_create */
#define CREATE_INHERIT_DEFAULT 0x1
#define CREATE_INHERIT_CURRENT 0x2
int dlclose(void *);
char *dlerror(void);
void *dlopen(const char *, int);
void *dlsym(void *__restrict, const char *__restrict);
void *dlvsym(void *__restrict, const char *__restrict, const char *__restrict);
/* namespace apis */
#define NS_NAME_MAX 255
typedef struct {
char name[NS_NAME_MAX+1];
} Dl_namespace;
/**
* @brief Initialize a namespace structure for operating namespaces through related functional interfaces.
* @param Dl_namespace * namespace handle.
* @param char * namespace name.
* @return void.
* @retval none.
*/
void dlns_init(Dl_namespace *, const char *);
/**
* @brief Gets the current namespace handle, or verifies that the given name namespace exists.
* @param char * Namespace name.Gets the current caller namespace handle when name is null.
* @param Dl_namespace * namespace handle.
* @return return 0 on success,fail other values.
* @retval
* EINVAL(22) Invalid argument.
* ENOKEY(126) Required key not available.
*/
int dlns_get(const char *, Dl_namespace *);
/**
* @brief open dso in given namespace which has own lib search paths, when namespace is null, it's same to dlopen().
* avoid using "default" as namespace, which is the default namespace.
* @param Dl_namespace * namespace handle.
* @param char * the name of the so file you want to open.
* @param int open file mode.
* -- RTLD_LAZY.
* -- RTLD_NOW.
* -- RTLD_NOLOAD.
* -- RTLD_NODELETE.
* -- RTLD_GLOBAL.
* -- RTLD_LOCAL.
* @return success: dynamic library handleoid,failed: NULL.
* @retval none.
*/
void *dlopen_ns(Dl_namespace *, const char *, int);
/**
* @brief create the namespace and set lib search paths of namespace,
* the paths should be splited by ':'. When namespace already exist,return error.
* avoid using "default" as namespace, which is the default namespace.
* @param Dl_namespace * namespace handle.
* @param char * lib path library that can be specified.
* @return return 0 on success,fail other values.
* @retval
* EINVAL(22) Invalid argument.
* EEXIST(17) File exists.
* ENOMEM(12) Out of memory.
*/
int dlns_create(Dl_namespace *, const char *);
/**
* @brief create the namespace and set lib search paths of namespace,
* like dlns_create, except can use flags to set parent ns.
* @param Dl_namespace * namespace handle.
* @param char * lib path library that can be specified.
* #param int flags for create namespace, CREATE_INHERIT_CURRENT or CREATE_INHERIT_DEFAULT.
* @return return 0 on success,fail other values.
* @retval
* EINVAL(22) Invalid argument.
* EEXIST(17) File exists.
* ENOMEM(12) Out of memory.
*/
int dlns_create2(Dl_namespace *, const char *, int);
/**
* @brief make one namespace inherit another, and so it can use shared libs by the inherited one.
* param1: namespace, param2: inherited namespace, param3: shared libs.
* the shared libs should be splited by ':'. when it is null or empty, all libs can be shared.
* one namespace can inherit or be inherited by multiple ones.
* When namespaces do not exist, return error.
* @param Dl_namespace * The first parameter is the namespace to inherit from.
* @param Dl_namespace * The second parameter is the inherited namespace.
* @param char * some library names to inherit.
* @return return 0 on success,fail other values.
* @retval
* EINVAL(22) Invalid argument.
* ENOKEY(126) Required key not available.
*/
int dlns_inherit(Dl_namespace *, Dl_namespace *, const char *);
/**
* @brief Set namespace lib_path.
* @param name namespace name.
* @param lib_path The lib path name that needs to be reset, it can be multiple, link with ":".
* @return Returns 0 on success, other on failure.
* @retval
* EINVAL(22) Invalid argument.
* ENOKEY(126) Required key not available.
*/
int dlns_set_namespace_lib_path(const char *name, const char *lib_path);
/**
* @brief Set namespace separated.
* @param name namespace name.
* @param separated separated.
* @return Returns 0 on success, other on failure.
* @retval
* EINVAL(22) Invalid argument.
* ENOKEY(126) Required key not available.
*/
int dlns_set_namespace_separated(const char *name, const bool separated);
/**
* @brief Set namespace permitted_paths.
* @param name namespace name.
* @param permitted_paths set new permitted_paths.
* @return Returns 0 on success, other on failure.
* @retval
* EINVAL(22) Invalid argument.
* ENOKEY(126) Required key not available.
*/
int dlns_set_namespace_permitted_paths(const char *name, const char *permitted_paths);
/**
* @brief Set namespace allowed_libs.
* @param name namespace name.
* @param allowed_libs set new allowed_libs.
* @return Returns 0 on success, other on failure.
* @retval
* EINVAL(22) Invalid argument.
* ENOKEY(126) Required key not available.
*/
int dlns_set_namespace_allowed_libs(const char *name, const char *allowed_libs);
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
typedef struct {
const char *dli_fname;
void *dli_fbase;
const char *dli_sname;
void *dli_saddr;
} Dl_info;
int dladdr(const void *, Dl_info *);
int dlinfo(void *, int, void *);
#endif
#if _REDIR_TIME64
__REDIR(dlsym, __dlsym_time64);
#endif
#ifdef __cplusplus
}
#endif
#endif
/*
* Copyright (c) 2022 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.
*/
#ifndef DLFCN_EXT_H
#define DLFCN_EXT_H
#include <dlfcn.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
/* for dl_extinfo flag */
#define DL_EXT_WRITE_RELRO 0x1
#define DL_EXT_USE_RELRO 0x2
#define DL_EXT_RESERVED_ADDRESS_RECURSIVE 0x4
#define DL_EXT_RESERVED_ADDRESS 0x8
#define DL_EXT_RESERVED_ADDRESS_HINT 0x10
/** Mask of valid bits. */
#define DL_EXT_VALID_FLAG_BITS \
(DL_EXT_WRITE_RELRO | DL_EXT_USE_RELRO | DL_EXT_RESERVED_ADDRESS_RECURSIVE | DL_EXT_RESERVED_ADDRESS | \
DL_EXT_RESERVED_ADDRESS_HINT)
typedef struct {
int flag;
int relro_fd;
void *reserved_addr;
size_t reserved_size;
} dl_extinfo;
/**
* @brief Loads the dynamic shared object (shared library) file with the extended feature.
* If extinfo is NULL, it is equivalent to dlopen.
* If DL_EXT_WRITE_RELRO is set in extinfo, the GNU RELRO section will be written to relro_fd and allowed to
* reused by other process loading the same library at the same address.
* IF DL_EXT_USE_RELRO is set in extinfo, the GNU RELRO section written in relro_fd will be reused.
* @param file Equivalent to the argument of dlopen.
* @param mode Equivalent to the argument of dlopen.
* @param extinfo Indicates the dl_extinfo struct.
* @return Returns a non-NULL handle for the loaded object on success. On error returns NULL.
*/
void *dlopen_ext(const char *file, int mode, const dl_extinfo *extinfo);
/**
* @brief open dso in given namespace which has own lib search paths,
* when namespace is null, it's same to dlopen_ext().
* avoid using "default" as namespace, which is the default namespace.
* @param Dl_namespace * Carry the naming information of the namespace.
* @param char * the name of the so file you want to open.
* @param int open file mode.
* -- RTLD_LAZY.
* -- RTLD_NOW.
* -- RTLD_NOLOAD.
* -- RTLD_NODELETE.
* -- RTLD_GLOBAL.
* -- RTLD_LOCAL.
* @param dl_extinfo * indicates the dl_extinfo struct,include flag and relro_fd.
* @return success: dynamic library handleoid,failed: NULL.
* @retval none.
*/
void *dlopen_ns_ext(Dl_namespace *, const char *, int, const dl_extinfo *);
#ifdef __cplusplus
}
#endif
#endif
此差异已折叠。
#ifndef _FCNTL_H
#define _FCNTL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <features.h>
#define __NEED_off_t
#define __NEED_pid_t
#define __NEED_mode_t
#ifdef _GNU_SOURCE
#define __NEED_size_t
#define __NEED_ssize_t
#define __NEED_struct_iovec
#endif
#include <bits/alltypes.h>
#include <bits/fcntl.h>
#include <fortify/fcntl.h>
struct flock {
short l_type;
short l_whence;
off_t l_start;
off_t l_len;
pid_t l_pid;
};
int creat(const char *, mode_t);
int fcntl(int, int, ...);
int open(const char *, int, ...);
int openat(int, const char *, int, ...);
int posix_fadvise(int, off_t, off_t, int);
int posix_fallocate(int, off_t, off_t);
#define O_SEARCH O_PATH
#define O_EXEC O_PATH
#define O_TTY_INIT 0
#define O_ACCMODE (03|O_SEARCH)
#define O_RDONLY 00
#define O_WRONLY 01
#define O_RDWR 02
#define F_OFD_GETLK 36
#define F_OFD_SETLK 37
#define F_OFD_SETLKW 38
#define F_DUPFD_CLOEXEC 1030
#define F_RDLCK 0
#define F_WRLCK 1
#define F_UNLCK 2
#define FD_CLOEXEC 1
#define AT_FDCWD (-100)
#define AT_SYMLINK_NOFOLLOW 0x100
#define AT_REMOVEDIR 0x200
#define AT_SYMLINK_FOLLOW 0x400
#define AT_EACCESS 0x200
#define POSIX_FADV_NORMAL 0
#define POSIX_FADV_RANDOM 1
#define POSIX_FADV_SEQUENTIAL 2
#define POSIX_FADV_WILLNEED 3
#ifndef POSIX_FADV_DONTNEED
#define POSIX_FADV_DONTNEED 4
#define POSIX_FADV_NOREUSE 5
#endif
#undef SEEK_SET
#undef SEEK_CUR
#undef SEEK_END
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#ifndef S_IRUSR
#define S_ISUID 04000
#define S_ISGID 02000
#define S_ISVTX 01000
#define S_IRUSR 0400
#define S_IWUSR 0200
#define S_IXUSR 0100
#define S_IRWXU 0700
#define S_IRGRP 0040
#define S_IWGRP 0020
#define S_IXGRP 0010
#define S_IRWXG 0070
#define S_IROTH 0004
#define S_IWOTH 0002
#define S_IXOTH 0001
#define S_IRWXO 0007
#endif
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define AT_NO_AUTOMOUNT 0x800
#define AT_EMPTY_PATH 0x1000
#define AT_STATX_SYNC_TYPE 0x6000
#define AT_STATX_SYNC_AS_STAT 0x0000
#define AT_STATX_FORCE_SYNC 0x2000
#define AT_STATX_DONT_SYNC 0x4000
#define AT_RECURSIVE 0x8000
#define FAPPEND O_APPEND
#define FFSYNC O_SYNC
#define FASYNC O_ASYNC
#define FNONBLOCK O_NONBLOCK
#define FNDELAY O_NDELAY
#define F_OK 0
#define R_OK 4
#define W_OK 2
#define X_OK 1
#define F_ULOCK 0
#define F_LOCK 1
#define F_TLOCK 2
#define F_TEST 3
#define F_SETLEASE 1024
#define F_GETLEASE 1025
#define F_NOTIFY 1026
#define F_CANCELLK 1029
#define F_SETPIPE_SZ 1031
#define F_GETPIPE_SZ 1032
#define F_ADD_SEALS 1033
#define F_GET_SEALS 1034
#define F_SEAL_SEAL 0x0001
#define F_SEAL_SHRINK 0x0002
#define F_SEAL_GROW 0x0004
#define F_SEAL_WRITE 0x0008
#define F_SEAL_FUTURE_WRITE 0x0010
#define F_GET_RW_HINT 1035
#define F_SET_RW_HINT 1036
#define F_GET_FILE_RW_HINT 1037
#define F_SET_FILE_RW_HINT 1038
#define RWF_WRITE_LIFE_NOT_SET 0
#define RWH_WRITE_LIFE_NONE 1
#define RWH_WRITE_LIFE_SHORT 2
#define RWH_WRITE_LIFE_MEDIUM 3
#define RWH_WRITE_LIFE_LONG 4
#define RWH_WRITE_LIFE_EXTREME 5
#define DN_ACCESS 0x00000001
#define DN_MODIFY 0x00000002
#define DN_CREATE 0x00000004
#define DN_DELETE 0x00000008
#define DN_RENAME 0x00000010
#define DN_ATTRIB 0x00000020
#define DN_MULTISHOT 0x80000000
int lockf(int, int, off_t);
#endif
#if defined(_GNU_SOURCE)
#define F_OWNER_TID 0
#define F_OWNER_PID 1
#define F_OWNER_PGRP 2
#define F_OWNER_GID 2
struct file_handle {
unsigned handle_bytes;
int handle_type;
unsigned char f_handle[];
};
struct f_owner_ex {
int type;
pid_t pid;
};
#define FALLOC_FL_KEEP_SIZE 1
#define FALLOC_FL_PUNCH_HOLE 2
#define MAX_HANDLE_SZ 128
#define SYNC_FILE_RANGE_WAIT_BEFORE 1
#define SYNC_FILE_RANGE_WRITE 2
#define SYNC_FILE_RANGE_WAIT_AFTER 4
#define SPLICE_F_MOVE 1
#define SPLICE_F_NONBLOCK 2
#define SPLICE_F_MORE 4
#define SPLICE_F_GIFT 8
int fallocate(int, int, off_t, off_t);
#define fallocate64 fallocate
int name_to_handle_at(int, const char *, struct file_handle *, int *, int);
int open_by_handle_at(int, struct file_handle *, int);
ssize_t readahead(int, off_t, size_t);
int sync_file_range(int, off_t, off_t, unsigned);
ssize_t vmsplice(int, const struct iovec *, size_t, unsigned);
ssize_t splice(int, off_t *, int, off_t *, size_t, unsigned);
ssize_t tee(int, int, size_t, unsigned);
#define loff_t off_t
#endif
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
#define F_GETLK64 F_GETLK
#define F_SETLK64 F_SETLK
#define F_SETLKW64 F_SETLKW
#define flock64 flock
#define open64 open
#define openat64 openat
#define creat64 creat
#define lockf64 lockf
#define posix_fadvise64 posix_fadvise
#define posix_fallocate64 posix_fallocate
#define off64_t off_t
#endif
#ifdef __cplusplus
}
#endif
#endif
/*
* Copyright (c) 2022 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.
*/
#ifndef _FCNTL_H
#error "Never include this file directly; instead, include <fcntl.h>"
#endif
#include "fortify.h"
#ifdef __cplusplus
extern "C" {
#endif
int __open_diagnose(const char*, int);
int __openat_diagnose(int, const char*, int);
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
int __open64_diagnose(const char*, int);
int __openat64_diagnose(int, const char*, int);
#endif
/*
* Even in musl FORTIFY, the following is the easiest way to call a real open.
*/
int __open_real(const char*, int, ...) __DIAGNOSE_RENAME(open);
int __openat_real(int, const char*, int, ...) __DIAGNOSE_RENAME(openat);
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
int __open64_real(const char*, int, ...) __DIAGNOSE_RENAME(open64);
int __openat64_real(int, const char*, int, ...) __DIAGNOSE_RENAME(openat64);
#endif
#ifdef __FORTIFY_COMPILATION
__DIAGNOSE_FORTIFY_INLINE
int open(const char* const __DIAGNOSE_PASS_OBJECT_SIZE path, int flags)
__DIAGNOSE_OVERLOAD
__DIAGNOSE_ERROR_IF(__DIAGNOSE_OPEN_MODES_USEFUL(flags), "'open' " OPEN_TOO_FEW_ARGS_ERROR)
{
#ifdef __FORTIFY_RUNTIME
return __open_diagnose(path, flags);
#else
return __open_real(path, flags);
#endif
}
__DIAGNOSE_FORTIFY_INLINE
int open(const char* const __DIAGNOSE_PASS_OBJECT_SIZE path, int flags, unsigned modes)
__DIAGNOSE_OVERLOAD
__DIAGNOSE_WARNING_IF(!__DIAGNOSE_OPEN_MODES_USEFUL(flags) && modes, "'open' " OPEN_USELESS_MODES_WARNING)
{
return __open_real(path, flags, modes);
}
__DIAGNOSE_FORTIFY_INLINE
int openat(int dirfd, const char* const __DIAGNOSE_PASS_OBJECT_SIZE path, int flags)
__DIAGNOSE_OVERLOAD
__DIAGNOSE_ERROR_IF(__DIAGNOSE_OPEN_MODES_USEFUL(flags), "'openat' " OPEN_TOO_FEW_ARGS_ERROR)
{
#ifdef __FORTIFY_RUNTIME
return __openat_diagnose(dirfd, path, flags);
#else
return __openat_real(dirfd, path, flags);
#endif
}
__DIAGNOSE_FORTIFY_INLINE
int openat(int dirfd, const char* const __DIAGNOSE_PASS_OBJECT_SIZE path, int flags, mode_t modes)
__DIAGNOSE_OVERLOAD
__DIAGNOSE_WARNING_IF(!__DIAGNOSE_OPEN_MODES_USEFUL(flags) && modes, "'openat' " OPEN_USELESS_MODES_WARNING)
{
return __openat_real(dirfd, path, flags, modes);
}
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
__DIAGNOSE_FORTIFY_INLINE
int open64(const char* const __DIAGNOSE_PASS_OBJECT_SIZE path, int flags)
__DIAGNOSE_OVERLOAD
__DIAGNOSE_ERROR_IF(__DIAGNOSE_OPEN_MODES_USEFUL(flags), "'open64' " OPEN_TOO_FEW_ARGS_ERROR)
{
#ifdef __FORTIFY_RUNTIME
return __open64_diagnose(path, flags);
#else
return __open64_real(path, flags);
#endif
}
__DIAGNOSE_FORTIFY_INLINE
int open64(const char* const __DIAGNOSE_PASS_OBJECT_SIZE path, int flags, mode_t modes)
__DIAGNOSE_OVERLOAD
__DIAGNOSE_WARNING_IF(!__DIAGNOSE_OPEN_MODES_USEFUL(flags) && modes, "'open64' " OPEN_USELESS_MODES_WARNING)
{
return __open64_real(path, flags, modes);
}
__DIAGNOSE_FORTIFY_INLINE
int openat64(int dirfd, const char* const __DIAGNOSE_PASS_OBJECT_SIZE path, int flags)
__DIAGNOSE_OVERLOAD
__DIAGNOSE_ERROR_IF(__DIAGNOSE_OPEN_MODES_USEFUL(flags), "'openat64' " OPEN_TOO_FEW_ARGS_ERROR)
{
#ifdef __FORTIFY_RUNTIME
return __openat64_diagnose(dirfd, path, flags);
#else
return __openat64_real(dirfd, path, flags);
#endif
}
__DIAGNOSE_FORTIFY_INLINE
int openat64(int dirfd, const char* const __DIAGNOSE_PASS_OBJECT_SIZE path, int flags, mode_t modes)
__DIAGNOSE_OVERLOAD
__DIAGNOSE_WARNING_IF(!__DIAGNOSE_OPEN_MODES_USEFUL(flags) && modes, "'openat64' " OPEN_USELESS_MODES_WARNING)
{
return __openat64_real(dirfd, path, flags, modes);
}
#endif
#endif
#ifdef __cplusplus
}
#endif
\ No newline at end of file
/*
* Copyright (c) 2022 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.
*/
#ifndef _FORTIFY_FORTIFY_H
#define _FORTIFY_FORTIFY_H
#ifdef __cplusplus
extern "C" {
#endif
#if (MUSL_FORTIFY_SOURCE == 1) || (MUSL_FORTIFY_SOURCE == 2)
#ifndef __FORTIFY_COMPILATION
#define __FORTIFY_COMPILATION
#endif
#endif
#if (MUSL_FORTIFY_SOURCE == 2)
#ifndef __FORTIFY_RUNTIME
#define __FORTIFY_RUNTIME
#endif
#endif
#if defined(__cplusplus)
#define __DIAGNOSE_CAST(_k, _t, _v) (_k<_t>(_v))
#else
#define __DIAGNOSE_CAST(_k, _t, _v) ((_t) (_v))
#endif
#if defined(__LP64__)
#ifndef FORTIFY_LONG_MAX
#define FORTIFY_LONG_MAX 0x7fffffffffffffffL
#endif
#ifndef FORTIFY_SSIZE_MAX
#define FORTIFY_SSIZE_MAX FORTIFY_LONG_MAX
#endif
#else
#ifndef FORTIFY_LONG_MAX
#define FORTIFY_LONG_MAX 0x7fffffffL
#endif
#ifndef FORTIFY_SSIZE_MAX
#define FORTIFY_SSIZE_MAX FORTIFY_LONG_MAX
#endif
#endif
#ifndef FORTIFY_PATH_MAX
#define FORTIFY_PATH_MAX 4096
#endif
#define __DIAGNOSE_ALWAYS_INLINE __attribute__((__always_inline__))
#define __DIAGNOSE_PREDICT_TRUE(exp) __builtin_expect((exp) != 0, 1)
#define __DIAGNOSE_PREDICT_FALSE(exp) __builtin_expect((exp) != 0, 0)
#define __DIAGNOSE_ENABLE_IF(cond, msg) __attribute__((enable_if(cond, msg)))
#define __DIAGNOSE_ERROR_IF(cond, msg) __attribute__((diagnose_if(cond, msg, "error")))
#define __DIAGNOSE_WARNING_IF(cond, msg) __attribute__((diagnose_if(cond, msg, "warning")))
#define __DIAGNOSE_BOS_LEVEL (1)
#define __DIAGNOSE_BOSN(s, n) __builtin_object_size((s), (n))
#define __DIAGNOSE_BOS(s) __DIAGNOSE_BOSN((s), __DIAGNOSE_BOS_LEVEL)
#define __DIAGNOSE_BOS0(s) __DIAGNOSE_BOSN((s), 0)
#define __DIAGNOSE_PASS_OBJECT_SIZE_N(n) __attribute__((pass_object_size(n)))
#define __DIAGNOSE__SIZE_MUL_OVERFLOW(a, b, result) __builtin_umull_overflow(a, b, result)
#define __DIAGNOSE_PRINTFLIKE(x, y) __attribute__((__format__(printf, x, y)))
#define __DIAGNOSE_CALL_BYPASSING_FORTIFY(fn) (&(fn))
#define __DIAGNOSE_FORTIFY_INLINE static __inline__ __attribute__((no_stack_protector)) \
__DIAGNOSE_ALWAYS_INLINE
#define __DIAGNOSE_FORTIFY_VARIADIC static __inline__
#define __DIAGNOSE_PASS_OBJECT_SIZE __DIAGNOSE_PASS_OBJECT_SIZE_N(__DIAGNOSE_BOS_LEVEL)
#define __DIAGNOSE_PASS_OBJECT_SIZE0 __DIAGNOSE_PASS_OBJECT_SIZE_N(0)
#define __DIAGNOSE_FORTIFY_UNKNOWN_SIZE ((unsigned int) -1)
/* The following are intended for use in unevaluated environments, e.g. diagnose_if conditions. */
#define __DIAGNOSE_UNEVALUATED_LT(bos_val, val) \
((bos_val) != __DIAGNOSE_FORTIFY_UNKNOWN_SIZE && (bos_val) < (val))
#define __DIAGNOSE_UNEVALUATED_LE(bos_val, val) \
((bos_val) != __DIAGNOSE_FORTIFY_UNKNOWN_SIZE && (bos_val) <= (val))
/* The following acts in the context of evaluation. */
#define __DIAGNOSE_BOS_DYNAMIC_CHECK_IMPL_AND(bos_val, op, index, cond) \
((bos_val) == __DIAGNOSE_FORTIFY_UNKNOWN_SIZE || \
(__builtin_constant_p(index) && bos_val op index && (cond)))
#define __DIAGNOSE_BOS_DYNAMIC_CHECK_IMPL(bos_val, op, index) \
__DIAGNOSE_BOS_DYNAMIC_CHECK_IMPL_AND(bos_val, op, index, 1)
#define __DIAGNOSE_BOS_TRIVIALLY_GE(bos_val, index) __DIAGNOSE_BOS_DYNAMIC_CHECK_IMPL((bos_val), >=, (index))
#define __DIAGNOSE_BOS_TRIVIALLY_GT(bos_val, index) __DIAGNOSE_BOS_DYNAMIC_CHECK_IMPL((bos_val), >, (index))
#define __DIAGNOSE_OVERLOAD __attribute__((overloadable))
/*
* A function to prevent this function from being applied.
* Used to rename the function so that the compiler emits a call to "x".
*/
#define __DIAGNOSE_RENAME(x) __asm__(#x)
#define __DIAGNOSE_OPEN_MODES_USEFUL(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
#define __DIAGNOSE_BOS_FD_COUNT_TRIVIALLY_SAFE(bos_val, fds, fd_count) \
__DIAGNOSE_BOS_DYNAMIC_CHECK_IMPL_AND((bos_val), >=, (sizeof(*(fds)) * (fd_count)), \
(fd_count) <= __DIAGNOSE_CAST(static_cast, unsigned int, -1) / sizeof(*(fds)))
#define __DIAGNOSE_UNSAFE_CHK_MUL_OVERFLOW(x, y) ((__SIZE_TYPE__)-1 / (x) < (y))
#define __DIAGNOSE_BOS_TRIVIALLY_GE_MUL(bos_val, size, count) \
__DIAGNOSE_BOS_DYNAMIC_CHECK_IMPL_AND(bos_val, >=, (size) * (count), \
!__DIAGNOSE_UNSAFE_CHK_MUL_OVERFLOW(size, count))
#define FORTIFY_RUNTIME_ERROR_PREFIX "Musl Fortify runtime error: "
#define OPEN_TOO_MANY_ARGS_ERROR "There are too many arguments"
#define OPEN_TOO_FEW_ARGS_ERROR "invoking with O_CREAT or O_TMPFILE, but missing pattern."
#define OPEN_USELESS_MODES_WARNING "having redundant mode bits; but missing O_CREAT."
#define CALLED_WITH_STRING_BIGGER_BUFFER "called with a string larger than the buffer"
#define FD_COUNT_LARGE_GIVEN_BUFFER "fd_count is greater than the given buffer"
#define CALLED_WITH_SIZE_BIGGER_BUFFER "called with bigger size than the buffer"
#define OUTPUT_PARAMETER_BYTES "the output parameter must be nullptr or a pointer to the buffer with >= FORTIFY_PATH_MAX bytes"
#define SIZE_LARGER_THEN_DESTINATION_BUFFER "the size is greater than the target buffer"
void __fortify_error(const char* info, ...);
#ifdef __cplusplus
}
#endif
#endif
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
/*
* Copyright (c) 2022 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.
*/
#ifndef _STDLIB_H
#error "Never include this file directly; instead, include <stdlib.h>"
#endif
#include "fortify.h"
#ifdef __cplusplus
extern "C" {
#endif
#if defined(_GNU_SOURCE) && defined(__FORTIFY_COMPILATION)
char* realpath(const char* path, char* resolved)
__DIAGNOSE_ERROR_IF(!path, "'realpath': NULL path is never correct; flipped arguments?")
__DIAGNOSE_ERROR_IF(__DIAGNOSE_UNEVALUATED_LT(__DIAGNOSE_BOS(resolved), FORTIFY_PATH_MAX),
"'realpath' " OUTPUT_PARAMETER_BYTES);
#endif
#ifdef __cplusplus
}
#endif
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
#include "memory_tag.h"
mtypeset __mem_typeset = NULL;
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册