当我用:
配置摘要:
vm-structs'
H 111版本字符串: 11.0.16-internal+0-adhoc.sadman.jdk11u-dev-master (11.0.16-internal)
工具摘要:
构建性能摘要:
使用
它提醒我
jdk11u-dev-master/src/hotspot/share/jfr/periodic/jfrNetworkUtilization.cpp:59:30:错误:为类似函数的宏调用断言提供了太多的参数(接口!= NULL,“不变”);
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/assert.h:98:9:注意:这里定义的宏“断言”#定义断言(E)\
这意味着jdk的源代码使用两个参数断言,但我的Mac只支持一个参数断言。
发布于 2022-09-23 22:43:37
在./test/hotspot/gtest/unittest.hpp中,在jdk11u源代码中有这样的注释和对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不知怎么这对test/hotspot/gtest/jfr/test_networkUtilization.cpp来说已经被打破了..。看起来assert在unittest.hpp之后的一个包含中被重新定义了。
您可以通过向下移动#include of unittest.hpp来修复编译,请参阅下面的差异:
--- 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 {发布于 2022-06-04 00:44:20
在macos蒙特雷上编译openjdk11是成功的
https://stackoverflow.com/questions/72336864
复制相似问题