----- Build times ------- Start 2020-05-24 03:18:37 End 2020-05-24 03:30:07 00:00:19 corba 00:00:46 demos 00:01:52 docs 00:02:53 hotspot 00:01:28 images 00:00:12 jaxp 00:00:18 jaxws 00:03:07 jdk 00:00:26 langtools 00:00:09 nashorn 00:11:30 TOTAL ------------------------- Finished building OpenJDK for target 'all'
如何在CLion里面做调试,后面我再详细的写一篇。敬请期待~
遇到的坑
问题一:Xcode 4 is required to build JDK 8
1 2
configure: error: Xcode 4 is required to build JDK 8, the version found was 11.4.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
解决方案:
1 2 3 4 5 6 7
➜ openjdk8 vim common/autoconf/generated-configure.sh # Fail-fast: verify we're building on Xcode 4, we cannot build with Xcode 5 or later #XCODE_VERSION=`$XCODEBUILD -version | grep '^Xcode ' | sed 's/Xcode //'` #XC_VERSION_PARTS=( ${XCODE_VERSION//./ } ) #if test ! "${XC_VERSION_PARTS[0]}" = "4"; then # as_fn_error $? "Xcode 4 is required to build JDK 8, the version found was $XCODE_VERSION. Use --with-xcode-path to specify the l ocation of Xcode 4 or make Xcode 4 active by using xcode-select." "$LINENO" 5 #fi
configure: error: A gcc compiler is required. Try setting --with-tools-dir. configure exiting with result code # 第一处代码 eliftest"x$TOOLCHAIN_TYPE" = xgcc; then # gcc --version output typically looks like # gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1 # Copyright (C) 2013 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1` # Check that this is likely to be GCC. $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Free Software Foundation" > /dev/null # 条件语句注释掉 # iftest $? -ne 0; then # { $as_echo"$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 # $as_echo"$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} # { $as_echo"$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$COMPILER_VERSION\"" >&5 # $as_echo"$as_me: The result from running with --version was: \"$COMPILER_VERSION\"" >&6;} # as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.""$LINENO" 5 # fi # 第二处代码, elif test "x$TOOLCHAIN_TYPE" = xgcc; then # gcc --version output typically looks like # gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1 # Copyright (C) 2013 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1` # Check that this is likely to be GCC. $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Free Software Foundation" > /dev/null # 条件语句注释掉 # iftest $? -ne 0; then # { $as_echo"$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 # $as_echo"$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} # { $as_echo"$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$COMPILER_VERSION\"" >&5 # $as_echo"$as_me: The result from running with --version was: \"$COMPILER_VERSION\"" >&6;} # as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.""$LINENO" 5
==================================================== A new configuration has been successfully created in /Users/chenyuan/Workspaces/Openjdk/openjdk8/build/macosx-x86_64-normal-server-release using default settings.
Configuration summary: * Debug level: release * JDK variant: normal * JVM variants: server * OpenJDK target: OS: macosx, CPU architecture: x86, address length: 64
Tools summary: * Boot JDK: java version "1.8.0_162" Java(TM) SE Runtime Environment (build 1.8.0_162-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode) (at /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home) * Toolchain: gcc (GNU Compiler Collection) * C Compiler: Version 11.0.3 (at /usr/bin/gcc) * C++ Compiler: Version 11.0.3 (at /usr/bin/g++)
clang: clangerror: include path for libstdc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Werror,-Wstdlibcxx-not-found] : error: include path for libstdc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Werror,-Wstdlibcxx-not-found] make[6]: *** [../generated/adfiles/archDesc.o] Error 1 make[6]: *** Waiting for unfinished jobs.... make[6]: *** [../generated/adfiles/adlparse.o] Error 1 clang: error: include path for libstdc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Werror,-Wstdlibcxx-not-found] make[6]: *** [../generated/adfiles/arena.o] Error 1 make[5]: *** [ad_stuff] Error 2 make[4]: *** [product] Error 2 make[3]: *** [generic_build2] Error 2 make[2]: *** [product] Error 2 make[1]: *** [/Users/chenyuan/Workspaces/Openjdk/openjdk8/build/macosx-x86_64-normal-server-release/hotspot/_hotspot.timestamp] Error 2 make: *** [hotspot-only] Error 2
问题六:invalid argument ‘-std=gnu++98’ not allowed with ‘C’
1 2 3
Making signal interposition lib... error: invalid argument '-std=gnu++98' not allowed with 'C' make[6]: *** [libjsig.dylib] Error 1
解决方案
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then if test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -xregs=no%appl" CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl" fi elif test "x$TOOLCHAIN_TYPE" = xxlc; then LDFLAGS_JDK="${LDFLAGS_JDK} -q64 -brtl -bnolibpath -liconv -bexpall" CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt" CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt" elif test "x$TOOLCHAIN_TYPE" = xgcc; then LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS -fstack-protector" LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS -fstack-protector" if test "x$OPENJDK_TARGET_OS" != xmacosx; then LDFLAGS_JDK="$LDFLAGS_JDK -Wl,-z,relro" LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS -Wl,-z,relro" fi # CXXSTD_CXXFLAG="-std=gnu++98" # 注释掉这行