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

Solve JDK-8353272 properly -- replace STATIC_LIB_CFLAGS and fix CFLAGS/CXXFLAGS assignment

XMLWordPrintable

      This is a bit of a mess. First, in JDK-8345683, STATIC_LIBS_CFLAGS was removed. In Flags.gmk we instead did:
      $1_EXTRA_CFLAGS += -DSTATIC_BUILD=1

      This worked just fine. Then came along JDK-8353272, which claimed we missed making the corresponding change for $1_EXTRA_CXXFLAGS, so we did, and assigned -DSTATIC_BUILD=1 to $1_EXTRA_CXXFLAGS as well.

      The problem was that the old code did not in fact assign STATIC_LIBS_CFLAGS, but STATIC_LIB_CFLAGS. (Note the missing plural S), which was empty, so $1_EXTRA_CXXFLAGS never got any value before JDK-8353272, but after that "fix" it did.

      This in turned caused problems further down the line. JDK-8353449 backed out JDK-8353272. This bug has a clear discussion about the problem, but in short two native libraries failed to build. Here are some excerpts from that bug:

      "It looks like for libjpackageapplauncher, this change caused CXXFLAGS to get a value, so CFLAGS are no longer copied to CXXFLAGS. This in combination of warning flags not being set correctly as they are set as CFLAGS argument as -W-no-format-nonliteral instead of set as DISABLED_WARNINGS"

      "The windows failure seems to be similar in nature. We only specify `-EHsc` for CFLAGS_windows, so it seems to be getting lost. However, I'm reluctant to make this kind of fix quickly. It's highly likely that we are losing more CFLAGS this way that aren't breaking the build directly, but will result in a different build. This will need careful analysis."

      The purpose of this bug is to try to get to the bottom of this mess. This means:

      1) Sort out how we do the CFLAGS/CXXFLAGS "copying/aliasing". This has bitten us before, so we should really find a more robust solution.

      2) Actually, finally, get rid of the incorrect STATIC_LIB_CFLAGS.

            Unassigned Unassigned
            ihse Magnus Ihse Bursie
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: