When I make, with:
Configuration summary:
Tools summary:
Build performance summary:
And it remind me that
jdk11u-dev-master/src/hotspot/share/jfr/periodic/jfrNetworkUtilization.cpp:59:30: error: too many arguments provided to function-like macro invocation assert(interfaces,= NULL; "invariant");
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/assert.h:98:9: note: macro 'assert' defined here #define assert(e) \
Which means the source codes of jdk use two arguments assert, but my Mac just support one argument assert.
在 macos monterey 上编译 openjdk11 是成功的
In ./test/hotspot/gtest/unittest.hpp
in the jdk11u source there is this comment and redefinition of assert
:
// gtest/gtest.h includes assert.h which will define the assert macro, but hotspot has its
// own standards incompatible assert macro that takes two parameters.
// The workaround is to undef assert and then re-define it. The re-definition
// must unfortunately be copied since debug.hpp might already have been
// included and a second include wouldn't work due to the header guards in debug.hpp.
#ifdef assert
#undef assert
#ifdef vmassert
#define assert(p, ...) vmassert(p, __VA_ARGS__)
#endif
#endif
Somehow this has been broken for test/hotspot/gtest/jfr/test_networkUtilization.cpp
... it appears to be that assert
is getting redefined in one of the includes after unittest.hpp
.
You can fix the compile by moving the #include
of unittest.hpp
down a bit, see this diff:
--- a/test/hotspot/gtest/jfr/test_networkUtilization.cpp
+++ b/test/hotspot/gtest/jfr/test_networkUtilization.cpp
@@ -42,12 +42,12 @@
#include "utilities/globalDefinitions.hpp"
#include "utilities/growableArray.hpp"
-#include "unittest.hpp"
-
#include <vector>
#include <list>
#include <map>
+#include "unittest.hpp"
+
namespace {
class MockFastUnorderedElapsedCounterSource : public ::FastUnorderedElapsedCounterSource {
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.