From c8e6739f8ed3667b9c4b0cc41d6377d5445d2377 Mon Sep 17 00:00:00 2001 From: liuwenfeng Date: Tue, 3 Jun 2025 18:44:15 +0800 Subject: [PATCH] stripped symbols Signed-off-by: liuwenfeng --- BUILD.gn | 23 +++++++++++++++++++++-- ohos/meson_cross_process64.py | 8 ++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 0c45e230ef9..2611b0c2eca 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -50,13 +50,27 @@ action("mesa3d_action_build") { ] } +ohos_copy("mesa3d_unstripped_copy") { + sources = [ + "${root_build_dir}/thirdparty/mesa3d/lib/libEGL_mesa.so", + "${root_build_dir}/thirdparty/mesa3d/lib/libgallium-25.0.1.so", + ] + outputs = [ root_out_dir + "/lib.unstripped/thirdparty/mesa3d/{{source_file_part}}" ] + deps = [ ":mesa3d_action_build" ] +} + ohos_prebuilt_shared_library("mesa3d_libEGL") { source = "${root_build_dir}/thirdparty/mesa3d/lib/libEGL_mesa.so" subsystem_name = "$SUBSYSTEM_NAME" part_name = "$PART_NAME" module_install_dir = "lib64" install_enable = true - deps = [ ":mesa3d_action_build" ] + enable_strip = true + mini_debug = true + deps = [ + ":mesa3d_action_build", + ":mesa3d_unstripped_copy" + ] } ohos_prebuilt_shared_library("mesa3d_libgallium") { @@ -65,7 +79,12 @@ ohos_prebuilt_shared_library("mesa3d_libgallium") { part_name = "$PART_NAME" module_install_dir = "lib64" install_enable = true - deps = [ ":mesa3d_action_build" ] + enable_strip = true + mini_debug = true + deps = [ + ":mesa3d_action_build", + ":mesa3d_unstripped_copy" + ] } group("zink_opengl") { diff --git a/ohos/meson_cross_process64.py b/ohos/meson_cross_process64.py index f42c4cf5423..55c38f6fa6b 100755 --- a/ohos/meson_cross_process64.py +++ b/ohos/meson_cross_process64.py @@ -37,6 +37,10 @@ c_args = [ '--sysroot=sysroot_stub', '-fno-emulated-tls', '-fPIC', + '-g', + '-O2', + '-D_FORTIFY_SOURCE=2', + '-fstack-protector-all', asan_compile_args_stub ] @@ -45,6 +49,10 @@ cpp_args = [ '--sysroot=sysroot_stub', '-fno-emulated-tls', '-fPIC', + '-g', + '-O2', + '-D_FORTIFY_SOURCE=2', + '-fstack-protector-all', asan_compile_args_stub ] -- Gitee