Skip to content
Snippets Groups Projects
Commit 42dfbd3e authored by Esben Haabendal's avatar Esben Haabendal Committed by Thierry Escande
Browse files

musl: Partial build-fix for the OpenHarmony hooks code


This moves the public headers defining the interface to the OpenHarmony
musl (malloc/free) hooks into the correct place, so they get installed as public
headers.

Signed-off-by: default avatarEsben Haabendal <esben.haabendal@huawei.com>
parent 29122488
No related branches found
No related tags found
1 merge request!10OpenHarmony 3.1
......@@ -15,3 +15,11 @@ SRC_URI:append:oniro-openharmony-linux = " file://openharmony-linux-user.patch"
# libclang_rt.builtins.a manually as needed
LDFLAGS_CLANG_COMPILER_RT = "-L${RECIPE_SYSROOT}/lib/clang/*/lib/${OPENHARMONY_LLVM_BINARY_TARGET_ARCH}/${OPENHARMONY_LLVM_BINARY_TARGET_ABI} -lclang_rt.builtins"
LDFLAGS:append:toolchain-clang = " ${@bb.utils.contains('COMPILER_RT', '-rtlib=compiler-rt', d.getVar('LDFLAGS_CLANG_COMPILER_RT'), '', d)}"
# Enable this to (try to) build the malloc/free hooks and support needed for
# OpenHarmony //developtools/profiler component. It doesn't build for now as the
# code uses stdatomic.h header, which is not available as musl is being built
# with `-nostdinc` argument.
# Possible fix is to rewrite the hooks implementation to use the musl internal
# atomic.h functions instead.
#CFLAGS:append:oniro-openharmony-linux = "-DHOOK_ENABLE"
......@@ -537,11 +537,11 @@ index 000000000000..27f30869d0d8
+#endif
+
+#endif
diff --git a/src/hook/musl_malloc_dispatch.h b/src/hook/musl_malloc_dispatch.h
diff --git a/include/musl_malloc_dispatch.h b/include/musl_malloc_dispatch.h
new file mode 100755
index 000000000000..15b859eea083
--- /dev/null
+++ b/src/hook/musl_malloc_dispatch.h
+++ b/include/musl_malloc_dispatch.h
@@ -0,0 +1,37 @@
+#ifndef _MUSL_MALLOC_DISPATCH_H
+#define _MUSL_MALLOC_DISPATCH_H
......@@ -580,11 +580,11 @@ index 000000000000..15b859eea083
+#endif
+
+#endif
diff --git a/src/hook/musl_malloc_dispatch_table.h b/src/hook/musl_malloc_dispatch_table.h
diff --git a/include/musl_malloc_dispatch_table.h b/include/musl_malloc_dispatch_table.h
new file mode 100755
index 000000000000..430de744bb50
--- /dev/null
+++ b/src/hook/musl_malloc_dispatch_table.h
+++ b/include/musl_malloc_dispatch_table.h
@@ -0,0 +1,13 @@
+#ifndef _MUSL_MALLOC_DISPATCH_TABLE_H
+#define _MUSL_MALLOC_DISPATCH_TABLE_H
......@@ -1028,11 +1028,11 @@ index 000000000000..7db57bc0223d
+volatile atomic_bool __hook_enable_hook_flag;
+
+#endif
diff --git a/src/hook/musl_preinit_common.h b/src/hook/musl_preinit_common.h
diff --git a/include/musl_preinit_common.h b/include/musl_preinit_common.h
new file mode 100755
index 000000000000..b3920f58bd94
--- /dev/null
+++ b/src/hook/musl_preinit_common.h
+++ b/include/musl_preinit_common.h
@@ -0,0 +1,99 @@
+#ifndef _MUSL_PREINIT_COMMON_H
+#define _MUSL_PREINIT_COMMON_H
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment