duke@2: duke@2: ohair@13:
ohair@13:ohair@25: ohair@13: | ohair@13:
ohair@13: OpenJDK Build READMEohair@13: |
ohair@13:
ohair@632: This README file contains build instructions for the ohair@632: OpenJDK. ohair@632: Building the source code for the ohair@632: OpenJDK ohair@632: requires ohair@632: a certain degree of technical expertise. ohair@632: ohair@632: ohair@632:ohair@632: ohair@632: ohair@13:!!!!!!!!!!!!!!! THIS IS A MAJOR RE-WRITE of this document. !!!!!!!!!!!!!
ohair@632:ohair@632: Some Headlines: ohair@632:ohair@13:ohair@632:
ohair@632:- ohair@632: The build is now a "
ohair@632:configure && make
" style build ohair@632:- ohair@632: Any GNU make 3.81 or newer should work ohair@632:
ohair@632:- ohair@632: The build should scale, i.e. more processors should ohair@632: cause the build to be done in less wall-clock time ohair@632:
ohair@632:- ohair@632: Nested or recursive make invocations have been significantly ohair@632: reduced, as has the total fork/exec or spawning ohair@632: of sub processes during the build ohair@632:
ohair@632:- ohair@632: Windows MKS usage is no longer supported ohair@632:
ohair@632:- ohair@632: Windows Visual Studio
ohair@632:vsvars*.bat
and ohair@632:vcvars*.bat
files are run automatically ohair@632:- ohair@632: Ant is no longer used when building the OpenJDK ohair@632:
ohair@632:- ohair@632: Use of ALT_* environment variables for configuring the ohair@632: build is no longer supported ohair@632:
ohair@632:
ohair@13:ohair@276: ohair@632: ohair@276:ohair@13:
ohair@632:- Introduction
ohair@632: ohair@276:- Use of Mercurial ohair@276:
ohair@632: ohair@632:ohair@276:
ohair@276:- Getting the Source
ohair@632:- Repositories
ohair@276:- Building ohair@41: ohair@276:
ohair@632:- Testing
ohair@632:
ohair@632:ohair@632:
ohair@13:- Appendix A: Hints and Tips ohair@320:
ohair@632:ohair@632:
ohair@320:- FAQ
ohair@632:- Build Performance Tips
ohair@632:- Troubleshooting
ohair@320:- Appendix B: GNU Make Information
ohair@632:- Appendix C: Build Environments
ohair@632: ohair@632: ohair@632: ohair@13:
ohair@276: The OpenJDK sources are maintained with the revision control system ohair@276: Mercurial. ohair@276: If you are new to Mercurial, please see the ohair@632: ohair@632: Beginner Guides ohair@632: or refer to the ohair@632: Mercurial Book. ohair@276: The first few chapters of the book provide an excellent overview of ohair@276: Mercurial, what it is and how it works. ohair@276:ohair@276: ohair@632: ohair@13:
ohair@276: For using Mercurial with the OpenJDK refer to the ohair@320: ohair@320: Developer Guide: Installing and Configuring Mercurial ohair@276: section for more information. ohair@276: ohair@276:Getting the Source
ohair@276:ohair@276: To get the entire set of OpenJDK Mercurial repositories ohair@632: use the scriptohair@276: ohair@632:get_source.sh
located in the ohair@632: root repository: ohair@276:ohair@632:ohair@632: Once you have all the repositories, keep in mind that each erikj@774: repository is its own independent repository. ohair@632: You can also re-runohair@632: hg clone http://hg.openjdk.java.net/jdk8/jdk8 ohair@632: YourOpenJDK ohair@632:
ohair@276:
ohair@632: cd YourOpenJDK ohair@632:
ohair@632: bash ./get_source.sh ohair@632:./get_source.sh
anytime to ohair@632: pull over all the latest changesets in all the repositories. ohair@632: This set of nested repositories has been given the term ohair@632: "forest" and there are various ways to apply the same ohair@632:hg
command to each of the repositories. ohair@632: For example, the scriptmake/scripts/hgforest.sh
ohair@632: can be used to repeat the samehg
ohair@632: command on every repository, e.g. ohair@276:ohair@632:ohair@276:ohair@276: cd YourOpenJDK ohair@632:
ohair@276:
ohair@632: bash ./make/scripts/hgforest.sh status ohair@632:Repositories
ohair@632:ohair@632:ohair@632: ohair@632:The set of repositories and what they contain:
ohair@632:ohair@632: ohair@632:
ohair@632:ohair@632: ohair@632: ohair@632: ohair@632:Repository ohair@632:Contains ohair@632:ohair@632: ohair@632:ohair@632: . (root) ohair@632: ohair@632:ohair@632: common configure and makefile logic ohair@632: ohair@632:ohair@632: ohair@632:ohair@632: hotspot ohair@632: ohair@632:ohair@632: source code and make files for building ohair@632: the OpenJDK Hotspot Virtual Machine ohair@632: ohair@632:ohair@632: ohair@632:ohair@632: langtools ohair@632: ohair@632:ohair@632: source code for the OpenJDK javac and language tools ohair@632: ohair@632:ohair@632: ohair@632:ohair@632: jdk ohair@632: ohair@632:ohair@632: source code and make files for building ohair@632: the OpenJDK runtime libraries and misc files ohair@632: ohair@632:ohair@632: ohair@632:ohair@632: jaxp ohair@632: ohair@632:ohair@632: source code for the OpenJDK JAXP functionality ohair@632: ohair@632:ohair@632: ohair@632:ohair@632: jaxws ohair@632: ohair@632:ohair@632: source code for the OpenJDK JAX-WS functionality ohair@632: ohair@632:ohair@632: erikj@774:ohair@632: corba ohair@632: ohair@632:ohair@632: source code for the OpenJDK Corba functionality ohair@632: ohair@632:erikj@774: ohair@632: ohair@632:erikj@774: nashorn erikj@774: erikj@774:erikj@774: source code for the OpenJDK JavaScript implementation erikj@774: erikj@774:Repository Source Guidelines
ohair@632:ohair@632: There are some very basic guidelines: ohair@632:ohair@632: ohair@276:ohair@632:
ohair@632:- ohair@632: Use of whitespace in source files ohair@632: (.java, .c, .h, .cpp, and .hpp files) ohair@632: is restricted. ohair@632: No TABs, no trailing whitespace on lines, and files ohair@632: should not terminate in more than one blank line. ohair@632:
ohair@632:- ohair@632: Files with execute permissions should not be added ohair@632: to the source repositories. ohair@632:
ohair@632:- ohair@632: All generated files need to be kept isolated from ohair@632: the files ohair@632: maintained or managed by the source control system. ohair@632: The standard area for generated files is the top level ohair@632:
ohair@632:build/
directory. ohair@632:- ohair@632: The default build process should be to build the product ohair@632: and nothing else, in one form, e.g. a product (optimized), ohair@632: debug (non-optimized, -g plus assert logic), or ohair@632: fastdebug (optimized, -g plus assert logic). ohair@632:
ohair@632:- ohair@632: The .hgignore file in each repository ohair@632: must exist and should ohair@632: include ^build/, ^dist/ and ohair@632: optionally any ohair@632: nbproject/private directories. ohair@632: It should NEVER include ohair@632: anything in the ohair@632: src/ or test/ ohair@632: or any managed directory area of a repository. ohair@632:
ohair@632:- ohair@632: Directory names and file names should never contain ohair@632: blanks or ohair@632: non-printing characters. ohair@632:
ohair@632:- ohair@632: Generated source or binary files should NEVER be added to ohair@632: the repository (that includes javah output). ohair@632: There are some exceptions to this rule, in particular ohair@632: with some of the generated configure scripts. ohair@632:
ohair@632:- ohair@632: Files not needed for typical building ohair@632: or testing of the repository ohair@632: should not be added to the repository. ohair@632:
ohair@632:
ohair@632: The very first step in building the OpenJDK is making sure the ohair@632: system itself has everything it needs to do OpenJDK builds. ohair@632: Once a system is setup, it generally doesn't need to be done again. ohair@632:ohair@632: ohair@632: ohair@632:
ohair@632: Building the OpenJDK is now done with running a ohair@632:configure
ohair@632: script which will try and find and verify you have everything ohair@632: you need, followed by running ohair@632:make
, e.g. ohair@276:ohair@632: ohair@632:ohair@632: Where possible theohair@632: bash ./configure
ohair@632: ohair@632:
ohair@632: make all ohair@632:configure
script will attempt to located the ohair@632: various components in the default locations or via component ohair@632: specific variable settings. ohair@632: When the normal defaults fail or components cannot be found, ohair@632: additionalconfigure
options may be necessary to helpconfigure
ohair@632: find the necessary tools for the build, or you may need to ohair@632: re-visit the setup of your system due to missing software ohair@632: packages. ohair@632:
ohair@632: NOTE: Theconfigure
script ohair@632: file does not have ohair@632: execute permissions and will need to be explicitly run with ohair@632:bash
, ohair@632: see the source guidelines. robilad@132: ohair@632: ohair@632:
ohair@632:System Setup
ohair@632:ohair@632: Before even attempting to use a system to build the OpenJDK ohair@632: there are some very basic system setups needed. ohair@632: For all systems: ohair@632:ohair@632: ohair@632: ohair@632:ohair@632:
ohair@632: And for specific systems: ohair@632:- ohair@632: Be sure the GNU make utility is version 3.81 or newer, ohair@632: e.g. run "
ohair@632:make -version
" ohair@632:- ohair@632: Install a smarks@744: Bootstrap JDK. ohair@632: All OpenJDK builds require access to a previously released smarks@744: JDK called the bootstrap JDK or boot JDK. smarks@744: The general rule is that the bootstrap JDK smarks@744: must be an instance of the previous major smarks@744: release of the JDK. In addition, there may be smarks@744: a requirement to use a release at or beyond a smarks@744: particular update level. smarks@744:
ohair@632:
smarks@744: smarks@744: Building JDK 8 requires use of a version smarks@744: of JDK 7 that is at Update 7 or newer. JDK 8 smarks@744: developers should not use JDK 8 as the boot smarks@744: JDK, to ensure that JDK 8 dependencies are smarks@744: not introduced into the parts of the system smarks@744: that are built with JDK 7. smarks@744: smarks@744:
ohair@632: The JDK 7 binaries can be downloaded from Oracle's ohair@632: JDK 7 download site. ohair@632: For build performance reasons ohair@632: is very important that this bootstrap JDK be made available ohair@632: on the local disk of the machine doing the build. ohair@632: You should add itsbin
directory ohair@632: to thePATH
environment variable. ohair@632: Ifconfigure
has any issues finding this JDK, you may ohair@632: need to use theconfigure
option ohair@632:--with-boot-jdk
. ohair@632:- erikj@774: Ensure that GNU make, the Bootstrap JDK, ohair@632: and the compilers are all ohair@632: in your PATH environment variable ohair@632:
ohair@632:ohair@632: ohair@632:
ohair@632: ohair@632:ohair@632: ohair@632: ohair@632: ohair@632:Linux ohair@632:Solaris ohair@632:Windows ohair@632:Mac OS X ohair@632:ohair@632: ohair@632: ohair@632:ohair@632: Install all the software development ohair@632: packages needed including ohair@632: alsa, ohair@632: freetype, ohair@632: cups, and ohair@632: xrender. ohair@632: ohair@632:
ohair@632: See ohair@632: specific system packages. ohair@632:ohair@632: Install all the software development ohair@632: packages needed including ohair@632: Studio Compilers, ohair@632: freetype, ohair@632: cups, and ohair@632: xrender. ohair@632: ohair@632:
ohair@632: See ohair@632: specific system packages. ohair@632:ohair@632: ohair@632:ohair@632:
ohair@632:- ohair@632: Install one of ohair@632: CYGWIN or ohair@632: MinGW/MSYS ohair@632:
ohair@632:- ohair@632: Install ohair@632: Visual Studio 2010 ohair@632:
ohair@632:ohair@632: Install ohair@632: XCode 4.5.2 ohair@632: and also install the "Command line tools" found under the ohair@632: preferences pane "Downloads" ohair@632: ohair@632:Linux
ohair@632:ohair@632: With Linux, try and favor the system packages over ohair@632: building your own ohair@632: or getting packages from other areas. ohair@632: Most Linux builds should be possible with the system's ohair@632: available packages. ohair@632:ohair@632: ohair@632:
ohair@632: Note that some Linux systems have a habit of pre-populating ohair@632: your environment variables for you, for exampleJAVA_HOME
ohair@632: might get pre-defined for you to refer to the JDK installed on ohair@632: your Linux system. ohair@632: You will need to unsetJAVA_HOME
. ohair@632: It's a good idea to runenv
and verify the ohair@632: environment variables you are getting from the default system ohair@632: settings make sense for building the OpenJDK. ohair@632: ohair@632:Solaris
ohair@632:ohair@632:ohair@632: ohair@632:Studio Compilers
ohair@632:ohair@632: At a minimum, the ohair@632: ohair@632: Studio 12 Update 1 Compilers ohair@632: (containing version 5.10 of the C and C++ compilers) is required, ohair@632: including specific patches. ohair@632:ohair@632: ohair@632:ohair@632: The Solaris SPARC patch list is: ohair@632:
ohair@632:
ohair@632:- ohair@632: 118683-05: SunOS 5.10: Patch for profiling libraries and assembler ohair@632:
ohair@632:- ohair@632: 119963-21: SunOS 5.10: Shared library patch for C++ ohair@632:
ohair@632:- ohair@632: 120753-08: SunOS 5.10: Microtasking libraries (libmtsk) patch ohair@632:
ohair@632:- ohair@632: 128228-09: Sun Studio 12 Update 1: Patch for Sun C++ Compiler ohair@632:
ohair@632:- ohair@632: 141860-03: Sun Studio 12 Update 1: Patch for Compiler Common patch for Sun C C++ F77 F95 ohair@632:
ohair@632:- ohair@632: 141861-05: Sun Studio 12 Update 1: Patch for Sun C Compiler ohair@632:
ohair@632:- ohair@632: 142371-01: Sun Studio 12.1 Update 1: Patch for dbx ohair@632:
ohair@632:- ohair@632: 143384-02: Sun Studio 12 Update 1: Patch for debuginfo handling ohair@632:
ohair@632:- ohair@632: 143385-02: Sun Studio 12 Update 1: Patch for Compiler Common patch for Sun C C++ F77 F95 ohair@632:
ohair@632:- ohair@632: 142369-01: Sun Studio 12.1: Patch for Performance Analyzer Tools ohair@632:
ohair@632:ohair@632: The Solaris X86 patch list is: ohair@632:
ohair@632:
ohair@632:- ohair@632: 119961-07: SunOS 5.10_x86, x64, Patch for profiling libraries and assembler ohair@632:
ohair@632:- ohair@632: 119964-21: SunOS 5.10_x86: Shared library patch for C++_x86 ohair@632:
ohair@632:- ohair@632: 120754-08: SunOS 5.10_x86: Microtasking libraries (libmtsk) patch ohair@632:
ohair@632:- ohair@632: 141858-06: Sun Studio 12 Update 1_x86: Sun Compiler Common patch for x86 backend ohair@632:
ohair@632:- ohair@632: 128229-09: Sun Studio 12 Update 1_x86: Patch for C++ Compiler ohair@632:
ohair@632:- ohair@632: 142363-05: Sun Studio 12 Update 1_x86: Patch for C Compiler ohair@632:
ohair@632:- ohair@632: 142368-01: Sun Studio 12.1_x86: Patch for Performance Analyzer Tools ohair@632:
ohair@632:ohair@632: Place the
bin
directory inPATH
. ohair@632:ohair@632: The Oracle Solaris Studio Express compilers at: ohair@632: ohair@632: Oracle Solaris Studio Express Download site ohair@632: are also an option, although these compilers have not ohair@632: been extensively used yet. ohair@632:
Windows
ohair@632:ohair@632: ohair@632:ohair@632: ohair@632:Windows Unix Toolkit
ohair@632:ohair@632: Building on Windows requires a Unix-like environment, notably a ohair@632: Unix-like shell. ohair@632: There are several such environments available of which ohair@632: Cygwin and ohair@632: MinGW/MSYS are ohair@632: currently supported for ohair@632: the OpenJDK build. One of the differences of these ohair@632: systems from standard Windows tools is the way ohair@632: they handle Windows path names, particularly path names which contain ohair@632: spaces, backslashes as path separators and possibly drive letters. ohair@632: Depending ohair@632: on the use case and the specifics of each environment these path ohair@632: problems can ohair@632: be solved by a combination of quoting whole paths, translating ohair@632: backslashes to ohair@632: forward slashes, escaping backslashes with additional backslashes and ohair@632: translating the path names to their ohair@632: ohair@632: "8.3" version. ohair@632: ohair@632:ohair@632: ohair@632:CYGWIN
ohair@632:ohair@632: CYGWIN is an open source, Linux-like environment which tries to emulate ohair@632: a complete POSIX layer on Windows. It tries to be smart about path names ohair@632: and can usually handle all kinds of paths if they are correctly quoted ohair@632: or escaped although internally it maps drive lettersohair@632: ohair@632:<drive>:
ohair@632: to a virtual directory/cygdrive/<drive>
. ohair@632:ohair@632: You can always use the
ohair@632:cygpath
utility to map pathnames with spaces ohair@632: or the backslash character into theC:/
style of pathname ohair@632: (called 'mixed'), e.g.cygpath -s -m "path"
. ohair@632:ohair@632: Note that the use of CYGWIN creates a unique problem with regards to ohair@632: setting
ohair@632:PATH
. Normally on Windows ohair@632: thePATH
variable contains directories ohair@632: separated with the ";" character (Solaris and Linux use ":"). ohair@632: With CYGWIN, it uses ":", but that means that paths like "C:/path" ohair@632: cannot be placed in the CYGWIN version ofPATH
and ohair@632: instead CYGWIN uses something like/cygdrive/c/path
ohair@632: which CYGWIN understands, but only CYGWIN understands. ohair@632:ohair@632: The OpenJDK build requires CYGWIN version 1.7.16 or newer. ohair@632: Information about CYGWIN can ohair@632: be obtained from the CYGWIN website at ohair@632: www.cygwin.com. ohair@632:
ohair@632:ohair@632: By default CYGWIN doesn't install all the tools required for building ohair@632: the OpenJDK. ohair@632: Along with the default installation, you need to install ohair@632: the following tools. ohair@632:
ohair@632:ohair@632: Note that the CYGWIN software can conflict with other non-CYGWIN ohair@632: software on your Windows system. ohair@632: CYGWIN provides a ohair@632: FAQ for ohair@632: known issues and problems, of particular interest is the ohair@632: section on ohair@632: ohair@632: BLODA (applications that interfere with CYGWIN). ohair@632:ohair@632: ohair@632:
ohair@632:ohair@632: ohair@632: ohair@632: ohair@632:Binary Name ohair@632:Category ohair@632:Package ohair@632:Description ohair@632:ohair@632: ohair@632:ar.exe ohair@632:Devel ohair@632:binutils ohair@632:ohair@632: The GNU assembler, linker and binary utilities ohair@632: ohair@632:ohair@632: ohair@632:make.exe ohair@632:Devel ohair@632:make ohair@632:ohair@632: The GNU version of the 'make' utility built for CYGWIN ohair@632: ohair@632:ohair@632: ohair@632:m4.exe ohair@632:Interpreters ohair@632:m4 ohair@632:ohair@632: GNU implementation of the traditional Unix macro ohair@632: processor ohair@632: ohair@632:ohair@632: ohair@632:cpio.exe ohair@632:Utils ohair@632:cpio ohair@632:ohair@632: A program to manage archives of files ohair@632: ohair@632:ohair@632: ohair@632:gawk.exe ohair@632:Utils ohair@632:awk ohair@632:ohair@632: Pattern-directed scanning and processing language ohair@632: ohair@632:ohair@632: ohair@632:file.exe ohair@632:Utils ohair@632:file ohair@632:ohair@632: Determines file type using 'magic' numbers ohair@632: ohair@632:ohair@632: ohair@632:zip.exe ohair@632:Archive ohair@632:zip ohair@632:ohair@632: Package and compress (archive) files ohair@632: ohair@632:ohair@632: ohair@632:unzip.exe ohair@632:Archive ohair@632:unzip ohair@632:ohair@632: Extract compressed files in a ZIP archive ohair@632: ohair@632:ohair@632: ohair@632: ohair@632:free.exe ohair@632:System ohair@632:procps ohair@632:ohair@632: Display amount of free and used memory in the system ohair@632: ohair@632:MinGW/MSYS
ohair@632:ohair@632: MinGW ("Minimalist GNU for Windows") is a collection of free Windows ohair@632: specific header files and import libraries combined with GNU toolsets that ohair@632: allow one to produce native Windows programs that do not rely on any ohair@632: 3rd-party C runtime DLLs. MSYS is a supplement to MinGW which allows building ohair@632: applications and programs which rely on traditional UNIX tools to ohair@632: be present. Among others this includes tools likeohair@632: ohair@632:bash
ohair@632: andmake
. ohair@632: See MinGW/MSYS ohair@632: for more information. ohair@632:ohair@632: Like Cygwin, MinGW/MSYS can handle different types of path formats. They ohair@632: are internally converted to paths with forward slashes and drive letters ohair@632:
ohair@632:<drive>:
replaced by a virtual ohair@632: directory/<drive>
. Additionally, MSYS automatically ohair@632: detects binaries compiled for the MSYS environment and feeds them with the ohair@632: internal, Unix-style path names. If native Windows applications are called ohair@632: from within MSYS programs their path arguments are automatically converted ohair@632: back to Windows style path names with drive letters and backslashes as ohair@632: path separators. This may cause problems for Windows applications which ohair@632: use forward slashes as parameter separator (e.g.cl /nologo /I
) ohair@632: because MSYS may wrongly ohair@632: replace such parameters by drive letters. ohair@632:ohair@632: In addition to the tools which will be installed ohair@632: by default, you have ohair@632: to manually install the ohair@632:
msys-zip
and ohair@632:msys-unzip
packages. ohair@632: This can be easily done with the MinGW command line installer: ohair@632:ohair@632:ohair@632:mingw-get.exe install msys-zip
ohair@632:
ohair@632:mingw-get.exe install msys-unzip
ohair@632:Visual Studio 2010 Compilers
ohair@632:ohair@632:ohair@632: ohair@632: ohair@632:ohair@632: The 32-bit and 64-bit OpenJDK Windows build requires ohair@632: Microsoft Visual Studio C++ 2010 (VS2010) Professional ohair@632: Edition or Express compiler. ohair@632: The compiler and other tools are expected to reside ohair@632: in the location defined by the variable ohair@632:
ohair@632:VS100COMNTOOLS
which ohair@632: is set by the Microsoft Visual Studio installer. ohair@632:ohair@632: Only the C++ part of VS2010 is needed. ohair@632: Try to let the installation go to the default ohair@632: install directory. ohair@632: Always reboot your system after installing VS2010. ohair@632: The system environment variable VS100COMNTOOLS ohair@632: should be ohair@632: set in your environment. ohair@632:
ohair@632:ohair@632: Make sure that TMP and TEMP are also set ohair@632: in the environment ohair@632: and refer to Windows paths that exist, ohair@632: like
ohair@632:C:\temp
, ohair@632: not/tmp
, not/cygdrive/c/temp
, ohair@632: and notC:/temp
. ohair@632:C:\temp
is just an example, ohair@632: it is assumed that this area is ohair@632: private to the user, so by default ohair@632: after installs you should ohair@632: see a unique user path in these variables. ohair@632:Mac OS X
ohair@632:ohair@632: Make sure you get the right XCode version. ohair@632:ohair@632: ohair@41:
ohair@632:Configure
ohair@276:ohair@632: The basic invocation of theohair@632: ohair@632: ohair@632:configure
script ohair@632: looks like: ohair@632:ohair@632:ohair@632: This will create an output directory containing the ohair@632: "configuration" and setup an area for the build result. ohair@632: This directory typically looks like: ohair@632:bash ./configure [options]
ohair@632:ohair@632:ohair@632:build/linux-x64-normal-server-release
ohair@632:configure
will try to figure out what system you are running on ohair@632: and where all necessary build components are. ohair@632: If you have all prerequisites for building installed, ohair@632: it should find everything. ohair@632: If it fails to detect any component automatically, ohair@632: it will exit and inform you about the problem. ohair@632: When this happens, read more below in ohair@632: theconfigure
options. ohair@632:ohair@632: Some examples: ohair@632:
ohair@632:ohair@632: ohair@632:
robilad@132: ohair@632: ohair@632:ohair@632: ohair@632: ohair@632: ohair@632:Description ohair@632:Configure Command Line ohair@632:ohair@632: ohair@632:Windows 32bit build with freetype specified ohair@632:ohair@632: ohair@632:bash ./configure --with-freetype=/cygdrive/c/freetype-i586 --with-target-bits=32
ohair@632:ohair@632: ohair@632: ohair@632:Debug 64bit Build ohair@632:ohair@632: ohair@632:bash ./configure --enable-debug --with-target-bits=64
ohair@632:Configure Options
ohair@632:ohair@632: Complete details on all the OpenJDKohair@632: robilad@132:configure
options can ohair@632: be seen with: ohair@632:ohair@632:ohair@632: Usebash ./configure --help=short
ohair@632:-help
to see all theconfigure
options ohair@632: available. ohair@632: ohair@632: You can generate any number of different configurations, ohair@632: e.g. debug, release, 32, 64, etc. ohair@632: ohair@632: Some of the more commonly usedconfigure
options are: ohair@632: ohair@632:ohair@632: ohair@632:
ohair@632:ohair@632: ohair@632: ohair@632: ohair@632:OpenJDK Configure Option ohair@632:Description ohair@632:ohair@632: ohair@632:ohair@632: --enable-debug
ohair@632: set the debug level to fastdebug (this is a shorthand for ohair@632: ohair@632:--with-debug-level=fastdebug
) ohair@632:ohair@632: ohair@632:ohair@632: --with-alsa=
pathohair@632: select the location of the ohair@632: Advanced Linux Sound Architecture (ALSA) ohair@632: ohair@632:
ohair@632: Version 0.9.1 or newer of the ALSA files are ohair@632: required for building the OpenJDK on Linux. ohair@632: These Linux files are usually available from an "alsa" ohair@632: of "libasound" ohair@632: development package, ohair@632: and it's highly recommended that you try and use ohair@632: the package provided by the particular version of Linux that ohair@632: you are using. ohair@632:ohair@632: ohair@632:ohair@632: --with-boot-jdk=
pathohair@632: select the Bootstrap JDK ohair@632: ohair@632:ohair@632: ohair@632:ohair@632: --with-boot-jdk-jvmargs=
"args"ohair@632: provide the JVM options to be used to run the ohair@632: Bootstrap JDK ohair@632: ohair@632:ohair@632: ohair@632:ohair@632: --with-cacerts=
pathohair@632: select the path to the cacerts file. ohair@632: ohair@632:
ohair@632: See ohair@632: http://en.wikipedia.org/wiki/Certificate_Authority ohair@632: for a better understanding of the Certificate Authority (CA). ohair@632: A certificates file named "cacerts" ohair@632: represents a system-wide keystore with CA certificates. ohair@632: In JDK and JRE ohair@632: binary bundles, the "cacerts" file contains root CA certificates from ohair@632: several public CAs (e.g., VeriSign, Thawte, and Baltimore). ohair@632: The source contain a cacerts file ohair@632: without CA root certificates. ohair@632: Formal JDK builders will need to secure ohair@632: permission from each public CA and include the certificates into their ohair@632: own custom cacerts file. ohair@632: Failure to provide a populated cacerts file ohair@632: will result in verification errors of a certificate chain during runtime. ohair@632: By default an empty cacerts file is provided and that should be ohair@632: fine for most JDK developers. ohair@632:ohair@632: ohair@632:ohair@632: --with-cups=
pathohair@632: select the CUPS install location ohair@632: ohair@632:
ohair@632: The ohair@632: Common UNIX Printing System (CUPS) Headers ohair@632: are required for building the ohair@632: OpenJDK on Solaris and Linux. ohair@632: The Solaris header files can be obtained by installing ohair@632: the package SFWcups from the Solaris Software ohair@632: Companion CD/DVD, these often will be installed into the ohair@632: directory/opt/sfw/cups
. ohair@632:
ohair@632: The CUPS header files can always be downloaded from ohair@632: www.cups.org. ohair@632:ohair@632: ohair@632:ohair@632: --with-cups-include=
pathohair@632: select the CUPS include directory location ohair@632: ohair@632:ohair@632: ohair@632:ohair@632: --with-debug-level=
levelohair@632: select the debug information level of release, ohair@632: fastdebug, or slowdebug ohair@632: ohair@632:ohair@632: ohair@632:ohair@632: --with-dev-kit=
pathohair@632: select location of the compiler install or ohair@632: developer install location ohair@632: ohair@632:ohair@632: ohair@632:ohair@632: --with-freetype=
pathohair@632: select the freetype files to use. ohair@632: ohair@632:
ohair@632: Expecting the ohair@632: freetype libraries under ohair@632:lib/
and the ohair@632: headers underinclude/
. ohair@632:
ohair@632: Version 2.3 or newer of FreeType is required. ohair@632: On Unix systems required files can be available as part of your ohair@632: distribution (while you still may need to upgrade them). ohair@632: Note that you need development version of package that ohair@632: includes both the FreeType library and header files. ohair@632:
ohair@632: You can always download latest FreeType version from the ohair@632: FreeType website. ohair@632:
ohair@632: Building the freetype 2 libraries from scratch is also possible, ohair@632: however on Windows refer to the ohair@632: ohair@632: Windows FreeType DLL build instructions. ohair@632:
ohair@632: Note that by default FreeType is built with byte code hinting ohair@632: support disabled due to licensing restrictions. ohair@632: In this case, text appearance and metrics are expected to ohair@632: differ from Sun's official JDK build. ohair@632: See ohair@632: ohair@632: the SourceForge FreeType2 Home Page ohair@632: ohair@632: for more information. ohair@632:ohair@632: ohair@632:ohair@632: --with-import-hotspot=
pathohair@632: select the location to find hotspot ohair@632: binaries from a previous build to avoid building ohair@632: hotspot ohair@632: ohair@632:ohair@632: ohair@632:ohair@632: --with-target-bits=
argohair@632: select 32 or 64 bit build ohair@632: ohair@632:ohair@632: ohair@632:ohair@632: --with-jvm-variants=
variantsohair@632: select the JVM variants to build from, comma ohair@632: separated list that can include: ohair@632: server, client, kernel, zero and zeroshark ohair@632: ohair@632:ohair@632: ohair@632:ohair@632: --with-memory-size=
sizeohair@632: select the RAM size that GNU make will think ohair@632: this system has ohair@632: ohair@632:ohair@632: ohair@632:ohair@632: --with-msvcr-dll=
pathohair@632: select the ohair@632:msvcr100.dll
ohair@632: file to include in the ohair@632: Windows builds (C/C++ runtime library for ohair@632: Visual Studio). ohair@632:
ohair@632: This is usually picked up automatically ohair@632: from the redist ohair@632: directories of Visual Studio 2010. ohair@632:ohair@632: ohair@632:ohair@632: --with-num-cores=
coresohair@632: select the number of cores to use (processor ohair@632: count or CPU count) ohair@632: ohair@632:ohair@632: ohair@632: ohair@632:ohair@632: --with-x=
pathohair@632: select the location of the X11 and xrender files. ohair@632: ohair@632:
ohair@632: The ohair@632: XRender Extension Headers ohair@632: are required for building the ohair@632: OpenJDK on Solaris and Linux. ohair@632:
ohair@632: The Linux header files are usually available from a "Xrender" ohair@632: development package, it's recommended that you try and use ohair@632: the package provided by the particular distribution of Linux that ohair@632: you are using. ohair@632:
ohair@632: The Solaris XRender header files is ohair@632: included with the other X11 header files ohair@632: in the package SFWxwinc ohair@632: on new enough versions of ohair@632: Solaris and will be installed in ohair@632:/usr/X11/include/X11/extensions/Xrender.h
or ohair@632:/usr/openwin/share/include/X11/extensions/Xrender.h
ohair@632:
ohair@632:Make
ohair@276:ohair@632: The basic invocation of theohair@13:make
utility ohair@632: looks like: ohair@632:ohair@632:ohair@632: This will start the build to the output directory containing the ohair@632: "configuration" that was created by themake all
ohair@632:configure
ohair@632: script. Runmake help
for more information on ohair@632: the available targets. ohair@632:
ohair@632: There are some of the make targets that ohair@632: are of general interest: ohair@632:ohair@632: ohair@632:
ohair@276:ohair@632: ohair@632: ohair@632: ohair@632:Make Target ohair@632:Description ohair@632:ohair@632: ohair@632:empty ohair@632:build everything but no images ohair@632:ohair@632: ohair@632:ohair@632: all
build everything including images ohair@632:ohair@632: ohair@632:ohair@632: all-conf
build all configurations ohair@632:ohair@632: ohair@632:ohair@632: images
create complete j2sdk and j2re images ohair@632:ohair@632: ohair@632:ohair@632: install
install the generated images locally, ohair@632: typically in ohair@632:/usr/local
ohair@632: ohair@632:ohair@632: clean
remove all files generated by make, ohair@632: but not those generated by ohair@632:configure
ohair@632: ohair@632:ohair@632: dist-clean
remove all files generated by both ohair@632: and ohair@632:configure
(basically killing the configuration)ohair@632: ohair@632: ohair@632:ohair@632: help
give some help on using ohair@632:make
, ohair@632: including some interesting make targets
ohair@632: When the build is completed, you should see the generated ohair@632: binaries and associated files in theohair@632: robilad@132: ohair@632: ohair@632: ohair@632: ohair@632: ohair@632: ohair@632: ohair@632: ohair@632: ohair@632: ohair@632: ohair@632:j2sdk-image
ohair@632: directory in the output directory. ohair@632: In particular, the ohair@632:build/*/images/j2sdk-image/bin
ohair@632: directory should contain executables for the ohair@632: OpenJDK tools and utilities for that configuration. ohair@632: The testing tooljtreg
will be needed ohair@632: and can be found at: ohair@632: ohair@632: the jtreg site. ohair@632: The provided regression tests in the repositories ohair@632: can be run with the command: ohair@41:ohair@632:robilad@132:cd test && make PRODUCT_HOME=`pwd`/../build/*/images/j2sdk-image all
ohair@276:
ohair@632: ohair@632:ohair@632: ohair@632: ohair@13:FAQ
ohair@276:ohair@320: ohair@320:ohair@632: ohair@632:erikj@783: Q: The
ohair@320: ohair@632:generated-configure.sh
file looks horrible! ohair@632: How are you going to edit it? ohair@320:
erikj@783: A: Thegenerated-configure.sh
file is generated (think ohair@632: "compiled") by the autoconf tools. The source code is erikj@783: inconfigure.ac
and various .m4 files in common/autoconf, erikj@783: which are much more readable. ohair@320:ohair@632: Q: erikj@783: Why is the
ohair@632: ohair@632:generated-configure.sh
file checked in, ohair@632: if it is generated? ohair@632:
ohair@632: A: ohair@632: If it was not generated, every user would need to have the autoconf ohair@632: tools installed, and re-generate theconfigure
file ohair@632: as the first step. ohair@632: Our goal is to minimize the work needed to be done by the user ohair@632: to start building OpenJDK, and to minimize ohair@632: the number of external dependencies required. ohair@632:ohair@632: Q: ohair@632: Do you require a specific version of autoconf for regenerating erikj@783:
erikj@783: erikj@783:generated-configure.sh
? ohair@632:
ohair@632: A: erikj@783: Yes, version 2.69 is required and should be easy erikj@783: enough to aquire on all supported operating erikj@783: systems. The reason for this is to avoid erikj@783: large spurious changes ingenerated-configure.sh
. erikj@783:erikj@783: Q: erikj@783: How do you regenerate
ohair@632: ohair@632:generated-configure.sh
erikj@783: after making changes to the input files? erikj@783:
erikj@783: A: erikj@783: Regneratinggenerated-configure.sh
erikj@783: should always be done using the erikj@783: scriptcommon/autoconf/autogen.sh
to erikj@783: ensure that the correct files get updated. This erikj@783: script should also be run after mercurial tries to erikj@783: mergegenerated-configure.sh
as a erikj@783: merge of the generated file is not guaranteed to erikj@783: be correct. ohair@632:ohair@632: Q: ohair@632: What are the files in
ohair@632: ohair@632:common/makefiles/support/*
for? ohair@632: They look like gibberish. ohair@632:
ohair@632: A: ohair@632: They are a somewhat ugly hack to compensate for command line length ohair@632: limitations on certain platforms (Windows, Solaris). ohair@632: Due to a combination of limitations in make and the shell, ohair@632: command lines containing too many files will not work properly. ohair@632: These ohair@632: helper files are part of an elaborate hack that will compress the ohair@632: command line in the makefile and then uncompress it safely. ohair@632: We're ohair@632: not proud of it, but it does fix the problem. ohair@632: If you have any better suggestions, we're all ears! :-) ohair@632:ohair@632: Q: ohair@632: I want to see the output of the commands that make runs, ohair@632: like in the old build. How do I do that? ohair@632:
ohair@320:
ohair@632: A: ohair@632: You specify theLOG
variable to make. There are ohair@632: several log levels: ohair@632:ohair@632:ohair@320: ohair@632:ohair@320:
ohair@320:- ohair@632:
ohair@320:warn
— Default and very quiet. ohair@320:- ohair@632:
ohair@320:info
— Shows more progress information ohair@632: than warn. ohair@320:- ohair@632:
ohair@320:debug
— Echos all command lines and ohair@632: prints all macro calls for compilation definitions. ohair@320:- ohair@632:
ohair@632:trace
— Echos all $(shell) command ohair@632: lines as well. ohair@320:ohair@632: Q: ohair@632: When do I have to re-run
ohair@632: ohair@632:configure
? ohair@632:
ohair@632: A: ohair@632: Normally you will runconfigure
only once for creating a ohair@632: configuration. ohair@632: You need to re-run configuration only if you want to change any ohair@632: configuration options, ohair@632: or if you pull down changes to theconfigure
script. ohair@632:ohair@632: Q: ohair@632: I have added a new source file. Do I need to modify the makefiles? ohair@632:
ohair@632: ohair@632:
ohair@632: A: ohair@632: Normally, no. If you want to create e.g. a new native ohair@632: library, ohair@632: you will need to modify the makefiles. But for normal file ohair@632: additions or removals, no changes are needed. There are certan ohair@632: exceptions for some native libraries where the source files are spread erikj@774: over many directories which also contain sources for other ohair@632: libraries. In these cases it was simply easier to create include lists erikj@774: rather than excludes. ohair@632:ohair@632: Q: ohair@632: When I run
ohair@632: ohair@632:configure --help
, I see many strange options, ohair@632: like--dvidir
. What is this? ohair@632:
ohair@632: A: ohair@632: Configure provides a slew of options by default, to all projects ohair@632: that use autoconf. Most of them are not used in OpenJDK, ohair@632: so you can safely ignore them. To list only OpenJDK specific features, ohair@632: useconfigure --help=short
instead. ohair@632:ohair@632: Q: ohair@632:
ohair@632: ohair@632:configure
provides OpenJDK-specific features such as erikj@774:--with-builddeps-server
that are not erikj@774: described in this document. What about those? ohair@632:
ohair@632: A: ohair@632: Try them out if you like! But be aware that most of these are ohair@632: experimental features. ohair@632: Many of them don't do anything at all at the moment; the option erikj@774: is just a placeholder. Others depend on ohair@632: pieces of code or infrastructure that is currently ohair@632: not ready for prime time. ohair@632:ohair@632: Q: ohair@632: How will you make sure you don't break anything? ohair@632:
ohair@632: ohair@632:
ohair@632: A: ohair@632: We have a script that compares the result of the new build system ohair@632: with the result of the old. For most part, we aim for (and achieve) ohair@632: byte-by-byte identical output. There are however technical issues ohair@632: with e.g. native binaries, which might differ in a byte-by-byte ohair@632: comparison, even ohair@632: when building twice with the old build system. ohair@632: For these, we compare relevant aspects ohair@632: (e.g. the symbol table and file size). ohair@632: Note that we still don't have 100% ohair@632: equivalence, but we're close. ohair@632:ohair@632: Q: ohair@632: I noticed this thing X in the build that looks very broken by design. ohair@632: Why don't you fix it? ohair@632:
ohair@632: ohair@632:
ohair@632: A: ohair@632: Our goal is to produce a build output that is as close as ohair@632: technically possible to the old build output. ohair@632: If things were weird in the old build, ohair@632: they will be weird in the new build. ohair@632: Often, things were weird before due to obscurity, ohair@632: but in the new build system the weird stuff comes up to the surface. ohair@632: The plan is to attack these things at a later stage, ohair@632: after the new build system is established. ohair@632:ohair@632: Q: ohair@632: The code in the new build system is not that well-structured. ohair@632: Will you fix this? ohair@632:
ohair@632: ohair@632:
ohair@632: A: ohair@632: Yes! The new build system has grown bit by bit as we converted ohair@632: the old system. When all of the old build system is converted, ohair@632: we can take a step back and clean up the structure of the new build ohair@632: system. Some of this we plan to do before replacing the old build ohair@632: system and some will need to wait until after. ohair@632:ohair@632: Q: ohair@632: Is anything able to use the results of the new build's default make target? ohair@632:
ohair@632: ohair@632:
ohair@632: A: ohair@632: Yes, this is the minimal (or roughly minimal) ohair@632: set of compiled output needed for a developer to actually ohair@632: execute the newly built JDK. The idea is that in an incremental ohair@632: development fashion, when doing a normal make, ohair@632: you should only spend time recompiling what's changed ohair@632: (making it purely incremental) and only do the work that's ohair@632: needed to actually run and test your code. ohair@632: The packaging stuff that is part of theimages
ohair@632: target is not needed for a normal developer who wants to ohair@632: test his new code. Even if it's quite fast, it's still unnecessary. ohair@632: We're targeting sub-second incremental rebuilds! ;-) ohair@632: (Or, well, at least single-digit seconds...) ohair@632:ohair@632: Q: ohair@632: I usually set a specific environment variable when building, ohair@632: but I can't find the equivalent in the new build. ohair@632: What should I do? ohair@632:
ohair@632: ohair@632:
ohair@632: A: erikj@774: It might very well be that we have neglected to add support for ohair@632: an option that was actually used from outside the build system. erikj@774: Email us and we will add support for it! ohair@632:Build Performance Tips
ohair@632:ohair@632: ohair@632:ohair@632: ohair@632:Building OpenJDK requires a lot of horsepower. ohair@632: Some of the build tools can be adjusted to utilize more or less ohair@632: of resources such as ohair@632: parallel threads and memory. ohair@632: The
ohair@632: ohair@632:configure
script analyzes your system and selects reasonable ohair@632: values for such options based on your hardware. ohair@632: If you encounter resource problems, such as out of memory conditions, ohair@632: you can modify the detected values with:ohair@632:
ohair@632: ohair@632:- ohair@632:
ohair@632:--with-num-cores
ohair@632: — ohair@632: number of cores in the build system, ohair@632: e.g.--with-num-cores=8
ohair@632:- ohair@632:
ohair@632:--with-memory-size
ohair@632: — memory (in MB) available in the build system, ohair@632: e.g.--with-memory-size=1024
ohair@632:It might also be necessary to specify the JVM arguments passed ohair@632: to the Bootstrap JDK, using e.g. ohair@632:
ohair@632: ohair@632: ohair@632:--with-boot-jdk-jvmargs="-Xmx8G -enableassertions"
. ohair@632: Doing this will override the default JVM arguments ohair@632: passed to the Bootstrap JDK.One of the top goals of the new build system is to improve the ohair@632: build performance and decrease the time needed to build. This will ohair@632: soon also apply to the java compilation when the Smart Javac wrapper ohair@632: is making its way into jdk8. It can be tried in the build-infra ohair@632: repository already. You are likely to find that the new build system ohair@632: is faster than the old one even without this feature.
ohair@632: ohair@632:At the end of a successful execution of
ohair@632: ohair@632:configure
, ohair@632: you will get a performance summary, ohair@632: indicating how well the build will perform. Here you will ohair@632: also get performance hints. ohair@632: If you want to build fast, pay attention to those!Building with ccache
ohair@632: ohair@632:A simple way to radically speed up compilation of native code ohair@632: (typically hotspot and native libraries in JDK) is to install ohair@632: ccache. This will cache and reuse prior compilation results, if the ohair@632: source code is unchanged. However, ccache versions prior to 3.1.4 ohair@632: does not work correctly with the precompiled headers used in ohair@632: OpenJDK. So if your platform supports ccache at 3.1.4 or later, we ohair@632: highly recommend installing it. This is currently only supported on ohair@632: linux.
ohair@632: ohair@632:Building on local disk
ohair@632: ohair@632:If you are using network shares, e.g. via NFS, for your source code, ohair@632: make sure the build directory is situated on local disk. ohair@632: The performance ohair@632: penalty is extremely high for building on a network share, ohair@632: close to unusable.
ohair@632: ohair@632:Building only one JVM
ohair@632: ohair@632:The old build builds multiple JVMs on 32-bit systems (client and ohair@632: server; and on Windows kernel as well). In the new build we have ohair@632: changed this default to only build server when it's available. This ohair@632: improves build times for those not interested in multiple JVMs. To ohair@632: mimic the old behavior on platforms that support it, ohair@632: use
ohair@632: ohair@632:--with-jvm-variants=client,server
.Selecting the number of cores to build on
ohair@632: ohair@632:By default,
ohair@632: ohair@632:configure
will analyze your machine and run the make ohair@632: process in parallel with as many threads as you have cores. This ohair@632: behavior can be overridden, either "permanently" (on aconfigure
ohair@632: basis) using--with-num-cores=N
or for a single build ohair@632: only (on a make basis), usingmake JOBS=N
.If you want to make a slower build just this time, to save some CPU ohair@632: power for other processes, you can run ohair@632: e.g.
ohair@632: ohair@632:make JOBS=2
. This will force the makefiles ohair@632: to only run 2 parallel processes, or evenmake JOBS=1
ohair@632: which will disable parallelism.If you want to have it the other way round, namely having slow ohair@632: builds default and override with fast if you're ohair@632: impatient, you should call
ohair@632: ohair@632:configure
with ohair@632:--with-num-cores=2
, making 2 the default. ohair@632: If you want to run with more ohair@632: cores, runmake JOBS=8
Troubleshooting
ohair@632:ohair@632: ohair@632:ohair@632: ohair@632:Solving build problems
ohair@632: ohair@320:ohair@632: If the build fails (and it's not due to a compilation error in ohair@632: a source file you've changed), the first thing you should do ohair@632: is to re-run the build with more verbosity. ohair@632: Do this by addingohair@632: ohair@632:LOG=debug
to your make command line. ohair@632:
ohair@632: The build log (with both stdout and stderr intermingled, ohair@632: basically the same as you see on your console) can be found as ohair@632:build.log
in your build directory. ohair@632:
ohair@632: You can ask for help on build problems with the new build system ohair@632: on either the ohair@632: ohair@632: build-dev ohair@632: or the ohair@632: ohair@632: build-infra-dev ohair@632: mailing lists. Please include the relevant parts ohair@632: of the build log. ohair@632:
ohair@632: A build can fail for any number of reasons. ohair@632: Most failures ohair@632: are a result of trying to build in an environment in which all the ohair@632: pre-build requirements have not been met. ohair@632: The first step in ohair@632: troubleshooting a build failure is to recheck that you have satisfied ohair@632: all the pre-build requirements for your platform. ohair@632: Scanning theconfigure
log is a good first step, making ohair@632: sure that what it found makes sense for your system. ohair@632: Look for strange error messages or any difficulties that ohair@632:configure
had in finding things. ohair@632:
ohair@632: Some of the more common problems with builds are briefly ohair@632: described ohair@632: below, with suggestions for remedies. ohair@632:ohair@632:
ohair@320:- ohair@632: Corrupted Bundles on Windows: ohair@632:
ohair@632:ohair@632: Some virus scanning software has been known to ohair@632: corrupt the ohair@632: downloading of zip bundles. ohair@632: It may be necessary to disable the 'on access' or ohair@632: 'real time' ohair@632: virus scanning features to prevent this corruption. ohair@632: This type of "real time" virus scanning can also ohair@632: slow down the ohair@632: build process significantly. ohair@632: Temporarily disabling the feature, or excluding the build ohair@632: output directory may be necessary to get correct and ohair@632: faster builds. ohair@632:ohair@632:- ohair@632: Slow Builds: ohair@632:
ohair@632:ohair@632: If your build machine seems to be overloaded from too many ohair@632: simultaneous C++ compiles, try setting the ohair@632:ohair@632:JOBS=1
on themake
command line. ohair@632: Then try increasing the count slowly to an acceptable ohair@632: level for your system. Also: ohair@632:ohair@632: Creating the javadocs can be very slow, ohair@632: if you are running ohair@632: javadoc, consider skipping that step. ohair@632:ohair@632:
ohair@632: Faster CPUs, more RAM, and a faster DISK usually helps. ohair@632: The VM build tends to be CPU intensive ohair@632: (many C++ compiles), ohair@632: and the rest of the JDK will often be disk intensive. ohair@632:
ohair@632: Faster compiles are possible using a tool called ohair@632: ccache. ohair@632:- ohair@632: File time issues: ohair@632:
ohair@632:ohair@632: If you see warnings that refer to file time stamps, e.g. ohair@632:ohair@632:ohair@632: Warning message:ohair@632: These warnings can occur when the clock on the build ohair@632: machine is out of ohair@632: sync with the timestamps on the source files. ohair@632: Other errors, apparently ohair@632: unrelated but in fact caused by the clock skew, ohair@632: can occur along with ohair@632: the clock skew warnings. ohair@632: These secondary errors may tend to obscure the ohair@632: fact that the true root cause of the problem ohair@632: is an out-of-sync clock. ohair@632:ohair@632: File `xxx' has modification time in ohair@632: the future.
ohair@632:
ohair@632: Warning message:Clock skew detected. ohair@632: Your build may ohair@632: be incomplete.
ohair@632:ohair@632: If you see these warnings, reset the clock on the ohair@632: build ohair@632: machine, run "
gmake clobber
" ohair@632: or delete the directory ohair@632: containing the build output, and restart the ohair@632: build from the beginning. ohair@632:- ohair@632: Error message: ohair@632:
ohair@632:Trouble writing out table to disk
ohair@632:ohair@632: Increase the amount of swap space on your build machine. ohair@632: This could be caused by overloading the system and ohair@632: it may be necessary to use: ohair@632:ohair@632:ohair@632:ohair@632: to reduce the load on the system. ohair@632:make JOBS=1
ohair@632:- ohair@632: Error Message: ohair@632:
ohair@632:libstdc++ not found:
ohair@632:ohair@632: This is caused by a missing libstdc++.a library. ohair@632: This is installed as part of a specific package ohair@632: (e.g. libstdc++.so.devel.386). ohair@632: By default some 64-bit Linux versions (e.g. Fedora) ohair@632: only install the 64-bit version of the libstdc++ package. ohair@632: Various parts of the JDK build require a static ohair@632: link of the C++ runtime libraries to allow for maximum ohair@632: portability of the built images. ohair@632:ohair@632:- ohair@632: Linux Error Message: ohair@632:
ohair@632:cannot restore segment prot after reloc
ohair@632:ohair@632: This is probably an issue with SELinux (See ohair@632: ohair@632: http://en.wikipedia.org/wiki/SELinux). ohair@632: Parts of the VM is built without theohair@632:-fPIC
for ohair@632: performance reasons. ohair@632:ohair@632: To completely disable SELinux: ohair@632:
ohair@632:
ohair@632:- ohair@632:
$ su root
- ohair@632:
# system-config-securitylevel
- ohair@632:
In the window that appears, select the SELinux tab
- ohair@632:
Disable SELinux
ohair@632: Alternatively, instead of completely disabling it you could ohair@632: disable just this one check. ohair@632:
ohair@632:
ohair@632:- Select System->Administration->SELinux Management
ohair@632:- In the SELinux Management Tool which appears, ohair@632: select "Boolean" from the menu on the left
ohair@632:- Expand the "Memory Protection" group
ohair@632:- Check the first item, labeled ohair@632: "Allow all unconfined executables to use ohair@632: libraries requiring text relocation ..."
ohair@632:- ohair@632: Windows Error Messages: ohair@632:
ohair@632:
ohair@632:*** fatal error - couldn't allocate heap, ...
ohair@632:
ohair@632:rm fails with "Directory not empty"
ohair@632:
ohair@632:unzip fails with "cannot create ... Permission denied"
ohair@632:
ohair@632:unzip fails with "cannot create ... Error 50"
ohair@632:
ohair@632:ohair@632: The CYGWIN software can conflict with other non-CYGWIN ohair@632: software. See the CYGWIN FAQ section on ohair@632: ohair@632: BLODA (applications that interfere with CYGWIN). ohair@632:ohair@632:- ohair@632: Windows Error Message:
ohair@632:spawn failed
ohair@632:ohair@632: Try rebooting the system, or there could be some kind of ohair@632: issue with the disk or disk partition being used. ohair@632: Sometimes it comes with a "Permission Denied" message. ohair@632:ohair@632:
ohair@632: ohair@13: The Makefiles in the OpenJDK are only valid when used with the ohair@632: GNU version of the utility commandohair@632: ohair@632: ohair@632:make
ohair@632: (usually calledgmake
on Solaris). ohair@13: A few notes about using GNU make: ohair@13:ohair@13:
ohair@13:- ohair@320: You need GNU make version 3.81 or newer. ohair@632: If the GNU make utility on your systems is not ohair@632: 3.81 or newer, ohair@632: see "Building GNU make". ohair@13:
ohair@13:- ohair@632: Place the location of the GNU make binary in the ohair@632:
ohair@13:PATH
. ohair@13:- ohair@13: Solaris: ohair@632: Do NOT use
ohair@13:/usr/bin/make
on Solaris. ohair@13: If your Solaris system has the software ohair@632: from the Solaris Developer Companion CD installed, ohair@632: you should try and usegmake
ohair@632: which will be located in either the ohair@632:/usr/bin
,/opt/sfw/bin
or ohair@632:/usr/sfw/bin
directory. ohair@13:- ohair@13: Windows: ohair@632: Make sure you start your build inside a bash shell. ohair@632:
ohair@632:- ohair@632: Mac OS X: ohair@632: The XCode "command line tools" must be installed on your Mac. ohair@13:
ohair@13:ohair@276: Information on GNU make, and access to ftp download sites, are ohair@276: available on the ohair@276: ohair@276: GNU make web site ohair@276: . ohair@276: The latest source to GNU make is available at ohair@276: ohair@276: ftp.gnu.org/pub/gnu/make/. ohair@320:
ohair@632: ohair@632:Building GNU make
ohair@320:ohair@632: First step is to get the GNU make 3.81 or newer source from ohair@320: ohair@320: ftp.gnu.org/pub/gnu/make/. ohair@632: Building is a little different depending on the OS but is ohair@632: basically done with: ohair@13:ohair@632: ohair@632:ohair@632:ohair@13:bash ./configure
ohair@632:
ohair@632:make
ewendeli@433:
ohair@632: ohair@632:ohair@632: ohair@632: ohair@632: ohair@632: ohair@632: ohair@632: ohair@13:Minimum Build Environments
ohair@13:ohair@632: This file often describes specific requirements for what we ohair@632: call the ohair@632: "minimum build environments" (MBE) for this ohair@632: specific release of the JDK. ohair@632: What is listed below is what the Oracle Release ohair@632: Engineering Team will use to build the Oracle JDK product. ohair@632: Building with the MBE will hopefully generate the most compatible ohair@632: bits that install on, and run correctly on, the most variations ohair@632: of the same base OS and hardware architecture. ohair@632: In some cases, these represent what is often called the ohair@632: least common denominator, but each Operating System has different ohair@632: aspects to it. ohair@632:ohair@632: ohair@632: ohair@632:ohair@632: In all cases, the Bootstrap JDK version minimum is critical, ohair@632: we cannot guarantee builds will work with older Bootstrap JDK's. ohair@632: Also in all cases, more RAM and more processors is better, ohair@632: the minimums listed below are simply recommendations. ohair@632:
ohair@632: With Solaris and Mac OS X, the version listed below is the ohair@632: oldest release we can guarantee builds and works, and the ohair@632: specific version of the compilers used could be critical. ohair@632:
ohair@632: With Windows the critical aspect is the Visual Studio compiler ohair@632: used, which due to it's runtime, generally dictates what Windows ohair@632: systems can do the builds and where the resulting bits can ohair@632: be used.
ohair@632: NOTE: We expect a change here off these older Windows OS releases ohair@632: and to a 'less older' one, probably Windows 2008R2 X64. ohair@632:ohair@632: With Linux, it was just a matter of picking a ohair@632: stable distribution that is a good representative for Linux ohair@632: in general.
ohair@632: NOTE: We expect a change here from Fedora 9 to something else, ohair@632: but it has not been completely determined yet, possibly ohair@632: Ubuntu 12.04 X64, unbiased community feedback would be welcome on ohair@632: what a good choice would be here. ohair@632:ohair@632: It is understood that most developers will NOT be using these ohair@632: specific versions, and in fact creating these specific versions ohair@632: may be difficult due to the age of some of this software. ohair@632: It is expected that developers are more often using the more ohair@632: recent releases and distributions of these operating systems. ohair@632:
ohair@632: Compilation problems with newer or different C/C++ compilers is a ohair@632: common problem. ohair@632: Similarly, compilation problems related to changes to the ohair@632:
ohair@632:/usr/include
or system header files is also a ohair@632: common problem with older, newer, or unreleased OS versions. ohair@632: Please report these types of problems as bugs so that they ohair@632: can be dealt with accordingly. ohair@632:ohair@632: ohair@632:
ohair@13:ohair@632: ohair@632: ohair@632: ohair@632:Base OS and Architecture ohair@632:OS ohair@632:C/C++ Compiler ohair@632:Bootstrap JDK ohair@632:Processors ohair@632:RAM Minimum ohair@632:DISK Needs ohair@632:ohair@632: ohair@632:Linux X86 (32-bit) and X64 (64-bit) ohair@632:Fedora 9 ohair@632:gcc 4.3 ohair@632:JDK 7u7 ohair@632:2 or more ohair@632:1 GB ohair@632:6 GB ohair@632:ohair@632: ohair@632:Solaris SPARC (32-bit) and SPARCV9 (64-bit) ohair@632:Solaris 10 Update 6 ohair@632:Studio 12 Update 1 + patches ohair@632:JDK 7u7 ohair@632:4 or more ohair@632:4 GB ohair@632:8 GB ohair@632:ohair@632: ohair@632:Solaris X86 (32-bit) and X64 (64-bit) ohair@632:Solaris 10 Update 6 ohair@632:Studio 12 Update 1 + patches ohair@632:JDK 7u7 ohair@632:4 or more ohair@632:4 GB ohair@632:8 GB ohair@632:ohair@632: ohair@632:Windows X86 (32-bit) ohair@632:Windows XP ohair@632:Microsoft Visual Studio C++ 2010 Professional Edition ohair@632:JDK 7u7 ohair@632:2 or more ohair@632:2 GB ohair@632:6 GB ohair@632:ohair@632: ohair@632:Windows X64 (64-bit) ohair@632:Windows Server 2003 - Enterprise x64 Edition ohair@632:Microsoft Visual Studio C++ 2010 Professional Edition ohair@632:JDK 7u7 ohair@632:2 or more ohair@632:2 GB ohair@632:6 GB ohair@632:ohair@632: ohair@632: ohair@632:Mac OS X X64 (64-bit) ohair@632:Mac OS X 10.7 "Lion" ohair@632:XCode 4.5.2 or newer ohair@632:JDK 7u7 ohair@632:2 or more ohair@632:4 GB ohair@632:6 GB ohair@632:
ohair@632:Specific Developer Build Environments
ohair@13:ohair@632: We won't be listing all the possible environments, but ohair@632: we will try to provide what information we have available to us. ohair@13:ohair@632: ohair@632:ohair@632: NOTE: The community can help out by updating ohair@632: this part of the document. ohair@632: ohair@632: ohair@632:
Fedora
ohair@632:ohair@632: After installing the latest ohair@632: Fedora ohair@632: you need to install several build dependencies. ohair@632: The simplest way to do it is to execute the ohair@632: following commands as userohair@632: ohair@632: ohair@632:root
: ohair@632:ohair@632:ohair@632:yum-builddep java-1.7.0-openjdk
ohair@632:
ohair@632:yum install gcc gcc-c++
ohair@632:ohair@632: In addition, it's necessary to set a few environment ohair@632: variables for the build: ohair@632:
ohair@632:ohair@632:export LANG=C
ohair@632:
ohair@632:export PATH="/usr/lib/jvm/java-openjdk/bin:${PATH}"
ohair@632:CentOS 5.5
ohair@632:ohair@632: After installing ohair@632: CentOS 5.5 ohair@632: you need to make sure you have ohair@632: the following Development bundles installed: ohair@632:ohair@632: ohair@632:ohair@632:ohair@632:ohair@632:
ohair@632:- Development Libraries
ohair@632:- Development Tools
ohair@632:- Java Development
ohair@632:- X Software Development (Including XFree86-devel)
ohair@632:ohair@632: Plus the following packages: ohair@632:
ohair@632:ohair@632:ohair@632:
ohair@632:- cups devel: Cups Development Package
ohair@632:- alsa devel: Alsa Development Package
ohair@632:- Xi devel: libXi.so Development Package
ohair@632:ohair@632: The freetype 2.3 packages don't seem to be available, ohair@632: but the freetype 2.3 sources can be downloaded, built, ohair@632: and installed easily enough from ohair@632: ohair@632: the freetype site. ohair@632: Build and install with something like: ohair@632:
ohair@632:ohair@632:bash ./configure
ohair@632:
ohair@632:make
ohair@632:
ohair@632:sudo -u root make install
ohair@632:ohair@632: Mercurial packages could not be found easily, but a Google ohair@632: search should find ones, and they usually include Python if ohair@632: it's needed. ohair@632:
Debian 5.0 (Lenny)
ohair@632:ohair@632: After installing Debian 5 ohair@632: you need to install several build dependencies. ohair@632: The simplest way to install the build dependencies is to ohair@632: execute the following commands as userohair@632: ohair@632:root
: ohair@632:ohair@632:ohair@632:aptitude build-dep openjdk-7
ohair@632:
ohair@632:aptitude install openjdk-7-jdk libmotif-dev
ohair@632:ohair@632: In addition, it's necessary to set a few environment ohair@632: variables for the build: ohair@632:
ohair@632:ohair@632:export LANG=C
ohair@632:
ohair@632:export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
ohair@632:Ubuntu 12.04
ohair@632:ohair@632: After installing Ubuntu 12.04 ohair@632: you need to install several build dependencies. The simplest ohair@632: way to do it is to execute the following commands: ohair@632:ohair@632: ohair@632:ohair@632:ohair@632:sudo aptitude build-dep openjdk-7
ohair@632:
ohair@632:sudo aptitude install openjdk-7-jdk
ohair@632:ohair@632: In addition, it's necessary to set a few environment ohair@632: variables for the build: ohair@632:
ohair@632:ohair@632:export LANG=C
ohair@632:
ohair@632:export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
ohair@632:OpenSUSE 11.1
ohair@632:ohair@632: After installing OpenSUSE 11.1 ohair@632: you need to install several build dependencies. ohair@632: The simplest way to install the build dependencies is to ohair@632: execute the following commands: ohair@632:ohair@632: ohair@632:ohair@632:ohair@632:sudo zypper source-install -d java-1_7_0-openjdk
ohair@632:
ohair@632:sudo zypper install make
ohair@632:ohair@632: In addition, it is necessary to set a few environment ohair@632: variables for the build: ohair@632:
ohair@632:ohair@632:export LANG=C
ohair@632:
ohair@632:export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:$[PATH}"
ohair@632:ohair@632: Finally, you need to unset the
JAVA_HOME
ohair@632: environment variable: ohair@632:ohair@632:ohair@632:export -n JAVA_HOME
ohair@632:Mandriva Linux One 2009 Spring
ohair@632:ohair@632: After installing Mandriva ohair@632: Linux One 2009 Spring ohair@632: you need to install several build dependencies. ohair@632: The simplest way to install the build dependencies is to ohair@632: execute the following commands as userohair@632: ohair@632:root
: ohair@632:ohair@632:ohair@632:urpmi java-1.7.0-openjdk-devel make gcc gcc-c++ ohair@632: freetype-devel zip unzip libcups2-devel libxrender1-devel ohair@632: libalsa2-devel libstc++-static-devel libxtst6-devel ohair@632: libxi-devel
ohair@632:ohair@632: In addition, it is necessary to set a few environment ohair@632: variables for the build: ohair@632:
ohair@632:ohair@632:export LANG=C
ohair@632:
ohair@632:export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:${PATH}"
ohair@632:OpenSolaris 2009.06
ohair@632:ohair@632: After installing OpenSolaris 2009.06 ohair@632: you need to install several build dependencies. ohair@632: The simplest way to install the build dependencies is to ohair@632: execute the following commands: ohair@632:ohair@632: ohair@13:ohair@632:ohair@632:pfexec pkg install SUNWgmake SUNWj7dev ohair@632: sunstudioexpress SUNWcups SUNWzip SUNWunzip SUNWxwhl ohair@632: SUNWxorg-headers SUNWaudh SUNWfreetype2
ohair@632:ohair@632: In addition, it is necessary to set a few environment ohair@632: variables for the build: ohair@632:
ohair@632:ohair@632:export LANG=C
ohair@632:
ohair@632:export PATH="/opt/SunStudioExpress/bin:${PATH}"
ohair@632:
End of OpenJDK README-builds.html document.
Please come again!
ohair@13: