Skip to content

Commit 31b9538

Browse files
authored
Merge pull request #2 from openjdk/master
Update forked branch.
2 parents 654ad27 + 8ba390d commit 31b9538

File tree

5,411 files changed

+287575
-159055
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,411 files changed

+287575
-159055
lines changed

.github/workflows/submit.yml

Lines changed: 207 additions & 499 deletions
Large diffs are not rendered by default.

.jcheck/conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ version=0
1414
domain=openjdk.org
1515

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

1920
[checks "merge"]
2021
message=Merge

doc/building.html

Lines changed: 22 additions & 38 deletions
Large diffs are not rendered by default.

doc/building.md

Lines changed: 46 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
## TL;DR (Instructions for the Impatient)
44

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

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

1212
2. [Run configure](#running-configure): \
1313
`bash configure`
@@ -47,14 +47,14 @@ JDK.
4747

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

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

5959
### Special Considerations
6060

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

92-
* Clone the JDK repository using the Cygwin command line `hg` client
93-
as instructed in this document. That is, do *not* use another Mercurial
94-
client such as TortoiseHg.
92+
* You need to install a git client. You have two choices, Cygwin git or
93+
Git for Windows. Unfortunately there are pros and cons with each choice.
94+
95+
* The Cygwin `git` client has no line ending issues and understands
96+
Cygwin paths (which are used throughout the JDK build system).
97+
However, it does not currently work well with the Skara CLI tooling.
98+
Please see the [Skara wiki on Git clients](
99+
https://wiki.openjdk.java.net/display/SKARA/Skara#Skara-Git) for
100+
up-to-date information about the Skara git client support.
101+
102+
* The [Git for Windows](https://gitforwindows.org) client has issues
103+
with line endings, and do not understand Cygwin paths. It does work
104+
well with the Skara CLI tooling, however. To alleviate the line ending
105+
problems, make sure you set `core.autocrlf` to `false` (this is asked
106+
during installation).
95107

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

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

385+
If you have Visual Studio installed but `configure` fails to detect it, it may
386+
be because of [spaces in path](#spaces-in-path).
387+
373388
### IBM XL C/C++
374389

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

12871302
=== Output from failing command(s) repeated here ===
12881303
* For target hotspot_variant-server_libjvm_objs_psMemoryPool.o:
1289-
/localhome/hg/jdk9-sandbox/hotspot/src/share/vm/services/psMemoryPool.cpp:1:1: error: 'failhere' does not name a type
1304+
/localhome/git/jdk-sandbox/hotspot/src/share/vm/services/psMemoryPool.cpp:1:1: error: 'failhere' does not name a type
12901305
... (rest of output omitted)
12911306

1292-
* All command lines available in /localhome/hg/jdk9-sandbox/build/linux-x64/make-support/failure-logs.
1307+
* All command lines available in /localhome/git/jdk-sandbox/build/linux-x64/make-support/failure-logs.
12931308
=== End of repeated output ===
12941309

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

@@ -1391,7 +1406,7 @@ order. Most issues will be solved at step 1 or 2.
13911406
13921407
1. Make sure your repository is up-to-date
13931408
1394-
Run `hg pull -u` to make sure you have the latest changes.
1409+
Run `git pull origin master` to make sure you have the latest changes.
13951410
13961411
2. Clean build results
13971412
@@ -1416,13 +1431,13 @@ order. Most issues will be solved at step 1 or 2.
14161431
make
14171432
```
14181433
1419-
4. Re-clone the Mercurial repository
1434+
4. Re-clone the Git repository
14201435
1421-
Sometimes the Mercurial repository gets in a state that causes the product
1436+
Sometimes the Git repository gets in a state that causes the product
14221437
to be un-buildable. In such a case, the simplest solution is often the
14231438
"sledgehammer approach": delete the entire repository, and re-clone it.
14241439
If you have local changes, save them first to a different location using
1425-
`hg export`.
1440+
`git format-patch`.
14261441
14271442
### Specific Build Issues
14281443
@@ -1454,6 +1469,15 @@ This can be a sign of a Cygwin problem. See the information about solving
14541469
problems in the [Cygwin](#cygwin) section. Rebooting the computer might help
14551470
temporarily.
14561471
1472+
#### Spaces in Path
1473+
1474+
On Windows, when configuring, `fixpath.sh` may report that some directory
1475+
names have spaces. Usually, it assumes those directories have
1476+
[short paths](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-8dot3name).
1477+
You can run `fsutil file setshortname` in `cmd` on certain directories, such as
1478+
`Microsoft Visual Studio` or `Windows Kits`, to assign arbitrary short paths so
1479+
`configure` can access them.
1480+
14571481
### Getting Help
14581482
14591483
If none of the suggestions in this document helps you, or if you find what you
@@ -1467,33 +1491,6 @@ contact the Adoption Group. See the section on [Contributing to OpenJDK](
14671491
14681492
## Hints and Suggestions for Advanced Users
14691493
1470-
### Setting Up a Repository for Pushing Changes (defpath)
1471-
1472-
To help you prepare a proper push path for a Mercurial repository, there exists
1473-
a useful tool known as [defpath](
1474-
http://openjdk.java.net/projects/code-tools/defpath). It will help you setup a
1475-
proper push path for pushing changes to the JDK.
1476-
1477-
Install the extension by cloning
1478-
`http://hg.openjdk.java.net/code-tools/defpath` and updating your `.hgrc` file.
1479-
Here's one way to do this:
1480-
1481-
```
1482-
cd ~
1483-
mkdir hg-ext
1484-
cd hg-ext
1485-
hg clone http://hg.openjdk.java.net/code-tools/defpath
1486-
cat << EOT >> ~/.hgrc
1487-
[extensions]
1488-
defpath=~/hg-ext/defpath/defpath.py
1489-
EOT
1490-
```
1491-
1492-
You can now setup a proper push path using:
1493-
```
1494-
hg defpath -d -u <your OpenJDK username>
1495-
```
1496-
14971494
### Bash Completion
14981495
14991496
The `configure` and `make` commands tries to play nice with bash command-line
@@ -1634,16 +1631,6 @@ instance, `make java.base JDK_FILTER=javax/crypto` (or, to combine methods,
16341631
`make java.base-java-only JDK_FILTER=javax/crypto`) will limit the compilation
16351632
to files in the `javax.crypto` package.
16361633
1637-
### Learn About Mercurial
1638-
1639-
To become an efficient JDK developer, it is recommended that you invest in
1640-
learning Mercurial properly. Here are some links that can get you started:
1641-
1642-
* [Mercurial for git users](http://www.mercurial-scm.org/wiki/GitConcepts)
1643-
* [The official Mercurial tutorial](http://www.mercurial-scm.org/wiki/Tutorial)
1644-
* [hg init](http://hginit.com/)
1645-
* [Mercurial: The Definitive Guide](http://hgbook.red-bean.com/read/)
1646-
16471634
## Understanding the Build System
16481635
16491636
This section will give you a more technical description on the details of the

doc/hotspot-style.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ <h3 id="additional-permitted-features">Additional Permitted Features</h3>
304304
<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>
305305
<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>
306306
<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>
307+
<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>
307308
</ul>
308309
<h3 id="excluded-features">Excluded Features</h3>
309310
<ul>

doc/hotspot-style.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,10 @@ part of the avoidance of the C++ Standard Library in HotSpot code.
750750
* Local and unnamed types as template parameters
751751
([n2657](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm))
752752

753+
* Range-based `for` loops
754+
([n2930](http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2930.html))
755+
([range-for](https://en.cppreference.com/w/cpp/language/range-for))
756+
753757
### Excluded Features
754758

755759
* New string and character literals

make/CompileCommands.gmk

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -45,11 +45,6 @@ $(OUTPUTDIR)/compile_commands.json: $(wildcard $(MAKESUPPORT_OUTPUTDIR)/compile-
4545
$(RM) $@
4646
$(FIND) $(MAKESUPPORT_OUTPUTDIR)/compile-commands/ -name \*.json | \
4747
$(SORT) | $(XARGS) $(CAT) >> [email protected]
48-
$(if $(FIXPATH),$(FIXPATH) $(AWK) 'BEGIN { \
49-
tmpfile = substr(ARGV[2],2); \
50-
cmd = "$(CP) " "\047" tmpfile "\047" " [email protected]"; \
51-
system(cmd); \
52-
5348
$(SED) -e '1s/^/[\$(NEWLINE)/' -e '$(DOLLAR)s/,\s\{0,\}$(DOLLAR)/\$(NEWLINE)]/' [email protected] > $@
5449
5550

make/CompileInterimLangtools.gmk

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -49,8 +49,8 @@ TARGETS += $(patsubst %, $(BUILDTOOLS_OUTPUTDIR)/gensrc/%/module-info.java, \
4949
$(INTERIM_LANGTOOLS_MODULES))
5050

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

5656
TARGETS += $(COPY_PREVIEW_FEATURES)
@@ -74,15 +74,15 @@ define SetupInterimModule
7474
EXCLUDE_FILES := $(TOPDIR)/src/$1/share/classes/module-info.java \
7575
Standard.java, \
7676
EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java, \
77-
COPY := .gif .png .xml .css .js .txt javax.tools.JavaCompilerTool, \
77+
COPY := .gif .png .xml .css .js .js.template .txt javax.tools.JavaCompilerTool, \
7878
BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules/$1.interim, \
7979
DISABLED_WARNINGS := module options, \
8080
JAVAC_FLAGS := \
8181
--module-path $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules \
8282
$$(INTERIM_LANGTOOLS_ADD_EXPORTS) \
8383
--patch-module java.base=$(BUILDTOOLS_OUTPUTDIR)/gensrc/java.base.interim \
84-
--add-exports java.base/jdk.internal=java.compiler.interim \
85-
--add-exports java.base/jdk.internal=jdk.compiler.interim, \
84+
--add-exports java.base/jdk.internal.javac=java.compiler.interim \
85+
--add-exports java.base/jdk.internal.javac=jdk.compiler.interim, \
8686
))
8787

8888
$1_DEPS_INTERIM := $$(addsuffix .interim, $$(filter \

0 commit comments

Comments
 (0)