Linaro GCC FAQ Page
5 stars based on
If you are eager to try out building OpenJDK, these simple steps works most of the time. They assume that you have installed Mercurial and Cygwin if running on Windows and cloned the top-level OpenJDK repository that you want to build. Get the complete source code: If configure fails due why are there only windows 32-binaries for armaarch64 cross-toolchains on the release page missing dependencies to either the toolchainexternal libraries or the boot JDKmost of the time it prints a suggestion on how to resolve the situation on your platform.
Follow the instructions, and try running bash configure again. If any of these steps failed, or if you want to know more about build requirements or build functionality, please continue reading this document. OpenJDK is a complex software project.
Building it requires a certain amount of technical expertise, a fair number of dependencies on external software, and reasonably powerful hardware. If you just want to use OpenJDK and not build it yourself, this document is not for you. OpenJDK uses Mercurial for source control. The source code is contained not in a single Mercurial repository, but in a tree "forest" of interrelated repositories.
You will need to check out all of the repositories to be able to build OpenJDK. To assist you in dealing with this somewhat unusual arrangement, there are multiple tools available, which are explained below. In any case, make sure you are getting the correct version. If you want to build an older version, e. JDK 8, it is recommended that you get the jdk8u forest, which contains incremental updates, instead of the jdk8 forest, which was frozen at JDK 8 GA.
If you are new to Mercurial, a good place to start is the Mercurial Beginner's Guide. The rest of this document assumes a working knowledge of Mercurial. For a smooth building experience, it is recommended that you follow these rules on where and how to check out the source code. Do not check out the source code in a path which contains spaces.
Chances are the build will not work. This is most likely to be an issue on Windows systems. Do not check out the source code in a path which has a very long name or is nested many levels deep. Chances are you will hit an OS limitation during the build. Put the source code on a local disk, not a network share. If possible, use an SSD. The build process is very disk intensive, and having slow disk access will significantly increase build times.
If you need to use a network share for the source code, see below for suggestions on how to keep the build artifacts on a local disk.
On Windows, extra care must be taken to make sure the Cygwin environment is consistent. It is recommended that you follow this procedure:. Create the directory that is going to contain the top directory of the Why are there only windows 32-binaries for armaarch64 cross-toolchains on the release page clone by using the mkdir command in the Cygwin bash shell.
That is, do not create it using Windows Explorer. This will ensure that it will have proper Cygwin attributes, and that it's children will inherit those attributes. That is, do not use another Mercurial client such as TortoiseHg. The first time this is run, it will clone all the sub-repositories.
Any subsequent execution of the script will update all sub-repositories to the latest revision. It takes any number of why are there only windows 32-binaries for armaarch64 cross-toolchains on the release page, and runs hg with those arguments on each sub-repository in the forest.
The trees extension is a Mercurial add-on that helps you deal with the forest. More information is available on the Code Tools trees page. Install the extension by cloning http: Here's one way to do this:. The trees extension needs to know the structure of the forest. If you have already cloned the entire forest using another method, you can initialize the forest like this:. Or you can clone the entire forest at once, if you substitute clone with tclone when cloning the top-level repository, e.
The trees extensions supplement many common operations with a trees version by prefixing a t to the normal Mercurial command, e. For instance, to update the entire forest:. OpenJDK is a massive project, and require machines ranging from decent to powerful to be able to build in a reasonable amount of time, or to be able to complete a build at all. We strongly recommend usage of an SSD disk for the build, since disk speed is one of the limiting factors for build performance.
The more cores to use, the more memory you need. At least 8 GB of free disk space is required. This is not recommended. Instead, see the section on Cross-compiling. Support for other operating system, e. BSD, exists in separate "port" projects. In general, OpenJDK can be built on a wide range of versions of these operating systems, but the further you deviate from what is tested on a daily basis, the more likely you are to run into problems. Such information is always subject to change, but this table is up to date at the time of writing.
The double version numbers for Linux, Solaris and macOS is due to the hybrid model used at Oracle, where why are there only windows 32-binaries for armaarch64 cross-toolchains on the release page files and external libraries from an older version is used when building on a more modern version of the OS.
From time why are there only windows 32-binaries for armaarch64 cross-toolchains on the release page time, this is updated by the community to list successes or failures of building on different platforms. On Windows, it is important that you pay attention to the instructions in the Special Considerations. Msys is no longer supported due to a too old bash; msys2 and the new Windows Subsystem for Linux WSL would likely be possible to support in a future version but that would require a community effort to implement.
Internally in the build system, all paths are represented as Unix-style paths, e. This rule also applies to input to the build system, e. For details on this conversion, see the section on Fixpath. If you have a bit OS, we strongly recommend using the bit version of Cygwin. Cygwin has a model of continuously updating all packages without any easy way to install or revert to a specific version of a package. This means that whenever you add or update a package in Cygwin, you might inadvertently update tools that are used by the OpenJDK build process, and that can cause unexpected build problems.
This is usually not a problem, since Cygwin currently only distributes GNU Make at a version above 4. Unfortunately, Cygwin can be unreliable in certain circumstances. The versions specified in this list is the versions used by the daily builds at Oracle, and is likely to work properly. Older versions of Solaris shipped a broken version of objcopy. At least version 2. Objcopy is needed if you want to have external debug symbols.
Please make sure you are using at least version 2. Apple is using a quite aggressive scheme of pushing OS updates, and coupling these updates with required updates of Xcode. Unfortunately, this makes it difficult for a project like OpenJDK to keep pace with a continuously updated machine running macOS. See the section on Apple Xcode on some strategies to deal with this.
It is recommended that you use at least Mac OS X The standard macOS environment contains the basic tooling needed to build, but for external libraries a package manager is recommended.
OpenJDK uses homebrew in the examples, but feel free to use whatever manager you want or none. The only general advice is to try to use the compilers, external libraries and header files as provided by your distribution. The basic tooling is provided as part of the core operating system, but you will most likely need to install developer packages. Large portions of OpenJDK consists of native code, that needs to be compiled to be able to run on the target platform. In theory, toolchain and operating system should be independent factors, but in practice there's more or less a one-to-one correlation between target operating system and toolchain.
Please see the individual sections on the toolchains for version recommendations. As a reference, these versions of the toolchains are used, at the time of writing, by Oracle for the daily builds of OpenJDK.
It should be possible to compile OpenJDK with both older and newer versions, but the closer you stay to this list, the more likely you are to compile successfully without issues. The minimum accepted version of gcc is 4. Older versions will not be accepted by configure. OpenJDK 9 includes patches that should allow gcc 6 to compile, but this should be considered experimental.
The minimum accepted version of clang is 3. Actually, only the command lines tools are needed, not the IDE. The simplest way to install these is to run:. This blog page has good suggestions on managing multiple Xcode versions.
To use a specific version of Xcode, use xcode-select -s before running configureor use --with-toolchain-path to point to the version of Xcode to use, e. The minimum accepted version of the Solaris Studio compilers is 5. Compiling with Solaris Studio can sometimes be finicky. This is the exact version used by Oracle, which worked correctly at the time of writing:. The minimum accepted version of Visual Studio is The maximum accepted version of Visual Studio is