首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在OpenJDK上编译macOS 11?

如何在OpenJDK上编译macOS 11?
EN

Stack Overflow用户
提问于 2022-05-22 10:47:09
回答 2查看 196关注 0票数 2

当我用:

配置摘要:

vm-structs'

  • OpenJDK
  • 调试级别:快速调试
  • 调试级别:快速调试
  • JVM变体:服务器
  • JVM特性:服务器:‘address compiler1 compiler2 dtrace epsilongc g1gc graal jfr jni--检查jvmci jvmti管理nmt并行g1gc序列化服务
  • 目标: OS: macosx,CPU体系结构: x86,地址长度:64

H 111版本字符串: 11.0.16-internal+0-adhoc.sadman.jdk11u-dev-master (11.0.16-internal)

工具摘要:

  • Boot JDK: openjdk版本"11.0.2“2019-01-15 OpenJDK运行时环境18.9 (构建11.0.2+9) OpenJDK 64位服务器VM 18.9 (构建11.0.2+9,混合模式(在/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home)
  • Toolchain: clang ( /usr/bin/clang)
  • C++ /LLVM来自Xcode 13.4)
  • C编译器:版本13.1.6 (at /usr/bin/clang)
  • C++ Compiler: Version 13.1.6 )

构建性能摘要:

使用

  • 核:12
  • 内存限制: 16384 MB

它提醒我

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只支持一个参数断言。

EN

回答 2

Stack Overflow用户

发布于 2022-09-23 22:43:37

./test/hotspot/gtest/unittest.hpp中,在jdk11u源代码中有这样的注释和对assert的重新定义

代码语言:javascript
复制
// 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来说已经被打破了..。看起来assertunittest.hpp之后的一个包含中被重新定义了。

您可以通过向下移动#include of unittest.hpp来修复编译,请参阅下面的差异:

代码语言:javascript
复制
--- 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 {
票数 0
EN

Stack Overflow用户

发布于 2022-06-04 00:44:20

在macos蒙特雷上编译openjdk11是成功的

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72336864

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档