Ohos: include build id in ohos built binary (#38215)

add link-arg for ohos to include build id in its ELF binary. This could
enable us to do debugging and size checking more easily.

Testing: No test needed.
Fixes: N/A

cc @jschwe

Signed-off-by: rayguo17 <tin.tun.aung1@huawei.com>
This commit is contained in:
TIN TUN AUNG 2025-07-23 12:54:21 +08:00 committed by GitHub
parent 6417d3077b
commit 7f6d4825cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -374,7 +374,12 @@ class OpenHarmonyTarget(CrossBuildTarget):
# rustc linker
env[f"CARGO_TARGET_{rust_target_triple.upper()}_LINKER"] = ndk_clang
link_args = ["-fuse-ld=lld", f"--target={clang_target_triple}", f"--sysroot={ohos_sysroot_posix}"]
link_args = [
"-fuse-ld=lld",
f"--target={clang_target_triple}",
f"--sysroot={ohos_sysroot_posix}",
"-Wl,--build-id",
]
env["HOST_CFLAGS"] = ""
env["HOST_CXXFLAGS"] = ""