On Mon, 26 Feb 2024 19:26:33 GMT, Erik Joelsson <er...@openjdk.org> wrote:
>> Adds Linux -fdebug-prefix-map'ing for SUPPORT_OUTPUTDIR and >> HOTSPOT_OUTPUTDIR when absolute paths are not allowed in the binaries, thus >> making the building of a JDK identically reproducible from different build >> directories. > > make/autoconf/flags-cflags.m4 line 126: > >> 124: DEBUG_PREFIX_MAP_GCC_INCLUDE_PATHS >> 125: DEBUG_PREFIX_CFLAGS="$DEBUG_PREFIX_CFLAGS >> -fdebug-prefix-map=\$(SUPPORT_OUTPUTDIR)/=" >> 126: DEBUG_PREFIX_CFLAGS="$DEBUG_PREFIX_CFLAGS >> -fdebug-prefix-map=\$(HOTSPOT_OUTPUTDIR)/=" > > This is only a problem if the build directory is located outside the > workspace root. In the case where the build directory is inside the root, I > think it would be preferable to stick to just the one prefix map, for > consistent relative paths for all affected files. If the build directory is > outside, like in your example, I would suggest adding just `$(OUTPUTDIR)/=` > to both `-fdebug-prefix-map` and `-fmacro-prefix-map` for consistency. We > don't seem to have a variable indicating if the OUTPUTDIR is inside > WORKSPACE_ROOT or not, but we can add one in basic.m4 where the OUTPUTDIR is > initialized. Then you can conditionally add the extra prefix maps based on > that variable. I have not thought this fully through, but just throwing out a question: would this work even if one build directory were inside the workspace root, and the other not? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/18009#discussion_r1503314922