JDK-8232084 : HotSpot build failed with GCC 9.2.1
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 8,11,14
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-10-10
  • Updated: 2021-05-14
  • Resolved: 2019-10-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13 JDK 14
11.0.12Fixed 13.0.8Fixed 14 b20Fixed
Related Reports
Relates :  
Relates :  
Description
I tried to build OpenJDK on Fedora 30 x64 with GCC 9.2.1, but it was failed as below:


macroAssembler_x86.hpp

```
In file included from /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/utilities/globalDefinitions.hpp:29,
                 from /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/memory/allocation.hpp:28,
                 from /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/classfile/classLoaderData.hpp:28,
                 from /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/precompiled/precompiled.hpp:34:
In member function 'void MacroAssembler::pd_patch_instruction(address, address, const char*, int)',
    inlined from 'void MacroAssembler::pd_patch_instruction(address, address, const char*, int)' at /home/ysuenaga/OpenJDK/jdk/src/hotspot/cpu/x86/macroAssembler_x86.hpp:103:8,
    inlined from 'void Label::patch_instructions(MacroAssembler*)' at /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/asm/assembler.cpp:217:31:
/home/ysuenaga/OpenJDK/jdk/src/hotspot/share/utilities/debug.hpp:101:20: warning: '%s' directive argument is null [-Wformat-overflow=]
  101 |     report_vm_error(__FILE__, __LINE__, "guarantee(" #p ") failed", __VA_ARGS__); \
      |     ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ysuenaga/OpenJDK/jdk/src/hotspot/cpu/x86/macroAssembler_x86.hpp:117:7: note: in expansion of macro 'guarantee'
  117 |       guarantee(this->is8bit(imm8), "Short forward jump exceeds 8-bit offset at %s:%d", file, line);
      |       ^~~~~~~~~
In file included from /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/asm/macroAssembler.hpp:31,
                 from /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/asm/assembler.cpp:27:
/home/ysuenaga/OpenJDK/jdk/src/hotspot/cpu/x86/macroAssembler_x86.hpp: In member function 'void Label::patch_instructions(MacroAssembler*)':
/home/ysuenaga/OpenJDK/jdk/src/hotspot/cpu/x86/macroAssembler_x86.hpp:117:81: note: format string is defined here
  117 |       guarantee(this->is8bit(imm8), "Short forward jump exceeds 8-bit offset at %s:%d", file, line);
```


diagnosticArgument.cpp:

```
In member function 'void DCmdArgument<ArgType>::parse_value(const char*, size_t, Thread*) [with ArgType = bool]',
    inlined from 'void DCmdArgument<ArgType>::init_value(Thread*) [with ArgType = bool]' at /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/services/diagnosticArgument.cpp:164:22:
/home/ysuenaga/OpenJDK/jdk/src/hotspot/share/services/diagnosticArgument.cpp:154:14: warning: 'char* strncpy(char*, const char*, size_t)' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
  154 |       strncpy(buf, str, len);
      |       ~~~~~~~^~~~~~~~~~~~~~~
/home/ysuenaga/OpenJDK/jdk/src/hotspot/share/services/diagnosticArgument.cpp: In member function 'void DCmdArgument<ArgType>::init_value(Thread*) [with ArgType = bool]':
/home/ysuenaga/OpenJDK/jdk/src/hotspot/share/services/diagnosticArgument.cpp:164:22: note: length computed here
  164 |     this->parse_value(_default_string, strlen(_default_string), THREAD);
```
Comments
jdk11 backport request I would like to have the change in jdk11 as well, to be able to build jdk11 with gcc-9.X . The backport needs to be adjusted, RFR : https://mail.openjdk.java.net/pipermail/jdk-updates-dev/2021-May/006150.html .
14-05-2021

Fix request (jdk13u): should be ported here, too. Additional disabled warnings are necessary in 13u as in 11u but there's no problems with jvmti_tools.c. Verified with gcc 9.3.0 and 7.5.0, release and fastdebug builds and native hotspot testing.
13-05-2021

MacroAssembler hunk was introduced with JDK-8209594, linking up.
21-10-2019

URL: https://hg.openjdk.java.net/jdk/jdk/rev/9f5b92d5a1b2 User: ysuenaga Date: 2019-10-18 00:57:47 +0000
18-10-2019

ILW = Build fails (with unsupported GCC version), Fedora 30 x64 with GCC 9.2.1, no workaround = LLH = P5 https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms
11-10-2019

Suggested fix: http://cr.openjdk.java.net/~ysuenaga/JDK-8232084/webrev.00/
10-10-2019