From 224863150c9320b32f344792928af7fbda56d65d Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 11 Aug 2022 12:55:03 -0700 Subject: toolchain-clang: Specify -ffile-compilation-dir to omit absolute file paths in debug info Clang does not remap the src filename in asm files debug info when using -fdebug-prefix-map but gcc does [1], however, there is an option to help reproducibility with clang namely ffile-compilation-dir to remove the source directory from path. use it globally with clang compiler [1] https://github.com/llvm/llvm-project/issues/56609 Signed-off-by: Khem Raj --- classes/clang.bbclass | 2 ++ 1 file changed, 2 insertions(+) (limited to 'classes') diff --git a/classes/clang.bbclass b/classes/clang.bbclass index 8433edc..b960183 100644 --- a/classes/clang.bbclass +++ b/classes/clang.bbclass @@ -60,6 +60,8 @@ TUNE_CCARGS:append:toolchain-clang:libc-musl:powerpc = " -mlong-double-64" TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains("DISTRO_FEATURES", "usrmerge", " --dyld-prefix=/usr", "", d)}" TUNE_CCARGS:append:toolchain-clang = " -Qunused-arguments" +# Get rid of absolute paths in .file asm directive +TUNE_CCARGS:append:toolchain-clang = " -ffile-compilation-dir=." LDFLAGS:append:toolchain-clang:class-nativesdk:x86-64 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux-x86-64.so.2" LDFLAGS:append:toolchain-clang:class-nativesdk:x86 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux.so.2" -- cgit v1.2.3-54-g00ecf