Skip to content

Commit

Permalink
Merge pull request #2 from openjdk/master
Browse files Browse the repository at this point in the history
Update forked branch.
  • Loading branch information
amresh-sahu authored Feb 16, 2021
2 parents 654ad27 + 8ba390d commit 31b9538
Show file tree
Hide file tree
Showing 5,411 changed files with 287,575 additions and 159,055 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
706 changes: 207 additions & 499 deletions .github/workflows/submit.yml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion .jcheck/conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ version=0
domain=openjdk.org

[checks "whitespace"]
files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java|.*\.cc|.*\.hh|.*\.m|.*\.mm
files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java|.*\.cc|.*\.hh|.*\.m|.*\.mm|.*\.gmk|.*\.m4|.*\.ac|Makefile
ignore-tabs=.*\.gmk|Makefile

[checks "merge"]
message=Merge
Expand Down
60 changes: 22 additions & 38 deletions doc/building.html

Large diffs are not rendered by default.

105 changes: 46 additions & 59 deletions doc/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
## TL;DR (Instructions for the Impatient)

If you are eager to try out building the JDK, these simple steps works most of
the time. They assume that you have installed Mercurial (and Cygwin if running
the time. They assume that you have installed Git (and Cygwin if running
on Windows) and cloned the top-level JDK repository that you want to build.

1. [Get the complete source code](#getting-the-source-code): \
`hg clone http://hg.openjdk.java.net/jdk/jdk`
`git clone https://git.openjdk.java.net/jdk/`

2. [Run configure](#running-configure): \
`bash configure`
Expand Down Expand Up @@ -47,14 +47,14 @@ JDK.

Make sure you are getting the correct version. As of JDK 10, the source is no
longer split into separate repositories so you only need to clone one single
repository. At the [OpenJDK Mercurial server](http://hg.openjdk.java.net/) you
repository. At the [OpenJDK Git site](https://git.openjdk.java.net/) you
can see a list of all available repositories. If you want to build an older version,
e.g. 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.
e.g. JDK 11, it is recommended that you get the `jdk11u` repo, which contains
incremental updates, instead of the `jdk11` repo, which was frozen at JDK 11 GA.

If you are new to Mercurial, a good place to start is the [Mercurial Beginner's
Guide](http://www.mercurial-scm.org/guide). The rest of this document assumes a
working knowledge of Mercurial.
If you are new to Git, a good place to start is the book [Pro
Git](https://git-scm.com/book/en/v2). The rest of this document
assumes a working knowledge of Git.

### Special Considerations

Expand Down Expand Up @@ -89,9 +89,21 @@ on where and how to check out the source code.
directory. This is especially important if your user name contains
spaces and/or mixed upper and lower case letters.

* Clone the JDK repository using the Cygwin command line `hg` client
as instructed in this document. That is, do *not* use another Mercurial
client such as TortoiseHg.
* You need to install a git client. You have two choices, Cygwin git or
Git for Windows. Unfortunately there are pros and cons with each choice.

* The Cygwin `git` client has no line ending issues and understands
Cygwin paths (which are used throughout the JDK build system).
However, it does not currently work well with the Skara CLI tooling.
Please see the [Skara wiki on Git clients](
https://wiki.openjdk.java.net/display/SKARA/Skara#Skara-Git) for
up-to-date information about the Skara git client support.

* The [Git for Windows](https://gitforwindows.org) client has issues
with line endings, and do not understand Cygwin paths. It does work
well with the Skara CLI tooling, however. To alleviate the line ending
problems, make sure you set `core.autocrlf` to `false` (this is asked
during installation).

Failure to follow this procedure might result in hard-to-debug build
problems.
Expand Down Expand Up @@ -173,7 +185,7 @@ likely be possible to support in a future version but that would require effort
to implement.)

Internally in the build system, all paths are represented as Unix-style paths,
e.g. `/cygdrive/c/hg/jdk9/Makefile` rather than `C:\hg\jdk9\Makefile`. This
e.g. `/cygdrive/c/git/jdk/Makefile` rather than `C:\git\jdk\Makefile`. This
rule also applies to input to the build system, e.g. in arguments to
`configure`. So, use `--with-msvcr-dll=/cygdrive/c/msvcr100.dll` rather than
`--with-msvcr-dll=c:\msvcr100.dll`. For details on this conversion, see the section
Expand Down Expand Up @@ -370,6 +382,9 @@ If you have multiple versions of Visual Studio installed, `configure` will by
default pick the latest. You can request a specific version to be used by
setting `--with-toolchain-version`, e.g. `--with-toolchain-version=2017`.

If you have Visual Studio installed but `configure` fails to detect it, it may
be because of [spaces in path](#spaces-in-path).

### IBM XL C/C++

Please consult the AIX section of the [Supported Build Platforms](
Expand Down Expand Up @@ -641,7 +656,7 @@ features, use `bash configure --help=short` instead.)
On Linux, BSD and AIX, it is possible to override where Java by default
searches for runtime/JNI libraries. This can be useful in situations where
there is a special shared directory for system JNI libraries. This setting
can in turn be overriden at runtime by setting the `java.library.path` property.
can in turn be overridden at runtime by setting the `java.library.path` property.
* `--with-jni-libpath=<path>` - Use the specified path as a default
when searching for runtime libraries.
Expand Down Expand Up @@ -707,7 +722,7 @@ hard to use properly. Therefore, `configure` will print a warning if this is
detected.
However, there are a few `configure` variables, known as *control variables*
that are supposed to be overriden on the command line. These are variables that
that are supposed to be overridden on the command line. These are variables that
describe the location of tools needed by the build, like `MAKE` or `GREP`. If
any such variable is specified, `configure` will use that value instead of
trying to autodetect the tool. For instance, `bash configure
Expand Down Expand Up @@ -787,7 +802,7 @@ broken build. Unless you're well versed in the build system, this is hard to
use properly. Therefore, `make` will print a warning if this is detected.
However, there are a few `make` variables, known as *control variables* that
are supposed to be overriden on the command line. These make up the "make time"
are supposed to be overridden on the command line. These make up the "make time"
configuration, as opposed to the "configure time" configuration.
#### General Make Control Variables
Expand Down Expand Up @@ -1286,14 +1301,14 @@ ERROR: Build failed for target 'hotspot' in configuration 'linux-x64' (exit code

=== Output from failing command(s) repeated here ===
* For target hotspot_variant-server_libjvm_objs_psMemoryPool.o:
/localhome/hg/jdk9-sandbox/hotspot/src/share/vm/services/psMemoryPool.cpp:1:1: error: 'failhere' does not name a type
/localhome/git/jdk-sandbox/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 /localhome/hg/jdk9-sandbox/build/linux-x64/make-support/failure-logs.
* All command lines available in /localhome/git/jdk-sandbox/build/linux-x64/make-support/failure-logs.
=== End of repeated output ===

=== Make failed targets repeated here ===
lib/CompileJvm.gmk:207: recipe for target '/localhome/hg/jdk9-sandbox/build/linux-x64/hotspot/variant-server/libjvm/objs/psMemoryPool.o' failed
lib/CompileJvm.gmk:207: recipe for target '/localhome/git/jdk-sandbox/build/linux-x64/hotspot/variant-server/libjvm/objs/psMemoryPool.o' failed
make/Main.gmk:263: recipe for target 'hotspot-server-libs' failed
=== End of repeated output ===

Expand Down Expand Up @@ -1391,7 +1406,7 @@ order. Most issues will be solved at step 1 or 2.
1. Make sure your repository is up-to-date
Run `hg pull -u` to make sure you have the latest changes.
Run `git pull origin master` to make sure you have the latest changes.
2. Clean build results
Expand All @@ -1416,13 +1431,13 @@ order. Most issues will be solved at step 1 or 2.
make
```
4. Re-clone the Mercurial repository
4. Re-clone the Git repository
Sometimes the Mercurial repository gets in a state that causes the product
Sometimes the Git repository gets in a state that causes the product
to be un-buildable. In such a case, the simplest solution is often the
"sledgehammer approach": delete the entire repository, and re-clone it.
If you have local changes, save them first to a different location using
`hg export`.
`git format-patch`.
### Specific Build Issues
Expand Down Expand Up @@ -1454,6 +1469,15 @@ This can be a sign of a Cygwin problem. See the information about solving
problems in the [Cygwin](#cygwin) section. Rebooting the computer might help
temporarily.
#### Spaces in Path
On Windows, when configuring, `fixpath.sh` may report that some directory
names have spaces. Usually, it assumes those directories have
[short paths](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-8dot3name).
You can run `fsutil file setshortname` in `cmd` on certain directories, such as
`Microsoft Visual Studio` or `Windows Kits`, to assign arbitrary short paths so
`configure` can access them.
### Getting Help
If none of the suggestions in this document helps you, or if you find what you
Expand All @@ -1467,33 +1491,6 @@ contact the Adoption Group. See the section on [Contributing to OpenJDK](
## Hints and Suggestions for Advanced Users
### Setting Up a Repository for Pushing Changes (defpath)
To help you prepare a proper push path for a Mercurial repository, there exists
a useful tool known as [defpath](
http://openjdk.java.net/projects/code-tools/defpath). It will help you setup a
proper push path for pushing changes to the JDK.
Install the extension by cloning
`http://hg.openjdk.java.net/code-tools/defpath` and updating your `.hgrc` file.
Here's one way to do this:
```
cd ~
mkdir hg-ext
cd hg-ext
hg clone http://hg.openjdk.java.net/code-tools/defpath
cat << EOT >> ~/.hgrc
[extensions]
defpath=~/hg-ext/defpath/defpath.py
EOT
```
You can now setup a proper push path using:
```
hg defpath -d -u <your OpenJDK username>
```
### Bash Completion
The `configure` and `make` commands tries to play nice with bash command-line
Expand Down Expand Up @@ -1634,16 +1631,6 @@ instance, `make java.base JDK_FILTER=javax/crypto` (or, to combine methods,
`make java.base-java-only JDK_FILTER=javax/crypto`) will limit the compilation
to files in the `javax.crypto` package.
### Learn About Mercurial
To become an efficient JDK developer, it is recommended that you invest in
learning Mercurial properly. Here are some links that can get you started:
* [Mercurial for git users](http://www.mercurial-scm.org/wiki/GitConcepts)
* [The official Mercurial tutorial](http://www.mercurial-scm.org/wiki/Tutorial)
* [hg init](http://hginit.com/)
* [Mercurial: The Definitive Guide](http://hgbook.red-bean.com/read/)
## Understanding the Build System
This section will give you a more technical description on the details of the
Expand Down
1 change: 1 addition & 0 deletions doc/hotspot-style.html
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ <h3 id="additional-permitted-features">Additional Permitted Features</h3>
<li><p>Dynamic initialization and destruction with concurrency (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm">n2660</a>)</p></li>
<li><p><code>final</code> virtual specifiers for classes and virtual functions (<a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm">n2928</a>), (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm">n3206</a>), (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm">n3272</a>)</p></li>
<li><p>Local and unnamed types as template parameters (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm">n2657</a>)</p></li>
<li><p>Range-based <code>for</code> loops (<a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2930.html">n2930</a>) (<a href="https://en.cppreference.com/w/cpp/language/range-for">range-for</a>)</p></li>
</ul>
<h3 id="excluded-features">Excluded Features</h3>
<ul>
Expand Down
4 changes: 4 additions & 0 deletions doc/hotspot-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,10 @@ part of the avoidance of the C++ Standard Library in HotSpot code.
* Local and unnamed types as template parameters
([n2657](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm))

* Range-based `for` loops
([n2930](http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2930.html))
([range-for](https://en.cppreference.com/w/cpp/language/range-for))

### Excluded Features

* New string and character literals
Expand Down
7 changes: 1 addition & 6 deletions make/CompileCommands.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -45,11 +45,6 @@ $(OUTPUTDIR)/compile_commands.json: $(wildcard $(MAKESUPPORT_OUTPUTDIR)/compile-
$(RM) $@
$(FIND) $(MAKESUPPORT_OUTPUTDIR)/compile-commands/ -name \*.json | \
$(SORT) | $(XARGS) $(CAT) >> [email protected]
$(if $(FIXPATH),$(FIXPATH) $(AWK) 'BEGIN { \
tmpfile = substr(ARGV[2],2); \
cmd = "$(CP) " "\047" tmpfile "\047" " [email protected]"; \
system(cmd); \
}' -- @[email protected])
$(SED) -e '1s/^/[\$(NEWLINE)/' -e '$(DOLLAR)s/,\s\{0,\}$(DOLLAR)/\$(NEWLINE)]/' [email protected] > $@
$(RM) [email protected]

Expand Down
12 changes: 6 additions & 6 deletions make/CompileInterimLangtools.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -49,8 +49,8 @@ TARGETS += $(patsubst %, $(BUILDTOOLS_OUTPUTDIR)/gensrc/%/module-info.java, \
$(INTERIM_LANGTOOLS_MODULES))

$(eval $(call SetupCopyFiles, COPY_PREVIEW_FEATURES, \
FILES := $(TOPDIR)/src/java.base/share/classes/jdk/internal/PreviewFeature.java, \
DEST := $(BUILDTOOLS_OUTPUTDIR)/gensrc/java.base.interim/jdk/internal/, \
FILES := $(TOPDIR)/src/java.base/share/classes/jdk/internal/javac/PreviewFeature.java, \
DEST := $(BUILDTOOLS_OUTPUTDIR)/gensrc/java.base.interim/jdk/internal/javac/, \
))

TARGETS += $(COPY_PREVIEW_FEATURES)
Expand All @@ -74,15 +74,15 @@ define SetupInterimModule
EXCLUDE_FILES := $(TOPDIR)/src/$1/share/classes/module-info.java \
Standard.java, \
EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java, \
COPY := .gif .png .xml .css .js .txt javax.tools.JavaCompilerTool, \
COPY := .gif .png .xml .css .js .js.template .txt javax.tools.JavaCompilerTool, \
BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules/$1.interim, \
DISABLED_WARNINGS := module options, \
JAVAC_FLAGS := \
--module-path $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules \
$$(INTERIM_LANGTOOLS_ADD_EXPORTS) \
--patch-module java.base=$(BUILDTOOLS_OUTPUTDIR)/gensrc/java.base.interim \
--add-exports java.base/jdk.internal=java.compiler.interim \
--add-exports java.base/jdk.internal=jdk.compiler.interim, \
--add-exports java.base/jdk.internal.javac=java.compiler.interim \
--add-exports java.base/jdk.internal.javac=jdk.compiler.interim, \
))

$1_DEPS_INTERIM := $$(addsuffix .interim, $$(filter \
Expand Down
Loading

0 comments on commit 31b9538

Please sign in to comment.