Skip to content

Commit 2248631

Browse files
committed
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] llvm/llvm-project#56609 Signed-off-by: Khem Raj <[email protected]>
1 parent d33a4f2 commit 2248631

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

classes/clang.bbclass

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ TUNE_CCARGS:append:toolchain-clang:libc-musl:powerpc = " -mlong-double-64"
6060
TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains("DISTRO_FEATURES", "usrmerge", " --dyld-prefix=/usr", "", d)}"
6161

6262
TUNE_CCARGS:append:toolchain-clang = " -Qunused-arguments"
63+
# Get rid of absolute paths in .file asm directive
64+
TUNE_CCARGS:append:toolchain-clang = " -ffile-compilation-dir=."
6365

6466
LDFLAGS:append:toolchain-clang:class-nativesdk:x86-64 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux-x86-64.so.2"
6567
LDFLAGS:append:toolchain-clang:class-nativesdk:x86 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux.so.2"

0 commit comments

Comments
 (0)