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

Magnus Ihse Bursie ihse at openjdk.java.net
Tue Apr 12 10:32:27 UTC 2022


On Mon, 11 Apr 2022 15:41:20 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 one additional commit since the last revision:
> 
>   8284661: Reproducible assembly builds without relative linking
>   
>   Signed-off-by: Andrew Leonard <anleonar at redhat.com>

Actually, a better option might be to let GCC append the `.file` automatically to all assembly files. I think this can be done by creating a file like `make/data/autoheaders/assemblyprefix.h` with:


// ASSEMBLY_SRC_FILE gets replaced by relative or absolute file path
// in NativeCompilation.gmk, this ensures reproducible .debuginfo
.file ASSEMBLY_SRC_FILE

and then add `-include $TOPDIR/make/data/autoheaders/assemblyprefix.h` to the gcc assembly command line.

I have not verified this so it needs to be checked.

I also think we should remove the `.file` keyword from the incubator files. (Nothing good can come out of having two `.file` attributes.)

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

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



More information about the build-dev mailing list