When a build fails, the build system prints a failure summary:
ERROR: Build failed for target 'hotspot' in configuration 'linux-x64' (exit code 2)=== Output from failing command(s) repeated here ===* For target hotspot_variant-server_libjvm_objs_psMemoryPool.o:/src/jdk/hotspot/src/share/vm/services/psMemoryPool.cpp:1:1: error: 'failhere' does not name a type ... (rest of output omitted)* All command lines available in /src/jdk/build/linux-x64/make-support/failure-logs.=== End of repeated output ====== Make failed targets repeated here ===lib/CompileJvm.gmk:207: recipe for target '/src/jdk/build/linux-x64/hotspot/variant-server/libjvm/objs/psMemoryPool.o' failedmake/Main.gmk:263: recipe for target 'hotspot-server-libs' failed=== End of repeated output ===HELP: Try searching the build log for the name of the first failed target.HELP: Run 'make doctor' to diagnose build problems.
The first line shows which configuration failed and which top-level target you were building.
2
Command output
Between Output from failing command(s) repeated here and End of repeated output, you’ll see the actual error message(s) from the failing command(s).In parallel builds, output from all failed commands is shown.
3
Failure logs directory
The path to failure-logs directory is printed. Contains:
<target>.log - Complete output from the failing command
<target>.cmd - Complete command line used
Re-run the failing command:
. <path-to-failure-logs>/<target>.cmd
4
Make target chain
Between Make failed targets repeated here and End of repeated output, you’ll see the chain of make targets leading to the failure.The first failed recipe typically contains the full path to the file that failed to compile.
# Search for specific file that failedgrep "psMemoryPool.o" $BUILD/build.log# Search for error markersgrep "] Error" $BUILD/build.loggrep "\*\*\*" $BUILD/build.log# Search for warningsgrep -i "warning" $BUILD/build.log
Always run make doctor when encountering unexpected build failures.
The build system includes a diagnostic tool:
make doctor
Example output:
"make doctor" will help you analyze your build environment. It can highlightcertain well-known problems, but it can never find all possible errors.* Verifying that configure has picked up git...* Checking for warnings from configure... ---The following warnings were produced. Repeated here for convenience:WARNING: pandoc is version 3.1.9, not the recommended version 2.19.2 ---! Inspect the warnings, fix any problems, and re-run configure* Checking for left-over core files...Found these potential core files. They might interfere with the build process: ---src/hotspot/core.1337 ---! Remove left-over core files* Checking for untracked files with illegal names...* If all else fails, try removing the entire build directory and re-creatingthe same configuration using: ---configure_command_line=$(make print-configuration)make dist-cleanbash configure $configure_command_line ---* The build README (doc/building.md) is a great source of information,especially the chapter "Fixing Unexpected Build Failures". Check it out!* If you still need assistance please contact [email protected].
Problem: After OS or Xcode update, build fails.Solutions:
Use older Xcode version
# Download older Xcode from xcodereleases.com# Install to /Applications/Xcode13.1.app# Use specific versionbash configure --with-xcode-path=/Applications/Xcode13.1.app
# Check available localeslocale -a | grep -i utf# Generate locale if missingsudo locale-gen en_US.UTF-8# Set for buildexport LC_ALL=en_US.UTF-8bash configure
GCC version too old
Minimum: GCC 10.0Solution: Install newer GCC or use distribution’s update repositories:
# Ubuntu - use toolchain PPAsudo add-apt-repository ppa:ubuntu-toolchain-r/testsudo apt-get updatesudo apt-get install gcc-12 g++-12# Specify to configurebash configure CC=gcc-12 CXX=g++-12