Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New "prefix_mappings" build argument to set "-fdebug-prefix-map=" cfl…
…ag (#25174) To improve build reproducibility a build argument was added to set the "-fdebug-prefix-map=" cflag, which allows replacing build-time paths which may differ between builds. https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html#index-fdebug-prefix-map > When compiling files residing in directory old, record debugging information describing them as if the files resided in directory new instead. This can be used to replace a build-time path with an install-time path in the debug info. It can also be used to change an absolute path to a relative path by using . for new. This can give more reproducible builds, which are location independent, but may require an extra command to tell GDB where to find the source files. When using GDB, the `set substitute-path from to` command can be used to substitute placeholder values. https://sourceware.org/gdb/onlinedocs/gdb/Source-Path.html#set-substitute_002dpath Example 1: Replace absolute path to current dir with relative path ``` --args="prefix_mappings=[\"${PWD}/=.\"]" ``` Example 2: Replace multiple paths with substitution placeholders ``` --args="prefix_mappings=[\"${PWD}/=PWD\",\"${ANDROID_HOME}=ANDROID_HOME\",\"${ANDROID_NDK_HOME}=ANDROID_NDK_HOME\"]" ```