seaswalker / hotspot Goto Github PK
View Code? Open in Web Editor NEW从《Hotspot实战》一书中引出的想法,^_^
从《Hotspot实战》一书中引出的想法,^_^
安装Mercurial: brew install Mercurial
,这是openjdk使用的代码管理工具,clone:
hg clone http://hg.openjdk.java.net/jdk8u/jdk8u
clone下来后文件夹内有一个get_source.sh文件,运行它就可以最终拉下代码来
brew install freetype ccache
除此之外还需要在本地有已经安装的jdk
参考的: Mac OSX之Catalina 10.15中编译OpenJDK8
使用命令:
./configure --with-debug-level=slowdebug --with-freetype-include=/usr/local/include/freetype2 --with-freetype-lib=/usr/local/lib --with-boot-jdk=/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home --with-native-debug-symbols=internal
命令里的jdk位置随自己的实际版本而定
类似这样
xcode-select: error: tool 'xcodebuild' requires Xcode,
but active developer directory
'/Library/Developer/CommandLineTools' is a command line tools instance
使用命令: sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
可解
报错:
checking for xcodebuild... /usr/bin/xcodebuild
configure: error: Xcode 4 is required to build JDK 8, the version found was 11.1. Use --with-xcode-path to specify the location of Xcode 4 or make Xcode 4 active by using xcode-select.
configure exiting with result code 1
这时去common/autoconf/generated-configure.sh中直接把版本校验的代码注释掉就好了,大约从27927行开始,有10处左右,是连续的。如下图:
到这时应该就可以configure通过了。
开始之前先准备好xcode缺失的头文件,不然会报fatal error: ‘iostream’ file not found
错误,我用的这个仓库:
imkiwa/xcode-missing-libstdc-
clone下来后执行install.sh
就好了
报这个错: invalid argument ‘-std=gnu++98’ not allowed with ‘C’
,还是去common/autoconf/generated-configure.sh
,把这一行注释掉:
CXXSTD_CXXFLAG="-std=gnu++98"
如下:
Undefined symbols for architecture x86_64:
"_attachCurrentThread", referenced from:
+[ThreadUtilities getJNIEnv] in ThreadUtilities.o
+[ThreadUtilities getJNIEnvUncached] in ThreadUtilities.o
处理方法是把jdk/src/macosx/native/sun/osxapp/ThreadUtilities.m
的方法:
inline void attachCurrentThread(void** env) {//...}
改为:
static inline void attachCurrentThread(void** env) {//...}
报错全部: V [libjvm.dylib+0xd4cc58] PerfData::~PerfData()+0x8
出现在显示编译成功,但执行java命令却报错,需要修改hotspot/src/share/vm/runtime/perfMemory.cpp
的约75行,注释掉:
// if (SafepointSynchronize::is_at_safepoint() && !StatSampler::is_active()) {
// PerfDataManager::destroy();
// }
这个最好提前修改,不然还要重新make一遍....
make支持多核并行,可以快很多: make all -j4
,4是并行数。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.