Details
-
Bug
-
Resolution: Fixed
-
P4
-
None
-
None
-
b13
Description
GNU toolchain provided by Debian starting from bullseye defaults to the --as-needed link option[1]. This causes linkage inconsistency between builds made on Debian-based systems and other Linux distributions[2].
The toolchain used by Adoptium[3] and Oracle[4] does not set --as-needed.
To provide consistent linking for Debian-based systems, add "--no-as-needed" to the default OpenJDK GCC link options as a workaround that forces consistent linkage behavior.
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=982443
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1031521
[3] https://ci.adoptium.net/job/build-scripts/job/jobs/job/jdk17u/job/jdk17u-linux-x64-temurin/lastBuild/consoleFull
[4] https://mail.openjdk.org/pipermail/build-dev/2023-August/040502.html
The toolchain used by Adoptium[3] and Oracle[4] does not set --as-needed.
To provide consistent linking for Debian-based systems, add "--no-as-needed" to the default OpenJDK GCC link options as a workaround that forces consistent linkage behavior.
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=982443
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1031521
[3] https://ci.adoptium.net/job/build-scripts/job/jobs/job/jdk17u/job/jdk17u-linux-x64-temurin/lastBuild/consoleFull
[4] https://mail.openjdk.org/pipermail/build-dev/2023-August/040502.html