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

riscv: Fix build warnings-as-errors with GCC 11

XMLWordPrintable

    • 19
    • b07
    • riscv
    • linux

        GCC version:
        ------------------------------------------------------------------------------------------
        $ gcc -v
        Using built-in specs.
        COLLECT_GCC=gcc
        COLLECT_LTO_WRAPPER=/usr/lib/gcc/riscv64-linux-gnu/11/lto-wrapper
        Target: riscv64-linux-gnu
        Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.2.0-7ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=riscv64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --disable-multilib --with-arch=rv64imafdc --with-abi=lp64d --enable-checking=release --build=riscv64-linux-gnu --host=riscv64-linux-gnu --target=riscv64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=4
        Thread model: posix
        Supported LTO compression algorithms: zlib zstd
        gcc version 11.2.0 (Ubuntu 11.2.0-7ubuntu2)
        ------------------------------------------------------------------------------------------

        OpenJDK build warnings-as-errors message:
        ------------------------------------------------------------------------------------------
        Building target 'default (exploded-image)' in configuration 'linux-riscv64-server-release'
        Updating support/modules_libs/java.base/server/libjvm.so due to 6 file(s)
        In file included from /home/fyang/openjdk-jdk/src/hotspot/share/c1/c1_LIRAssembler.hpp:28,
                         from /home/fyang/openjdk-jdk/src/hotspot/share/c1/c1_LIRAssembler.cpp:30:
        In member function 'void PatchingStub::install(MacroAssembler*, LIR_PatchCode, Register, CodeEmitInfo*)',
            inlined from 'void PatchingStub::install(MacroAssembler*, LIR_PatchCode, Register, CodeEmitInfo*)' at /home/fyang/openjdk-jdk/src/hotspot/share/c1/c1_CodeStubs.hpp:423:8,
            inlined from 'void LIR_Assembler::patching_epilog(PatchingStub*, LIR_PatchCode, Register, CodeEmitInfo*)' at /home/fyang/openjdk-jdk/src/hotspot/share/c1/c1_LIRAssembler.cpp:46:17:
        /home/fyang/openjdk-jdk/src/hotspot/share/c1/c1_CodeStubs.hpp:440:25: error: 'this' pointer is null [-Werror=nonnull]
          440 | n_move->set_offset(field_offset);
              | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
        In file included from /home/fyang/openjdk-jdk/src/hotspot/share/code/nativeInst.hpp:30,
                         from /home/fyang/openjdk-jdk/src/hotspot/share/c1/c1_CodeStubs.hpp:33,
                         from /home/fyang/openjdk-jdk/src/hotspot/share/c1/c1_LIRAssembler.hpp:28,
                         from /home/fyang/openjdk-jdk/src/hotspot/share/c1/c1_LIRAssembler.cpp:30:
        /home/fyang/openjdk-jdk/src/hotspot/cpu/riscv/nativeInst_riscv.hpp: In member function 'void LIR_Assembler::patching_epilog(PatchingStub*, LIR_PatchCode, Register, CodeEmitInfo*)':
        /home/fyang/openjdk-jdk/src/hotspot/cpu/riscv/nativeInst_riscv.hpp:420:8: note: in a call to non-static member function 'void NativeMovRegMem::set_offset(int)'
          420 | void set_offset(int x);
              | ^~~~~~~~~~
        cc1plus: all warnings being treated as errors
        gmake[3]: *** [lib/CompileJvm.gmk:149: /home/fyang/openjdk-jdk/build/linux-riscv64-server-release/hotspot/variant-server/libjvm/objs/c1_LIRAssembler.o] Error 1
        gmake[3]: *** Waiting for unfinished jobs....
        gmake[2]: *** [make/Main.gmk:252: hotspot-server-libs] Error 2
        ----------------------------------------------------------------------------------------

        Workaround:
            Use configure flag --disable-warnings-as-errors

              fyang Fei Yang
              fyang Fei Yang
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: