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

LP64 gets incorrectly defined on Linux

XMLWordPrintable

    • linux

      In hotspot/make/linux/Makefile a variable called MFLAGS is populated with some useful defines and later passed in to one of the sub make commands. Among other things LP64 is added like so:

      # we need to set up LP64 correctly to satisfy sanity checks in adlc
      ifneq ("$(filter $(LP64_ARCH),$(BUILDARCH))","")
        MFLAGS += " LP64=1 "
      endif

      In make/linux/makefiles/vm.make the value of LP64 is checked:

      # Large File Support
      ifneq ($(LP64), 1)
      CXXFLAGS/ostream.o += -D_FILE_OFFSET_BITS=64
      endif # ifneq ($(LP64), 1)

      I'm assuming that the check is trying to check if the target platform is 32-bit, and in that case add an extra define when compiling ostream.cpp.

      The problem with the way the LP64 define is constructed is that the value of it ends up being "1 ", as in, there's an extra space in the value. Since the check in vm.make checks if the value is exactly "1" the test will actually never fail, meaning the body of the if is executed no matter if the target platform is 32-bit or 64-bit, which in the next step means _FILE_OFFSET_BITS=64 is always defined when compiling ostream.cpp.

      The check in vm.make was added as part of JDK-7122222, but the incorrect definition of the value has been there since rev 0.

            gthornbr Gerald Thornbrugh (Inactive)
            mikael Mikael Vidstedt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: