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

EXTRA_CFLAGS not being picked up for assembler files

    Details

    • Subcomponent:
    • OS:
      linux

      Description

      When compiling OpenJDK 8 with extra C flags like this on Linux:

      $ configure [...] --with-extra-cflags=<flags> --with-extra-cxxflags=<flags>
      $ export EXTRA_CFLAGS=<flags>
      $ make images

      The hotspot build picks up extra C flags for cpp files, but for .S or .s files, the extra c flags are not propagated.

      Example:

      EXTRA_CFLAGS=-g -pipe -Wformat -Wno-cpp -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection

      Then I see for live.cpp for example this in the build log:

      /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 -fstack-protector -g -pipe -Wformat -Wno-cpp -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -std=gnu++98 -Wno-error -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-delete-null-pointer-checks -fno-lifetime-dse -std=gnu++98 -DDTRACE_ENABLED -c -MMD -MP -MF ../generated/dependencies/live.o.d -fpch-deps -o live.o /disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/src/share/vm/opto/live.cpp

      Yet, for linux_x86_64.s - an assembler file - the gcc command is:

      /usr/bin/gcc -c -m64 -g -MMD -MP -MF ../generated/dependencies/linux_x86_64.o.d -fpch-deps -o linux_x86_64.o /disk/openjdk/upstream-sources/openjdk8u-dev/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.s

      The extra C flags are missing for assembling .s files

        Attachments

          Issue Links

            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: