前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >mac os openjdk 编译记录

mac os openjdk 编译记录

作者头像
heidsoft
发布2022-01-17 16:10:25
8440
发布2022-01-17 16:10:25
举报
文章被收录于专栏:云计算与大数据

本地系统

代码语言:javascript
复制
jdk git:(master) ✗ bash ./configure --with-debug-level=slowdebug  --with-boot-jdk=/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home
configure: Configuration created at Sun Oct 17 14:20:26 CST 2021.
checking for basename... /usr/bin/basename
checking for dirname... /usr/bin/dirname
checking for file... /usr/bin/file
checking for ldd... no
checking for bash... /bin/bash
checking for cat... /bin/cat
checking for chmod... /bin/chmod
checking for cp... /bin/cp
checking for cut... /usr/bin/cut
checking for date... /bin/date
checking for gdiff... [not found]
checking for diff... /usr/bin/diff
checking for echo... echo [builtin]
checking for expr... /bin/expr
checking for find... /usr/bin/find
checking for gunzip... /usr/bin/gunzip
checking for pigz... [not found]
checking for gzip... /usr/bin/gzip
checking for head... /usr/bin/head
checking for ln... /bin/ln
checking for ls... /bin/ls
checking for gmkdir... /usr/local/bin/gmkdir
checking for mktemp... /usr/bin/mktemp
checking for mv... /bin/mv
checking for gawk... [not found]
checking for nawk... [not found]
checking for awk... /usr/bin/awk
checking for printf... printf [builtin]
checking for rm... /bin/rm
checking for rmdir... /bin/rmdir
checking for sh... /bin/sh
checking for sort... /usr/bin/sort
checking for tail... /usr/bin/tail
checking for gtar... [not found]
checking for tar... /usr/bin/tar
checking for tee... /usr/bin/tee
checking for touch... /usr/bin/touch
checking for tr... /usr/bin/tr
checking for uname... /usr/bin/uname
checking for wc... /usr/bin/wc
checking for xargs... /usr/bin/xargs
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for a sed that does not truncate output... /usr/bin/sed
checking for df... /bin/df
checking for nice... /usr/bin/nice
checking for greadlink... /usr/local/bin/greadlink
checking for cygpath... [not found]
checking for wslpath... [not found]
checking for lsb_release... [not found]
checking for cmd.exe... [not found]
checking for cmp... /usr/bin/cmp
checking for uniq... /usr/bin/uniq
checking build system type... x86_64-apple-darwin20.6.0
checking host system type... x86_64-apple-darwin20.6.0
checking target system type... x86_64-apple-darwin20.6.0
checking openjdk-build os-cpu... macosx-x86_64
checking openjdk-target os-cpu... macosx-x86_64
checking compilation type... native
checking for top-level directory... /Users/heidsoft/Downloads/research/jdk
checking if custom source is suppressed (openjdk-only)... disabled, default
checking for --enable-debug... disabled, default
checking which debug level to use... slowdebug
checking which variants of the JVM to build... server
checking if absolute paths should be allowed in the build output... yes, debug build
checking for xcodebuild... /usr/bin/xcodebuild
checking for sdk name...
checking for sysroot... /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk
checking for toolchain path...
checking for extra path...
checking where to store configuration... in default location
checking what configuration name to use... macosx-x86_64-server-slowdebug
checking for zypper... [not found]
checking for apt-get... [not found]
checking for yum... [not found]
checking for brew... /usr/local/bin/brew
checking for pandoc... [not found]
checking for gmake... [not found]
checking for make... /usr/bin/make
configure: Testing potential make at /usr/bin/make, found using make in PATH
configure: Using GNU make at /usr/bin/make (version: GNU Make 3.81)
checking if make --output-sync is supported... no
checking if find supports -delete... yes
checking what type of tar was found... bsd
checking that grep (/usr/bin/grep) -Fx handles empty lines in the pattern list correctly... yes
checking for unzip... /usr/bin/unzip
checking for zip... /usr/bin/zip
checking for greadelf... [not found]
checking for readelf... [not found]
checking for dot... [not found]
checking for hg... [not found]
checking for git... /usr/local/bin/git
checking for stat... /usr/bin/stat
checking for time... time [builtin]
checking for flock... [not found]
checking for dtrace... /usr/sbin/dtrace
checking for gpatch... [not found]
checking for patch... /usr/bin/patch
checking for dsymutil... /usr/bin/dsymutil
checking for mig... /usr/bin/mig
checking for xattr... /usr/bin/xattr
checking for codesign... /usr/bin/codesign
checking if codesign certificate is present... no
checking for SetFile... /usr/bin/SetFile
checking for ulimit... ulimit [builtin]
checking bash version... 3.2.57
checking if bash supports pipefail... yes
checking if bash supports errexit (-e)... yes
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for default LOG value...
checking if packaged modules are kept... enabled, default
checking for version string... 18-internal+0-adhoc.heidsoft.jdk
configure: Found potential Boot JDK using configure arguments
checking for Boot JDK... /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home
checking Boot JDK version... openjdk version "17" 2021-09-14 OpenJDK Runtime Environment (build 17+35-2724) OpenJDK 64-Bit Server VM (build 17+35-2724, mixed mode, sharing)
checking for java [Boot JDK]... $BOOT_JDK/bin/java
checking for javac [Boot JDK]... $BOOT_JDK/bin/javac
checking for javadoc [Boot JDK]... $BOOT_JDK/bin/javadoc
checking for jar [Boot JDK]... $BOOT_JDK/bin/jar
checking if Boot JDK is 32 or 64 bits... 64
checking for local Boot JDK Class Data Sharing (CDS)... yes, created
checking for Build JDK... yes, will use output dir
checking for docs-reference JDK... no, using interim javadoc for the docs-reference targets
checking if we should build headless-only (no GUI)... disabled, default
checking if linker should clean out unused code (linktime-gc)... disabled, default
checking for graphviz dot... no, cannot generate full docs
checking for pandoc... no, cannot generate full docs
checking for --enable-full-docs... disabled, from default 'auto'
checking for cacerts file... default
checking for --enable-unlimited-crypto... enabled, default
checking for jni library path... default
checking if static build is available... yes
checking if static build is enabled... disabled, default
configure: Xcode major version: 12
configure: Using default toolchain clang (clang/LLVM)
configure: WARNING: Ignoring LDFLAGS(-L/usr/local/opt/openssl/lib) found in environment. Use --with-extra-ldflags
checking for clang... /usr/bin/clang
checking resolved symbolic links for CC... no symlink
configure: Using clang C compiler version 12.0.5 [Apple clang version 12.0.5 (clang-1205.0.22.11) Target: x86_64-apple-darwin20.6.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin]
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/clang accepts -g... yes
checking for /usr/bin/clang option to accept ISO C89... none needed
checking for clang++... /usr/bin/clang++
checking resolved symbolic links for CXX... no symlink
configure: Using clang C++ compiler version 12.0.5 [Apple clang version 12.0.5 (clang-1205.0.22.11) Target: x86_64-apple-darwin20.6.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin]
checking whether we are using the GNU C++ compiler... yes
checking whether /usr/bin/clang++ accepts -g... yes
checking how to run the C preprocessor... /usr/bin/clang -E
checking how to run the C++ preprocessor... /usr/bin/clang++ -E
configure: Using clang linker version 650.9 [@(#)PROGRAM:ld  PROJECT:ld64-650.9]
checking for ar... /usr/bin/ar
checking for lipo... /usr/bin/lipo
checking for otool... /usr/bin/otool
checking for install_name_tool... /usr/bin/install_name_tool
checking for metal... [not found]
checking if metal can be run using xcrun... yes, will be using 'xcrun -sdk macosx metal'
checking for metallib... [not found]
checking if metallib can be run using xcrun... yes, will be using 'xcrun -sdk macosx metallib'
checking for strip... /usr/bin/strip
checking for nm... /usr/bin/nm
checking for gobjdump... [not found]
checking for objdump... /usr/bin/objdump
checking for c++filt... /usr/bin/c++filt
checking for jtreg... [not found]
checking for jtreg test harness... no, not found
checking for jmh (Java Microbenchmark Harness)... no, disabled
checking for jib... no
checking if CC supports "-m64"... yes
checking if CXX supports "-m64"... yes
checking if both CC and CXX support "-m64"... yes
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking size of int *... 8
checking for target address size... 64 bits
checking whether byte ordering is bigendian... no
checking what source date to use... determined at build time, from 'updated'
checking for --enable-reproducible-build... disabled, default
checking for --enable-warnings-as-errors... enabled, default
checking if TARGET is x86... no
checking if CC supports "-fno-delete-null-pointer-checks"... yes
checking if CXX supports "-fno-delete-null-pointer-checks"... yes
checking if both CC and CXX support "-fno-delete-null-pointer-checks"... yes
checking if CC supports "-ffp-contract=off"... yes
checking if CXX supports "-ffp-contract=off"... yes
checking if both CC and CXX support "-ffp-contract=off"... yes
checking if BUILD is x86... no
checking if BUILD_CC supports "-fno-delete-null-pointer-checks"... yes
checking if BUILD_CXX supports "-fno-delete-null-pointer-checks"... yes
checking if both BUILD_CC and BUILD_CXX support "-fno-delete-null-pointer-checks"... yes
checking if BUILD_CC supports "-ffp-contract=off"... yes
checking if BUILD_CXX supports "-ffp-contract=off"... yes
checking if both BUILD_CC and BUILD_CXX support "-ffp-contract=off"... yes
checking what type of native debug symbols to use... external
checking if we should add external native debug symbols to the shipped bundles... no
checking if native coverage is available... yes
checking for --enable-native-coverage... disabled, default
checking if AddressSanitizer (asan) is available... yes
checking for --enable-asan... disabled, default
checking cups/cups.h usability... yes
checking cups/cups.h presence... yes
checking for cups/cups.h... yes
checking cups/ppd.h usability... yes
checking cups/ppd.h presence... yes
checking for cups/ppd.h... yes
Using freetype: bundled
checking for --enable-libffi-bundling... disabled, default
checking for which libjpeg to use... bundled
checking for which giflib to use... bundled
checking for PNG... yes
checking for which libpng to use... bundled
checking for compress in -lz... yes
checking for which zlib to use... system
checking for system zlib functionality... ok
checking for which lcms to use... bundled
checking for which harfbuzz to use... bundled
checking for cos in -lm... yes
checking for dlopen in -ldl... yes
checking for JVM features enabled by the user... none
checking for JVM features disabled by the user... none
checking if platform is supported by CDS... yes
checking if JVM feature 'cds' is available... yes
checking for dtrace tool... /usr/sbin/dtrace
checking sys/sdt.h usability... yes
checking sys/sdt.h presence... yes
checking for sys/sdt.h... yes
checking if JVM feature 'dtrace' is available... yes
checking if platform is supported by JFR... yes
checking if JVM feature 'jfr' is available... yes
checking if platform is supported by JVMCI... yes
checking if JVM feature 'jvmci' is available... yes
checking if platform is supported by Shenandoah... yes
checking if JVM feature 'shenandoahgc' is available... yes
checking if static-build is enabled in configure... no, use --enable-static-build to enable static build.
checking if JVM feature 'static-build' is available... no
checking if platform is supported by ZGC... yes
checking if JVM feature 'zgc' is available... yes
checking JVM features to use for variant 'server'... 'cds compiler1 compiler2 dtrace epsilongc g1gc jfr jni-check jvmci jvmti management nmt parallelgc serialgc services shenandoahgc vm-structs zgc'
checking if the jtreg failure handler is available... no (jtreg not present)
checking if the jtreg failure handler should be built... disabled, from default 'auto'
checking if the CDS classlist generation should be enabled... enabled, from default 'auto'
checking if any translations should be excluded... no
checking if static man pages should be copied... enabled, default
checking if CDS archive is available... yes
checking if a default CDS archive should be generated... enabled, from default 'auto'
checking if CDS archive is available... yes
checking if compatible cds region alignment enabled... disabled, default
checking for number of cores... 16
checking for memory size... 16384 MB
checking for appropriate number of jobs to run in parallel... 16
checking whether to use javac server... enabled, default
checking flags for boot jdk java command ...  -Duser.language=en -Duser.country=US  -XX:+UnlockDiagnosticVMOptions -XX:-VerifySharedSpaces -XX:SharedArchiveFile=/Users/heidsoft/Downloads/research/jdk/build/macosx-x86_64-server-slowdebug/configure-support/classes.jsa -Xshare:auto
checking flags for boot jdk java command for big workloads...  -Xms64M -Xmx1600M
checking flags for bootcycle boot jdk java command for big workloads... -Xms64M -Xmx1600M
checking flags for boot jdk java command for small workloads...  -XX:+UseSerialGC -Xms32M -Xmx512M -XX:TieredStopAtLevel=1
checking for --enable-icecc... disabled, default
checking if precompiled headers are available... yes
checking for --enable-precompiled-headers... enabled, from default 'auto'
checking for ccache... [not found]
checking if ccache is available... no, ccache binary missing or not executable
checking if ccache is enabled... disabled, default
checking if build directory is on local disk... yes
configure: creating /Users/heidsoft/Downloads/research/jdk/build/macosx-x86_64-server-slowdebug/configure-support/config.status
config.status: creating /Users/heidsoft/Downloads/research/jdk/build/macosx-x86_64-server-slowdebug/spec.gmk
config.status: creating /Users/heidsoft/Downloads/research/jdk/build/macosx-x86_64-server-slowdebug/bootcycle-spec.gmk
config.status: creating /Users/heidsoft/Downloads/research/jdk/build/macosx-x86_64-server-slowdebug/buildjdk-spec.gmk
config.status: creating /Users/heidsoft/Downloads/research/jdk/build/macosx-x86_64-server-slowdebug/compare.sh
config.status: creating /Users/heidsoft/Downloads/research/jdk/build/macosx-x86_64-server-slowdebug/Makefile

====================================================
A new configuration has been successfully created in
/Users/heidsoft/Downloads/research/jdk/build/macosx-x86_64-server-slowdebug
using configure arguments '--with-debug-level=slowdebug --with-boot-jdk=/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home'.

Configuration summary:
* Name:           macosx-x86_64-server-slowdebug
* Debug level:    slowdebug
* HS debug level: debug
* JVM variants:   server
* JVM features:   server: 'cds compiler1 compiler2 dtrace epsilongc g1gc jfr jni-check jvmci jvmti management nmt parallelgc serialgc services shenandoahgc vm-structs zgc'
* OpenJDK target: OS: macosx, CPU architecture: x86, address length: 64
* Version string: 18-internal+0-adhoc.heidsoft.jdk (18-internal)

Tools summary:
* Boot JDK:       openjdk version "17" 2021-09-14 OpenJDK Runtime Environment (build 17+35-2724) OpenJDK 64-Bit Server VM (build 17+35-2724, mixed mode, sharing) (at /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home)
* Toolchain:      clang (clang/LLVM from Xcode 12.5.1)
* C Compiler:     Version 12.0.5 (at /usr/bin/clang)
* C++ Compiler:   Version 12.0.5 (at /usr/bin/clang++)

Build performance summary:
* Build jobs:     16
* Memory limit:   16384 MB

The following warnings were produced. Repeated here for convenience:
WARNING: Ignoring LDFLAGS(-L/usr/local/opt/openssl/lib) found in environment. Use --with-extra-ldflags

➜  jdk git:(master) make all
Building target 'all' in configuration 'macosx-x86_64-server-slowdebug'
Compiling 1 files for BUILD_TOOLS_HOTSPOT
Compiling 8 files for BUILD_TOOLS_LANGTOOLS
Parsing 2 properties into enum-like class for jdk.compiler
Compiling 13 properties into resource bundles for jdk.javadoc
Compiling 12 properties into resource bundles for jdk.jdeps
Compiling 7 properties into resource bundles for jdk.jshell
Creating hotspot/variant-server/tools/adlc/adlc from 13 file(s)
Compiling 16 properties into resource bundles for jdk.compiler
Compiling 2 files for BUILD_JVMTI_TOOLS
Compiling 127 files for BUILD_java.compiler.interim
Compiling 403 files for BUILD_jdk.compiler.interim
Compiling 241 files for BUILD_jdk.javadoc.interim
Creating support/modules_libs/java.base/server/libjvm.dylib from 1068 file(s)
Compiling 31 files for BUILD_JRTFS
Compiling 185 files for BUILD_TOOLS_JDK
Compiling 2 files for COMPILE_DEPEND
Creating support/modules_libs/java.base/jrt-fs.jar
Compiling 2 files for BUILD_BREAKITERATOR_BASE
Compiling 2 files for BUILD_BREAKITERATOR_LD
Compiling 11 properties into resource bundles for java.logging
Compiling 11 properties into resource bundles for java.base
Compiling 6 properties into resource bundles for java.base
Compiling 11 properties into resource bundles for jdk.jartool
Compiling 71 files for COMPILE_CREATE_SYMBOLS
Compiling 11 properties into resource bundles for jdk.management.agent
Compiling 4 properties into resource bundles for jdk.jlink
Compiling 3 properties into resource bundles for jdk.jlink
Compiling 3 properties into resource bundles for jdk.jdi
Compiling 1 properties into resource bundles for jdk.jlink
Compiling 224 properties into resource bundles for jdk.localedata
Compiling 71 files for COMPILE_CREATE_SYMBOLS
Creating ct.sym classes

编译错误

代码语言:javascript
复制
configure: Found potential Boot JDK using well-known locations (in /Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk)
configure: Potential Boot JDK found at /Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home is incorrect JDK version (java version "13.0.2" 2020-01-14 Java(TM) SE Runtime Environment (build 13.0.2+8) Java HotSpot(TM) 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)); ignoring
configure: (Your Boot JDK version must be one of: 17 18)
configure: Could not find a valid Boot JDK. OpenJDK distributions are available at http://jdk.java.net/.
configure: This might be fixed by explicitly setting --with-boot-jdk
configure: error: Cannot continue
/Users/heidsoft/Downloads/research/jdk/build/.configure-support/generated-configure.sh: line 82: 5: Bad file descriptor
configure exiting with result code 1

提示本地jdk版本低了,需要升级为更高版本

编译完成后

参考:

https://gist.github.com/stepheneb/243072

https://maarten.mulders.it/2021/05/build-your-own-openjdk-on-macos/

https://jishuin.proginn.com/p/763bfbd31b18

https://hg.openjdk.java.net/jdk/jdk11/raw-file/tip/doc/building.html#running-configure

https://github.com/heidsoft/jdk

https://jdk.java.net/17/

https://medium.com/@brunofrascino/working-with-multiple-java-versions-in-macos-9a9c4f15615a

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2021-10-17,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 云数智圈 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档