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

[hotspot] --with-extra-cxx-flags should not change optimization for libjvm

    Details

    • Subcomponent:
    • OS:
      linux

      Description

      When building OpenJDK 8 with --with-extra-cflags="-O2" --with-extra-cxxflags="-O2" libjvm.so objects get compiled with -O2 instead of default -O3 for a "release" type build. Example from a build log when configured as above:

      /usr/bin/g++ -DLINUX -D_GNU_SOURCE -DAMD64 -DPRODUCT -I. -I/disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/src/share/vm/prims -I/disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/src/share/vm -I/disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/src/share/vm/precompiled -I/disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/src/cpu/x86/vm -I/disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/src/os_cpu/linux_x86/vm -I/disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/src/os/linux/vm -I/disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/src/os/posix/vm -I../generated -DHOTSPOT_RELEASE_VERSION="\"25.71-b00\"" -DHOTSPOT_BUILD_TARGET="\"product\"" -DHOTSPOT_BUILD_USER="\"sgehwolf\"" -DHOTSPOT_LIB_ARCH=\"amd64\" -DHOTSPOT_VM_DISTRO="\"OpenJDK\"" -DTARGET_OS_FAMILY_linux -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_linux_x86 -DTARGET_OS_ARCH_MODEL_linux_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fPIC -fno-rtti -fno-exceptions -D_REENTRANT -fcheck-new -fvisibility=hidden -m64 -pipe -fno-strict-aliasing -g -fno-omit-frame-pointer -O3 -DVM_LITTLE_ENDIAN -D_LP64=1 -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -O2 -std=gnu++98 -DDTRACE_ENABLED -c -MMD -MP -MF ../generated/dependencies/yieldingWorkgroup.o.d -fpch-deps -o yieldingWorkgroup.o /disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/src/share/vm/utilities/yieldingWorkgroup.cpp

      Note that -O3 comes *before* -O2 on the command line, thus the objects will be -O2 compiled on GCC platforms. This doesn't seem to happen on JDK 9+ builds which has the new build system.

        Attachments

          Activity

            People

            • Assignee:
              sgehwolf Severin Gehwolf
              Reporter:
              sgehwolf Severin Gehwolf
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: