-
Bug
-
Resolution: Fixed
-
P2
-
None
-
b174
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8182344 | 10 | Erik Österlund | P2 | Resolved | Fixed | b13 |
JDK-8181997 | 9.0.4 | Erik Österlund | P2 | Resolved | Fixed | b01 |
Building hotspot with GCC 6 is currently broken because hotspot fails to build tests:
In file included from /home/omajid/rpmbuild/BUILD/java-9-openjdk-9.0.0.126-1.fc24.x86_64/jdk9/test/fmw/gtest/include/gtest/gtest.h:54:0,
from /home/omajid/rpmbuild/BUILD/java-9-openjdk-9.0.0.126-1.fc24.x86_64/jdk9/hotspot/test/native/unittest.hpp:29,
from /home/omajid/rpmbuild/BUILD/java-9-openjdk-9.0.0.126-1.fc24.x86_64/jdk9/hotspot/test/native/runtime/test_instanceKlass.cpp:28:
/usr/include/c++/6.1.1/limits:320:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6.1.1/limits:324:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6.1.1/limits:387:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return false; }
^
hotspot/src/share/vm/utilities/globalDefinitions.hpp defines min and max macros:
1166 #define max(a,b) Do_not_use_max_use_MAX2_instead
1167 #define min(a,b) Do_not_use_min_use_MIN2_instead
These macros are included first, and then the limits header is included which defines functions called min and max again:
min() _GLIBCXX_USE_NOEXCEPT { return false; }
max() _GLIBCXX_USE_NOEXCEPT { return true; }
And the compiler doesn't like the "macros" here.
There's a GCC bug that explains their position on this issue: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=29989
A quick fix - assuming hotspot want to keep defining min()/max() macros - is to include the limits header first and then include the hotspot's #define's.
In file included from /home/omajid/rpmbuild/BUILD/java-9-openjdk-9.0.0.126-1.fc24.x86_64/jdk9/test/fmw/gtest/include/gtest/gtest.h:54:0,
from /home/omajid/rpmbuild/BUILD/java-9-openjdk-9.0.0.126-1.fc24.x86_64/jdk9/hotspot/test/native/unittest.hpp:29,
from /home/omajid/rpmbuild/BUILD/java-9-openjdk-9.0.0.126-1.fc24.x86_64/jdk9/hotspot/test/native/runtime/test_instanceKlass.cpp:28:
/usr/include/c++/6.1.1/limits:320:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6.1.1/limits:324:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6.1.1/limits:387:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return false; }
^
hotspot/src/share/vm/utilities/globalDefinitions.hpp defines min and max macros:
1166 #define max(a,b) Do_not_use_max_use_MAX2_instead
1167 #define min(a,b) Do_not_use_min_use_MIN2_instead
These macros are included first, and then the limits header is included which defines functions called min and max again:
min() _GLIBCXX_USE_NOEXCEPT { return false; }
max() _GLIBCXX_USE_NOEXCEPT { return true; }
And the compiler doesn't like the "macros" here.
There's a GCC bug that explains their position on this issue: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=29989
A quick fix - assuming hotspot want to keep defining min()/max() macros - is to include the limits header first and then include the hotspot's #define's.
- backported by
-
JDK-8181997 The min/max macros make hotspot tests fail to build with GCC 6
-
- Resolved
-
-
JDK-8182344 The min/max macros make hotspot tests fail to build with GCC 6
-
- Resolved
-