-
Bug
-
Resolution: Fixed
-
P4
-
19
-
b08
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8295004 | 19.0.2 | Man Cao | P4 | Resolved | Fixed | b02 |
After JDK-8214976, OpenJDK cannot build with Clang 14 or newer. This is because Clang 14+ currently does not support merging warning attributes of functions. Build failure looks like:
```
jdkGitHead/src/hotspot/share/utilities/globalDefinitions.hpp:165:1: error: 'warning' attribute does not appear on the first declaration
FORBID_C_FUNCTION(void exit(int), "use os::exit");
^
jdkGitHead/src/hotspot/share/utilities/compilerWarnings_gcc.hpp:85:29: note: expanded from macro 'FORBID_C_FUNCTION'
extern "C" __attribute__((__warning__(alternative))) signature;
^
/usr/include/stdlib.h:617:13: note: previous declaration is here
extern void exit (int __status) __THROW __attribute__ ((__noreturn__));
```
https://github.com/llvm/llvm-project/issues/56519 has been opened and will be fixed in a future Clang release. I propose we temporarily disable the warning attribute when building with Clang, until the LLVM issue #56519 is fixed and released.
```
jdkGitHead/src/hotspot/share/utilities/globalDefinitions.hpp:165:1: error: 'warning' attribute does not appear on the first declaration
FORBID_C_FUNCTION(void exit(int), "use os::exit");
^
jdkGitHead/src/hotspot/share/utilities/compilerWarnings_gcc.hpp:85:29: note: expanded from macro 'FORBID_C_FUNCTION'
extern "C" __attribute__((__warning__(alternative))) signature;
^
/usr/include/stdlib.h:617:13: note: previous declaration is here
extern void exit (int __status) __THROW __attribute__ ((__noreturn__));
```
https://github.com/llvm/llvm-project/issues/56519 has been opened and will be fixed in a future Clang release. I propose we temporarily disable the warning attribute when building with Clang, until the LLVM issue #56519 is fixed and released.
- backported by
-
JDK-8295004 Build failure with Clang 14+ due to function warning attribute
-
- Resolved
-
- relates to
-
JDK-8290903 Enable function warning attribute for Clang build once Clang supports merging
-
- Open
-
-
JDK-8214976 Warn about uses of functions replaced for portability
-
- Resolved
-
- links to
-
Commit openjdk/jdk19u/763c080f
-
Commit openjdk/jdk/0599a05f
-
Review openjdk/jdk19u/44
-
Review openjdk/jdk/9621
(2 links to)