Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8314554

Debian/Ubuntu should not link OpenJDK with --as-needed link option

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 22
    • None
    • infrastructure
    • 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

      Attachments

        Issue Links

          Activity

            People

              vpetko Vladimir Petko
              vpetko Vladimir Petko
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: