diff --git a/musl_config.gni b/musl_config.gni index 3480888bbf41aaadfd8629de13fb49f4013f45e5..109d869d619a27ee5c7e5ac56dc30b62fa3d44d8 100644 --- a/musl_config.gni +++ b/musl_config.gni @@ -35,6 +35,7 @@ declare_args() { "//prebuilts/clang/ohos/linux-x86_64/llvm/lib/clang/12.0.1/lib" user_custom_libc = true use_jemalloc = false + musl_malloc_plugin = "" use_jemalloc_dfx_intf = false use_jemalloc_recycle_func = false use_pthread_cancel = false diff --git a/musl_template.gni b/musl_template.gni index 012b2c7141f538569723156db12d0d734a7a3905..e3715670dda70edf15a794019a43e5233c63b941 100644 --- a/musl_template.gni +++ b/musl_template.gni @@ -288,9 +288,9 @@ template("musl_libs") { include_dirs += [ "//third_party", "//third_party/musl/src/include/", - "//third_party/jemalloc/include/", - "//third_party/jemalloc/include/jemalloc/internal", - "//third_party/jemalloc/include/jemalloc", + "${musl_malloc_plugin}/include/", + "${musl_malloc_plugin}/include/jemalloc/internal", + "${musl_malloc_plugin}/include/jemalloc", ] } @@ -586,7 +586,7 @@ template("musl_libs") { if (use_jemalloc_recycle_func) { defines += [ "USE_JEMALLOC_RECYCLE_FUNC" ] } - include_dirs = [ "//third_party/jemalloc/include/jemalloc" ] + include_dirs = [ "${musl_malloc_plugin}/include/jemalloc" ] } if (!defined(include_dirs)) { @@ -802,7 +802,7 @@ template("musl_libs") { if (use_jemalloc_recycle_func) { defines += [ "USE_JEMALLOC_RECYCLE_FUNC" ] } - include_dirs = [ "//third_party/jemalloc/include/jemalloc" ] + include_dirs = [ "${musl_malloc_plugin}/include/jemalloc" ] } configs -= musl_inherited_configs @@ -822,7 +822,7 @@ template("musl_libs") { } source_set("soft_musl_jemalloc") { - sources = [ "./porting/linux/user/src/malloc/jemalloc/jemalloc.c" ] + sources = [ "${musl_malloc_plugin}/src/static.c" ] deps = [ "//third_party/musl:create_alltypes_h",