RFR: 8284661: Reproducible assembly builds without relative linking [v5]

Maxim Kartashev duke at openjdk.java.net
Thu Apr 14 10:17:15 UTC 2022


On Wed, 13 Apr 2022 13:55:59 GMT, Andrew Leonard <aleonard at openjdk.org> wrote:

>> This PR removes the need for relative object file linking introduced by JDK-8284437 for linux libraries, by specifying
>> .file <relative source path> directives in the linux .S source files. The source files specify a .file ASSEMBLY_SRC_FILE
>> where ASSEMBLY_SRC_FILE is defined by the NativeCompliation.gmk.
>> 
>> Signed-off-by: Andrew Leonard <anleonar at redhat.com>
>
> Andrew Leonard has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - 8284661: Reproducible assembly builds without relative linking
>    
>    Signed-off-by: Andrew Leonard <anleonar at redhat.com>
>  - 8284661: Reproducible assembly builds without relative linking
>    
>    Signed-off-by: Andrew Leonard <anleonar at redhat.com>

make/data/autoheaders/assemblyprefix.h line 25:

> 23: 
> 24: // ASSEMBLY_SRC_FILE gets replaced by relative or absolute file path
> 25: // in NativeCompilation.gmk, this ensures reproducible .debuginfo

Actually, this ensures reproducible object file (`.o`) rather than the contents of `.debuginfo`. As far as I remember, `gcc` uses the "value" of `.file` in `.debuginfo`, but `clang` does not. Which is why the path mapping option is still necessary even with `.file` present and with a value stable across builds.

Maybe phrase this something like

... this ensures a reproducible object file through a predictable value of the STT_FILE symbol.

?

-------------

PR: https://git.openjdk.java.net/jdk/pull/8177



More information about the build-dev mailing list