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

link-time-opt should not be using -fwhole-program

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 10
    • Fix Version/s: 10
    • Component/s: infrastructure
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b34

      Description

      When building hotspot with link-time-opt, we are currently using -fwhole-program to the linker. This causes all public symbols to be removed. To counter this, the attribute "externally_visible" has been added to JNIEXPORT for arm (the platform that traditionally has used link-time-opt).

      This is not an appropriate way of doing things.

      The gcc documentation says about "-fwhole-program": "This option should not be used in combination with -flto. Instead relying on a linker plugin should provide safer and more precise information."

      If we replace -fwhole-program with -fuse-linker-plugin, the need to use externally_visible disappears.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ihse Magnus Ihse Bursie
                Reporter:
                ihse Magnus Ihse Bursie
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: