Giter Site home page Giter Site logo

hotspot's Introduction

Hi there 👋

Top Langs Anurag's github stats

hotspot's People

Contributors

seaswalker avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

rzs840707

hotspot's Issues

在10.15.5 Catalina上编译(Xcode 11)

代码克隆

安装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

使用命令:

./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位置随自己的实际版本而定

xcodebuild

类似这样

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可解

xcode版本

报错:

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处左右,是连续的。如下图:
image

到这时应该就可以configure通过了。

make all

iostream

开始之前先准备好xcode缺失的头文件,不然会报fatal error: ‘iostream’ file not found错误,我用的这个仓库:
imkiwa/xcode-missing-libstdc-
clone下来后执行install.sh就好了

-std=gnu++98

报这个错: invalid argument ‘-std=gnu++98’ not allowed with ‘C’,还是去common/autoconf/generated-configure.sh,把这一行注释掉:

CXXSTD_CXXFLAG="-std=gnu++98"

ThreadUtilities报错

如下:

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) {//...}

PerfData::~PerfData()+0x8

报错全部: 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是并行数。

成功

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.