mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2026-01-02 06:31:38 +01:00
Compare commits
2102 Commits
lanai-sync
...
jbr-16+12
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
49e7609da2 | ||
|
|
93c00472eb | ||
|
|
8e4a4cdbe0 | ||
|
|
ecfb2914d0 | ||
|
|
3fb8f4364d | ||
|
|
9fc76c2b2c | ||
|
|
b328bc14a0 | ||
|
|
67b3cbff2e | ||
|
|
c2ee432602 | ||
|
|
929ffca471 | ||
|
|
714db70bf3 | ||
|
|
ae912be86f | ||
|
|
f797e19e3d | ||
|
|
9871f3a27a | ||
|
|
74cb1b4e75 | ||
|
|
54490d30c8 | ||
|
|
e8d284faac | ||
|
|
f779affda0 | ||
|
|
70c0815335 | ||
|
|
daffaa8376 | ||
|
|
74ae13716b | ||
|
|
cc8d52020d | ||
|
|
61e42ed85d | ||
|
|
39c9560cbf | ||
|
|
38f4f06ccc | ||
|
|
c190193eac | ||
|
|
89d7530411 | ||
|
|
57d2c86985 | ||
|
|
5dbcdbbef7 | ||
|
|
35421399a4 | ||
|
|
51c8ac362e | ||
|
|
34949494e4 | ||
|
|
5d9c1e45dc | ||
|
|
2631422bc5 | ||
|
|
ea73b5b0d9 | ||
|
|
55e3560abc | ||
|
|
f1a5cbb11e | ||
|
|
fb300a3ff3 | ||
|
|
77522d1270 | ||
|
|
50c37fc749 | ||
|
|
8d432d29b8 | ||
|
|
087cbbfd69 | ||
|
|
65b99c7b1a | ||
|
|
5732032707 | ||
|
|
a963aab1a8 | ||
|
|
9573ef8bda | ||
|
|
552a73301c | ||
|
|
d1b6691295 | ||
|
|
50f1b87a97 | ||
|
|
fe8fcfb4be | ||
|
|
d2d5bc7038 | ||
|
|
3148072079 | ||
|
|
dce1aee4ef | ||
|
|
62a67c5d90 | ||
|
|
63b3498733 | ||
|
|
5d2f6e737b | ||
|
|
d6bd183b84 | ||
|
|
b16a01bb67 | ||
|
|
28f963f6fc | ||
|
|
315ae4c51c | ||
|
|
23ed3a9e91 | ||
|
|
91926e262c | ||
|
|
b83ea8b391 | ||
|
|
092389e3c9 | ||
|
|
6cfe3fea08 | ||
|
|
e64a25b256 | ||
|
|
5e9702d390 | ||
|
|
79a4a019bb | ||
|
|
f70fc149b5 | ||
|
|
90f0612ada | ||
|
|
35e3226df8 | ||
|
|
7638580477 | ||
|
|
0db838628c | ||
|
|
473fa82000 | ||
|
|
3498a10a2b | ||
|
|
9f090cb6f8 | ||
|
|
e44575ad3e | ||
|
|
d8355e0281 | ||
|
|
03e5f256ca | ||
|
|
12ae68b197 | ||
|
|
19a08080e4 | ||
|
|
9edcdf12a0 | ||
|
|
a096c0a83f | ||
|
|
e648a907b3 | ||
|
|
191e1e6075 | ||
|
|
51b3bd2c2e | ||
|
|
0615eac2e6 | ||
|
|
2c00d740d4 | ||
|
|
764b50a7e3 | ||
|
|
c32923e06f | ||
|
|
44c6537b57 | ||
|
|
18d5626e25 | ||
|
|
13946835b5 | ||
|
|
0019679c69 | ||
|
|
c798b3d040 | ||
|
|
96f56eb4fc | ||
|
|
97bbbbba51 | ||
|
|
c200b4f1cb | ||
|
|
1066357887 | ||
|
|
7f74c7dd7f | ||
|
|
3a0741afa1 | ||
|
|
61ebb6adb7 | ||
|
|
a53ecac07c | ||
|
|
30c8811d11 | ||
|
|
6b8c16cf41 | ||
|
|
45c4d9d519 | ||
|
|
36b129fe84 | ||
|
|
eaf70e0ab8 | ||
|
|
1cc09ccaef | ||
|
|
ed5696dd2c | ||
|
|
688e5d9071 | ||
|
|
d0d925c13a | ||
|
|
b5f785ba9b | ||
|
|
db1e207a72 | ||
|
|
55e381b32f | ||
|
|
8e687450d6 | ||
|
|
b35a3bdee9 | ||
|
|
c57d89ad1a | ||
|
|
c2fa441d8d | ||
|
|
7332181372 | ||
|
|
1d480a7b96 | ||
|
|
660272ce7c | ||
|
|
032a4d6b9f | ||
|
|
970e251a54 | ||
|
|
c1093dc244 | ||
|
|
ee060c777c | ||
|
|
6df465de73 | ||
|
|
b5d775f115 | ||
|
|
3ed56830b4 | ||
|
|
084e15bca3 | ||
|
|
c79e6346d0 | ||
|
|
84e397b4de | ||
|
|
d7c7f70a6a | ||
|
|
f4de95a97c | ||
|
|
38af8be984 | ||
|
|
b0ceab23dd | ||
|
|
39616b4d7c | ||
|
|
00d223cff6 | ||
|
|
bafa476135 | ||
|
|
15a9c29036 | ||
|
|
4bd94fb9ea | ||
|
|
54bed60bfe | ||
|
|
d12fdfa3b7 | ||
|
|
1e535dfa53 | ||
|
|
9385203fbd | ||
|
|
42f4170b2a | ||
|
|
696b9e1847 | ||
|
|
e15e30fef2 | ||
|
|
d9abf606d9 | ||
|
|
ddb726d4a0 | ||
|
|
aab365f746 | ||
|
|
13a335722f | ||
|
|
9390446081 | ||
|
|
b76a154c6d | ||
|
|
ee5dc7cbb4 | ||
|
|
e03ca73dc1 | ||
|
|
a9ad296a55 | ||
|
|
024fa0969a | ||
|
|
dc71097c2e | ||
|
|
229f41808d | ||
|
|
58107e52a8 | ||
|
|
0f5e57aa8c | ||
|
|
7fd5cb6117 | ||
|
|
2dda9965cd | ||
|
|
1cc8d3a34b | ||
|
|
38636a8c96 | ||
|
|
d5c4c292a0 | ||
|
|
e3c6574ac0 | ||
|
|
72b530aac4 | ||
|
|
d6035a522e | ||
|
|
39892bf43f | ||
|
|
9798a0846b | ||
|
|
d3776c7d30 | ||
|
|
07c3021936 | ||
|
|
60745d14ec | ||
|
|
5735fce331 | ||
|
|
ee2e61d7e0 | ||
|
|
c55e52e01f | ||
|
|
7f0777ae88 | ||
|
|
831f23ee86 | ||
|
|
c540da3c4c | ||
|
|
6a5203877e | ||
|
|
d502554467 | ||
|
|
9885ac18ac | ||
|
|
178eea6065 | ||
|
|
a5ae1e306e | ||
|
|
fe5817aae8 | ||
|
|
832d896443 | ||
|
|
dc8026d66d | ||
|
|
7ca448b4fc | ||
|
|
fff8122978 | ||
|
|
8812113984 | ||
|
|
74eb250e36 | ||
|
|
846d21961c | ||
|
|
6986d53af9 | ||
|
|
11a8c9c13e | ||
|
|
7efa6090e8 | ||
|
|
03cf1c3a83 | ||
|
|
3a8a15b5d0 | ||
|
|
3c276ce1fe | ||
|
|
4ac45a3b50 | ||
|
|
c8c4d8377a | ||
|
|
9852a6f75c | ||
|
|
1ad1659413 | ||
|
|
e800cc2d2d | ||
|
|
77c46ea911 | ||
|
|
45c89daf72 | ||
|
|
0c9e0c2e7f | ||
|
|
4d3baa2d37 | ||
|
|
c148c2c176 | ||
|
|
555f0e6e2a | ||
|
|
12879e91b4 | ||
|
|
ef86f06c42 | ||
|
|
70885cae5e | ||
|
|
d02e7d55e8 | ||
|
|
db46b297fa | ||
|
|
c202bd705e | ||
|
|
111ba18ac6 | ||
|
|
c02b75705f | ||
|
|
9886b7e9e9 | ||
|
|
deaadfad52 | ||
|
|
99c7b2b85b | ||
|
|
db4d59cc0c | ||
|
|
b0e4e9a2e4 | ||
|
|
2d3372c8b5 | ||
|
|
dc86b2e22b | ||
|
|
b37b1a391a | ||
|
|
65577cf58a | ||
|
|
3ea5fdc9ac | ||
|
|
339016a0f2 | ||
|
|
831e98327b | ||
|
|
dfd3080c05 | ||
|
|
091b0c95c3 | ||
|
|
41eaa00eed | ||
|
|
5a365e8627 | ||
|
|
c0b9999c35 | ||
|
|
0e54ce2a8e | ||
|
|
ac4dc0470e | ||
|
|
cce3929e07 | ||
|
|
bbddae5552 | ||
|
|
5db58348f8 | ||
|
|
9b73fb125d | ||
|
|
fcd5d414d6 | ||
|
|
4b076cb93f | ||
|
|
922ba8da30 | ||
|
|
a0149f53f1 | ||
|
|
e6875c9bac | ||
|
|
75d642a467 | ||
|
|
cbf6894299 | ||
|
|
77c4adbeb5 | ||
|
|
890ca6ea2c | ||
|
|
bd12e85975 | ||
|
|
4a1d4be729 | ||
|
|
f79b7e62db | ||
|
|
c63911b33b | ||
|
|
778d8a45cb | ||
|
|
8b005fa74e | ||
|
|
26680f0c1a | ||
|
|
eaeb43542b | ||
|
|
22006dceb4 | ||
|
|
df923ff2fb | ||
|
|
55b19e84f2 | ||
|
|
0ef80293f9 | ||
|
|
1f91e0ebe3 | ||
|
|
e427697e55 | ||
|
|
5c8a154e93 | ||
|
|
2abefad512 | ||
|
|
9f23c2c159 | ||
|
|
6d665ed31f | ||
|
|
bb6647c845 | ||
|
|
8a9d2b08a0 | ||
|
|
6e198fec0b | ||
|
|
5088193336 | ||
|
|
8b87402a44 | ||
|
|
1f63603288 | ||
|
|
a28f4100ce | ||
|
|
dc80e63811 | ||
|
|
63d2421c3b | ||
|
|
993b1b0afa | ||
|
|
54ad4f9a80 | ||
|
|
33016a8325 | ||
|
|
b1ff2bd00a | ||
|
|
2f8653fbf0 | ||
|
|
1b1c1cd7b9 | ||
|
|
401d3ea9bc | ||
|
|
9cf96bf398 | ||
|
|
668acc7581 | ||
|
|
f8a06bc497 | ||
|
|
a764279daa | ||
|
|
9b42f4786c | ||
|
|
2d8e74ddea | ||
|
|
4d43cf9fc6 | ||
|
|
45e17d8dd2 | ||
|
|
18cf3d8080 | ||
|
|
4f99e1fb11 | ||
|
|
73c75ed838 | ||
|
|
2a8f92e7e7 | ||
|
|
39b22d134f | ||
|
|
dff37f89c5 | ||
|
|
9ff01f7b2f | ||
|
|
c7b074a9db | ||
|
|
f8c1d79917 | ||
|
|
cd98f7d5bf | ||
|
|
006d0bcec1 | ||
|
|
a20c31865d | ||
|
|
d116022893 | ||
|
|
35554ea085 | ||
|
|
3a69dfb5c5 | ||
|
|
8d97637cf2 | ||
|
|
af0d6d28b0 | ||
|
|
6ee76b6b05 | ||
|
|
ac38b399de | ||
|
|
4a4003e900 | ||
|
|
1c882d91f0 | ||
|
|
24a7d8c766 | ||
|
|
4d13bf33d4 | ||
|
|
d63aebe6cb | ||
|
|
4320afbd58 | ||
|
|
546158fb42 | ||
|
|
9694ca9eaf | ||
|
|
3770be7f70 | ||
|
|
3e641b796f | ||
|
|
631085bdfd | ||
|
|
1ce6ec6a28 | ||
|
|
3ec5f6b374 | ||
|
|
ca2df0e543 | ||
|
|
df3c55230e | ||
|
|
c9f9fde366 | ||
|
|
39d4b22fc0 | ||
|
|
507e54840f | ||
|
|
1108a4a77c | ||
|
|
18f3591a1b | ||
|
|
d11b0078a1 | ||
|
|
55039aa1c6 | ||
|
|
24f4f14c3d | ||
|
|
f636b84f48 | ||
|
|
62d77dc3fc | ||
|
|
8cfc7e39df | ||
|
|
e07ad838b5 | ||
|
|
b27e717c56 | ||
|
|
1b5391264a | ||
|
|
be2a92d8c7 | ||
|
|
681d06d39b | ||
|
|
8906904591 | ||
|
|
a640835c62 | ||
|
|
d7c1bb1fb7 | ||
|
|
6d201dbba6 | ||
|
|
919eb12b14 | ||
|
|
6c95a87157 | ||
|
|
ba1db57dde | ||
|
|
765abcb329 | ||
|
|
606aad5dc8 | ||
|
|
52977fd914 | ||
|
|
265b36ff28 | ||
|
|
7a0914c44c | ||
|
|
13bcda40dc | ||
|
|
a9b7ae8ac2 | ||
|
|
7a6c1a66b2 | ||
|
|
be04c8c724 | ||
|
|
92be493f0b | ||
|
|
77c83d9ee6 | ||
|
|
5b2fd36a6d | ||
|
|
04280a0d05 | ||
|
|
c5ad1daa96 | ||
|
|
9bbec0433c | ||
|
|
a376fb7720 | ||
|
|
32482c82a6 | ||
|
|
54c0178787 | ||
|
|
3e0dc68883 | ||
|
|
ba2caf0014 | ||
|
|
907719baec | ||
|
|
99eccaf6ec | ||
|
|
c7d84850bf | ||
|
|
ec074011a4 | ||
|
|
9376dd810c | ||
|
|
5d270677f7 | ||
|
|
b7c307c019 | ||
|
|
d1d17200c5 | ||
|
|
59cd79a8f9 | ||
|
|
7339cf8f54 | ||
|
|
2f6afe55d8 | ||
|
|
e13cb76baa | ||
|
|
955aee3bfa | ||
|
|
a8d6a05ce8 | ||
|
|
55af701cc3 | ||
|
|
749be7e761 | ||
|
|
1f5e21a16e | ||
|
|
cdc1dc939f | ||
|
|
bcd4690bc3 | ||
|
|
fd206e1e7e | ||
|
|
f1bdd9fca6 | ||
|
|
c83ce2e8d9 | ||
|
|
ee1efed55d | ||
|
|
05bb6f1ec2 | ||
|
|
2f989d273d | ||
|
|
023c53d190 | ||
|
|
1982432db4 | ||
|
|
590de670a9 | ||
|
|
f8f35d30af | ||
|
|
10e6a6a19a | ||
|
|
4922a35c6a | ||
|
|
82cc03fa89 | ||
|
|
734a6c94d3 | ||
|
|
83fff05498 | ||
|
|
6c89a9653e | ||
|
|
20147c36fe | ||
|
|
4506975561 | ||
|
|
e2072bba70 | ||
|
|
5cf33168d7 | ||
|
|
999357250a | ||
|
|
396146854b | ||
|
|
af51a73224 | ||
|
|
e0c26b37fd | ||
|
|
6b8bf62a75 | ||
|
|
4858141ce4 | ||
|
|
8b7c959164 | ||
|
|
ec25b42804 | ||
|
|
5a90271d01 | ||
|
|
579ed70629 | ||
|
|
78b9de8e40 | ||
|
|
dc0c0c7eca | ||
|
|
1eaa4116f5 | ||
|
|
4e962f9675 | ||
|
|
1356a0f1ac | ||
|
|
72ae322022 | ||
|
|
3d9bad16d1 | ||
|
|
dc63bf261b | ||
|
|
51937e18f8 | ||
|
|
00e0a60955 | ||
|
|
5fbac4a34c | ||
|
|
911c553cd2 | ||
|
|
c3ec97d41a | ||
|
|
43a2010936 | ||
|
|
637fdbc83c | ||
|
|
2e65885257 | ||
|
|
55e7003fd5 | ||
|
|
b67814941f | ||
|
|
83a8c4acc7 | ||
|
|
5699024184 | ||
|
|
7e93e03da5 | ||
|
|
bf04926d72 | ||
|
|
dc74336a65 | ||
|
|
4b85bd546e | ||
|
|
32aa66126e | ||
|
|
292a3d5722 | ||
|
|
03d47d58d6 | ||
|
|
eb78035d05 | ||
|
|
13b7c2e131 | ||
|
|
2a37607e98 | ||
|
|
f5673586b7 | ||
|
|
545d56dd42 | ||
|
|
7d54e71d38 | ||
|
|
46ff8fdce9 | ||
|
|
7c3d72fd3a | ||
|
|
0f43de9f02 | ||
|
|
a18e8d3d57 | ||
|
|
8f26a1f748 | ||
|
|
37880ba60d | ||
|
|
1b1fb08000 | ||
|
|
183dadbef2 | ||
|
|
2fe15bc62e | ||
|
|
69a9403995 | ||
|
|
9f0bafe6ad | ||
|
|
dda0c6cecd | ||
|
|
e5c43ab86e | ||
|
|
a0e5043781 | ||
|
|
802737cae7 | ||
|
|
ddcb17e1e0 | ||
|
|
e87c864847 | ||
|
|
5899ef11fb | ||
|
|
f4756fdf48 | ||
|
|
ca91da0e0c | ||
|
|
13750b6aca | ||
|
|
abc55dea7e | ||
|
|
a338213bb4 | ||
|
|
eb1bacc71b | ||
|
|
2de3595895 | ||
|
|
f19db799f3 | ||
|
|
f23c983a46 | ||
|
|
c7ecaa4a1d | ||
|
|
1b3a127d06 | ||
|
|
653af300cc | ||
|
|
7a4bf2456e | ||
|
|
45fce6baf9 | ||
|
|
a8d20c9254 | ||
|
|
79ad5512cf | ||
|
|
63a6adf2b5 | ||
|
|
622117d275 | ||
|
|
20a1e352c0 | ||
|
|
46f86477ad | ||
|
|
51b7c76a95 | ||
|
|
ba711f63ba | ||
|
|
682e836d60 | ||
|
|
5a6954abba | ||
|
|
840867efa6 | ||
|
|
fe145646e7 | ||
|
|
c07ce7eec7 | ||
|
|
55bbaf1ae1 | ||
|
|
48c0ce3b4b | ||
|
|
a25bacdd13 | ||
|
|
a793293464 | ||
|
|
5ad963cf61 | ||
|
|
9d6797019b | ||
|
|
ac4f14c386 | ||
|
|
f44f885f27 | ||
|
|
a2db08ae98 | ||
|
|
bdab5a0a3a | ||
|
|
1ef33e4df9 | ||
|
|
a0a0539b0d | ||
|
|
f6c537f8bc | ||
|
|
fc82a465d3 | ||
|
|
c0c4a8d738 | ||
|
|
57b792cba2 | ||
|
|
18cddad5a2 | ||
|
|
51ddc2adbf | ||
|
|
e7fa180e05 | ||
|
|
9ffba3002a | ||
|
|
55b472251e | ||
|
|
b87302ca99 | ||
|
|
2534e72618 | ||
|
|
e098a31307 | ||
|
|
708b60e8c6 | ||
|
|
fc82768478 | ||
|
|
23bbc981a6 | ||
|
|
4682835fb4 | ||
|
|
8a424425e1 | ||
|
|
5724c0d321 | ||
|
|
b4ea9cf23e | ||
|
|
e00aa7c866 | ||
|
|
aacb827896 | ||
|
|
d886d8c465 | ||
|
|
47e465cf1b | ||
|
|
0f2ac2021b | ||
|
|
8c20401051 | ||
|
|
a953a0f4ab | ||
|
|
a6e794b3e8 | ||
|
|
06cea107ef | ||
|
|
601e566b26 | ||
|
|
31c511e6a5 | ||
|
|
42d3bad0b1 | ||
|
|
921155dfc7 | ||
|
|
233cac3232 | ||
|
|
9e5f6885d8 | ||
|
|
34755c3528 | ||
|
|
a1b5e01003 | ||
|
|
f45d121128 | ||
|
|
ac37a29914 | ||
|
|
3e4ad5d8d1 | ||
|
|
362f168d23 | ||
|
|
2ad638621c | ||
|
|
1e45eb3b13 | ||
|
|
95b9024ab2 | ||
|
|
4b3c33bac1 | ||
|
|
0e60e8ad85 | ||
|
|
1550fd889b | ||
|
|
6b251191e0 | ||
|
|
112a4bd8bc | ||
|
|
9584e01d24 | ||
|
|
ef3b0ec567 | ||
|
|
9d6aa42a7c | ||
|
|
3797364ce9 | ||
|
|
156f6174ed | ||
|
|
a1f02d13e5 | ||
|
|
27fc8b6787 | ||
|
|
e178f0467b | ||
|
|
1aa6539576 | ||
|
|
0a6262f0b8 | ||
|
|
d85ff3c7f0 | ||
|
|
29936542ad | ||
|
|
6715f2306e | ||
|
|
2f09989ec0 | ||
|
|
4bcd70acc0 | ||
|
|
e66a2a3384 | ||
|
|
4076ca82d2 | ||
|
|
6986ab256d | ||
|
|
1e1985da9b | ||
|
|
36d716aa08 | ||
|
|
7f69acc778 | ||
|
|
6469685285 | ||
|
|
4167ba1288 | ||
|
|
2c868d6101 | ||
|
|
12554c2c03 | ||
|
|
9a99f511aa | ||
|
|
9a120e7f79 | ||
|
|
4862d0d542 | ||
|
|
3192ef367a | ||
|
|
cb9d3efe5d | ||
|
|
c0b348f3ef | ||
|
|
d8219d0a78 | ||
|
|
2765410a28 | ||
|
|
a10a9284c1 | ||
|
|
88df2f0f7f | ||
|
|
f8596b57f3 | ||
|
|
e3eb38f4d2 | ||
|
|
8d9826e4d1 | ||
|
|
17f2250c5a | ||
|
|
b7e944953e | ||
|
|
61e44cdb6a | ||
|
|
3c472b6700 | ||
|
|
02201d19c6 | ||
|
|
79f02a67ce | ||
|
|
a4eaf9536c | ||
|
|
cf345fd768 | ||
|
|
d86ab942f6 | ||
|
|
0417fcf13f | ||
|
|
257809d744 | ||
|
|
7685e53426 | ||
|
|
bd843673a8 | ||
|
|
0aefe6f20a | ||
|
|
4946a162aa | ||
|
|
6e32338330 | ||
|
|
eef2e1e3fc | ||
|
|
e6517d1ae2 | ||
|
|
10b9d0b6a6 | ||
|
|
27a9a2f64a | ||
|
|
b37228e11f | ||
|
|
17035efe87 | ||
|
|
6af643e5a1 | ||
|
|
3349e10b7f | ||
|
|
a72a8984a9 | ||
|
|
25d1305f7e | ||
|
|
76baa501fa | ||
|
|
64d130efc4 | ||
|
|
77a10a182f | ||
|
|
0b42b1cf15 | ||
|
|
f4301530b4 | ||
|
|
99ae9558fe | ||
|
|
816a7060ba | ||
|
|
ab729d7075 | ||
|
|
1a5ef6606f | ||
|
|
8a9675663f | ||
|
|
31368cd1f0 | ||
|
|
aff80ee900 | ||
|
|
42ac8e1856 | ||
|
|
0ebcf5c59d | ||
|
|
5b99c6ae1f | ||
|
|
e7289aa4d4 | ||
|
|
188ad9714d | ||
|
|
2aa291ad2c | ||
|
|
f2e69156c8 | ||
|
|
277ec3d260 | ||
|
|
ed7f796494 | ||
|
|
761a92d7c9 | ||
|
|
31753ef9bf | ||
|
|
6c2ff1781b | ||
|
|
af8c3b4a7e | ||
|
|
417e8e449d | ||
|
|
f84b5d2f80 | ||
|
|
3dba35d248 | ||
|
|
112bbcb396 | ||
|
|
eb758d53f1 | ||
|
|
f834dc3dc9 | ||
|
|
c4df79117d | ||
|
|
25b1e5a7bd | ||
|
|
e0a7782a9e | ||
|
|
8b6d3147fb | ||
|
|
2e6923ffd6 | ||
|
|
9d40d80237 | ||
|
|
f2b191a6e9 | ||
|
|
983e012c9f | ||
|
|
ffbee17d8a | ||
|
|
226e852831 | ||
|
|
5d1255bf52 | ||
|
|
326ba31787 | ||
|
|
bf1e6903a2 | ||
|
|
e208d9aa1f | ||
|
|
510354452f | ||
|
|
6c2c0563eb | ||
|
|
2155d525dd | ||
|
|
de3923edf9 | ||
|
|
05dc2af21f | ||
|
|
d5ae932b3f | ||
|
|
a7e352b554 | ||
|
|
144267d30f | ||
|
|
d19f2bdec0 | ||
|
|
320af9b34b | ||
|
|
d180fb3044 | ||
|
|
1a4f31409a | ||
|
|
d16ea55b62 | ||
|
|
97cdfb92f8 | ||
|
|
4a588d89f0 | ||
|
|
a750ac5feb | ||
|
|
56048d0480 | ||
|
|
11ac92c8fb | ||
|
|
cfab7f4c68 | ||
|
|
2cbdd21ed7 | ||
|
|
59a4517d07 | ||
|
|
ecb4cbfd4a | ||
|
|
ce4978ffe6 | ||
|
|
2a794b696c | ||
|
|
ed4b801771 | ||
|
|
338dd21cfe | ||
|
|
f740cda526 | ||
|
|
5547d3204d | ||
|
|
3237e82b4b | ||
|
|
a27ee6b284 | ||
|
|
dee90e4736 | ||
|
|
e7f8e1fdb5 | ||
|
|
5073b8c163 | ||
|
|
e5d33163c7 | ||
|
|
bf300e8d8c | ||
|
|
02cec3470f | ||
|
|
f968f32789 | ||
|
|
c55b06a4d5 | ||
|
|
898c638b95 | ||
|
|
6cdf06f02b | ||
|
|
6c3c3dad97 | ||
|
|
b71dac2502 | ||
|
|
fd7123b268 | ||
|
|
ca85c5ab15 | ||
|
|
e3b04bc135 | ||
|
|
bc73f12313 | ||
|
|
faaf52cc30 | ||
|
|
2536cbf2cf | ||
|
|
241f401815 | ||
|
|
e68f81ab4c | ||
|
|
7b988b31c6 | ||
|
|
eeb3c5e9e3 | ||
|
|
4bc69f4255 | ||
|
|
19c5bfe42f | ||
|
|
56d333c538 | ||
|
|
0b8f18beda | ||
|
|
edefd3c198 | ||
|
|
c0475c81f2 | ||
|
|
30ff2ad58c | ||
|
|
212ab17635 | ||
|
|
a6df9ae23a | ||
|
|
07e6b75ff5 | ||
|
|
0652a7883d | ||
|
|
56abdc178e | ||
|
|
80ae89b1aa | ||
|
|
ee452946fc | ||
|
|
b6a9f3015a | ||
|
|
0bf3ba402b | ||
|
|
27e168677f | ||
|
|
140a79765f | ||
|
|
41c5a07fa9 | ||
|
|
9d0ba7ae7f | ||
|
|
d7e68f375c | ||
|
|
cd16b568ce | ||
|
|
63a3d8f0f2 | ||
|
|
4d8189b265 | ||
|
|
82e3640eb1 | ||
|
|
8dc66431d4 | ||
|
|
dc91b06661 | ||
|
|
b37d806d82 | ||
|
|
976c469305 | ||
|
|
71d646a160 | ||
|
|
6fc6476da8 | ||
|
|
9cd41b6555 | ||
|
|
1786701011 | ||
|
|
63ade9c49c | ||
|
|
46f4bf93db | ||
|
|
a748779e1e | ||
|
|
785b914282 | ||
|
|
a043bd0ff8 | ||
|
|
5805cbeaaf | ||
|
|
ea9aeda5ee | ||
|
|
b073038e54 | ||
|
|
e90621c169 | ||
|
|
358714bcd0 | ||
|
|
3943f9d0b7 | ||
|
|
2845c3d029 | ||
|
|
f87ef60b09 | ||
|
|
28d2cdf99a | ||
|
|
045d61b5e0 | ||
|
|
086c5f1750 | ||
|
|
201d0a48d1 | ||
|
|
6cbd66b1c1 | ||
|
|
f160c80e3b | ||
|
|
ac2828ddf1 | ||
|
|
9a8ace2c0a | ||
|
|
6e43cddad7 | ||
|
|
3df95aa377 | ||
|
|
5b6f050fce | ||
|
|
59428f4a0d | ||
|
|
ac906168c8 | ||
|
|
c47f27e1c6 | ||
|
|
022d7a19d3 | ||
|
|
9149f10fa4 | ||
|
|
7d6c1cf4a8 | ||
|
|
a98bad2b22 | ||
|
|
35ceac0083 | ||
|
|
be14526569 | ||
|
|
ff8c6d5deb | ||
|
|
2625942c43 | ||
|
|
cd651b9aad | ||
|
|
2048bcb648 | ||
|
|
71c926c4f6 | ||
|
|
a46a94c431 | ||
|
|
8d19eca78c | ||
|
|
9c3be78826 | ||
|
|
97fc959e35 | ||
|
|
13d30235e1 | ||
|
|
ec4240b342 | ||
|
|
efffff1dbb | ||
|
|
0b02c5b5e0 | ||
|
|
498b0e61ed | ||
|
|
06e47d05b6 | ||
|
|
c66bef0289 | ||
|
|
45fa5aa699 | ||
|
|
4de4200652 | ||
|
|
cb960ee7b5 | ||
|
|
f833afa660 | ||
|
|
5aea3f0250 | ||
|
|
5f0f4d75e0 | ||
|
|
6c3bc71079 | ||
|
|
0963050548 | ||
|
|
d071ed0294 | ||
|
|
b4943a3f02 | ||
|
|
e97c5f41ee | ||
|
|
d616488567 | ||
|
|
c328bca493 | ||
|
|
cd340d5e70 | ||
|
|
7514ad9ad0 | ||
|
|
604005d65c | ||
|
|
1d4bd253e4 | ||
|
|
9e43496c42 | ||
|
|
f79801b74d | ||
|
|
5314d28f84 | ||
|
|
e639c9a840 | ||
|
|
4f9020f481 | ||
|
|
d101efc16b | ||
|
|
72f1a49746 | ||
|
|
984373408e | ||
|
|
6fd44901ec | ||
|
|
02fbf44cc7 | ||
|
|
b43f356288 | ||
|
|
c0a1a4e4fc | ||
|
|
55ed0d853f | ||
|
|
5967aaf629 | ||
|
|
4708c6d343 | ||
|
|
53015e6d82 | ||
|
|
7228978b19 | ||
|
|
60ac615aa8 | ||
|
|
e29685febd | ||
|
|
e0d03881d0 | ||
|
|
de34e258ef | ||
|
|
7045a46250 | ||
|
|
6df2a95d17 | ||
|
|
f3c463b50a | ||
|
|
23ce03d2ca | ||
|
|
b189d0b918 | ||
|
|
3459f9b861 | ||
|
|
339d52600b | ||
|
|
f702f4d93a | ||
|
|
a9477eb8c9 | ||
|
|
919f10c407 | ||
|
|
6f4f6a2a59 | ||
|
|
57388f807f | ||
|
|
7cc3ba5f9b | ||
|
|
456fe234ce | ||
|
|
7671f2716b | ||
|
|
dfc7905a10 | ||
|
|
8ea971e373 | ||
|
|
686ca5ae49 | ||
|
|
60ce159dad | ||
|
|
e4a972de1a | ||
|
|
4aea73361d | ||
|
|
e6855f20b0 | ||
|
|
7e85b2c787 | ||
|
|
69f7f95b93 | ||
|
|
4ad89925d0 | ||
|
|
17a298962c | ||
|
|
6f5e8a2aa3 | ||
|
|
93d89d3bf3 | ||
|
|
4af3a1e078 | ||
|
|
afbdb4932e | ||
|
|
954db3353e | ||
|
|
37c3b0bf10 | ||
|
|
b8d49f8c2f | ||
|
|
db1ef58d5c | ||
|
|
342e9f88cd | ||
|
|
85822a50d5 | ||
|
|
9b3fb5d1d5 | ||
|
|
c14590378a | ||
|
|
76ac621394 | ||
|
|
5200d162bc | ||
|
|
6e1403480a | ||
|
|
2ff952bf32 | ||
|
|
d0294c3845 | ||
|
|
bc669dfc82 | ||
|
|
c638618814 | ||
|
|
1357c01e57 | ||
|
|
eb20ed7374 | ||
|
|
64c5823aa4 | ||
|
|
845799935b | ||
|
|
846fd238fc | ||
|
|
5374383dcd | ||
|
|
aabcf9f792 | ||
|
|
0400119e5b | ||
|
|
1401fe0087 | ||
|
|
44a0a08991 | ||
|
|
6aa15ad7ab | ||
|
|
a689a1108c | ||
|
|
c31cae7b53 | ||
|
|
035d5dffb1 | ||
|
|
bf1f78b9f0 | ||
|
|
47be3b098e | ||
|
|
220061b13e | ||
|
|
1a8b2a700e | ||
|
|
ad7f611149 | ||
|
|
66f6c8c3fe | ||
|
|
30b750dcd0 | ||
|
|
371a663180 | ||
|
|
039b259e94 | ||
|
|
d3042cc401 | ||
|
|
bc822ffad8 | ||
|
|
742d35e08a | ||
|
|
e04e052889 | ||
|
|
ce4e780f53 | ||
|
|
ad940d3154 | ||
|
|
36c4b11bc6 | ||
|
|
f3eb44a94d | ||
|
|
9b94b9d1a1 | ||
|
|
de4b15e52e | ||
|
|
360554e41f | ||
|
|
4059e44b94 | ||
|
|
008d69e5e2 | ||
|
|
98cb95b7b7 | ||
|
|
04e6b743db | ||
|
|
8e01f3ad02 | ||
|
|
04b3bf6024 | ||
|
|
15433df97f | ||
|
|
ccd7d70586 | ||
|
|
2f80d69518 | ||
|
|
9dc6f10755 | ||
|
|
4aa057013c | ||
|
|
505d3da49b | ||
|
|
50f24ca0cb | ||
|
|
b2269be8db | ||
|
|
de37507b8e | ||
|
|
113c48f5da | ||
|
|
ab042c601f | ||
|
|
7d330d34f1 | ||
|
|
ea38873d30 | ||
|
|
b5b6ae32d2 | ||
|
|
e3be308329 | ||
|
|
af85c26514 | ||
|
|
b58735ea76 | ||
|
|
270674ce1b | ||
|
|
20dbc949d5 | ||
|
|
040d70c155 | ||
|
|
804576efd9 | ||
|
|
f39a0d585b | ||
|
|
071bd521bc | ||
|
|
9fe4b69c1a | ||
|
|
732d8865df | ||
|
|
5adfaa3986 | ||
|
|
04adafb753 | ||
|
|
3576a88369 | ||
|
|
927a7287b7 | ||
|
|
5bd6e9d790 | ||
|
|
4ef42b9215 | ||
|
|
cd3354756a | ||
|
|
651c20d4ef | ||
|
|
a16994ff7b | ||
|
|
0bacc69a4c | ||
|
|
2627f15348 | ||
|
|
9a26a01e2f | ||
|
|
07f9376f54 | ||
|
|
1cb5a48ed7 | ||
|
|
175b597ad2 | ||
|
|
4f2edacaaf | ||
|
|
34c79640e7 | ||
|
|
1d87958ead | ||
|
|
44d4e37ccb | ||
|
|
00dc525e5f | ||
|
|
d2c1027edc | ||
|
|
aeeaffa888 | ||
|
|
6d2959b393 | ||
|
|
3e5abdaf32 | ||
|
|
3839c8656e | ||
|
|
a512099313 | ||
|
|
9e4b9e9151 | ||
|
|
77bdc30650 | ||
|
|
0a108f9ef2 | ||
|
|
e33ebc7f0a | ||
|
|
c1cd3893bd | ||
|
|
0be5b7d66e | ||
|
|
23e2f27996 | ||
|
|
38f9a938e5 | ||
|
|
ab57f7d628 | ||
|
|
08df6a1f15 | ||
|
|
3341d36131 | ||
|
|
3752a81ec8 | ||
|
|
76879aa9c6 | ||
|
|
0f7b18a9c8 | ||
|
|
c82c50b2a2 | ||
|
|
af83d6ab25 | ||
|
|
1faed205df | ||
|
|
bac2e7fcad | ||
|
|
8c90f4c0a7 | ||
|
|
892d998587 | ||
|
|
be278bc564 | ||
|
|
1a681a434f | ||
|
|
0e4829ef0a | ||
|
|
c06fe155ef | ||
|
|
ac4603144d | ||
|
|
1b64fb2063 | ||
|
|
24f040da36 | ||
|
|
1b75b7de80 | ||
|
|
08304ada3c | ||
|
|
494f9667b4 | ||
|
|
2f5d4c633b | ||
|
|
b81f2f1f48 | ||
|
|
6341f8c077 | ||
|
|
319b4e71e1 | ||
|
|
a5b5712733 | ||
|
|
15999a9f21 | ||
|
|
6dec50a7e8 | ||
|
|
65455ff60b | ||
|
|
bb86779366 | ||
|
|
4862a00f6b | ||
|
|
9ac1ab372d | ||
|
|
7da56dfbf3 | ||
|
|
59dc384fbd | ||
|
|
66514251c1 | ||
|
|
ac93f38b16 | ||
|
|
0a94d85172 | ||
|
|
3f7cd1f204 | ||
|
|
afe76a97d5 | ||
|
|
600d82adf8 | ||
|
|
d191d2f4e2 | ||
|
|
47ceb80368 | ||
|
|
9ae8b32dee | ||
|
|
3d659eff6e | ||
|
|
6f29ba1991 | ||
|
|
0d5f6548a9 | ||
|
|
8c7fac8a2d | ||
|
|
6812f6f641 | ||
|
|
6508c5a38d | ||
|
|
1f233c8b99 | ||
|
|
a4b135316c | ||
|
|
9c415c4d52 | ||
|
|
08ded85a5c | ||
|
|
f76b6e7450 | ||
|
|
4cf3e6bfd8 | ||
|
|
79905b14b1 | ||
|
|
7e05213271 | ||
|
|
95730995b6 | ||
|
|
03642a01af | ||
|
|
2085fd32ff | ||
|
|
83d0318ea1 | ||
|
|
0228a5c767 | ||
|
|
b9ce3b435e | ||
|
|
6a2e3ca206 | ||
|
|
c563c3d15b | ||
|
|
96fadefaa3 | ||
|
|
6d8c81f694 | ||
|
|
2ff9f53a44 | ||
|
|
bb5e5b3826 | ||
|
|
462f806818 | ||
|
|
259662fe77 | ||
|
|
a2401333fa | ||
|
|
609819173e | ||
|
|
e3cb4df4ef | ||
|
|
52be8949e7 | ||
|
|
7450098458 | ||
|
|
54f7732c2b | ||
|
|
b03766fb79 | ||
|
|
120a0d116a | ||
|
|
99136026b8 | ||
|
|
e47b2bc8c3 | ||
|
|
bf22f82207 | ||
|
|
847a3baca8 | ||
|
|
268d870187 | ||
|
|
714b345bf5 | ||
|
|
191fe75c0f | ||
|
|
d36a55d2ac | ||
|
|
f3c2a17a30 | ||
|
|
65c461ed74 | ||
|
|
7e3d4f8c4f | ||
|
|
1dc79293a0 | ||
|
|
19be497143 | ||
|
|
2e8356ea40 | ||
|
|
c4985fb868 | ||
|
|
a5e03e234b | ||
|
|
0e770d1e3f | ||
|
|
b4d09cc9e4 | ||
|
|
81685b2ab3 | ||
|
|
c58aaca77e | ||
|
|
8e865fc569 | ||
|
|
90a774b922 | ||
|
|
d8510ea0c1 | ||
|
|
15d7ef7102 | ||
|
|
bdb8ef1d18 | ||
|
|
93fcbec20a | ||
|
|
822ec45b02 | ||
|
|
3802524153 | ||
|
|
5b3c33ac67 | ||
|
|
275079ce7f | ||
|
|
612c38cdc9 | ||
|
|
58adc04d69 | ||
|
|
692f753580 | ||
|
|
f3519016c7 | ||
|
|
e544a6afc5 | ||
|
|
59eb03151a | ||
|
|
d5b5059af5 | ||
|
|
3f505750ed | ||
|
|
3beee2cd93 | ||
|
|
b75ea9b069 | ||
|
|
1f2f808794 | ||
|
|
5f0d11e1e9 | ||
|
|
13d6b49ed8 | ||
|
|
601891ac2b | ||
|
|
88722a82ed | ||
|
|
61864c28d1 | ||
|
|
e05227a2ce | ||
|
|
f64bdedeac | ||
|
|
ed4bc1bf23 | ||
|
|
29f015cf61 | ||
|
|
1a16a4b628 | ||
|
|
74132fe7e1 | ||
|
|
54b49db321 | ||
|
|
f6dda95113 | ||
|
|
93b0516d5d | ||
|
|
c2780c9556 | ||
|
|
62bf2d07e7 | ||
|
|
b231ad70c8 | ||
|
|
c3e3459027 | ||
|
|
58a34f7c32 | ||
|
|
e9b8463d3d | ||
|
|
18db3dec42 | ||
|
|
6cbf57aa37 | ||
|
|
dc3843919e | ||
|
|
939c0a46a7 | ||
|
|
d3e0c4ce9c | ||
|
|
104ea2d56d | ||
|
|
554e988bea | ||
|
|
9d4872f612 | ||
|
|
fa36d28aff | ||
|
|
1cb7df63e7 | ||
|
|
74f1e6da4e | ||
|
|
b6fde85f33 | ||
|
|
ebf928a0e7 | ||
|
|
13cf783154 | ||
|
|
77826c0a39 | ||
|
|
8ec7512fec | ||
|
|
bcf99aa98e | ||
|
|
ce6aadbd2f | ||
|
|
cc3a8595a4 | ||
|
|
080b3b83eb | ||
|
|
a97932d8fc | ||
|
|
4159f6852e | ||
|
|
b08140dade | ||
|
|
039cb65753 | ||
|
|
b26516309a | ||
|
|
3eaf944203 | ||
|
|
fd28aad72d | ||
|
|
02293daa64 | ||
|
|
60728a487c | ||
|
|
b957788c32 | ||
|
|
840c3050e9 | ||
|
|
6bd9391f03 | ||
|
|
1ac381171e | ||
|
|
1c136aae13 | ||
|
|
441e4cd91b | ||
|
|
2f9cfb1178 | ||
|
|
76507eef63 | ||
|
|
0ef6d1dff5 | ||
|
|
6dd8443493 | ||
|
|
28f6cd5917 | ||
|
|
b0f7ebc26b | ||
|
|
6a9d0579ca | ||
|
|
0cf828153c | ||
|
|
d2e6339992 | ||
|
|
b24c0d21ee | ||
|
|
a2c35a6acb | ||
|
|
91ed3fc599 | ||
|
|
1f31afd855 | ||
|
|
09287ab1ac | ||
|
|
ed24927500 | ||
|
|
eb91535be5 | ||
|
|
ddb1d7a163 | ||
|
|
9f86d94580 | ||
|
|
5e83cb6ca5 | ||
|
|
72704aaba1 | ||
|
|
a040c56dd9 | ||
|
|
823d1d222f | ||
|
|
4071546506 | ||
|
|
2731d62234 | ||
|
|
eb6ef3c24d | ||
|
|
d29e5b72f0 | ||
|
|
56fcd54843 | ||
|
|
b938a4c5ed | ||
|
|
a777dcff82 | ||
|
|
832272da71 | ||
|
|
eaf3306e44 | ||
|
|
0264b050f6 | ||
|
|
da064f8060 | ||
|
|
318fab950a | ||
|
|
60b41575ea | ||
|
|
07cb35a9f3 | ||
|
|
26e37d13a7 | ||
|
|
b3e1ea0407 | ||
|
|
908e57638c | ||
|
|
a0d04ad0ae | ||
|
|
eddab115d8 | ||
|
|
2ebf5a261c | ||
|
|
a15b1ea09b | ||
|
|
227868034a | ||
|
|
7f877f6384 | ||
|
|
38e6f3665c | ||
|
|
463e377053 | ||
|
|
ca371c9536 | ||
|
|
1e1c724c0d | ||
|
|
a0ed53b986 | ||
|
|
188106be4d | ||
|
|
c37bd06081 | ||
|
|
d74e4f2237 | ||
|
|
5b86c4aa68 | ||
|
|
3153373e49 | ||
|
|
68e53065e0 | ||
|
|
05b3bc57ac | ||
|
|
7dad5d261a | ||
|
|
e9cc3da89c | ||
|
|
e513acab16 | ||
|
|
46fe7e303b | ||
|
|
ed9cbe252d | ||
|
|
31479a0d48 | ||
|
|
dde3b90050 | ||
|
|
76b76654d2 | ||
|
|
d5bd523869 | ||
|
|
0f7aeed416 | ||
|
|
42bad03de8 | ||
|
|
9efdaacc31 | ||
|
|
a2057ad440 | ||
|
|
a09720f2ee | ||
|
|
46cf294250 | ||
|
|
1e251e9471 | ||
|
|
6d98502550 | ||
|
|
36fb21dc2f | ||
|
|
35a7eff951 | ||
|
|
b61c88c693 | ||
|
|
fb6e7b06fb | ||
|
|
150d6cfea8 | ||
|
|
e83968799e | ||
|
|
adf1d4757b | ||
|
|
fad2cf51ba | ||
|
|
3930460af5 | ||
|
|
178e69a3b9 | ||
|
|
82f2a0e2e4 | ||
|
|
b76a215ff6 | ||
|
|
4c54fa2274 | ||
|
|
b883badc47 | ||
|
|
cab61f1515 | ||
|
|
8da07d1ae9 | ||
|
|
71cc95e4b1 | ||
|
|
95b8e9eaa3 | ||
|
|
9a0463165d | ||
|
|
43da9ff24e | ||
|
|
014095c4ab | ||
|
|
8c5430972f | ||
|
|
e13c481c7f | ||
|
|
c992521995 | ||
|
|
0cc7f3585f | ||
|
|
9768618bab | ||
|
|
1856ff8913 | ||
|
|
5b6f81de07 | ||
|
|
587505f14a | ||
|
|
17dd7dc38c | ||
|
|
be7771b2b9 | ||
|
|
80c75c9fa9 | ||
|
|
073e095e60 | ||
|
|
659aa08fbc | ||
|
|
168cdcf65d | ||
|
|
ad2afe0bf4 | ||
|
|
92d1c4a61a | ||
|
|
49bfbd3bc7 | ||
|
|
3d50f242c2 | ||
|
|
658fb7ac3e | ||
|
|
398a2b3c37 | ||
|
|
ca53ee2593 | ||
|
|
707462edc2 | ||
|
|
fe46f44bd1 | ||
|
|
382e5dc334 | ||
|
|
9651edd247 | ||
|
|
0dab181993 | ||
|
|
7345502884 | ||
|
|
0d2cc3b449 | ||
|
|
820f7227b7 | ||
|
|
e48410a466 | ||
|
|
dc54da232d | ||
|
|
cdf8cc5706 | ||
|
|
06d6234213 | ||
|
|
be6f74718e | ||
|
|
a726aca6de | ||
|
|
e686fb6bf6 | ||
|
|
e722efa65c | ||
|
|
ba59fe9503 | ||
|
|
25dcb1f717 | ||
|
|
a6cdce1404 | ||
|
|
b29d982a9c | ||
|
|
52e1bec7bc | ||
|
|
cc47d0aa61 | ||
|
|
45e0c6a181 | ||
|
|
46d287916c | ||
|
|
babaab2edb | ||
|
|
e93cd7ed3c | ||
|
|
d813a883c3 | ||
|
|
8a7ff65d98 | ||
|
|
560da25f46 | ||
|
|
5c70479bec | ||
|
|
25e0f4737b | ||
|
|
bef54e0a7e | ||
|
|
943f8df793 | ||
|
|
70165f56a4 | ||
|
|
a3443d0fd1 | ||
|
|
5b066096a4 | ||
|
|
611fda672f | ||
|
|
98d41015ca | ||
|
|
7ae3bea212 | ||
|
|
317bd88e33 | ||
|
|
0c0d485c37 | ||
|
|
bc8065facd | ||
|
|
eadcb08c3c | ||
|
|
957eb270f0 | ||
|
|
98cbf4660c | ||
|
|
5868c76ec6 | ||
|
|
2254cf5a24 | ||
|
|
14b7dd4090 | ||
|
|
b36738a55a | ||
|
|
a0a9595d8b | ||
|
|
c18080fef7 | ||
|
|
059329b346 | ||
|
|
b54a34786a | ||
|
|
53e4de6cf7 | ||
|
|
76e5da4d59 | ||
|
|
2a4596cfe4 | ||
|
|
e5c84ff282 | ||
|
|
905eb57ede | ||
|
|
009dd60ea3 | ||
|
|
0c56c3511a | ||
|
|
90ada6a314 | ||
|
|
37e5aec119 | ||
|
|
2bf4c06182 | ||
|
|
4765b3bdd8 | ||
|
|
e1f07cd05b | ||
|
|
079b60c6b9 | ||
|
|
91220287fc | ||
|
|
fc842d2b4b | ||
|
|
3b9367636e | ||
|
|
9253c29fd2 | ||
|
|
78825925a5 | ||
|
|
aebc856c44 | ||
|
|
d5414d7929 | ||
|
|
4016667300 | ||
|
|
e3138f8cba | ||
|
|
f37b72c0ee | ||
|
|
68e55bdf72 | ||
|
|
39670b0e57 | ||
|
|
3887904c16 | ||
|
|
ceda3089db | ||
|
|
a06585af49 | ||
|
|
8db994854f | ||
|
|
f0b37f161b | ||
|
|
e7aafcd61d | ||
|
|
311c9ab5ba | ||
|
|
d7b3692983 | ||
|
|
354033ecc7 | ||
|
|
5bb821771e | ||
|
|
3b9b4b2fdc | ||
|
|
2594f0b9b8 | ||
|
|
4f05f3f885 | ||
|
|
fde66512df | ||
|
|
cbdb4ba7ca | ||
|
|
b28137b093 | ||
|
|
a7830958e3 | ||
|
|
7553c132d3 | ||
|
|
e507405f5c | ||
|
|
8d388381ee | ||
|
|
6efcb818bc | ||
|
|
7f634155b5 | ||
|
|
58e284c017 | ||
|
|
82e43b2527 | ||
|
|
42d2a7411b | ||
|
|
2785fe5621 | ||
|
|
268ea904ec | ||
|
|
72446bb0dc | ||
|
|
c1eb104fa1 | ||
|
|
08784f18ea | ||
|
|
1a7f6af1bc | ||
|
|
def1d5a8c0 | ||
|
|
9ad39392db | ||
|
|
62a2354299 | ||
|
|
73e52d0690 | ||
|
|
b852688c05 | ||
|
|
8b002d881d | ||
|
|
12d93f11c0 | ||
|
|
a11993519a | ||
|
|
34fc33074a | ||
|
|
3cb0f002b3 | ||
|
|
19c29923a5 | ||
|
|
5efa545d48 | ||
|
|
d7bbb5c4a6 | ||
|
|
74b556d666 | ||
|
|
2d350addf7 | ||
|
|
478773c102 | ||
|
|
313758a57a | ||
|
|
5bbee05c7a | ||
|
|
46a67f4b31 | ||
|
|
fe152cdcc5 | ||
|
|
35af52dd4f | ||
|
|
60e2afe2d3 | ||
|
|
0de9bbd4f3 | ||
|
|
739e8e322d | ||
|
|
408bc486e0 | ||
|
|
0783dd69a5 | ||
|
|
7f49c9167a | ||
|
|
a9d14e1462 | ||
|
|
6ff66db553 | ||
|
|
9320f9c60a | ||
|
|
70e632d5ec | ||
|
|
6911667eb7 | ||
|
|
5d2740b524 | ||
|
|
066346ce9c | ||
|
|
f159234fe5 | ||
|
|
9687723c81 | ||
|
|
9921097bd9 | ||
|
|
3a416b9f67 | ||
|
|
f4cb2bfd92 | ||
|
|
1b16192363 | ||
|
|
04ae3fd603 | ||
|
|
b723b94614 | ||
|
|
87f0ff6c10 | ||
|
|
941643ece9 | ||
|
|
09e8b7ca4d | ||
|
|
c03a9bc9a2 | ||
|
|
0b5f5d54f6 | ||
|
|
3ed0849504 | ||
|
|
a8ffbb350d | ||
|
|
1b0a423f6f | ||
|
|
184b433630 | ||
|
|
7a937e0dde | ||
|
|
65344142d3 | ||
|
|
9cea1a5179 | ||
|
|
538e005813 | ||
|
|
1041efe027 | ||
|
|
ae9d5636f1 | ||
|
|
3a9f7648d2 | ||
|
|
223ca800cc | ||
|
|
a740f83da3 | ||
|
|
18c43241fb | ||
|
|
03f8e6ccd8 | ||
|
|
68b189ae8b | ||
|
|
9697772b1f | ||
|
|
c2d3ff3bf8 | ||
|
|
d84e4f1fd6 | ||
|
|
e0f46d0cb6 | ||
|
|
a3d14c6de5 | ||
|
|
a075c328e4 | ||
|
|
83a6527e44 | ||
|
|
9097c799f2 | ||
|
|
27dc913618 | ||
|
|
bdf672659c | ||
|
|
d2e0d0e06a | ||
|
|
c55e7d5a4a | ||
|
|
0bbdcdac5a | ||
|
|
32eb99e3e3 | ||
|
|
5d783f761f | ||
|
|
e34508cba2 | ||
|
|
d07d6bd123 | ||
|
|
0e07f5a7d7 | ||
|
|
b2db7a0c9a | ||
|
|
7fb48971ee | ||
|
|
806566519a | ||
|
|
0fd64dea3d | ||
|
|
b0739f4683 | ||
|
|
5fc5cb9f25 | ||
|
|
f8ab03fa04 | ||
|
|
05bf8dced5 | ||
|
|
bfcb340606 | ||
|
|
88f3861cb7 | ||
|
|
33d9178ebd | ||
|
|
e19d880581 | ||
|
|
b4615b163c | ||
|
|
f9b816b8f9 | ||
|
|
94a99ab9e5 | ||
|
|
04c6d13322 | ||
|
|
816d9483f0 | ||
|
|
efba976cfb | ||
|
|
6b0b851a7c | ||
|
|
ca46bba505 | ||
|
|
455d2e7cea | ||
|
|
b7d5172b89 | ||
|
|
1d7dee9ae4 | ||
|
|
e0a75ed00d | ||
|
|
ef8537ec1a | ||
|
|
d9bf934831 | ||
|
|
36f22938ed | ||
|
|
136450572e | ||
|
|
cdfe841d3d | ||
|
|
7c351405c4 | ||
|
|
0eb72d4e74 | ||
|
|
d1091364aa | ||
|
|
cd8be04b8a | ||
|
|
16f8c294b5 | ||
|
|
3487361a39 | ||
|
|
3850f28ed8 | ||
|
|
82dfec76c6 | ||
|
|
64365fb908 | ||
|
|
3a6249d0c7 | ||
|
|
ac8d42087a | ||
|
|
cdb379e5b4 | ||
|
|
64957a1770 | ||
|
|
62060fc278 | ||
|
|
89a33e69a7 | ||
|
|
51a5e9ca3c | ||
|
|
52ea4802f1 | ||
|
|
dd4e04d6f5 | ||
|
|
0ffbbc821a | ||
|
|
a5b81d97f9 | ||
|
|
76a8557d0c | ||
|
|
6c1f8e1dc2 | ||
|
|
29b0912bc3 | ||
|
|
10ca487305 | ||
|
|
a6678d2e58 | ||
|
|
f67e608861 | ||
|
|
a62b24f573 | ||
|
|
84fc4850a6 | ||
|
|
343ecd806b | ||
|
|
8eb7c3efb1 | ||
|
|
0ffa6b75fd | ||
|
|
fe514a2e55 | ||
|
|
1c651455a7 | ||
|
|
1cca0e48e0 | ||
|
|
50ed53076f | ||
|
|
c2efd224ca | ||
|
|
9292b4002d | ||
|
|
64aee56add | ||
|
|
7b870e70d0 | ||
|
|
4c4271f283 | ||
|
|
59684e10d1 | ||
|
|
343f7603e7 | ||
|
|
05c26d8b65 | ||
|
|
6405d75070 | ||
|
|
6b7a466f74 | ||
|
|
67fd181eb8 | ||
|
|
d8539a51ef | ||
|
|
ccd2a16c58 | ||
|
|
9fb91b4e9c | ||
|
|
25642dd303 | ||
|
|
a40ef7e41d | ||
|
|
2b42382e7e | ||
|
|
7ac64b81ee | ||
|
|
8523e37f7e | ||
|
|
cceee2c638 | ||
|
|
378aef32ab | ||
|
|
e53ae5ae63 | ||
|
|
1a40b7931a | ||
|
|
6351f95bc1 | ||
|
|
9ba424ee57 | ||
|
|
9743ec80f1 | ||
|
|
951cda8d1f | ||
|
|
5fff119dde | ||
|
|
76b1119f61 | ||
|
|
f5a728af03 | ||
|
|
edc4ffe54b | ||
|
|
b317d0ee39 | ||
|
|
e18d66174a | ||
|
|
3aa216ecdf | ||
|
|
c1016d5de2 | ||
|
|
e3aae42d33 | ||
|
|
0d1e636aba | ||
|
|
59f28e56a2 | ||
|
|
1d687b3525 | ||
|
|
185f372127 | ||
|
|
c4d01f8c8b | ||
|
|
ba26538cef | ||
|
|
843a86214e | ||
|
|
ec5ccb8de3 | ||
|
|
08b90285b2 | ||
|
|
e9adf7bbe1 | ||
|
|
722a18d31e | ||
|
|
b73460b366 | ||
|
|
5aed2164ea | ||
|
|
3d36ef14b3 | ||
|
|
4895a19dd1 | ||
|
|
3a0a3d21d0 | ||
|
|
3cf922b3d1 | ||
|
|
93831d4ed2 | ||
|
|
f11d4628c1 | ||
|
|
8ace920733 | ||
|
|
5ad5aa49ce | ||
|
|
86722cb038 | ||
|
|
502d45955f | ||
|
|
592b9a9571 | ||
|
|
2883bccf48 | ||
|
|
469c13a86d | ||
|
|
cd9b2bb97f | ||
|
|
2163dec6c4 | ||
|
|
0b7a47665f | ||
|
|
80d280263a | ||
|
|
a899004d4e | ||
|
|
c976be69c3 | ||
|
|
5ac755681f | ||
|
|
704749a094 | ||
|
|
1a0755008d | ||
|
|
00e15ff4e6 | ||
|
|
81597d9f8f | ||
|
|
a8edd11d7a | ||
|
|
600319b68a | ||
|
|
df182ea6e0 | ||
|
|
342edb4c6d | ||
|
|
14ae7cf769 | ||
|
|
0efacb3eed | ||
|
|
90e8a0a3db | ||
|
|
e70d76d741 | ||
|
|
31041d406a | ||
|
|
2d8bea8c1d | ||
|
|
cbfcae7746 | ||
|
|
c7b1b1bb74 | ||
|
|
e5099daae2 | ||
|
|
352e460529 | ||
|
|
4e55421171 | ||
|
|
1a35219f01 | ||
|
|
09912cc509 | ||
|
|
bbcb3b638b | ||
|
|
57fbf93ef9 | ||
|
|
765a5b858b | ||
|
|
eee32495a1 | ||
|
|
f0f7070cb5 | ||
|
|
bcf3ae8245 | ||
|
|
47c30dbc16 | ||
|
|
e3673d4677 | ||
|
|
1ad4834807 | ||
|
|
0c7e01fa32 | ||
|
|
d8d8424db9 | ||
|
|
6b5fc175a1 | ||
|
|
1ba7cf7dd6 | ||
|
|
91d204780d | ||
|
|
8e21a2a1e4 | ||
|
|
ac088b4631 | ||
|
|
59521b0389 | ||
|
|
d945999862 | ||
|
|
0d09d682a4 | ||
|
|
306eeb0861 | ||
|
|
61b03fbfa6 | ||
|
|
78a0baa57c | ||
|
|
c7ae195a03 | ||
|
|
f8f698465d | ||
|
|
d041941e64 | ||
|
|
d80f55e7e9 | ||
|
|
392b75d158 | ||
|
|
d19f5f6830 | ||
|
|
efa570126b | ||
|
|
1c6ca09b02 | ||
|
|
1feb24e561 | ||
|
|
7cc1371059 | ||
|
|
642041adbc | ||
|
|
93032c637b | ||
|
|
48569d9da0 | ||
|
|
71b06ed298 | ||
|
|
74b3243f8c | ||
|
|
6a905b6546 | ||
|
|
5a665c39c9 | ||
|
|
0bc7cc4d28 | ||
|
|
7b8c373494 | ||
|
|
8da1ee7833 | ||
|
|
bc3ed7bdb4 | ||
|
|
85d07da475 | ||
|
|
db8757ad12 | ||
|
|
da1abd18db | ||
|
|
e8dfd8ce54 | ||
|
|
ec1c111c6c | ||
|
|
4b6e75dc72 | ||
|
|
df82d9a4b5 | ||
|
|
f08b5a8006 | ||
|
|
f51088e261 | ||
|
|
25cd1774a7 | ||
|
|
efcb6bd20e | ||
|
|
fc728278c2 | ||
|
|
d185fe9953 | ||
|
|
4d487927ad | ||
|
|
05d6a66330 | ||
|
|
f6f97ea24b | ||
|
|
a4d318c92c | ||
|
|
1b45bf2d58 | ||
|
|
12f8b52fb8 | ||
|
|
430f8020fd | ||
|
|
078c027441 | ||
|
|
124caec26c | ||
|
|
f04a7e5cb4 | ||
|
|
9735678c26 | ||
|
|
25c70b3bc3 | ||
|
|
aeb2f9492e | ||
|
|
07156dd25b | ||
|
|
b09a8ee657 | ||
|
|
59563a4ca9 | ||
|
|
455eaca215 | ||
|
|
d0f5c5c6bb | ||
|
|
50bca089c4 | ||
|
|
2ec33aa077 | ||
|
|
f64a255a3a | ||
|
|
c6c1f9bad9 | ||
|
|
3efd000036 | ||
|
|
3cc1fdf2b6 | ||
|
|
d295762f4c | ||
|
|
46963fc14f | ||
|
|
5f03df7d25 | ||
|
|
d5cd165965 | ||
|
|
dc6d76f518 | ||
|
|
474ce89ebc | ||
|
|
c7fd570e65 | ||
|
|
d37985cd70 | ||
|
|
ed18906c08 | ||
|
|
cc05419e1a | ||
|
|
941bb3bcb8 | ||
|
|
d983fa6ca3 | ||
|
|
7bd2cd0bf8 | ||
|
|
b0d709cc23 | ||
|
|
919027a90e | ||
|
|
23709c830e | ||
|
|
346d09e7aa | ||
|
|
0278846eaa | ||
|
|
7bce9a9158 | ||
|
|
4c7d85b636 | ||
|
|
4694da31f8 | ||
|
|
b98e863f57 | ||
|
|
3602186430 | ||
|
|
e969c158d8 | ||
|
|
a62a0e5282 | ||
|
|
1cc71b41de | ||
|
|
165fa2450c | ||
|
|
416f4ed7ae | ||
|
|
aadc7c7ca8 | ||
|
|
b812e8baff | ||
|
|
e0ccd77617 | ||
|
|
b18e006b55 | ||
|
|
5dca7ec6b7 | ||
|
|
8cd9241448 | ||
|
|
d34f732b99 | ||
|
|
4a09f31eff | ||
|
|
a46f4bfa95 | ||
|
|
45258a1799 | ||
|
|
99a6b6b848 | ||
|
|
77041dc4ec | ||
|
|
c73934d8c8 | ||
|
|
116fe806c3 | ||
|
|
15464b36c3 | ||
|
|
68e0e49bc8 | ||
|
|
7a608f40fc | ||
|
|
ea36a53b75 | ||
|
|
447d6499f1 | ||
|
|
83a1d70f0f | ||
|
|
0c58055bac | ||
|
|
048c5c0ddd | ||
|
|
fc9389c164 | ||
|
|
ed00873148 | ||
|
|
a6b990f74a | ||
|
|
2e4783411e | ||
|
|
76d534986b | ||
|
|
512644de06 | ||
|
|
965404dd98 | ||
|
|
acafdb3f60 | ||
|
|
ff34c4cdf8 | ||
|
|
59af1c2af4 | ||
|
|
a309046028 | ||
|
|
fe2a82031f | ||
|
|
746d28d110 | ||
|
|
f541970b31 | ||
|
|
553ea1e891 | ||
|
|
c09b0a7793 | ||
|
|
21d5f88f40 | ||
|
|
218d0f71cf | ||
|
|
cd76575df1 | ||
|
|
62b7404bd9 | ||
|
|
f82e44cc40 | ||
|
|
a21c4fb0a6 | ||
|
|
934b8a9849 | ||
|
|
9a69bb807b | ||
|
|
61940fe4ce | ||
|
|
a76f0f78ad | ||
|
|
cf22d4440a | ||
|
|
80b8644499 | ||
|
|
3ae56fdf10 | ||
|
|
487070cc09 | ||
|
|
6570425dc4 | ||
|
|
5532b27d22 | ||
|
|
fb56759d08 | ||
|
|
ea56776ef5 | ||
|
|
73ddea766a | ||
|
|
c6b22388b7 | ||
|
|
15fcf27414 | ||
|
|
2718bcd0c7 | ||
|
|
0386b7d0c3 | ||
|
|
3790e58090 | ||
|
|
cc25927f2d | ||
|
|
13af7bb9ad | ||
|
|
e08f25a942 | ||
|
|
25b2118bb4 | ||
|
|
961c1d6a66 | ||
|
|
6af855fd97 | ||
|
|
fc806b6706 | ||
|
|
15c3d76a49 | ||
|
|
bf41f548e1 | ||
|
|
8d84cf5a3b | ||
|
|
6c9d6507da | ||
|
|
f1ef83b02e | ||
|
|
c8b1f966cb | ||
|
|
990a11e421 | ||
|
|
5700a934bb | ||
|
|
aba017fa70 | ||
|
|
35f4df51d4 | ||
|
|
6d44ff7d93 | ||
|
|
8cb3cc01f1 | ||
|
|
931af1260c | ||
|
|
b31bea8a99 | ||
|
|
8fdf2925d1 | ||
|
|
75849a5ca0 | ||
|
|
16df851efd | ||
|
|
4b4633d976 | ||
|
|
6a4e93bbc9 | ||
|
|
2bc8691156 | ||
|
|
de7ea8db92 | ||
|
|
83a9afaff1 | ||
|
|
53b2368d49 | ||
|
|
916f00acc1 | ||
|
|
b7439a8ae3 | ||
|
|
6df2370120 | ||
|
|
87396af743 | ||
|
|
a8a9fb95e1 | ||
|
|
af15605bab | ||
|
|
8cb7635372 | ||
|
|
b0e1ee4b3b | ||
|
|
7f8d785086 | ||
|
|
253ccad50a | ||
|
|
98e6be7cc2 | ||
|
|
6b6c5bd622 | ||
|
|
fee15cac0c | ||
|
|
ccc699600f | ||
|
|
6ac3892e16 | ||
|
|
c90e523e0a | ||
|
|
800f133a29 | ||
|
|
45cace2867 | ||
|
|
8fdbb29079 | ||
|
|
fa3d79c2f8 | ||
|
|
c17ed6a5e5 | ||
|
|
9e9f110d05 | ||
|
|
211e529373 | ||
|
|
bfa3ad9108 | ||
|
|
6e580b3847 | ||
|
|
92d854f5e1 | ||
|
|
0861f3f796 | ||
|
|
7056b96854 | ||
|
|
a45889dc5e | ||
|
|
5ddbcb7a51 | ||
|
|
bb7a8f643f | ||
|
|
2df18266b9 | ||
|
|
d0a672292f | ||
|
|
536e062a56 | ||
|
|
195c45a0e1 | ||
|
|
30bc2b7ca1 | ||
|
|
49002194fb | ||
|
|
c4f835b3a7 | ||
|
|
7436ef236e | ||
|
|
231a8408b2 | ||
|
|
8f8ff52cae | ||
|
|
83a458c5f7 | ||
|
|
5146474954 | ||
|
|
097720cce5 | ||
|
|
a14490dd16 | ||
|
|
deddbe5a85 | ||
|
|
f613d43f26 | ||
|
|
870e67d520 | ||
|
|
2d3c928f0b | ||
|
|
faf4d7ccb7 | ||
|
|
09510a15a1 | ||
|
|
086124845f | ||
|
|
985061ac28 | ||
|
|
0a38584c10 | ||
|
|
d3d29a4f82 | ||
|
|
5c76194ae9 | ||
|
|
9bac33fbc6 | ||
|
|
97b948a9b2 | ||
|
|
6b911624f2 | ||
|
|
59e3ebb4a5 | ||
|
|
65b23ca67a | ||
|
|
f4f094021c | ||
|
|
6a91c73dda | ||
|
|
ed31b661d3 | ||
|
|
3dcd1c1ab0 | ||
|
|
11ba454f39 | ||
|
|
fc1b24e4e8 | ||
|
|
e2353cc324 | ||
|
|
dfe381ae08 | ||
|
|
4d2b0b53b4 | ||
|
|
0853b33004 | ||
|
|
d308558d4f | ||
|
|
d42f541dc3 | ||
|
|
1d5ec8f363 | ||
|
|
d7b097f117 | ||
|
|
eeb4b15f06 | ||
|
|
ed05d57603 | ||
|
|
c782d0e486 | ||
|
|
db2d4e8f5a | ||
|
|
f243b281ea | ||
|
|
50e18e29e3 | ||
|
|
a6cf325152 | ||
|
|
584e983c38 | ||
|
|
c5bb023584 | ||
|
|
485194c1a7 | ||
|
|
3d1b1a6bc9 | ||
|
|
e58423796e | ||
|
|
8170244a81 | ||
|
|
28e219f038 | ||
|
|
2e09a58f64 | ||
|
|
6d137a3616 | ||
|
|
b02e4d4aba | ||
|
|
459da4aa11 | ||
|
|
7e20cf75f9 | ||
|
|
5fff0506f9 | ||
|
|
151b6f1402 | ||
|
|
4d75aef609 | ||
|
|
8384f7ff28 | ||
|
|
1c27ce30b4 | ||
|
|
aee74901f7 | ||
|
|
9d5f388498 | ||
|
|
9a7f519aee | ||
|
|
507816d550 | ||
|
|
0db1be28c7 | ||
|
|
b94314a0d9 | ||
|
|
9a88048a05 | ||
|
|
1b59097077 | ||
|
|
9cadf1a004 | ||
|
|
dd016c34dd | ||
|
|
a351ebd40b | ||
|
|
e1b8e91e80 | ||
|
|
4365c2b745 | ||
|
|
62d1de37e2 | ||
|
|
bcbe46b0b3 | ||
|
|
2bfc64ad1f | ||
|
|
7d1eb8f07c | ||
|
|
827c8865d8 | ||
|
|
d9fc44540e | ||
|
|
f1e1cb7055 | ||
|
|
eec7750e55 | ||
|
|
f7cb0f760f | ||
|
|
99d6bea20d | ||
|
|
06b49fa3f7 | ||
|
|
10874e0291 | ||
|
|
a809ff0e3f | ||
|
|
b5678a43cc | ||
|
|
a180444c6f | ||
|
|
5fc89b6e72 | ||
|
|
1314ca87c1 | ||
|
|
26a18414f6 | ||
|
|
56b7960496 | ||
|
|
563ce12127 | ||
|
|
d347d2ebf9 | ||
|
|
3dc78e76e4 | ||
|
|
453f6cf4d9 | ||
|
|
f2cd6d6a10 | ||
|
|
0366f6bf45 | ||
|
|
ddbc7ed0a1 | ||
|
|
7e862f91dc | ||
|
|
47cc808b98 | ||
|
|
1933fe39ae | ||
|
|
5ce3d0d8e5 | ||
|
|
334df28eca | ||
|
|
512cc3ebf2 | ||
|
|
8752e02e66 | ||
|
|
5f67125ba6 | ||
|
|
f6ad22fce5 | ||
|
|
a1114948b0 | ||
|
|
ccb6d0e572 | ||
|
|
9c99008aff | ||
|
|
01cfedf2c9 | ||
|
|
ed538ea5e0 | ||
|
|
82dc495ca0 | ||
|
|
19257f4fb7 | ||
|
|
22532ff30e | ||
|
|
f7a65b7fff | ||
|
|
f39a71cafe | ||
|
|
b5775c831d | ||
|
|
f822eed55c | ||
|
|
5793b0633a | ||
|
|
44ae643b2b | ||
|
|
04ad75e788 | ||
|
|
1adecc8e3a | ||
|
|
00f223e22f | ||
|
|
30aa1b0689 | ||
|
|
d42bfef8a4 | ||
|
|
567692e4ae | ||
|
|
5e5880d4f1 | ||
|
|
1f698a35f2 | ||
|
|
f3e027c001 | ||
|
|
ad7dafb138 | ||
|
|
0b20eafb30 | ||
|
|
d0c6eef9a5 | ||
|
|
0ec39a0b70 | ||
|
|
5a57b9f8ec | ||
|
|
4d10ebba12 | ||
|
|
bfd2e96120 | ||
|
|
7467cd2ee5 | ||
|
|
231d9a01d9 | ||
|
|
116aee4950 | ||
|
|
0082c69496 | ||
|
|
6212aea580 | ||
|
|
4eeb61299f | ||
|
|
3476724641 | ||
|
|
697fb9e41b | ||
|
|
ead83e6b63 | ||
|
|
5a5e4bbfee | ||
|
|
fc02d9872e | ||
|
|
d285fd6dce | ||
|
|
8a616df8b5 | ||
|
|
f77016b935 | ||
|
|
a5a46ff8e5 | ||
|
|
1dd60a35d1 | ||
|
|
c9f5004bae | ||
|
|
85d5048ce2 | ||
|
|
5ff2d7baaa | ||
|
|
7048684ca7 | ||
|
|
67cf35ee22 | ||
|
|
83f7ee14da | ||
|
|
cc8715d844 | ||
|
|
2bc4308d86 | ||
|
|
87805d9207 | ||
|
|
5f1636b2d5 | ||
|
|
ebdb70fe9e | ||
|
|
6be46f8ebb | ||
|
|
8c5531b629 | ||
|
|
e509368fa1 | ||
|
|
098b48b7db | ||
|
|
54e2c6fe3e | ||
|
|
e11ab6a46c | ||
|
|
eb7c80a308 | ||
|
|
d77c52b255 | ||
|
|
307b376a9b | ||
|
|
d882d528bb | ||
|
|
f930d4661a | ||
|
|
b35032dc01 | ||
|
|
b8f8dea9c2 | ||
|
|
eb003a7382 | ||
|
|
c4f25e5126 | ||
|
|
913a0ff0a8 | ||
|
|
c659b637ce | ||
|
|
0d22ad6400 | ||
|
|
60fae77974 | ||
|
|
ffe5e84644 | ||
|
|
b0245c2b54 | ||
|
|
b8f2b3264c | ||
|
|
7fc31eadf3 | ||
|
|
d1b506597f | ||
|
|
c01e986cc9 | ||
|
|
9a6038fbf3 | ||
|
|
27ef185bae | ||
|
|
7753422909 | ||
|
|
d743518243 | ||
|
|
3059f593ab | ||
|
|
7afa57a37e | ||
|
|
6694402d3d | ||
|
|
643f5b5350 | ||
|
|
cb1632e8e3 | ||
|
|
40173c5042 | ||
|
|
b5897fe4ed | ||
|
|
ca85500615 | ||
|
|
d01f67193f | ||
|
|
5110de6c1f | ||
|
|
32d496507b | ||
|
|
23d6a788b4 | ||
|
|
7dc952ec20 | ||
|
|
81353a56f9 | ||
|
|
f0ba0dc6dc | ||
|
|
b6783320ca | ||
|
|
fe533725ae | ||
|
|
f37149b1c5 | ||
|
|
edb6783a21 | ||
|
|
398ce2948c | ||
|
|
75a8b7fa83 | ||
|
|
b66c680885 | ||
|
|
ed28a27490 | ||
|
|
901029355f | ||
|
|
e04080bd0f | ||
|
|
618bacec2e | ||
|
|
36af90acc0 | ||
|
|
da6daad2e5 | ||
|
|
1bfcf768f5 | ||
|
|
833a3897dc | ||
|
|
14c0c19539 | ||
|
|
d7136cd430 | ||
|
|
e4f4e8eda1 | ||
|
|
f711ce40ba | ||
|
|
f476138133 | ||
|
|
8e5af26326 | ||
|
|
2309ac529c | ||
|
|
4df99aa7ae | ||
|
|
0a73d5b7b1 | ||
|
|
c182379f32 | ||
|
|
ad09813035 | ||
|
|
2ea157fee1 | ||
|
|
72c7b49b0a | ||
|
|
3dd1fd2964 | ||
|
|
3bbc499f06 | ||
|
|
0e4b718a25 | ||
|
|
740e70ba17 | ||
|
|
e6304dcaad | ||
|
|
6c16f55fde | ||
|
|
123febeb98 | ||
|
|
9efd3d7f20 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,6 +1,7 @@
|
||||
/build/
|
||||
/dist/
|
||||
/.idea/
|
||||
/.vscode/
|
||||
nbproject/private/
|
||||
/webrev
|
||||
/.src-rev
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
^build/
|
||||
^dist/
|
||||
^.idea/
|
||||
^.vscode/
|
||||
nbproject/private/
|
||||
^webrev
|
||||
^.src-rev$
|
||||
|
||||
33
.hgtags
33
.hgtags
@@ -626,3 +626,36 @@ b2dd4028a6de4e40dda8b76109e4b5c6b294f980 jdk-15+11
|
||||
1d6ceb13e142665ea833fca01c8c8598e0ddd211 jdk-15+14
|
||||
bc54620a3848c26cff9766e5e2a6e5ddab98ed18 jdk-14-ga
|
||||
82b7c62cf4cc56828a8fb724f57087967232a2a7 jdk-15+15
|
||||
5c7ec21f5d13f6eb5cd32288c69b8be2f9cac256 jdk-15+16
|
||||
dd5198db2e5b1ebcafe065d987c03ba9fcb50fc3 jdk-15+17
|
||||
44aef192b488a48cce12422394691a6b1d16b98e jdk-15+18
|
||||
7cc27caabe6e342151e8baf549beb07a9c755ec2 jdk-15+19
|
||||
46bca5e5e6fb26efd07245d26fe96a9c3260f51e jdk-15+20
|
||||
12b55fad80f30d24b1f8fdb3b947ea6465ef9518 jdk-15+21
|
||||
7223c6d610343fd8323af9d07d501e01fa1a7696 jdk-15+22
|
||||
f143729ca00ec14a98ea5c7f73acba88da97746e jdk-15+23
|
||||
497fd9f9129c4928fd5a876dd55e0daf6298b511 jdk-15+24
|
||||
90b266a84c06f1b3dc0ed8767856793e8c1c357e jdk-15+25
|
||||
0a32396f7a690015d22ca3328ac441a358295d90 jdk-15+26
|
||||
93813843680bbe1b7efbca56c03fd137f20a2c31 jdk-16+0
|
||||
93813843680bbe1b7efbca56c03fd137f20a2c31 jdk-15+27
|
||||
4a485c89d5a08b495961835f5308a96038678aeb jdk-16+1
|
||||
06c9f89459daba98395fad726100feb44f89ba71 jdk-15+28
|
||||
bcbe7b8a77b8971bc221c0be1bd2abb6fb68c2d0 jdk-16+2
|
||||
b58fc60580550a4a587cab729d8fd87223ad6932 jdk-15+29
|
||||
76810b3a88c8c641ae3850a8dfd7c40c984aea9d jdk-16+3
|
||||
6909e4a1f25bfe9a2727026f5845fc1fc44a36aa jdk-15+30
|
||||
e2622818f0bd30e736252eba101fe7d2c27f400b jdk-16+4
|
||||
a32f58c6b8be81877411767de7ba9c4cf087c1b5 jdk-15+31
|
||||
143e258f64af490010eb7e0bacc1cfaeceff0993 jdk-16+5
|
||||
2dad000726b8d5db9f3df647fb4949d88f269dd4 jdk-15+32
|
||||
4a8fd81d64bafa523cddb45f82805536edace106 jdk-16+6
|
||||
6b65f4e7a975628df51ef755b02642075390041d jdk-15+33
|
||||
c3a4a7ea7c304cabdacdc31741eb94c51351668d jdk-16+7
|
||||
b0817631d2f4395508cb10e81c3858a94d9ae4de jdk-15+34
|
||||
0a73d6f3aab48ff6d7e61e47f0bc2d87a054f217 jdk-16+8
|
||||
fd60c3146a024037cdd9be34c645bb793995a7cc jdk-15+35
|
||||
c075a286cc7df767cce28e8057d6ec5051786490 jdk-16+9
|
||||
b01985b4f88f554f97901e53e1ba314681dd9c19 jdk-16+10
|
||||
e3f940bd3c8fcdf4ca704c6eb1ac745d155859d5 jdk-15+36
|
||||
5c18d696c7ce724ca36df13933aa53f50e12b9e0 jdk-16+11
|
||||
|
||||
38
.jcheck/conf
38
.jcheck/conf
@@ -1,36 +1,2 @@
|
||||
;
|
||||
; Copyright (c) 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
|
||||
; under the terms of the GNU General Public License version 2 only, as
|
||||
; published by the Free Software Foundation.
|
||||
;
|
||||
; This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
; version 2 for more details (a copy is included in the LICENSE file that
|
||||
; accompanied this code).
|
||||
;
|
||||
; You should have received a copy of the GNU General Public License version
|
||||
; 2 along with this work; if not, write to the Free Software Foundation,
|
||||
; Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
;
|
||||
; Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
; or visit www.oracle.com if you need additional information or have any
|
||||
; questions.
|
||||
;
|
||||
|
||||
[general]
|
||||
project=lanai
|
||||
jbs=JDK
|
||||
|
||||
[checks]
|
||||
error=author,whitespace,executable
|
||||
|
||||
[census]
|
||||
version=0
|
||||
domain=openjdk.org
|
||||
|
||||
[checks "whitespace"]
|
||||
files=.*\.java$|.*\.c$|.*\.h$|.*\.cpp$|.*\.hpp$
|
||||
project=jdk
|
||||
bugids=dup
|
||||
|
||||
8
README
8
README
@@ -2,11 +2,11 @@
|
||||
Welcome to the JDK!
|
||||
===================
|
||||
|
||||
For information about building the JDK, including how to retrieve all
|
||||
of the source code, please see either of these files:
|
||||
For build instructions, please see either of these files:
|
||||
|
||||
* doc/building.html (html version)
|
||||
* doc/building.md (markdown version)
|
||||
|
||||
See http://openjdk.java.net/ for more information about the OpenJDK
|
||||
Community and the JDK.
|
||||
See https://openjdk.java.net/ for more information about
|
||||
the OpenJDK Community and the JDK.
|
||||
|
||||
|
||||
60
bin/idea.sh
60
bin/idea.sh
@@ -74,7 +74,7 @@ if [ "x$TOPLEVEL_DIR" = "x" ] ; then
|
||||
fi
|
||||
|
||||
MAKE_DIR="$SCRIPT_DIR/../make"
|
||||
IDEA_MAKE="$MAKE_DIR/idea"
|
||||
IDEA_MAKE="$MAKE_DIR/ide/idea/jdk"
|
||||
IDEA_TEMPLATE="$IDEA_MAKE/template"
|
||||
|
||||
cp -r "$IDEA_TEMPLATE"/* "$IDEA_OUTPUT"
|
||||
@@ -147,13 +147,7 @@ add_replacement() {
|
||||
add_replacement "###MODULE_NAMES###" "$MODULE_NAMES"
|
||||
add_replacement "###VCS_TYPE###" "$VCS_TYPE"
|
||||
SPEC_DIR=`dirname $SPEC`
|
||||
if [ "x$CYGPATH" = "x" ]; then
|
||||
add_replacement "###BUILD_DIR###" "$SPEC_DIR"
|
||||
add_replacement "###JTREG_HOME###" "$JT_HOME"
|
||||
add_replacement "###IMAGES_DIR###" "$SPEC_DIR/images/jdk"
|
||||
add_replacement "###ROOT_DIR###" "$TOPLEVEL_DIR"
|
||||
add_replacement "###IDEA_DIR###" "$IDEA_OUTPUT"
|
||||
else
|
||||
if [ "x$CYGPATH" != "x" ]; then
|
||||
add_replacement "###BUILD_DIR###" "`cygpath -am $SPEC_DIR`"
|
||||
add_replacement "###IMAGES_DIR###" "`cygpath -am $SPEC_DIR`/images/jdk"
|
||||
add_replacement "###ROOT_DIR###" "`cygpath -am $TOPLEVEL_DIR`"
|
||||
@@ -163,6 +157,22 @@ else
|
||||
else
|
||||
add_replacement "###JTREG_HOME###" "`cygpath -am $JT_HOME`"
|
||||
fi
|
||||
elif [ "x$WSL_DISTRO_NAME" != "x" ]; then
|
||||
add_replacement "###BUILD_DIR###" "`wslpath -am $SPEC_DIR`"
|
||||
add_replacement "###IMAGES_DIR###" "`wslpath -am $SPEC_DIR`/images/jdk"
|
||||
add_replacement "###ROOT_DIR###" "`wslpath -am $TOPLEVEL_DIR`"
|
||||
add_replacement "###IDEA_DIR###" "`wslpath -am $IDEA_OUTPUT`"
|
||||
if [ "x$JT_HOME" = "x" ]; then
|
||||
add_replacement "###JTREG_HOME###" ""
|
||||
else
|
||||
add_replacement "###JTREG_HOME###" "`wslpath -am $JT_HOME`"
|
||||
fi
|
||||
else
|
||||
add_replacement "###BUILD_DIR###" "$SPEC_DIR"
|
||||
add_replacement "###JTREG_HOME###" "$JT_HOME"
|
||||
add_replacement "###IMAGES_DIR###" "$SPEC_DIR/images/jdk"
|
||||
add_replacement "###ROOT_DIR###" "$TOPLEVEL_DIR"
|
||||
add_replacement "###IDEA_DIR###" "$IDEA_OUTPUT"
|
||||
fi
|
||||
|
||||
SOURCE_PREFIX="<sourceFolder url=\"file://"
|
||||
@@ -170,7 +180,9 @@ SOURCE_POSTFIX="\" isTestSource=\"false\" />"
|
||||
|
||||
for root in $MODULE_ROOTS; do
|
||||
if [ "x$CYGPATH" != "x" ]; then
|
||||
root=`cygpath -am $root`
|
||||
root=`cygpath -am $root`
|
||||
elif [ "x$WSL_DISTRO_NAME" != "x" ]; then
|
||||
root=`wslpath -am $root`
|
||||
fi
|
||||
SOURCES=$SOURCES" $SOURCE_PREFIX""$root""$SOURCE_POSTFIX"
|
||||
done
|
||||
@@ -196,14 +208,30 @@ fi
|
||||
CP=$ANT_HOME/lib/ant.jar
|
||||
rm -rf $CLASSES; mkdir $CLASSES
|
||||
|
||||
if [ "x$CYGPATH" = "x" ] ; then ## CYGPATH may be set in env.cfg
|
||||
JAVAC_SOURCE_FILE=$IDEA_OUTPUT/src/idea/JdkIdeaAntLogger.java
|
||||
JAVAC_CLASSES=$CLASSES
|
||||
JAVAC_CP=$CP
|
||||
else
|
||||
JAVAC_SOURCE_FILE=`cygpath -am $IDEA_OUTPUT/src/idea/JdkIdeaAntLogger.java`
|
||||
if [ "x$CYGPATH" != "x" ] ; then ## CYGPATH may be set in env.cfg
|
||||
JAVAC_SOURCE_FILE=`cygpath -am $IDEA_OUTPUT/src/idea/IdeaLoggerWrapper.java`
|
||||
JAVAC_SOURCE_PATH=`cygpath -am $IDEA_OUTPUT/src`
|
||||
JAVAC_CLASSES=`cygpath -am $CLASSES`
|
||||
JAVAC_CP=`cygpath -am $CP`
|
||||
JAVAC=javac
|
||||
elif [ "x$WSL_DISTRO_NAME" != "x" ]; then
|
||||
JAVAC_SOURCE_FILE=`realpath --relative-to=./ $IDEA_OUTPUT/src/idea/IdeaLoggerWrapper.java`
|
||||
JAVAC_SOURCE_PATH=`realpath --relative-to=./ $IDEA_OUTPUT/src`
|
||||
JAVAC_CLASSES=`realpath --relative-to=./ $CLASSES`
|
||||
ANT_TEMP=`mktemp -d -p ./`
|
||||
cp $ANT_HOME/lib/ant.jar $ANT_TEMP/ant.jar
|
||||
JAVAC_CP=$ANT_TEMP/ant.jar
|
||||
JAVAC=javac.exe
|
||||
else
|
||||
JAVAC_SOURCE_FILE=$IDEA_OUTPUT/src/idea/IdeaLoggerWrapper.java
|
||||
JAVAC_SOURCE_PATH=$IDEA_OUTPUT/src
|
||||
JAVAC_CLASSES=$CLASSES
|
||||
JAVAC_CP=$CP
|
||||
JAVAC=javac
|
||||
fi
|
||||
|
||||
$BOOT_JDK/bin/javac -d $JAVAC_CLASSES -cp $JAVAC_CP $JAVAC_SOURCE_FILE
|
||||
$BOOT_JDK/bin/$JAVAC -d $JAVAC_CLASSES -sourcepath $JAVAC_SOURCE_PATH -cp $JAVAC_CP $JAVAC_SOURCE_FILE
|
||||
|
||||
if [ "x$WSL_DISTRO_NAME" != "x" ]; then
|
||||
rm -rf $ANT_TEMP
|
||||
fi
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2010, 2013, 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
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
fix() {
|
||||
#convert tabs to spaces
|
||||
find . -name $1 -exec sed -i "" 's/ / /g' {} \;
|
||||
#remove trailing whitespace
|
||||
find . -name $1 -exec sed -i "" 's/[ ]*$//' \{} \;
|
||||
}
|
||||
|
||||
if [ ! -z $1 ]; then
|
||||
fix $1;
|
||||
else
|
||||
fix "*.java"
|
||||
fix "*.js"
|
||||
fi
|
||||
@@ -1,135 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2010, 2018, 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
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
###########################################################################################
|
||||
# This is a helper script to evaluate nashorn with optimistic types
|
||||
# it produces a flight recording for every run, and uses the best
|
||||
# known flags for performance for the current configration
|
||||
###########################################################################################
|
||||
|
||||
# Flags to enable assertions, we need the system assertions too, since
|
||||
# this script runs Nashorn in the BCP to override any nashorn.jar that might
|
||||
# reside in your $JAVA_HOME/jre/lib/ext/nashorn.jar
|
||||
#
|
||||
ENABLE_ASSERTIONS_FLAGS="-ea -esa"
|
||||
|
||||
# Flags to instrument lambdaform computation, caching, interpretation and compilation
|
||||
# Default compile threshold for lambdaforms is 30
|
||||
#
|
||||
#LAMBDAFORM_FLAGS="\
|
||||
# -Djava.lang.invoke.MethodHandle.COMPILE_THRESHOLD=3 \
|
||||
# -Djava.lang.invoke.MethodHandle.DUMP_CLASS_FILES=true \
|
||||
# -Djava.lang.invoke.MethodHandle.TRACE_METHOD_LINKAGE=true \
|
||||
# -Djava.lang.invoke.MethodHandle.TRACE_INTERPRETER=true"
|
||||
|
||||
# Flags to run trusted tests from the Nashorn test suite
|
||||
#
|
||||
#TRUSTED_TEST_FLAGS="\
|
||||
#-Djava.security.manager \
|
||||
#-Djava.security.policy=../build/nashorn.policy -Dnashorn.debug"
|
||||
|
||||
# Testing out new code optimizations using the generic hotspot "new code" parameter
|
||||
#
|
||||
#USE_NEW_CODE_FLAGS=-XX:+UnlockDiagnosticVMOptions -XX:+UseNewCode
|
||||
|
||||
#
|
||||
#-Dnashorn.typeInfo.disabled=false \
|
||||
# and for Nashorn options:
|
||||
# --class-cache-size=0 --persistent-code-cache=false
|
||||
|
||||
# Unique timestamped file name for JFR recordings. For JFR, we also have to
|
||||
# crank up the stack cutoff depth to 1024, because of ridiculously long lambda form
|
||||
# stack traces.
|
||||
#
|
||||
# It is also recommended that you go into $JAVA_HOME/jre/lib/jfr/default.jfc and
|
||||
# set the "method-sampling-interval" Normal and Maximum sample time as low as you
|
||||
# can go (10 ms on most platforms). The default is normally higher. The increased
|
||||
# sampling overhead is usually negligible for Nashorn runs, but the data is better
|
||||
|
||||
if [ -z $JFR_FILENAME ]; then
|
||||
JFR_FILENAME="./nashorn_$(date|sed "s/ /_/g"|sed "s/:/_/g").jfr"
|
||||
fi
|
||||
|
||||
# Flight recorder
|
||||
#
|
||||
# see above - already in place, copy the flags down here to disable
|
||||
ENABLE_FLIGHT_RECORDER_FLAGS="\
|
||||
-XX:+FlightRecorder \
|
||||
-XX:FlightRecorderOptions=defaultrecording=true,disk=true,dumponexit=true,dumponexitpath=$JFR_FILENAME,stackdepth=1024"
|
||||
|
||||
# Type specialization and math intrinsic replacement should be enabled by default in 8u20 and nine,
|
||||
# keeping this flag around for experimental reasons. Replace + with - to switch it off
|
||||
#
|
||||
#ENABLE_TYPE_SPECIALIZATION_FLAGS=-XX:+UseTypeSpeculation
|
||||
|
||||
# Same with math intrinsics. They should be enabled by default in 8u20 and 9, so
|
||||
# this disables them if needed
|
||||
#
|
||||
#DISABLE_MATH_INTRINSICS_FLAGS=-XX:-UseMathExactIntrinsics
|
||||
|
||||
# Add timing to time the compilation phases.
|
||||
#ENABLE_TIME_FLAGS=--log=time
|
||||
|
||||
# Add ShowHiddenFrames to get lambda form internals on the stack traces
|
||||
#ENABLE_SHOW_HIDDEN_FRAMES_FLAGS=-XX:+ShowHiddenFrames
|
||||
|
||||
# Add print optoassembly to get an asm dump. This requires 1) a debug build, not product,
|
||||
# That tired compilation is switched off, for C2 only output and that the number of
|
||||
# compiler threads is set to 1 for determinsm.
|
||||
#
|
||||
#PRINT_ASM_FLAGS=-XX:+PrintOptoAssembly -XX:-TieredCompilation -XX:CICompilerCount=1 \
|
||||
|
||||
# Tier compile threasholds. Default value is 10. (1-100 is useful for experiments)
|
||||
#TIER_COMPILATION_THRESHOLD_FLAGS=-XX:IncreaseFirstTierCompileThresholdAt=10
|
||||
|
||||
# Directory where to look for nashorn.jar in a dist folder. The default is "..", assuming
|
||||
# that we run the script from the make dir
|
||||
DIR=..
|
||||
NASHORN_JAR=$DIR/dist/nashorn.jar
|
||||
|
||||
|
||||
# The built Nashorn jar is placed first in the bootclasspath to override the JDK
|
||||
# nashorn.jar in $JAVA_HOME/jre/lib/ext. Thus, we also need -esa, as assertions in
|
||||
# nashorn count as system assertions in this configuration
|
||||
|
||||
# Type profiling default level is 111, 222 adds some compile time, but is faster
|
||||
|
||||
$JAVA_HOME/bin/java \
|
||||
$ENABLE_ASSERTIONS_FLAGS \
|
||||
$LAMBDAFORM_FLAGS \
|
||||
$TRUSTED_FLAGS \
|
||||
$USE_NEW_CODE_FLAGS \
|
||||
$ENABLE_SHOW_HIDDEN_FRAMES_FLAGS \
|
||||
$ENABLE_FLIGHT_RECORDER_FLAGS \
|
||||
$ENABLE_TYPE_SPECIALIZATION_FLAGS \
|
||||
$TIERED_COMPILATION_THRESOLD_FLAGS \
|
||||
$DISABLE_MATH_INTRINSICS_FLAGS \
|
||||
$PRINT_ASM_FLAGS \
|
||||
-Xbootclasspath/p:$NASHORN_JAR \
|
||||
-Xms2G -Xmx2G \
|
||||
-XX:TypeProfileLevel=222 \
|
||||
-cp $CLASSPATH:../build/test/classes/ \
|
||||
jdk.nashorn.tools.Shell $ENABLE_TIME_FLAGS ${@}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 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
|
||||
@@ -58,7 +58,6 @@ src/jdk.compiler : jdk/src/jdk.compiler langtools/src/jdk.compiler
|
||||
src/jdk.crypto.cryptoki : jdk/src/jdk.crypto.cryptoki
|
||||
src/jdk.crypto.ec : jdk/src/jdk.crypto.ec
|
||||
src/jdk.crypto.mscapi : jdk/src/jdk.crypto.mscapi
|
||||
src/jdk.crypto.ucrypto : jdk/src/jdk.crypto.ucrypto
|
||||
src/jdk.dynalink : nashorn/src/jdk.dynalink
|
||||
src/jdk.editpad : jdk/src/jdk.editpad
|
||||
src/jdk.hotspot.agent : hotspot/src/jdk.hotspot.agent
|
||||
@@ -88,7 +87,6 @@ src/jdk.naming.dns : jdk/src/jdk.naming.dns
|
||||
src/jdk.naming.rmi : jdk/src/jdk.naming.rmi
|
||||
src/jdk.net : jdk/src/jdk.net
|
||||
src/jdk.pack : jdk/src/jdk.pack
|
||||
src/jdk.rmic : corba/src/jdk.rmic jdk/src/jdk.rmic
|
||||
src/jdk.scripting.nashorn : nashorn/src/jdk.scripting.nashorn
|
||||
src/jdk.scripting.nashorn.shell : nashorn/src/jdk.scripting.nashorn.shell
|
||||
src/jdk.sctp : jdk/src/jdk.sctp
|
||||
@@ -102,13 +100,11 @@ src/jdk.zipfs : jdk/src/jdk.zipfs
|
||||
src/langtools/sample : langtools/src/sample
|
||||
src/linux : jdk/src/linux
|
||||
src/sample : jdk/src/sample
|
||||
src/solaris : jdk/src/solaris
|
||||
src/hotspot/share : hotspot/src/share/vm
|
||||
src/hotspot/cpu/aarch64 : hotspot/src/cpu/aarch64/vm
|
||||
src/hotspot/cpu/arm : hotspot/src/cpu/arm/vm
|
||||
src/hotspot/cpu/ppc : hotspot/src/cpu/ppc/vm
|
||||
src/hotspot/cpu/s390 : hotspot/src/cpu/s390/vm
|
||||
src/hotspot/cpu/sparc : hotspot/src/cpu/sparc/vm
|
||||
src/hotspot/cpu/x86 : hotspot/src/cpu/x86/vm
|
||||
src/hotspot/cpu/zero : hotspot/src/cpu/zero/vm
|
||||
src/hotspot/os/aix : hotspot/src/os/aix/vm
|
||||
@@ -116,7 +112,6 @@ src/hotspot/os/bsd : hotspot/src/os/bsd/vm
|
||||
src/hotspot/os/linux : hotspot/src/os/linux/vm
|
||||
src/hotspot/os/posix/dtrace : hotspot/src/os/posix/dtrace
|
||||
src/hotspot/os/posix : hotspot/src/os/posix/vm
|
||||
src/hotspot/os/solaris : hotspot/src/os/solaris/vm
|
||||
src/hotspot/os/windows : hotspot/src/os/windows/vm
|
||||
src/hotspot/os_cpu/aix_ppc : hotspot/src/os_cpu/aix_ppc/vm
|
||||
src/hotspot/os_cpu/bsd_x86 : hotspot/src/os_cpu/bsd_x86/vm
|
||||
@@ -125,11 +120,8 @@ src/hotspot/os_cpu/linux_aarch64 : hotspot/src/os_cpu/linux_aarch64/vm
|
||||
src/hotspot/os_cpu/linux_arm : hotspot/src/os_cpu/linux_arm/vm
|
||||
src/hotspot/os_cpu/linux_ppc : hotspot/src/os_cpu/linux_ppc/vm
|
||||
src/hotspot/os_cpu/linux_s390 : hotspot/src/os_cpu/linux_s390/vm
|
||||
src/hotspot/os_cpu/linux_sparc : hotspot/src/os_cpu/linux_sparc/vm
|
||||
src/hotspot/os_cpu/linux_x86 : hotspot/src/os_cpu/linux_x86/vm
|
||||
src/hotspot/os_cpu/linux_zero : hotspot/src/os_cpu/linux_zero/vm
|
||||
src/hotspot/os_cpu/solaris_sparc : hotspot/src/os_cpu/solaris_sparc/vm
|
||||
src/hotspot/os_cpu/solaris_x86 : hotspot/src/os_cpu/solaris_x86/vm
|
||||
src/hotspot/os_cpu/windows_x86 : hotspot/src/os_cpu/windows_x86/vm
|
||||
src/hotspot : hotspot/src
|
||||
src/utils/IdealGraphVisualizer : hotspot/src/share/tools/IdealGraphVisualizer
|
||||
@@ -140,7 +132,6 @@ src/utils/src/build : jdk/make/non-build-utils/src/build
|
||||
make/BuildNashorn.gmk : nashorn/make/BuildNashorn.gmk
|
||||
make/CompileDemos.gmk : jdk/make/CompileDemos.gmk
|
||||
make/CompileInterimLangtools.gmk : langtools/make/CompileInterim.gmk
|
||||
make/CompileInterimRmic.gmk : jdk/make/CompileInterimRmic.gmk
|
||||
make/CompileModuleTools.gmk : jdk/make/CompileModuleTools.gmk
|
||||
make/CompileToolsHotspot.gmk : hotspot/make/CompileTools.gmk
|
||||
make/CompileToolsJdk.gmk : jdk/make/CompileTools.gmk
|
||||
@@ -180,7 +171,6 @@ make/mapfiles/libjvm_dtrace : hotspot/make/mapfiles/libjvm_dtrace
|
||||
make/mapfiles/libsaproc : hotspot/make/mapfiles/libsaproc
|
||||
make/nashorn : nashorn/make
|
||||
make/nb_native : common/nb_native
|
||||
make/rmic : jdk/make/rmic
|
||||
make/scripts/addNotices.sh : jdk/make/scripts/addNotices.sh
|
||||
make/scripts/compare.sh : common/bin/compare.sh
|
||||
make/scripts/compare_exceptions.sh.incl : common/bin/compare_exceptions.sh.incl
|
||||
|
||||
@@ -30,13 +30,11 @@
|
||||
</ul></li>
|
||||
<li><a href="#build-hardware-requirements">Build Hardware Requirements</a><ul>
|
||||
<li><a href="#building-on-x86">Building on x86</a></li>
|
||||
<li><a href="#building-on-sparc">Building on sparc</a></li>
|
||||
<li><a href="#building-on-aarch64">Building on aarch64</a></li>
|
||||
<li><a href="#building-on-32-bit-arm">Building on 32-bit arm</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#operating-system-requirements">Operating System Requirements</a><ul>
|
||||
<li><a href="#windows">Windows</a></li>
|
||||
<li><a href="#solaris">Solaris</a></li>
|
||||
<li><a href="#macos">macOS</a></li>
|
||||
<li><a href="#linux">Linux</a></li>
|
||||
<li><a href="#aix">AIX</a></li>
|
||||
@@ -45,7 +43,6 @@
|
||||
<li><a href="#gcc">gcc</a></li>
|
||||
<li><a href="#clang">clang</a></li>
|
||||
<li><a href="#apple-xcode">Apple Xcode</a></li>
|
||||
<li><a href="#oracle-solaris-studio">Oracle Solaris Studio</a></li>
|
||||
<li><a href="#microsoft-visual-studio">Microsoft Visual Studio</a></li>
|
||||
<li><a href="#ibm-xl-cc">IBM XL C/C++</a></li>
|
||||
</ul></li>
|
||||
@@ -157,18 +154,15 @@
|
||||
<p>The JDK 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.</p>
|
||||
<p>We <em>strongly</em> recommend usage of an SSD disk for the build, since disk speed is one of the limiting factors for build performance.</p>
|
||||
<h3 id="building-on-x86">Building on x86</h3>
|
||||
<p>At a minimum, a machine with 2-4 cores is advisable, as well as 2-4 GB of RAM. (The more cores to use, the more memory you need.) At least 6 GB of free disk space is required (8 GB minimum for building on Solaris).</p>
|
||||
<p>At a minimum, a machine with 2-4 cores is advisable, as well as 2-4 GB of RAM. (The more cores to use, the more memory you need.) At least 6 GB of free disk space is required.</p>
|
||||
<p>Even for 32-bit builds, it is recommended to use a 64-bit build machine, and instead create a 32-bit target using <code>--with-target-bits=32</code>.</p>
|
||||
<h3 id="building-on-sparc">Building on sparc</h3>
|
||||
<p>At a minimum, a machine with 4 cores is advisable, as well as 4 GB of RAM. (The more cores to use, the more memory you need.) At least 8 GB of free disk space is required.</p>
|
||||
<p>Note: The sparc port is deprecated.</p>
|
||||
<h3 id="building-on-aarch64">Building on aarch64</h3>
|
||||
<p>At a minimum, a machine with 8 cores is advisable, as well as 8 GB of RAM. (The more cores to use, the more memory you need.) At least 6 GB of free disk space is required.</p>
|
||||
<p>If you do not have access to sufficiently powerful hardware, it is also possible to use <a href="#cross-compiling">cross-compiling</a>.</p>
|
||||
<h3 id="building-on-32-bit-arm">Building on 32-bit arm</h3>
|
||||
<p>This is not recommended. Instead, see the section on <a href="#cross-compiling">Cross-compiling</a>.</p>
|
||||
<h2 id="operating-system-requirements">Operating System Requirements</h2>
|
||||
<p>The mainline JDK project supports Linux, Solaris, macOS, AIX and Windows. Support for other operating system, e.g. BSD, exists in separate "port" projects.</p>
|
||||
<p>The mainline JDK project supports Linux, macOS, AIX and Windows. Support for other operating system, e.g. BSD, exists in separate "port" projects.</p>
|
||||
<p>In general, the JDK 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.</p>
|
||||
<p>This table lists the OS versions used by Oracle when building the JDK. Such information is always subject to change, but this table is up to date at the time of writing.</p>
|
||||
<table>
|
||||
@@ -184,20 +178,16 @@
|
||||
<td style="text-align: left;">Oracle Enterprise Linux 6.4 / 7.6</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td style="text-align: left;">Solaris</td>
|
||||
<td style="text-align: left;">Solaris 11.3 SRU 20</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td style="text-align: left;">macOS</td>
|
||||
<td style="text-align: left;">Mac OS X 10.13 (High Sierra)</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<tr class="odd">
|
||||
<td style="text-align: left;">Windows</td>
|
||||
<td style="text-align: left;">Windows Server 2012 R2</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>The double version numbers for Linux and Solaris are due to the hybrid model used at Oracle, where header files and external libraries from an older version are used when building on a more modern version of the OS.</p>
|
||||
<p>The double version numbers for Linux are due to the hybrid model used at Oracle, where header files and external libraries from an older version are used when building on a more modern version of the OS.</p>
|
||||
<p>The Build Group has a wiki page with <a href="https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms">Supported Build Platforms</a>. From time to time, this is updated by contributors to list successes or failures of building on different platforms.</p>
|
||||
<h3 id="windows">Windows</h3>
|
||||
<p>Windows XP is not a supported platform, but all newer Windows should be able to build the JDK.</p>
|
||||
@@ -223,10 +213,6 @@
|
||||
<p>It's possible to build both Windows and Linux binaries from WSL. To build Windows binaries, you must use a Windows boot JDK (located in a Windows-accessible directory). To build Linux binaries, you must use a Linux boot JDK. The default behavior is to build for Windows. To build for Linux, pass <code>--build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu</code> to <code>configure</code>.</p>
|
||||
<p>If building Windows binaries, the source code must be located in a Windows- accessible directory. This is because Windows executables (such as Visual Studio and the boot JDK) must be able to access the source code. Also, the drive where the source is stored must be mounted as case-insensitive by changing either /etc/fstab or /etc/wsl.conf in WSL. Individual directories may be corrected using the fsutil tool in case the source was cloned before changing the mount options.</p>
|
||||
<p>Note that while it's possible to build on WSL, testing is still not fully supported.</p>
|
||||
<h3 id="solaris">Solaris</h3>
|
||||
<p>See <code>make/devkit/solaris11.1-package-list.txt</code> for a list of recommended packages to install when building on Solaris. The versions specified in this list is the versions used by the daily builds at Oracle, and is likely to work properly.</p>
|
||||
<p>Older versions of Solaris shipped a broken version of <code>objcopy</code>. At least version 2.21.1 is needed, which is provided by Solaris 11 Update 1. Objcopy is needed if you want to have external debug symbols. Please make sure you are using at least version 2.21.1 of objcopy, or that you disable external debug symbols.</p>
|
||||
<p>Note: The Solaris port is deprecated.</p>
|
||||
<h3 id="macos">macOS</h3>
|
||||
<p>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 such as the JDK to keep pace with a continuously updated machine running macOS. See the section on <a href="#apple-xcode">Apple Xcode</a> on some strategies to deal with this.</p>
|
||||
<p>It is recommended that you use at least Mac OS X 10.13 (High Sierra). At the time of writing, the JDK has been successfully compiled on macOS 10.12 (Sierra).</p>
|
||||
@@ -259,14 +245,10 @@
|
||||
<td style="text-align: left;">Apple Xcode (using clang)</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td style="text-align: left;">Solaris</td>
|
||||
<td style="text-align: left;">Oracle Solaris Studio</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td style="text-align: left;">AIX</td>
|
||||
<td style="text-align: left;">IBM XL C/C++</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<tr class="even">
|
||||
<td style="text-align: left;">Windows</td>
|
||||
<td style="text-align: left;">Microsoft Visual Studio</td>
|
||||
</tr>
|
||||
@@ -283,29 +265,25 @@
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td style="text-align: left;">Linux</td>
|
||||
<td style="text-align: left;">gcc 8.3.0</td>
|
||||
<td style="text-align: left;">gcc 9.2.0</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td style="text-align: left;">macOS</td>
|
||||
<td style="text-align: left;">Apple Xcode 10.1 (using clang 10.0.0)</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td style="text-align: left;">Solaris</td>
|
||||
<td style="text-align: left;">Oracle Solaris Studio 12.6 (with compiler version 5.15)</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td style="text-align: left;">Windows</td>
|
||||
<td style="text-align: left;">Microsoft Visual Studio 2017 update 15.9.16</td>
|
||||
<td style="text-align: left;">Microsoft Visual Studio 2019 update 16.5.3</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>All compilers are expected to be able to compile to the C99 language standard, as some C99 features are used in the source code. Microsoft Visual Studio doesn't fully support C99 so in practice shared code is limited to using C99 features that it does support.</p>
|
||||
<h3 id="gcc">gcc</h3>
|
||||
<p>The minimum accepted version of gcc is 5.0. Older versions will generate a warning by <code>configure</code> and are unlikely to work.</p>
|
||||
<p>The JDK is currently known to be able to compile with at least version 8.3 of gcc.</p>
|
||||
<p>The JDK is currently known to be able to compile with at least version 9.2 of gcc.</p>
|
||||
<p>In general, any version between these two should be usable.</p>
|
||||
<h3 id="clang">clang</h3>
|
||||
<p>The minimum accepted version of clang is 3.2. Older versions will not be accepted by <code>configure</code>.</p>
|
||||
<p>The minimum accepted version of clang is 3.5. Older versions will not be accepted by <code>configure</code>.</p>
|
||||
<p>To use clang instead of gcc on Linux, use <code>--with-toolchain-type=clang</code>.</p>
|
||||
<h3 id="apple-xcode">Apple Xcode</h3>
|
||||
<p>The oldest supported version of Xcode is 8.</p>
|
||||
@@ -313,68 +291,9 @@
|
||||
<pre><code>xcode-select --install</code></pre>
|
||||
<p>It is advisable to keep an older version of Xcode for building the JDK when updating Xcode. This <a href="http://iosdevelopertips.com/xcode/install-multiple-versions-of-xcode.html">blog page</a> has good suggestions on managing multiple Xcode versions. To use a specific version of Xcode, use <code>xcode-select -s</code> before running <code>configure</code>, or use <code>--with-toolchain-path</code> to point to the version of Xcode to use, e.g. <code>configure --with-toolchain-path=/Applications/Xcode8.app/Contents/Developer/usr/bin</code></p>
|
||||
<p>If you have recently (inadvertently) updated your OS and/or Xcode version, and the JDK can no longer be built, please see the section on <a href="#problems-with-the-build-environment">Problems with the Build Environment</a>, and <a href="#getting-help">Getting Help</a> to find out if there are any recent, non-merged patches available for this update.</p>
|
||||
<h3 id="oracle-solaris-studio">Oracle Solaris Studio</h3>
|
||||
<p>The minimum accepted version of the Solaris Studio compilers is 5.13 (corresponding to Solaris Studio 12.4). Older versions will not be accepted by configure.</p>
|
||||
<p>The Solaris Studio installation should contain at least these packages:</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th style="text-align: left;">Package</th>
|
||||
<th style="text-align: left;">Version</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td style="text-align: left;">developer/solarisstudio-124/backend</td>
|
||||
<td style="text-align: left;">12.4-1.0.6.0</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td style="text-align: left;">developer/solarisstudio-124/c++</td>
|
||||
<td style="text-align: left;">12.4-1.0.10.0</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td style="text-align: left;">developer/solarisstudio-124/cc</td>
|
||||
<td style="text-align: left;">12.4-1.0.4.0</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td style="text-align: left;">developer/solarisstudio-124/library/c++-libs</td>
|
||||
<td style="text-align: left;">12.4-1.0.10.0</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td style="text-align: left;">developer/solarisstudio-124/library/math-libs</td>
|
||||
<td style="text-align: left;">12.4-1.0.0.1</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td style="text-align: left;">developer/solarisstudio-124/library/studio-gccrt</td>
|
||||
<td style="text-align: left;">12.4-1.0.0.1</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td style="text-align: left;">developer/solarisstudio-124/studio-common</td>
|
||||
<td style="text-align: left;">12.4-1.0.0.1</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td style="text-align: left;">developer/solarisstudio-124/studio-ja</td>
|
||||
<td style="text-align: left;">12.4-1.0.0.1</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td style="text-align: left;">developer/solarisstudio-124/studio-legal</td>
|
||||
<td style="text-align: left;">12.4-1.0.0.1</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td style="text-align: left;">developer/solarisstudio-124/studio-zhCN</td>
|
||||
<td style="text-align: left;">12.4-1.0.0.1</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Compiling with Solaris Studio can sometimes be finicky. This is the exact version used by Oracle, which worked correctly at the time of writing:</p>
|
||||
<pre><code>$ cc -V
|
||||
cc: Sun C 5.13 SunOS_i386 2014/10/20
|
||||
$ CC -V
|
||||
CC: Sun C++ 5.13 SunOS_i386 151846-10 2015/10/30</code></pre>
|
||||
<h3 id="microsoft-visual-studio">Microsoft Visual Studio</h3>
|
||||
<p>The minimum accepted version of Visual Studio is 2010. Older versions will not be accepted by <code>configure</code>. The maximum accepted version of Visual Studio is 2019. Versions older than 2017 are unlikely to continue working for long.</p>
|
||||
<p>If you have multiple versions of Visual Studio installed, <code>configure</code> will by default pick the latest. You can request a specific version to be used by setting <code>--with-toolchain-version</code>, e.g. <code>--with-toolchain-version=2015</code>.</p>
|
||||
<p>If you get <code>LINK: fatal error LNK1123: failure during conversion to COFF: file invalid</code> when building using Visual Studio 2010, you have encountered <a href="http://support.microsoft.com/kb/2757355">KB2757355</a>, a bug triggered by a specific installation order. However, the solution suggested by the KB article does not always resolve the problem. See <a href="https://stackoverflow.com/questions/10888391">this stackoverflow discussion</a> for other suggestions.</p>
|
||||
<p>The minimum accepted version of Visual Studio is 2017. Older versions will not be accepted by <code>configure</code> and will not work. The maximum accepted version of Visual Studio is 2019.</p>
|
||||
<p>If you have multiple versions of Visual Studio installed, <code>configure</code> will by default pick the latest. You can request a specific version to be used by setting <code>--with-toolchain-version</code>, e.g. <code>--with-toolchain-version=2017</code>.</p>
|
||||
<h3 id="ibm-xl-cc">IBM XL C/C++</h3>
|
||||
<p>Please consult the AIX section of the <a href="https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms">Supported Build Platforms</a> OpenJDK Build Wiki page for details about which versions of XLC are supported.</p>
|
||||
<h2 id="boot-jdk-requirements">Boot JDK Requirements</h2>
|
||||
@@ -394,7 +313,6 @@ CC: Sun C++ 5.13 SunOS_i386 151846-10 2015/10/30</code></pre>
|
||||
<ul>
|
||||
<li>To install on an apt-based Linux, try running <code>sudo apt-get install libfreetype6-dev</code>.</li>
|
||||
<li>To install on an rpm-based Linux, try running <code>sudo yum install freetype-devel</code>.</li>
|
||||
<li>To install on Solaris, try running <code>pkg install system/library/freetype-2</code>.</li>
|
||||
</ul>
|
||||
<p>Use <code>--with-freetype-include=<path></code> and <code>--with-freetype-lib=<path></code> if <code>configure</code> does not automatically locate the platform FreeType files.</p>
|
||||
<h3 id="cups">CUPS</h3>
|
||||
@@ -402,15 +320,13 @@ CC: Sun C++ 5.13 SunOS_i386 151846-10 2015/10/30</code></pre>
|
||||
<ul>
|
||||
<li>To install on an apt-based Linux, try running <code>sudo apt-get install libcups2-dev</code>.</li>
|
||||
<li>To install on an rpm-based Linux, try running <code>sudo yum install cups-devel</code>.</li>
|
||||
<li>To install on Solaris, try running <code>pkg install print/cups</code>.</li>
|
||||
</ul>
|
||||
<p>Use <code>--with-cups=<path></code> if <code>configure</code> does not properly locate your CUPS files.</p>
|
||||
<h3 id="x11">X11</h3>
|
||||
<p>Certain <a href="http://www.x.org/">X11</a> libraries and include files are required on Linux and Solaris.</p>
|
||||
<p>Certain <a href="http://www.x.org/">X11</a> libraries and include files are required on Linux.</p>
|
||||
<ul>
|
||||
<li>To install on an apt-based Linux, try running <code>sudo apt-get install libx11-dev libxext-dev libxrender-dev libxrandr-dev libxtst-dev libxt-dev</code>.</li>
|
||||
<li>To install on an rpm-based Linux, try running <code>sudo yum install libXtst-devel libXt-devel libXrender-devel libXrandr-devel libXi-devel</code>.</li>
|
||||
<li>To install on Solaris, try running <code>pkg install x11/header/x11-protocols x11/library/libice x11/library/libpthread-stubs x11/library/libsm x11/library/libx11 x11/library/libxau x11/library/libxcb x11/library/libxdmcp x11/library/libxevie x11/library/libxext x11/library/libxrender x11/library/libxrandr x11/library/libxscrnsaver x11/library/libxtst x11/library/toolkit/libxt</code>.</li>
|
||||
</ul>
|
||||
<p>Use <code>--with-x=<path></code> if <code>configure</code> does not properly locate your X11 files.</p>
|
||||
<h3 id="alsa">ALSA</h3>
|
||||
@@ -443,7 +359,6 @@ CC: Sun C++ 5.13 SunOS_i386 151846-10 2015/10/30</code></pre>
|
||||
<p>At least version 3.81 of GNU Make must be used. For distributions supporting GNU Make 4.0 or above, we strongly recommend it. GNU Make 4.0 contains useful functionality to handle parallel building (supported by <code>--with-output-sync</code>) and speed and stability improvements.</p>
|
||||
<p>Note that <code>configure</code> locates and verifies a properly functioning version of <code>make</code> and stores the path to this <code>make</code> binary in the configuration. If you start a build using <code>make</code> on the command line, you will be using the version of make found first in your <code>PATH</code>, and not necessarily the one stored in the configuration. This initial make will be used as "bootstrap make", and in a second stage, the make located by <code>configure</code> will be called. Normally, this will present no issues, but if you have a very old <code>make</code>, or a non-GNU Make <code>make</code> in your path, this might cause issues.</p>
|
||||
<p>If you want to override the default make found by <code>configure</code>, use the <code>MAKE</code> configure variable, e.g. <code>configure MAKE=/opt/gnu/make</code>.</p>
|
||||
<p>On Solaris, it is common to call the GNU version of make by using <code>gmake</code>.</p>
|
||||
<h3 id="gnu-bash">GNU Bash</h3>
|
||||
<p>The JDK requires <a href="http://www.gnu.org/software/bash">GNU Bash</a>. No other shells are supported.</p>
|
||||
<p>At least version 3.2 of GNU Bash must be used.</p>
|
||||
@@ -536,7 +451,7 @@ CC: Sun C++ 5.13 SunOS_i386 151846-10 2015/10/30</code></pre>
|
||||
<li><code>dist-clean</code> - Remove all files, including configuration</li>
|
||||
</ul>
|
||||
<p>Run <code>make help</code> to get an up-to-date list of important make targets and make control variables.</p>
|
||||
<p>It is possible to build just a single module, a single phase, or a single phase of a single module, by creating make targets according to these followin patterns. A phase can be either of <code>gensrc</code>, <code>gendata</code>, <code>copy</code>, <code>java</code>, <code>launchers</code>, <code>libs</code> or <code>rmic</code>. See <a href="#using-fine-grained-make-targets">Using Fine-Grained Make Targets</a> for more details about this functionality.</p>
|
||||
<p>It is possible to build just a single module, a single phase, or a single phase of a single module, by creating make targets according to these followin patterns. A phase can be either of <code>gensrc</code>, <code>gendata</code>, <code>copy</code>, <code>java</code>, <code>launchers</code>, or <code>libs</code>. See <a href="#using-fine-grained-make-targets">Using Fine-Grained Make Targets</a> for more details about this functionality.</p>
|
||||
<ul>
|
||||
<li><code><phase></code> - Build the specified phase and everything it depends on</li>
|
||||
<li><code><module></code> - Build the specified module and everything it depends on</li>
|
||||
@@ -578,7 +493,12 @@ CC: Sun C++ 5.13 SunOS_i386 151846-10 2015/10/30</code></pre>
|
||||
</ul>
|
||||
<h2 id="running-tests">Running Tests</h2>
|
||||
<p>Most of the JDK tests are using the <a href="http://openjdk.java.net/jtreg">JTReg</a> test framework. Make sure that your configuration knows where to find your installation of JTReg. If this is not picked up automatically, use the <code>--with-jtreg=<path to jtreg home></code> option to point to the JTReg framework. Note that this option should point to the JTReg home, i.e. the top directory, containing <code>lib/jtreg.jar</code> etc.</p>
|
||||
<p>The <a href="https://wiki.openjdk.java.net/display/Adoption">Adoption Group</a> provides recent builds of jtreg <a href="https://adopt-openjdk.ci.cloudbees.com/job/jtreg/lastSuccessfulBuild/artifact">here</a>. Download the latest <code>.tar.gz</code> file, unpack it, and point <code>--with-jtreg</code> to the <code>jtreg</code> directory that you just unpacked.</p>
|
||||
<p>The <a href="https://wiki.openjdk.java.net/display/Adoption">Adoption Group</a> provides recent builds of jtreg <a href="https://ci.adoptopenjdk.net/view/Dependencies/job/jtreg/lastSuccessfulBuild/artifact">here</a>. Download the latest <code>.tar.gz</code> file, unpack it, and point <code>--with-jtreg</code> to the <code>jtreg</code> directory that you just unpacked.</p>
|
||||
<p>Building of Hotspot Gtest suite requires the source code of Google Test framework. The top directory, which contains both <code>googletest</code> and <code>googlemock</code> directories, should be specified via <code>--with-gtest</code>. The supported version of Google Test is 1.8.1, whose source code can be obtained:</p>
|
||||
<ul>
|
||||
<li>by downloading and unpacking the source bundle from <a href="https://github.com/google/googletest/releases/tag/release-1.8.1">here</a></li>
|
||||
<li>or by checking out <code>release-1.8.1</code> tag of <code>googletest</code> project: <code>git clone -b release-1.8.1 https://github.com/google/googletest</code></li>
|
||||
</ul>
|
||||
<p>To execute the most basic tests (tier 1), use:</p>
|
||||
<pre><code>make run-test-tier1</code></pre>
|
||||
<p>For more details on how to run tests, please see the <a href="testing.html">Testing the JDK</a> document.</p>
|
||||
@@ -865,9 +785,6 @@ Clock skew detected. Your build may be incomplete.</code></pre>
|
||||
<p>then the clock on your build machine is out of sync with the timestamps on the source files. Other errors, apparently unrelated but in fact caused by the clock skew, can occur along with the clock skew warnings. These secondary errors may tend to obscure the fact that the true root cause of the problem is an out-of-sync clock.</p>
|
||||
<p>If you see these warnings, reset the clock on the build machine, run <code>make clean</code> and restart the build.</p>
|
||||
<h4 id="out-of-memory-errors">Out of Memory Errors</h4>
|
||||
<p>On Solaris, you might get an error message like this:</p>
|
||||
<pre><code>Trouble writing out table to disk</code></pre>
|
||||
<p>To solve this, increase the amount of swap space on your build machine.</p>
|
||||
<p>On Windows, you might get error messages like this:</p>
|
||||
<pre><code>fatal error - couldn't allocate heap
|
||||
cannot create ... Permission denied
|
||||
@@ -919,7 +836,7 @@ sudo mv /tmp/configure /usr/local/bin</code></pre>
|
||||
<p>If you are prepared to take some risk of an incorrect build, and know enough of the system to understand how things build and interact, you can speed up the build process considerably by instructing make to only build a portion of the product.</p>
|
||||
<h4 id="building-individual-modules">Building Individual Modules</h4>
|
||||
<p>The safe way to use fine-grained make targets is to use the module specific make targets. All source code in the JDK is organized so it belongs to a module, e.g. <code>java.base</code> or <code>jdk.jdwp.agent</code>. You can build only a specific module, by giving it as make target: <code>make jdk.jdwp.agent</code>. If the specified module depends on other modules (e.g. <code>java.base</code>), those modules will be built first.</p>
|
||||
<p>You can also specify a set of modules, just as you can always specify a set of make targets: <code>make jdk.crypto.cryptoki jdk.crypto.ec jdk.crypto.mscapi jdk.crypto.ucrypto</code></p>
|
||||
<p>You can also specify a set of modules, just as you can always specify a set of make targets: <code>make jdk.crypto.cryptoki jdk.crypto.ec jdk.crypto.mscapi</code></p>
|
||||
<h4 id="building-individual-module-phases">Building Individual Module Phases</h4>
|
||||
<p>The build process for each module is divided into separate phases. Not all modules need all phases. Which are needed depends on what kind of source code and other artifact the module consists of. The phases are:</p>
|
||||
<ul>
|
||||
@@ -929,7 +846,6 @@ sudo mv /tmp/configure /usr/local/bin</code></pre>
|
||||
<li><code>java</code> (Compile Java code)</li>
|
||||
<li><code>launchers</code> (Compile native executables)</li>
|
||||
<li><code>libs</code> (Compile native libraries)</li>
|
||||
<li><code>rmic</code> (Run the <code>rmic</code> tool)</li>
|
||||
</ul>
|
||||
<p>You can build only a single phase for a module by using the notation <code>$MODULE-$PHASE</code>. For instance, to build the <code>gensrc</code> phase for <code>java.base</code>, use <code>make java.base-gensrc</code>.</p>
|
||||
<p>Note that some phases may depend on others, e.g. <code>java</code> depends on <code>gensrc</code> (if present). Make will build all needed prerequisites before building the requested phase.</p>
|
||||
|
||||
119
doc/building.md
119
doc/building.md
@@ -109,19 +109,11 @@ one of the limiting factors for build performance.
|
||||
|
||||
At a minimum, a machine with 2-4 cores is advisable, as well as 2-4 GB of RAM.
|
||||
(The more cores to use, the more memory you need.) At least 6 GB of free disk
|
||||
space is required (8 GB minimum for building on Solaris).
|
||||
space is required.
|
||||
|
||||
Even for 32-bit builds, it is recommended to use a 64-bit build machine, and
|
||||
instead create a 32-bit target using `--with-target-bits=32`.
|
||||
|
||||
### Building on sparc
|
||||
|
||||
At a minimum, a machine with 4 cores is advisable, as well as 4 GB of RAM. (The
|
||||
more cores to use, the more memory you need.) At least 8 GB of free disk space
|
||||
is required.
|
||||
|
||||
Note: The sparc port is deprecated.
|
||||
|
||||
### Building on aarch64
|
||||
|
||||
At a minimum, a machine with 8 cores is advisable, as well as 8 GB of RAM.
|
||||
@@ -138,7 +130,7 @@ This is not recommended. Instead, see the section on [Cross-compiling](
|
||||
|
||||
## Operating System Requirements
|
||||
|
||||
The mainline JDK project supports Linux, Solaris, macOS, AIX and Windows.
|
||||
The mainline JDK project supports Linux, macOS, AIX and Windows.
|
||||
Support for other operating system, e.g. BSD, exists in separate "port"
|
||||
projects.
|
||||
|
||||
@@ -153,11 +145,10 @@ time of writing.
|
||||
Operating system Vendor/version used
|
||||
----------------- -------------------------------------------------------
|
||||
Linux Oracle Enterprise Linux 6.4 / 7.6
|
||||
Solaris Solaris 11.3 SRU 20
|
||||
macOS Mac OS X 10.13 (High Sierra)
|
||||
Windows Windows Server 2012 R2
|
||||
|
||||
The double version numbers for Linux and Solaris are due to the hybrid model
|
||||
The double version numbers for Linux are due to the hybrid model
|
||||
used at Oracle, where header files and external libraries from an older version
|
||||
are used when building on a more modern version of the OS.
|
||||
|
||||
@@ -247,21 +238,6 @@ options.
|
||||
Note that while it's possible to build on WSL, testing is still not fully
|
||||
supported.
|
||||
|
||||
### Solaris
|
||||
|
||||
See `make/devkit/solaris11.1-package-list.txt` for a list of recommended
|
||||
packages to install when building on Solaris. 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.21.1 is needed, which is provided by Solaris 11 Update 1. Objcopy is
|
||||
needed if you want to have external debug symbols. Please make sure you are
|
||||
using at least version 2.21.1 of objcopy, or that you disable external debug
|
||||
symbols.
|
||||
|
||||
Note: The Solaris port is deprecated.
|
||||
|
||||
### macOS
|
||||
|
||||
Apple is using a quite aggressive scheme of pushing OS updates, and coupling
|
||||
@@ -314,7 +290,6 @@ one-to-one correlation between target operating system and toolchain.
|
||||
------------------ -------------------------
|
||||
Linux gcc, clang
|
||||
macOS Apple Xcode (using clang)
|
||||
Solaris Oracle Solaris Studio
|
||||
AIX IBM XL C/C++
|
||||
Windows Microsoft Visual Studio
|
||||
|
||||
@@ -327,10 +302,9 @@ issues.
|
||||
|
||||
Operating system Toolchain version
|
||||
------------------ -------------------------------------------------------
|
||||
Linux gcc 8.3.0
|
||||
Linux gcc 9.2.0
|
||||
macOS Apple Xcode 10.1 (using clang 10.0.0)
|
||||
Solaris Oracle Solaris Studio 12.6 (with compiler version 5.15)
|
||||
Windows Microsoft Visual Studio 2017 update 15.9.16
|
||||
Windows Microsoft Visual Studio 2019 update 16.5.3
|
||||
|
||||
All compilers are expected to be able to compile to the C99 language standard,
|
||||
as some C99 features are used in the source code. Microsoft Visual Studio
|
||||
@@ -342,14 +316,14 @@ features that it does support.
|
||||
The minimum accepted version of gcc is 5.0. Older versions will generate a warning
|
||||
by `configure` and are unlikely to work.
|
||||
|
||||
The JDK is currently known to be able to compile with at least version 8.3 of
|
||||
The JDK is currently known to be able to compile with at least version 9.2 of
|
||||
gcc.
|
||||
|
||||
In general, any version between these two should be usable.
|
||||
|
||||
### clang
|
||||
|
||||
The minimum accepted version of clang is 3.2. Older versions will not be
|
||||
The minimum accepted version of clang is 3.5. Older versions will not be
|
||||
accepted by `configure`.
|
||||
|
||||
To use clang instead of gcc on Linux, use `--with-toolchain-type=clang`.
|
||||
@@ -379,52 +353,15 @@ Build Environment](#problems-with-the-build-environment), and [Getting
|
||||
Help](#getting-help) to find out if there are any recent, non-merged patches
|
||||
available for this update.
|
||||
|
||||
### Oracle Solaris Studio
|
||||
|
||||
The minimum accepted version of the Solaris Studio compilers is 5.13
|
||||
(corresponding to Solaris Studio 12.4). Older versions will not be accepted by
|
||||
configure.
|
||||
|
||||
The Solaris Studio installation should contain at least these packages:
|
||||
|
||||
Package Version
|
||||
-------------------------------------------------- -------------
|
||||
developer/solarisstudio-124/backend 12.4-1.0.6.0
|
||||
developer/solarisstudio-124/c++ 12.4-1.0.10.0
|
||||
developer/solarisstudio-124/cc 12.4-1.0.4.0
|
||||
developer/solarisstudio-124/library/c++-libs 12.4-1.0.10.0
|
||||
developer/solarisstudio-124/library/math-libs 12.4-1.0.0.1
|
||||
developer/solarisstudio-124/library/studio-gccrt 12.4-1.0.0.1
|
||||
developer/solarisstudio-124/studio-common 12.4-1.0.0.1
|
||||
developer/solarisstudio-124/studio-ja 12.4-1.0.0.1
|
||||
developer/solarisstudio-124/studio-legal 12.4-1.0.0.1
|
||||
developer/solarisstudio-124/studio-zhCN 12.4-1.0.0.1
|
||||
|
||||
Compiling with Solaris Studio can sometimes be finicky. This is the exact
|
||||
version used by Oracle, which worked correctly at the time of writing:
|
||||
```
|
||||
$ cc -V
|
||||
cc: Sun C 5.13 SunOS_i386 2014/10/20
|
||||
$ CC -V
|
||||
CC: Sun C++ 5.13 SunOS_i386 151846-10 2015/10/30
|
||||
```
|
||||
|
||||
### Microsoft Visual Studio
|
||||
|
||||
The minimum accepted version of Visual Studio is 2010. Older versions will not
|
||||
be accepted by `configure`. The maximum accepted version of Visual Studio is
|
||||
2019. Versions older than 2017 are unlikely to continue working for long.
|
||||
The minimum accepted version of Visual Studio is 2017. Older versions will not
|
||||
be accepted by `configure` and will not work. The maximum accepted
|
||||
version of Visual Studio is 2019.
|
||||
|
||||
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=2015`.
|
||||
|
||||
If you get `LINK: fatal error LNK1123: failure during conversion to COFF: file
|
||||
invalid` when building using Visual Studio 2010, you have encountered
|
||||
[KB2757355](http://support.microsoft.com/kb/2757355), a bug triggered by a
|
||||
specific installation order. However, the solution suggested by the KB article
|
||||
does not always resolve the problem. See [this stackoverflow discussion](
|
||||
https://stackoverflow.com/questions/10888391) for other suggestions.
|
||||
setting `--with-toolchain-version`, e.g. `--with-toolchain-version=2017`.
|
||||
|
||||
### IBM XL C/C++
|
||||
|
||||
@@ -494,7 +431,6 @@ rather than bundling the JDK's own copy.
|
||||
libfreetype6-dev`.
|
||||
* To install on an rpm-based Linux, try running `sudo yum install
|
||||
freetype-devel`.
|
||||
* To install on Solaris, try running `pkg install system/library/freetype-2`.
|
||||
|
||||
Use `--with-freetype-include=<path>` and `--with-freetype-lib=<path>`
|
||||
if `configure` does not automatically locate the platform FreeType files.
|
||||
@@ -509,7 +445,6 @@ your operating system.
|
||||
libcups2-dev`.
|
||||
* To install on an rpm-based Linux, try running `sudo yum install
|
||||
cups-devel`.
|
||||
* To install on Solaris, try running `pkg install print/cups`.
|
||||
|
||||
Use `--with-cups=<path>` if `configure` does not properly locate your CUPS
|
||||
files.
|
||||
@@ -517,18 +452,12 @@ files.
|
||||
### X11
|
||||
|
||||
Certain [X11](http://www.x.org/) libraries and include files are required on
|
||||
Linux and Solaris.
|
||||
Linux.
|
||||
|
||||
* To install on an apt-based Linux, try running `sudo apt-get install
|
||||
libx11-dev libxext-dev libxrender-dev libxrandr-dev libxtst-dev libxt-dev`.
|
||||
* To install on an rpm-based Linux, try running `sudo yum install
|
||||
libXtst-devel libXt-devel libXrender-devel libXrandr-devel libXi-devel`.
|
||||
* To install on Solaris, try running `pkg install x11/header/x11-protocols
|
||||
x11/library/libice x11/library/libpthread-stubs x11/library/libsm
|
||||
x11/library/libx11 x11/library/libxau x11/library/libxcb
|
||||
x11/library/libxdmcp x11/library/libxevie x11/library/libxext
|
||||
x11/library/libxrender x11/library/libxrandr x11/library/libxscrnsaver
|
||||
x11/library/libxtst x11/library/toolkit/libxt`.
|
||||
|
||||
Use `--with-x=<path>` if `configure` does not properly locate your X11 files.
|
||||
|
||||
@@ -603,8 +532,6 @@ will present no issues, but if you have a very old `make`, or a non-GNU Make
|
||||
If you want to override the default make found by `configure`, use the `MAKE`
|
||||
configure variable, e.g. `configure MAKE=/opt/gnu/make`.
|
||||
|
||||
On Solaris, it is common to call the GNU version of make by using `gmake`.
|
||||
|
||||
### GNU Bash
|
||||
|
||||
The JDK requires [GNU Bash](http://www.gnu.org/software/bash). No other shells
|
||||
@@ -818,7 +745,7 @@ control variables.
|
||||
It is possible to build just a single module, a single phase, or a single phase
|
||||
of a single module, by creating make targets according to these followin
|
||||
patterns. A phase can be either of `gensrc`, `gendata`, `copy`, `java`,
|
||||
`launchers`, `libs` or `rmic`. See [Using Fine-Grained Make Targets](
|
||||
`launchers`, or `libs`. See [Using Fine-Grained Make Targets](
|
||||
#using-fine-grained-make-targets) for more details about this functionality.
|
||||
|
||||
* `<phase>` - Build the specified phase and everything it depends on
|
||||
@@ -891,10 +818,18 @@ containing `lib/jtreg.jar` etc.
|
||||
|
||||
The [Adoption Group](https://wiki.openjdk.java.net/display/Adoption) provides
|
||||
recent builds of jtreg [here](
|
||||
https://adopt-openjdk.ci.cloudbees.com/job/jtreg/lastSuccessfulBuild/artifact).
|
||||
https://ci.adoptopenjdk.net/view/Dependencies/job/jtreg/lastSuccessfulBuild/artifact).
|
||||
Download the latest `.tar.gz` file, unpack it, and point `--with-jtreg` to the
|
||||
`jtreg` directory that you just unpacked.
|
||||
|
||||
Building of Hotspot Gtest suite requires the source code of Google Test framework.
|
||||
The top directory, which contains both `googletest` and `googlemock`
|
||||
directories, should be specified via `--with-gtest`.
|
||||
The supported version of Google Test is 1.8.1, whose source code can be obtained:
|
||||
|
||||
* by downloading and unpacking the source bundle from [here](https://github.com/google/googletest/releases/tag/release-1.8.1)
|
||||
* or by checking out `release-1.8.1` tag of `googletest` project: `git clone -b release-1.8.1 https://github.com/google/googletest`
|
||||
|
||||
To execute the most basic tests (tier 1), use:
|
||||
```
|
||||
make run-test-tier1
|
||||
@@ -1460,12 +1395,6 @@ clean` and restart the build.
|
||||
|
||||
#### Out of Memory Errors
|
||||
|
||||
On Solaris, you might get an error message like this:
|
||||
```
|
||||
Trouble writing out table to disk
|
||||
```
|
||||
To solve this, increase the amount of swap space on your build machine.
|
||||
|
||||
On Windows, you might get error messages like this:
|
||||
```
|
||||
fatal error - couldn't allocate heap
|
||||
@@ -1604,8 +1533,7 @@ module depends on other modules (e.g. `java.base`), those modules will be built
|
||||
first.
|
||||
|
||||
You can also specify a set of modules, just as you can always specify a set of
|
||||
make targets: `make jdk.crypto.cryptoki jdk.crypto.ec jdk.crypto.mscapi
|
||||
jdk.crypto.ucrypto`
|
||||
make targets: `make jdk.crypto.cryptoki jdk.crypto.ec jdk.crypto.mscapi`
|
||||
|
||||
#### Building Individual Module Phases
|
||||
|
||||
@@ -1619,7 +1547,6 @@ and other artifact the module consists of. The phases are:
|
||||
* `java` (Compile Java code)
|
||||
* `launchers` (Compile native executables)
|
||||
* `libs` (Compile native libraries)
|
||||
* `rmic` (Run the `rmic` tool)
|
||||
|
||||
You can build only a single phase for a module by using the notation
|
||||
`$MODULE-$PHASE`. For instance, to build the `gensrc` phase for `java.base`,
|
||||
|
||||
329
doc/hotspot-style.html
Normal file
329
doc/hotspot-style.html
Normal file
@@ -0,0 +1,329 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<title>HotSpot Coding Style</title>
|
||||
<style type="text/css">
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
span.underline{text-decoration: underline;}
|
||||
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="../make/data/docs-resources/resources/jdk-default.css" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<header id="title-block-header">
|
||||
<h1 class="title">HotSpot Coding Style</h1>
|
||||
</header>
|
||||
<nav id="TOC">
|
||||
<ul>
|
||||
<li><a href="#introduction">Introduction</a><ul>
|
||||
<li><a href="#why-care-about-style">Why Care About Style?</a></li>
|
||||
<li><a href="#counterexamples-and-updates">Counterexamples and Updates</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#structure-and-formatting">Structure and Formatting</a><ul>
|
||||
<li><a href="#factoring-and-class-design">Factoring and Class Design</a></li>
|
||||
<li><a href="#source-files">Source Files</a></li>
|
||||
<li><a href="#jtreg-tests">JTReg Tests</a></li>
|
||||
<li><a href="#naming">Naming</a></li>
|
||||
<li><a href="#commenting">Commenting</a></li>
|
||||
<li><a href="#macros">Macros</a></li>
|
||||
<li><a href="#whitespace">Whitespace</a></li>
|
||||
<li><a href="#miscellaneous">Miscellaneous</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#use-of-c-features">Use of C++ Features</a><ul>
|
||||
<li><a href="#error-handling">Error Handling</a></li>
|
||||
<li><a href="#rtti-runtime-type-information">RTTI (Runtime Type Information)</a></li>
|
||||
<li><a href="#memory-allocation">Memory Allocation</a></li>
|
||||
<li><a href="#class-inheritance">Class Inheritance</a></li>
|
||||
<li><a href="#namespaces">Namespaces</a></li>
|
||||
<li><a href="#c-standard-library">C++ Standard Library</a></li>
|
||||
<li><a href="#type-deduction">Type Deduction</a></li>
|
||||
<li><a href="#expression-sfinae">Expression SFINAE</a></li>
|
||||
<li><a href="#enum">enum</a></li>
|
||||
<li><a href="#thread_local">thread_local</a></li>
|
||||
<li><a href="#nullptr">nullptr</a></li>
|
||||
<li><a href="#atomic"><atomic></a></li>
|
||||
<li><a href="#additional-permitted-features">Additional Permitted Features</a></li>
|
||||
<li><a href="#excluded-features">Excluded Features</a></li>
|
||||
<li><a href="#undecided-features">Undecided Features</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<h2 id="introduction">Introduction</h2>
|
||||
<p>This is a collection of rules, guidelines, and suggestions for writing HotSpot code. Following these will help new code fit in with existing HotSpot code, making it easier to read and maintain. Failure to follow these guidelines may lead to discussion during code reviews, if not outright rejection of a change.</p>
|
||||
<h3 id="why-care-about-style">Why Care About Style?</h3>
|
||||
<p>Some programmers seem to have lexers and even C preprocessors installed directly behind their eyeballs. The rest of us require code that is not only functionally correct but also easy to read. More than that, since there is no one style for easy-to-read code, and since a mashup of many styles is just as confusing as no style at all, it is important for coders to be conscious of the many implicit stylistic choices that historically have gone into the HotSpot code base.</p>
|
||||
<p>Some of these guidelines are driven by the cross-platform requirements for HotSpot. Shared code must work on a variety of platforms, and may encounter deficiencies in some. Using platform conditionalization in shared code is usually avoided, while shared code is strongly preferred to multiple platform-dependent implementations, so some language features may be recommended against.</p>
|
||||
<p>Some of the guidelines here are relatively arbitrary choices among equally plausible alternatives. The purpose of stating and enforcing these rules is largely to provide a consistent look to the code. That consistency makes the code more readable by avoiding non-functional distractions from the interesting functionality.</p>
|
||||
<p>When changing pre-existing code, it is reasonable to adjust it to match these conventions. Exception: If the pre-existing code clearly conforms locally to its own peculiar conventions, it is not worth reformatting the whole thing. Also consider separating changes that make extensive stylistic updates from those which make functional changes.</p>
|
||||
<h3 id="counterexamples-and-updates">Counterexamples and Updates</h3>
|
||||
<p>Many of the guidelines mentioned here have (sometimes widespread) counterexamples in the HotSpot code base. Finding a counterexample is not sufficient justification for new code to follow the counterexample as a precedent, since readers of your code will rightfully expect your code to follow the greater bulk of precedents documented here.</p>
|
||||
<p>Occasionally a guideline mentioned here may be just out of synch with the actual HotSpot code base. If you find that a guideline is consistently contradicted by a large number of counterexamples, please bring it up for discussion and possible change. The architectural rule, of course, is "When in Rome do as the Romans". Sometimes in the suburbs of Rome the rules are a little different; these differences can be pointed out here.</p>
|
||||
<p>Proposed changes should be discussed on the <a href="mailto:hotspot-dev@openjdk.java.net">HotSpot Developers</a> mailing list, and approved by <a href="https://en.wikipedia.org/wiki/Rough_consensus">rough consensus</a> of the <a href="https://openjdk.java.net/census#hotspot">HotSpot Group</a> Members. The Group Lead determines whether consensus has been reached. Changes are likely to be cautious and incremental, since HotSpot coders have been using these guidelines for years.</p>
|
||||
<h2 id="structure-and-formatting">Structure and Formatting</h2>
|
||||
<h3 id="factoring-and-class-design">Factoring and Class Design</h3>
|
||||
<ul>
|
||||
<li><p>Group related code together, so readers can concentrate on one section of one file.</p></li>
|
||||
<li><p>Classes are the primary code structuring mechanism. Place related functionality in a class, or a set of related classes. Use of either namespaces or public non-member functions is rare in HotSpot code. Static non-member functions are not uncommon.</p></li>
|
||||
<li><p>If a class <code>FooBar</code> is going to be used in more than one place, put it a file named fooBar.hpp and fooBar.cpp. If the class is a sidekick to a more important class <code>BazBat</code>, it can go in bazBat.hpp.</p></li>
|
||||
<li><p>Put a member function <code>FooBar::bang</code> into the same file that defined <code>FooBar</code>, or its associated <em>.inline.hpp or </em>.cpp file.</p></li>
|
||||
<li><p>Use public accessor functions for member variables accessed outside the class.</p></li>
|
||||
<li><p>Assign names to constant literals and use the names instead.</p></li>
|
||||
<li><p>Keep functions small, a screenful at most. Split out chunks of logic into file-local classes or static functions if needed.</p></li>
|
||||
<li><p>Factor away nonessential complexity into local inline helper functions and helper classes.</p></li>
|
||||
<li><p>Think clearly about internal invariants that apply to each class, and document them in the form of asserts within member functions.</p></li>
|
||||
<li><p>Make simple, self-evident contracts for member functions. If you cannot communicate a simple contract, redesign the class.</p></li>
|
||||
<li><p>Implement classes as if expecting rough usage by clients. Check for incorrect usage of a class using <code>assert(...)</code>, <code>guarantee(...)</code>, <code>ShouldNotReachHere()</code> and comments wherever needed. Performance is almost never a reason to omit asserts.</p></li>
|
||||
<li><p>When possible, design as if for reusability. This forces a clear design of the class's externals, and clean hiding of its internals.</p></li>
|
||||
<li><p>Initialize all variables and data structures to a known state. If a class has a constructor, initialize it there.</p></li>
|
||||
<li><p>Do no optimization before its time. Prove the need to optimize.</p></li>
|
||||
<li><p>When you must defactor to optimize, preserve as much structure as possible. If you must hand-inline some name, label the local copy with the original name.</p></li>
|
||||
<li><p>If you need to use a hidden detail (e.g., a structure offset), name it (as a constant or function) in the class that owns it.</p></li>
|
||||
<li><p>Don't use the Copy and Paste keys to replicate more than a couple lines of code. Name what you must repeat.</p></li>
|
||||
<li><p>If a class needs a member function to change a user-visible attribute, the change should be done with a "setter" accessor matched to the simple "getter".</p></li>
|
||||
</ul>
|
||||
<h3 id="source-files">Source Files</h3>
|
||||
<ul>
|
||||
<li><p>All source files must have a globally unique basename. The build system depends on this uniqueness.</p></li>
|
||||
<li><p>Do not put non-trivial function implementations in .hpp files. If the implementation depends on other .hpp files, put it in a .cpp or a .inline.hpp file.</p></li>
|
||||
<li><p>.inline.hpp files should only be included in .cpp or .inline.hpp files.</p></li>
|
||||
<li><p>All .cpp files include precompiled.hpp as the first include line.</p></li>
|
||||
<li><p>precompiled.hpp is just a build time optimization, so don't rely on it to resolve include problems.</p></li>
|
||||
<li><p>Keep the include lines alphabetically sorted.</p></li>
|
||||
<li><p>Put conditional inclusions (<code>#if ...</code>) at the end of the include list.</p></li>
|
||||
</ul>
|
||||
<h3 id="jtreg-tests">JTReg Tests</h3>
|
||||
<ul>
|
||||
<li><p>JTReg tests should have meaningful names.</p></li>
|
||||
<li><p>JTReg tests associated with specific bugs should be tagged with the <code>@bug</code> keyword in the test description.</p></li>
|
||||
<li><p>JTReg tests should be organized by component or feature under <code>test/</code>, in a directory hierarchy that generally follows that of the <code>src/</code> directory. There may be additional subdirectories to further categorize tests by feature. This structure makes it easy to run a collection of tests associated with a specific feature by specifying the associated directory as the source of the tests to run.</p>
|
||||
<ul>
|
||||
<li>Some (older) tests use the associated bug number in the directory name, the test name, or both. That naming style should no longer be used, with existing tests using that style being candidates for migration.</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<h3 id="naming">Naming</h3>
|
||||
<ul>
|
||||
<li><p>The length of a name may be correlated to the size of its scope. In particular, short names (even single letter names) may be fine in a small scope, but are usually inappropriate for larger scopes.</p></li>
|
||||
<li><p>Prefer whole words rather than abbreviations, unless the abbreviation is more widely used than the long form in the code's domain.</p></li>
|
||||
<li><p>Choose names consistently. Do not introduce spurious variations. Abbreviate corresponding terms to a consistent length.</p></li>
|
||||
<li><p>Global names must be unique, to avoid <a href="https://en.cppreference.com/w/cpp/language/definition" title="One Definition Rule">One Definition Rule</a> (ODR) violations. A common prefixing scheme for related global names is often used. (This is instead of using namespaces, which are mostly avoided in HotSpot.)</p></li>
|
||||
<li><p>Don't give two names to the semantically same thing. But use different names for semantically different things, even if they are representationally the same. (So use meaningful <code>typedef</code> or template alias names where appropriate.)</p></li>
|
||||
<li><p>When choosing names, avoid categorical nouns like "variable", "field", "parameter", "value", and verbs like "compute", "get". (<code>storeValue(int param)</code> is bad.)</p></li>
|
||||
<li><p>Type names and global names should use mixed-case with the first letter of each word capitalized (<code>FooBar</code>).</p></li>
|
||||
<li><p>Embedded abbreviations in otherwise mixed-case names are usually capitalized entirely rather than being treated as a single word with only the initial letter capitalized, e.g. "HTML" rather than "Html".</p></li>
|
||||
<li><p>Function and local variable names use lowercase with words separated by a single underscore (<code>foo_bar</code>).</p></li>
|
||||
<li><p>Class data member names have a leading underscore, and use lowercase with words separated by a single underscore (<code>_foo_bar</code>).</p></li>
|
||||
<li><p>Constant names may be upper-case or mixed-case, according to historical necessity. (Note: There are many examples of constants with lowercase names.)</p></li>
|
||||
<li><p>Constant names should follow an existing pattern, and must have a distinct appearance from other names in related APIs.</p></li>
|
||||
<li><p>Class and type names should be noun phrases. Consider an "er" suffix for a class that represents an action.</p></li>
|
||||
<li><p>Function names should be verb phrases that reflect changes of state known to a class's user, or else noun phrases if they cause no change of state visible to the class's user.</p></li>
|
||||
<li><p>Getter accessor names are noun phrases, with no "<code>get_</code>" noise word. Boolean getters can also begin with "<code>is_</code>" or "<code>has_</code>". Member function for reading data members usually have the same name as the data member, exclusive of the leading underscore.</p></li>
|
||||
<li><p>Setter accessor names prepend "<code>set_</code>" to the getter name.</p></li>
|
||||
<li><p>Other member function names are verb phrases, as if commands to the receiver.</p></li>
|
||||
<li><p>Avoid leading underscores (as "<code>_oop</code>") except in cases required above. (Names with leading underscores can cause portability problems.)</p></li>
|
||||
</ul>
|
||||
<h3 id="commenting">Commenting</h3>
|
||||
<ul>
|
||||
<li><p>Clearly comment subtle fixes.</p></li>
|
||||
<li><p>Clearly comment tricky classes and functions.</p></li>
|
||||
<li><p>If you have to choose between commenting code and writing wiki content, comment the code. Link from the wiki to the source file if it makes sense.</p></li>
|
||||
<li><p>As a general rule don't add bug numbers to comments (they would soon overwhelm the code). But if the bug report contains significant information that can't reasonably be added as a comment, then refer to the bug report.</p></li>
|
||||
<li><p>Personal names are discouraged in the source code, which is a team product.</p></li>
|
||||
</ul>
|
||||
<h3 id="macros">Macros</h3>
|
||||
<ul>
|
||||
<li><p>You can almost always use an inline function or class instead of a macro. Use a macro only when you really need it.</p></li>
|
||||
<li><p>Templates may be preferable to multi-line macros. (There may be subtle performance effects with templates on some platforms; revert to macros if absolutely necessary.)</p></li>
|
||||
<li><p><code>#ifdef</code>s should not be used to introduce platform-specific code into shared code (except for <code>_LP64</code>). They must be used to manage header files, in the pattern found at the top of every source file. They should be used mainly for major build features, including <code>PRODUCT</code>, <code>ASSERT</code>, <code>_LP64</code>, <code>INCLUDE_SERIALGC</code>, <code>COMPILER1</code>, etc.</p></li>
|
||||
<li><p>For build features such as <code>PRODUCT</code>, use <code>#ifdef PRODUCT</code> for multiple-line inclusions or exclusions.</p></li>
|
||||
<li><p>For short inclusions or exclusions based on build features, use macros like <code>PRODUCT_ONLY</code> and <code>NOT_PRODUCT</code>. But avoid using them with multiple-line arguments, since debuggers do not handle that well.</p></li>
|
||||
<li><p>Use <code>CATCH</code>, <code>THROW</code>, etc. for HotSpot-specific exception processing.</p></li>
|
||||
</ul>
|
||||
<h3 id="whitespace">Whitespace</h3>
|
||||
<ul>
|
||||
<li><p>In general, don't change whitespace unless it improves readability or consistency. Gratuitous whitespace changes will make integrations and backports more difficult.</p></li>
|
||||
<li><p>Use One-True-Brace-Style. The opening brace for a function or class is normally at the end of the line; it is sometimes moved to the beginning of the next line for emphasis. Substatements are enclosed in braces, even if there is only a single statement. Extremely simple one-line statements may drop braces around a substatement.</p></li>
|
||||
<li><p>Indentation levels are two columns.</p></li>
|
||||
<li><p>There is no hard line length limit. That said, bear in mind that excessively long lines can cause difficulties. Some people like to have multiple side-by-side windows in their editors, and long lines may force them to choose among unpleasant options. They can use wide windows, reducing the number that can fit across the screen, and wasting a lot of screen real estate because most lines are not that long. Alternatively, they can have more windows across the screen, with long lines wrapping (or worse, requiring scrolling to see in their entirety), which is harder to read. Similar issues exist for side-by-side code reviews.</p></li>
|
||||
<li><p>Tabs are not allowed in code. Set your editor accordingly.<br> (Emacs: <code>(setq-default indent-tabs-mode nil)</code>.)</p></li>
|
||||
<li><p>Use good taste to break lines and align corresponding tokens on adjacent lines.</p></li>
|
||||
<li><p>Use spaces around operators, especially comparisons and assignments. (Relaxable for boolean expressions and high-precedence operators in classic math-style formulas.)</p></li>
|
||||
<li><p>Put spaces on both sides of control flow keywords <code>if</code>, <code>else</code>, <code>for</code>, <code>switch</code>, etc. Don't add spaces around the associated <em>control</em> expressions. Examples:</p>
|
||||
<pre><code>while (test_foo(args...)) { // Yes
|
||||
while(test_foo(args...)) { // No, missing space after while
|
||||
while ( test_foo(args...) ) { // No, excess spaces around control</code></pre></li>
|
||||
<li><p>Use extra parentheses in expressions whenever operator precedence seems doubtful. Always use parentheses in shift/mask expressions (<code><<</code>, <code>&</code>, <code>|</code>). Don't add whitespace immediately inside parentheses.</p></li>
|
||||
<li><p>Use more spaces and blank lines between larger constructs, such as classes or function definitions.</p></li>
|
||||
<li><p>If the surrounding code has any sort of vertical organization, adjust new lines horizontally to be consistent with that organization. (E.g., trailing backslashes on long macro definitions often align.)</p></li>
|
||||
</ul>
|
||||
<h3 id="miscellaneous">Miscellaneous</h3>
|
||||
<ul>
|
||||
<li><p>Use the <a href="https://en.cppreference.com/w/cpp/language/raii" title="Resource Acquisition Is Initialization">Resource Acquisition Is Initialization</a> (RAII) design pattern to manage bracketed critical sections. See class <code>ResourceMark</code> for an example.</p></li>
|
||||
<li>Avoid implicit conversions to <code>bool</code>.
|
||||
<ul>
|
||||
<li>Use <code>bool</code> for boolean values.</li>
|
||||
<li>Do not use ints or pointers as (implicit) booleans with <code>&&</code>, <code>||</code>, <code>if</code>, <code>while</code>. Instead, compare explicitly, i.e. <code>if (x != 0)</code> or <code>if (ptr != nullptr)</code>, etc.</li>
|
||||
<li>Do not use declarations in <em>condition</em> forms, i.e. don't use <code>if (T v = value) { ... }</code>.</li>
|
||||
</ul></li>
|
||||
<li><p>Use functions from globalDefinitions.hpp and related files when performing bitwise operations on integers. Do not code directly as C operators, unless they are extremely simple. (Examples: <code>align_up</code>, <code>is_power_of_2</code>, <code>exact_log2</code>.)</p></li>
|
||||
<li><p>Use arrays with abstractions supporting range checks.</p></li>
|
||||
<li><p>Always enumerate all cases in a switch statement or provide a default case. It is ok to have an empty default with comment.</p></li>
|
||||
</ul>
|
||||
<h2 id="use-of-c-features">Use of C++ Features</h2>
|
||||
<p>HotSpot was originally written in a subset of the C++98/03 language. More recently, support for C++14 is provided, though again, HotSpot only uses a subset. (Backports to JDK versions lacking support for more recent Standards must of course stick with the original C++98/03 subset.)</p>
|
||||
<p>This section describes that subset. Features from the C++98/03 language may be used unless explicitly excluded here. Features from C++11 and C++14 may be explicitly permitted or explicitly excluded, and discussed accordingly here. There is a third category, undecided features, about which HotSpot developers have not yet reached a consensus, or perhaps have not discussed at all. Use of these features is also excluded.</p>
|
||||
<p>(The use of some features may not be immediately obvious and may slip in anyway, since the compiler will accept them. The code review process is the main defense against this.)</p>
|
||||
<p>Some features are discussed in their own subsection, typically to provide more extensive discussion or rationale for limitations. Features that don't have their own subsection are listed in omnibus feature sections for permitted, excluded, and undecided features.</p>
|
||||
<p>Lists of new features for C++11 and C++14, along with links to their descriptions, can be found in the online documentation for some of the compilers and libraries. The C++14 Standard is the definitive description.</p>
|
||||
<ul>
|
||||
<li><a href="https://gcc.gnu.org/projects/cxx-status.html">C++ Standards Support in GCC</a></li>
|
||||
<li><a href="https://clang.llvm.org/cxx_status.html">C++ Support in Clang</a></li>
|
||||
<li><a href="https://docs.microsoft.com/en-us/cpp/visual-cpp-language-conformance">Visual C++ Language Conformance</a></li>
|
||||
<li><a href="https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html">libstdc++ Status</a></li>
|
||||
<li><a href="https://libcxx.llvm.org/cxx1y_status.html">libc++ Status</a></li>
|
||||
</ul>
|
||||
<p>As a rule of thumb, permitting features which simplify writing code and, especially, reading code, is encouraged.</p>
|
||||
<p>Similar discussions for some other projects:</p>
|
||||
<ul>
|
||||
<li><p><a href="https://google.github.io/styleguide/cppguide.html">Google C++ Style Guide</a> — Currently (2020) targeting C++17.</p></li>
|
||||
<li><p><a href="https://chromium-cpp.appspot.com">C++11 and C++14 use in Chromium</a> — Categorizes features as allowed, banned, or to be discussed.</p></li>
|
||||
<li><p><a href="https://llvm.org/docs/CodingStandards.html">llvm Coding Standards</a> — Currently (2020) targeting C++14.</p></li>
|
||||
<li><p><a href="https://firefox-source-docs.mozilla.org/code-quality/coding-style/using_cxx_in_firefox_code.html">Using C++ in Mozilla code</a> — C++17 support is required for recent versions (2020).</p></li>
|
||||
</ul>
|
||||
<h3 id="error-handling">Error Handling</h3>
|
||||
<p>Do not use exceptions. Exceptions are disabled by the build configuration for some platforms.</p>
|
||||
<p>Rationale: There is significant concern over the performance cost of exceptions and their usage model and implications for maintainable code. That's not just a matter of history that has been fixed; there remain questions and problems even today (2019). See, for example, <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0709r0.pdf">Zero cost deterministic exceptions</a>. Because of this, HotSpot has always used a build configuration that disables exceptions where that is available. As a result, HotSpot code uses error handling mechanisms such as two-phase construction, factory functions, returning error codes, and immediate termination. Even if the cost of exceptions were not a concern, the existing body of code was not written with exception safety in mind. Making HotSpot exception safe would be a very large undertaking.</p>
|
||||
<p>In addition to the usual alternatives to exceptions, HotSpot provides its own exception mechanism. This is based on a set of macros defined in utilities/exceptions.hpp.</p>
|
||||
<h3 id="rtti-runtime-type-information">RTTI (Runtime Type Information)</h3>
|
||||
<p>Do not use <a href="https://en.wikipedia.org/wiki/Run-time_type_information" title="Runtime Type Information">Runtime Type Information</a> (RTTI). <a href="https://en.wikipedia.org/wiki/Run-time_type_information" title="Runtime Type Information">RTTI</a> is disabled by the build configuration for some platforms. Among other things, this means <code>dynamic_cast</code> cannot be used.</p>
|
||||
<p>Rationale: Other than to implement exceptions (which HotSpot doesn't use), most potential uses of <a href="https://en.wikipedia.org/wiki/Run-time_type_information" title="Runtime Type Information">RTTI</a> are better done via virtual functions. Some of the remainder can be replaced by bespoke mechanisms. The cost of the additional runtime data structures needed to support <a href="https://en.wikipedia.org/wiki/Run-time_type_information" title="Runtime Type Information">RTTI</a> are deemed not worthwhile, given the alternatives.</p>
|
||||
<h3 id="memory-allocation">Memory Allocation</h3>
|
||||
<p>Do not use the standard global allocation and deallocation functions (operator new and related functions). Use of these functions by HotSpot code is disabled for some platforms.</p>
|
||||
<p>Rationale: HotSpot often uses "resource" or "arena" allocation. Even where heap allocation is used, the standard global functions are avoided in favor of wrappers around malloc and free that support the VM's Native Memory Tracking (NMT) feature.</p>
|
||||
<p>Native memory allocation failures are often treated as non-recoverable. The place where "out of memory" is (first) detected may be an innocent bystander, unrelated to the actual culprit.</p>
|
||||
<h3 id="class-inheritance">Class Inheritance</h3>
|
||||
<p>Use public single inheritance.</p>
|
||||
<p>Prefer composition rather than non-public inheritance.</p>
|
||||
<p>Restrict inheritance to the "is-a" case; use composition rather than non-is-a related inheritance.</p>
|
||||
<p>Avoid multiple inheritance. Never use virtual inheritance.</p>
|
||||
<h3 id="namespaces">Namespaces</h3>
|
||||
<p>Avoid using namespaces. HotSpot code normally uses "all static" classes rather than namespaces for grouping. An "all static" class is not instantiable, has only static members, and is normally derived (possibly indirectly) from the helper class <code>AllStatic</code>.</p>
|
||||
<p>Benefits of using such classes include:</p>
|
||||
<ul>
|
||||
<li><p>Provides access control for members, which is unavailable with namespaces.</p></li>
|
||||
<li><p>Avoids <a href="https://en.cppreference.com/w/cpp/language/adl" title="Argument Dependent Lookup">Argument Dependent Lookup</a> (ADL).</p></li>
|
||||
<li><p>Closed for additional members. Namespaces allow names to be added in multiple contexts, making it harder to see the complete API.</p></li>
|
||||
</ul>
|
||||
<p>Namespaces should be used only in cases where one of those "benefits" is actually a hindrance.</p>
|
||||
<p>In particular, don't use anonymous namespaces. They seem like they should be useful, and indeed have some real benefits for naming and generated code size on some platforms. Unfortunately, debuggers don't seem to like them at all.</p>
|
||||
<p><a href="https://groups.google.com/forum/#!topic/mozilla.dev.platform/KsaG3lEEaRM" class="uri">https://groups.google.com/forum/#!topic/mozilla.dev.platform/KsaG3lEEaRM</a><br> Suggests Visual Studio debugger might not be able to refer to anonymous namespace symbols, so can't set breakpoints in them. Though the discussion seems to go back and forth on that.</p>
|
||||
<p><a href="https://firefox-source-docs.mozilla.org/code-quality/coding-style/coding_style_cpp.html" class="uri">https://firefox-source-docs.mozilla.org/code-quality/coding-style/coding_style_cpp.html</a><br> Search for "Anonymous namespaces" Suggests preferring "static" to anonymous namespaces where applicable, because of poor debugger support for anonymous namespaces.</p>
|
||||
<p><a href="https://sourceware.org/bugzilla/show_bug.cgi?id=16874" class="uri">https://sourceware.org/bugzilla/show_bug.cgi?id=16874</a><br> Bug for similar gdb problems.</p>
|
||||
<h3 id="c-standard-library">C++ Standard Library</h3>
|
||||
<p>Avoid using the C++ Standard Library.</p>
|
||||
<p>Historically, HotSpot has mostly avoided use of the Standard Library.</p>
|
||||
<p>(It used to be impossible to use most of it in shared code, because the build configuration for Solaris with Solaris Studio made all but a couple of pieces inaccessible. Support for header-only parts was added in mid-2017. Support for Solaris was removed in 2020.)</p>
|
||||
<p>Some reasons for this include</p>
|
||||
<ul>
|
||||
<li><p>Exceptions. Perhaps the largest core issue with adopting the use of Standard Library facilities is exceptions. HotSpot does not use exceptions and, for platforms which allow doing so, builds with them turned off. Many Standard Library facilities implicitly or explicitly use exceptions.</p></li>
|
||||
<li><p><code>assert</code>. An issue that is quickly encountered is the <code>assert</code> macro name collision (<a href="https://bugs.openjdk.java.net/browse/JDK-8007770">JDK-8007770</a>). Some mechanism for addressing this would be needed before much of the Standard Library could be used. (Not all Standard Library implementations use assert in header files, but some do.)</p></li>
|
||||
<li><p>Memory allocation. HotSpot requires explicit control over where allocations occur. The C++98/03 <code>std::allocator</code> class is too limited to support our usage. (Changes in more recent Standards may remove this limitation.)</p></li>
|
||||
<li><p>Implementation vagaries. Bugs, or simply different implementation choices, can lead to different behaviors among the various Standard Libraries we need to deal with.</p></li>
|
||||
<li><p>Inconsistent naming conventions. HotSpot and the C++ Standard use different naming conventions. The coexistence of those different conventions might appear jarring and reduce readability.</p></li>
|
||||
</ul>
|
||||
<p>There are a few exceptions to this rule.</p>
|
||||
<ul>
|
||||
<li><code>#include <new></code> to use placement <code>new</code>, <code>std::nothrow</code>, and <code>std::nothrow_t</code>.</li>
|
||||
<li><code>#include <limits></code> to use <code>std::numeric_limits</code>.</li>
|
||||
<li><code>#include <type_traits></code>.</li>
|
||||
<li><code>#include <cstddef></code> to use <code>std::nullptr_t</code>.</li>
|
||||
</ul>
|
||||
<p>TODO: Rather than directly #including (permitted) Standard Library headers, use a convention of #including wrapper headers (in some location like hotspot/shared/stdcpp). This provides a single place for dealing with issues we might have for any given header, esp. platform-specific issues.</p>
|
||||
<h3 id="type-deduction">Type Deduction</h3>
|
||||
<p>Use type deduction only if it makes the code clearer or safer. Do not use it merely to avoid the inconvenience of writing an explicit type, unless that type is itself difficult to write. An example of the latter is a function template return type that depends on template parameters in a non-trivial way.</p>
|
||||
<p>There are several contexts where types are deduced.</p>
|
||||
<ul>
|
||||
<li><p>Function argument deduction. This is always permitted, and indeed encouraged. It is nearly always better to allow the type of a function template argument to be deduced rather than explicitly specified.</p></li>
|
||||
<li><p><code>auto</code> variable declarations (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf">n1984</a>)<br> For local variables, this can be used to make the code clearer by eliminating type information that is obvious or irrelevant. Excessive use can make code much harder to understand.</p></li>
|
||||
<li><p>Function return type deduction (<a href="https://isocpp.org/files/papers/N3638.html">n3638</a>)<br> Only use if the function body has a very small number of <code>return</code> statements, and generally relatively little other code.</p></li>
|
||||
<li><p>Generic lambdas. Lambdas are not (yet) permitted.</p></li>
|
||||
<li><p>Lambda init captures. Lambdas are not (yet) permitted.</p></li>
|
||||
</ul>
|
||||
<h3 id="expression-sfinae">Expression SFINAE</h3>
|
||||
<p><a href="https://en.cppreference.com/w/cpp/language/sfinae" title="Substitution Failure Is Not An Error">Substitution Failure Is Not An Error</a> (SFINAE) is a template metaprogramming technique that makes use of template parameter substitution failures to make compile-time decisions.</p>
|
||||
<p>C++11 relaxed the rules for what constitutes a hard-error when attempting to substitute template parameters with template arguments, making most deduction errors be substitution errors; see (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html">n2634</a>). This makes <a href="https://en.cppreference.com/w/cpp/language/sfinae" title="Substitution Failure Is Not An Error">SFINAE</a> more powerful and easier to use. However, the implementation complexity for this change is significant, and this seems to be a place where obscure corner-case bugs in various compilers can be found. So while this feature can (and indeed should) be used (and would be difficult to avoid), caution should be used when pushing to extremes.</p>
|
||||
<p>Here are a few closely related example bugs:<br> <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95468" class="uri">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95468</a><br> <a href="https://developercommunity.visualstudio.com/content/problem/396562/sizeof-deduced-type-is-sometimes-not-a-constant-ex.html" class="uri">https://developercommunity.visualstudio.com/content/problem/396562/sizeof-deduced-type-is-sometimes-not-a-constant-ex.html</a></p>
|
||||
<h3 id="enum">enum</h3>
|
||||
<p>Where appropriate, <em>scoped-enums</em> should be used. (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf">n2347</a>)</p>
|
||||
<p>Use of <em>unscoped-enums</em> is permitted, though ordinary constants may be preferable when the automatic initializer feature isn't used.</p>
|
||||
<p>The underlying type (the <em>enum-base</em>) of an unscoped enum type should always be specified explicitly. When unspecified, the underlying type is dependent on the range of the enumerator values and the platform.</p>
|
||||
<p>The underlying type of a <em>scoped-enum</em> should also be specified explicitly if conversions may be applied to values of that type.</p>
|
||||
<p>Due to bugs in certain (very old) compilers, there is widespread use of enums and avoidance of in-class initialization of static integral constant members. Compilers having such bugs are no longer supported. Except where an enum is semantically appropriate, new code should use integral constants.</p>
|
||||
<h3 id="thread_local">thread_local</h3>
|
||||
<p>Do not use <code>thread_local</code> (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm">n2659</a>); instead, use the HotSpot macro <code>THREAD_LOCAL</code>. The initializer must be a constant expression.</p>
|
||||
<p>As was discussed in the review for <a href="https://mail.openjdk.java.net/pipermail/hotspot-dev/2019-September/039487.html">JDK-8230877</a>, <code>thread_local</code> allows dynamic initialization and destruction semantics. However, that support requires a run-time penalty for references to non-function-local <code>thread_local</code> variables defined in a different translation unit, even if they don't need dynamic initialization. Dynamic initialization and destruction of namespace-scoped thread local variables also has the same ordering problems as for ordinary namespace-scoped variables.</p>
|
||||
<h3 id="nullptr">nullptr</h3>
|
||||
<p>Prefer <code>nullptr</code> (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf">n2431</a>) to <code>NULL</code>. Don't use (constexpr or literal) 0 for pointers.</p>
|
||||
<p>For historical reasons there are widespread uses of both <code>NULL</code> and of integer 0 as a pointer value.</p>
|
||||
<h3 id="atomic"><atomic></h3>
|
||||
<p>Do not use facilities provided by the <code><atomic></code> header (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html">n2427</a>), (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2752.htm">n2752</a>); instead, use the HotSpot <code>Atomic</code> class and related facilities.</p>
|
||||
<p>Atomic operations in HotSpot code must have semantics which are consistent with those provided by the JDK's compilers for Java. There are platform-specific implementation choices that a C++ compiler might make or change that are outside the scope of the C++ Standard, and might differ from what the Java compilers implement.</p>
|
||||
<p>In addition, HotSpot <code>Atomic</code> has a concept of "conservative" memory ordering, which may differ from (may be stronger than) sequentially consistent. There are algorithms in HotSpot that are believed to rely on that ordering.</p>
|
||||
<h3 id="additional-permitted-features">Additional Permitted Features</h3>
|
||||
<ul>
|
||||
<li><p><code>constexpr</code> (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf">n2235</a>) (<a href="https://isocpp.org/files/papers/N3652.html">n3652</a>)</p></li>
|
||||
<li><p>Sized deallocation (<a href="https://isocpp.org/files/papers/n3778.html">n3778</a>)</p></li>
|
||||
<li><p>Variadic templates (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf">n2242</a>) (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf">n2555</a>)</p></li>
|
||||
<li><p>Static assertions (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html">n1720</a>)</p></li>
|
||||
<li><p><code>decltype</code> (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf">n2343</a>) (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3276.pdf">n3276</a>)</p></li>
|
||||
<li><p>Right angle brackets (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html">n1757</a>)</p></li>
|
||||
<li><p>Default template arguments for function templates (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226">CWG D226</a>)</p></li>
|
||||
<li><p>Template aliases (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf">n2258</a>)</p></li>
|
||||
<li><p>Delegating constructors (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf">n1986</a>)</p></li>
|
||||
<li><p>Explicit conversion operators (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf">n2437</a>)</p></li>
|
||||
<li><p>Standard Layout Types (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm">n2342</a>)</p></li>
|
||||
<li><p>Defaulted and deleted functions (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm">n2346</a>)</p></li>
|
||||
<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>
|
||||
</ul>
|
||||
<h3 id="excluded-features">Excluded Features</h3>
|
||||
<ul>
|
||||
<li>New string and character literals
|
||||
<ul>
|
||||
<li>New character types (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html">n2249</a>)</li>
|
||||
<li>Unicode string literals (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm">n2442</a>)</li>
|
||||
<li>Raw string literals (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm">n2442</a>)</li>
|
||||
<li>Universal character name literals (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html">n2170</a>)</li>
|
||||
</ul>
|
||||
<p>HotSpot doesn't need any of the new character and string literal types.</p></li>
|
||||
<li><p>User-defined literals (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf">n2765</a>) — User-defined literals should not be added casually, but only through a proposal to add a specific UDL.</p></li>
|
||||
<li><p>Inline namespaces (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm">n2535</a>) — HotSpot makes very limited use of namespaces.</p></li>
|
||||
<li><p><code>using namespace</code> directives. In particular, don't use <code>using namespace std;</code> to avoid needing to qualify Standard Library names.</p></li>
|
||||
<li><p>Propagating exceptions (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html">n2179</a>) — HotSpot does not permit the use of exceptions, so this feature isn't useful.</p></li>
|
||||
<li><p>Avoid namespace-scoped variables with non-constexpr initialization. In particular, avoid variables with types requiring non-trivial initialization or destruction. Initialization order problems can be difficult to deal with and lead to surprises, as can destruction ordering. HotSpot doesn't generally try to cleanup on exit, and running destructors at exit can also lead to problems.</p></li>
|
||||
<li><p><code>[[deprecated]]</code> attribute (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3760.html">n3760</a>) — Not relevant in HotSpot code.</p></li>
|
||||
<li><p>Avoid most operator overloading, preferring named functions. When operator overloading is used, ensure the semantics conform to the normal expected behavior of the operation.</p></li>
|
||||
<li><p>Avoid most implicit conversion constructors and (implicit or explicit) conversion operators. (Note that conversion to <code>bool</code> isn't needed in HotSpot code because of the "no implicit boolean" guideline.)</p></li>
|
||||
<li><p>Avoid covariant return types.</p></li>
|
||||
<li><p>Avoid <code>goto</code> statements.</p></li>
|
||||
</ul>
|
||||
<h3 id="undecided-features">Undecided Features</h3>
|
||||
<p>This list is incomplete; it serves to explicitly call out some features that have not yet been discussed.</p>
|
||||
<ul>
|
||||
<li><p><code>overrides</code> virtual specifiers for virtual functions (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm">n3272</a>)</p></li>
|
||||
<li><p>Trailing return type syntax for functions (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm">n2541</a>)</p></li>
|
||||
<li><p>Variable templates (<a href="https://isocpp.org/files/papers/N3651.pdf">n3651</a>)</p></li>
|
||||
<li><p>Member initializers and aggregates (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3653.html">n3653</a>)</p></li>
|
||||
<li><p><code>[[noreturn]]</code> attribute (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf">n2761</a>)</p></li>
|
||||
<li><p>Rvalue references and move semantics</p></li>
|
||||
<li><p>Lambdas</p></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
828
doc/hotspot-style.md
Normal file
828
doc/hotspot-style.md
Normal file
@@ -0,0 +1,828 @@
|
||||
% HotSpot Coding Style
|
||||
|
||||
## Introduction
|
||||
|
||||
This is a collection of rules, guidelines, and suggestions for writing
|
||||
HotSpot code. Following these will help new code fit in with existing
|
||||
HotSpot code, making it easier to read and maintain. Failure to
|
||||
follow these guidelines may lead to discussion during code reviews, if
|
||||
not outright rejection of a change.
|
||||
|
||||
### Why Care About Style?
|
||||
|
||||
Some programmers seem to have lexers and even C preprocessors
|
||||
installed directly behind their eyeballs. The rest of us require code
|
||||
that is not only functionally correct but also easy to read. More than
|
||||
that, since there is no one style for easy-to-read code, and since a
|
||||
mashup of many styles is just as confusing as no style at all, it is
|
||||
important for coders to be conscious of the many implicit stylistic
|
||||
choices that historically have gone into the HotSpot code base.
|
||||
|
||||
Some of these guidelines are driven by the cross-platform requirements
|
||||
for HotSpot. Shared code must work on a variety of platforms, and may
|
||||
encounter deficiencies in some. Using platform conditionalization in
|
||||
shared code is usually avoided, while shared code is strongly
|
||||
preferred to multiple platform-dependent implementations, so some
|
||||
language features may be recommended against.
|
||||
|
||||
Some of the guidelines here are relatively arbitrary choices among
|
||||
equally plausible alternatives. The purpose of stating and enforcing
|
||||
these rules is largely to provide a consistent look to the code. That
|
||||
consistency makes the code more readable by avoiding non-functional
|
||||
distractions from the interesting functionality.
|
||||
|
||||
When changing pre-existing code, it is reasonable to adjust it to
|
||||
match these conventions. Exception: If the pre-existing code clearly
|
||||
conforms locally to its own peculiar conventions, it is not worth
|
||||
reformatting the whole thing. Also consider separating changes that
|
||||
make extensive stylistic updates from those which make functional
|
||||
changes.
|
||||
|
||||
### Counterexamples and Updates
|
||||
|
||||
Many of the guidelines mentioned here have (sometimes widespread)
|
||||
counterexamples in the HotSpot code base. Finding a counterexample is
|
||||
not sufficient justification for new code to follow the counterexample
|
||||
as a precedent, since readers of your code will rightfully expect your
|
||||
code to follow the greater bulk of precedents documented here.
|
||||
|
||||
Occasionally a guideline mentioned here may be just out of synch with
|
||||
the actual HotSpot code base. If you find that a guideline is
|
||||
consistently contradicted by a large number of counterexamples, please
|
||||
bring it up for discussion and possible change. The architectural
|
||||
rule, of course, is "When in Rome do as the Romans". Sometimes in the
|
||||
suburbs of Rome the rules are a little different; these differences
|
||||
can be pointed out here.
|
||||
|
||||
Proposed changes should be discussed on the
|
||||
[HotSpot Developers](mailto:hotspot-dev@openjdk.java.net) mailing
|
||||
list, and approved by
|
||||
[rough consensus](https://en.wikipedia.org/wiki/Rough_consensus) of
|
||||
the [HotSpot Group](https://openjdk.java.net/census#hotspot) Members.
|
||||
The Group Lead determines whether consensus has been reached.
|
||||
Changes are likely to be cautious and incremental, since HotSpot
|
||||
coders have been using these guidelines for years.
|
||||
|
||||
## Structure and Formatting
|
||||
|
||||
### Factoring and Class Design
|
||||
|
||||
* Group related code together, so readers can concentrate on one
|
||||
section of one file.
|
||||
|
||||
* Classes are the primary code structuring mechanism. Place related
|
||||
functionality in a class, or a set of related classes. Use of either
|
||||
namespaces or public non-member functions is rare in HotSpot code.
|
||||
Static non-member functions are not uncommon.
|
||||
|
||||
* If a class `FooBar` is going to be used in more than one place, put it
|
||||
a file named fooBar.hpp and fooBar.cpp. If the class is a sidekick
|
||||
to a more important class `BazBat`, it can go in bazBat.hpp.
|
||||
|
||||
* Put a member function `FooBar::bang` into the same file that defined
|
||||
`FooBar`, or its associated *.inline.hpp or *.cpp file.
|
||||
|
||||
* Use public accessor functions for member variables accessed
|
||||
outside the class.
|
||||
|
||||
* Assign names to constant literals and use the names instead.
|
||||
|
||||
* Keep functions small, a screenful at most. Split out chunks of
|
||||
logic into file-local classes or static functions if needed.
|
||||
|
||||
* Factor away nonessential complexity into local inline helper
|
||||
functions and helper classes.
|
||||
|
||||
* Think clearly about internal invariants that apply to each class,
|
||||
and document them in the form of asserts within member functions.
|
||||
|
||||
* Make simple, self-evident contracts for member functions. If you cannot
|
||||
communicate a simple contract, redesign the class.
|
||||
|
||||
* Implement classes as if expecting rough usage by clients. Check for
|
||||
incorrect usage of a class using `assert(...)`, `guarantee(...)`,
|
||||
`ShouldNotReachHere()` and comments wherever needed. Performance is
|
||||
almost never a reason to omit asserts.
|
||||
|
||||
* When possible, design as if for reusability. This forces a clear
|
||||
design of the class's externals, and clean hiding of its internals.
|
||||
|
||||
* Initialize all variables and data structures to a known state. If a
|
||||
class has a constructor, initialize it there.
|
||||
|
||||
* Do no optimization before its time. Prove the need to optimize.
|
||||
|
||||
* When you must defactor to optimize, preserve as much structure as
|
||||
possible. If you must hand-inline some name, label the local copy with
|
||||
the original name.
|
||||
|
||||
* If you need to use a hidden detail (e.g., a structure offset), name
|
||||
it (as a constant or function) in the class that owns it.
|
||||
|
||||
* Don't use the Copy and Paste keys to replicate more than a couple
|
||||
lines of code. Name what you must repeat.
|
||||
|
||||
* If a class needs a member function to change a user-visible attribute, the
|
||||
change should be done with a "setter" accessor matched to the simple
|
||||
"getter".
|
||||
|
||||
### Source Files
|
||||
|
||||
* All source files must have a globally unique basename. The build
|
||||
system depends on this uniqueness.
|
||||
|
||||
* Do not put non-trivial function implementations in .hpp files. If
|
||||
the implementation depends on other .hpp files, put it in a .cpp or
|
||||
a .inline.hpp file.
|
||||
|
||||
* .inline.hpp files should only be included in .cpp or .inline.hpp
|
||||
files.
|
||||
|
||||
* All .cpp files include precompiled.hpp as the first include line.
|
||||
|
||||
* precompiled.hpp is just a build time optimization, so don't rely on
|
||||
it to resolve include problems.
|
||||
|
||||
* Keep the include lines alphabetically sorted.
|
||||
|
||||
* Put conditional inclusions (`#if ...`) at the end of the include list.
|
||||
|
||||
### JTReg Tests
|
||||
|
||||
* JTReg tests should have meaningful names.
|
||||
|
||||
* JTReg tests associated with specific bugs should be tagged with the
|
||||
`@bug` keyword in the test description.
|
||||
|
||||
* JTReg tests should be organized by component or feature under
|
||||
`test/`, in a directory hierarchy that generally follows that of the
|
||||
`src/` directory. There may be additional subdirectories to further
|
||||
categorize tests by feature. This structure makes it easy to run a
|
||||
collection of tests associated with a specific feature by specifying
|
||||
the associated directory as the source of the tests to run.
|
||||
|
||||
* Some (older) tests use the associated bug number in the directory
|
||||
name, the test name, or both. That naming style should no longer be
|
||||
used, with existing tests using that style being candidates for migration.
|
||||
|
||||
### Naming
|
||||
|
||||
* The length of a name may be correlated to the size of its scope. In
|
||||
particular, short names (even single letter names) may be fine in a
|
||||
small scope, but are usually inappropriate for larger scopes.
|
||||
|
||||
* Prefer whole words rather than abbreviations, unless the
|
||||
abbreviation is more widely used than the long form in the code's
|
||||
domain.
|
||||
|
||||
* Choose names consistently. Do not introduce spurious
|
||||
variations. Abbreviate corresponding terms to a consistent length.
|
||||
|
||||
* Global names must be unique, to avoid [One Definition Rule][ODR] (ODR)
|
||||
violations. A common prefixing scheme for related global names is
|
||||
often used. (This is instead of using namespaces, which are mostly
|
||||
avoided in HotSpot.)
|
||||
|
||||
* Don't give two names to the semantically same thing. But use
|
||||
different names for semantically different things, even if they are
|
||||
representationally the same. (So use meaningful `typedef` or template
|
||||
alias names where appropriate.)
|
||||
|
||||
* When choosing names, avoid categorical nouns like "variable",
|
||||
"field", "parameter", "value", and verbs like "compute", "get".
|
||||
(`storeValue(int param)` is bad.)
|
||||
|
||||
* Type names and global names should use mixed-case with the first
|
||||
letter of each word capitalized (`FooBar`).
|
||||
|
||||
* Embedded abbreviations in
|
||||
otherwise mixed-case names are usually capitalized entirely rather
|
||||
than being treated as a single word with only the initial letter
|
||||
capitalized, e.g. "HTML" rather than "Html".
|
||||
|
||||
* Function and local variable names use lowercase with words separated
|
||||
by a single underscore (`foo_bar`).
|
||||
|
||||
* Class data member names have a leading underscore, and use lowercase
|
||||
with words separated by a single underscore (`_foo_bar`).
|
||||
|
||||
* Constant names may be upper-case or mixed-case, according to
|
||||
historical necessity. (Note: There are many examples of constants
|
||||
with lowercase names.)
|
||||
|
||||
* Constant names should follow an existing pattern, and must have a
|
||||
distinct appearance from other names in related APIs.
|
||||
|
||||
* Class and type names should be noun phrases. Consider an "er" suffix
|
||||
for a class that represents an action.
|
||||
|
||||
* Function names should be verb phrases that reflect changes of state
|
||||
known to a class's user, or else noun phrases if they cause no change
|
||||
of state visible to the class's user.
|
||||
|
||||
* Getter accessor names are noun phrases, with no "`get_`" noise
|
||||
word. Boolean getters can also begin with "`is_`" or "`has_`". Member
|
||||
function for reading data members usually have the same name as the
|
||||
data member, exclusive of the leading underscore.
|
||||
|
||||
* Setter accessor names prepend "`set_`" to the getter name.
|
||||
|
||||
* Other member function names are verb phrases, as if commands to the receiver.
|
||||
|
||||
* Avoid leading underscores (as "`_oop`") except in cases required
|
||||
above. (Names with leading underscores can cause portability
|
||||
problems.)
|
||||
|
||||
### Commenting
|
||||
|
||||
* Clearly comment subtle fixes.
|
||||
|
||||
* Clearly comment tricky classes and functions.
|
||||
|
||||
* If you have to choose between commenting code and writing wiki
|
||||
content, comment the code. Link from the wiki to the source file if
|
||||
it makes sense.
|
||||
|
||||
* As a general rule don't add bug numbers to comments (they would soon
|
||||
overwhelm the code). But if the bug report contains significant
|
||||
information that can't reasonably be added as a comment, then refer to
|
||||
the bug report.
|
||||
|
||||
* Personal names are discouraged in the source code, which is a team
|
||||
product.
|
||||
|
||||
### Macros
|
||||
|
||||
* You can almost always use an inline function or class instead of a
|
||||
macro. Use a macro only when you really need it.
|
||||
|
||||
* Templates may be preferable to multi-line macros. (There may be
|
||||
subtle performance effects with templates on some platforms; revert
|
||||
to macros if absolutely necessary.)
|
||||
|
||||
* `#ifdef`s should not be used to introduce platform-specific code
|
||||
into shared code (except for `_LP64`). They must be used to manage
|
||||
header files, in the pattern found at the top of every source
|
||||
file. They should be used mainly for major build features, including
|
||||
`PRODUCT`, `ASSERT`, `_LP64`, `INCLUDE_SERIALGC`, `COMPILER1`, etc.
|
||||
|
||||
* For build features such as `PRODUCT`, use `#ifdef PRODUCT` for
|
||||
multiple-line inclusions or exclusions.
|
||||
|
||||
* For short inclusions or exclusions based on build features, use
|
||||
macros like `PRODUCT_ONLY` and `NOT_PRODUCT`. But avoid using them
|
||||
with multiple-line arguments, since debuggers do not handle that
|
||||
well.
|
||||
|
||||
* Use `CATCH`, `THROW`, etc. for HotSpot-specific exception processing.
|
||||
|
||||
### Whitespace
|
||||
|
||||
* In general, don't change whitespace unless it improves readability
|
||||
or consistency. Gratuitous whitespace changes will make integrations
|
||||
and backports more difficult.
|
||||
|
||||
* Use One-True-Brace-Style. The opening brace for a function or class
|
||||
is normally at the end of the line; it is sometimes moved to the
|
||||
beginning of the next line for emphasis. Substatements are enclosed
|
||||
in braces, even if there is only a single statement. Extremely simple
|
||||
one-line statements may drop braces around a substatement.
|
||||
|
||||
* Indentation levels are two columns.
|
||||
|
||||
* There is no hard line length limit. That said, bear in mind that
|
||||
excessively long lines can cause difficulties. Some people like to
|
||||
have multiple side-by-side windows in their editors, and long lines
|
||||
may force them to choose among unpleasant options. They can use wide
|
||||
windows, reducing the number that can fit across the screen, and
|
||||
wasting a lot of screen real estate because most lines are not that
|
||||
long. Alternatively, they can have more windows across the screen,
|
||||
with long lines wrapping (or worse, requiring scrolling to see in
|
||||
their entirety), which is harder to read. Similar issues exist for
|
||||
side-by-side code reviews.
|
||||
|
||||
* Tabs are not allowed in code. Set your editor accordingly.<br>
|
||||
(Emacs: `(setq-default indent-tabs-mode nil)`.)
|
||||
|
||||
* Use good taste to break lines and align corresponding tokens on
|
||||
adjacent lines.
|
||||
|
||||
* Use spaces around operators, especially comparisons and
|
||||
assignments. (Relaxable for boolean expressions and high-precedence
|
||||
operators in classic math-style formulas.)
|
||||
|
||||
* Put spaces on both sides of control flow keywords `if`, `else`,
|
||||
`for`, `switch`, etc. Don't add spaces around the associated
|
||||
_control_ expressions. Examples:
|
||||
|
||||
```
|
||||
while (test_foo(args...)) { // Yes
|
||||
while(test_foo(args...)) { // No, missing space after while
|
||||
while ( test_foo(args...) ) { // No, excess spaces around control
|
||||
```
|
||||
|
||||
* Use extra parentheses in expressions whenever operator precedence
|
||||
seems doubtful. Always use parentheses in shift/mask expressions
|
||||
(`<<`, `&`, `|`). Don't add whitespace immediately inside
|
||||
parentheses.
|
||||
|
||||
* Use more spaces and blank lines between larger constructs, such as
|
||||
classes or function definitions.
|
||||
|
||||
* If the surrounding code has any sort of vertical organization,
|
||||
adjust new lines horizontally to be consistent with that
|
||||
organization. (E.g., trailing backslashes on long macro definitions
|
||||
often align.)
|
||||
|
||||
### Miscellaneous
|
||||
|
||||
* Use the [Resource Acquisition Is Initialization][RAII] (RAII)
|
||||
design pattern to manage bracketed critical
|
||||
sections. See class `ResourceMark` for an example.
|
||||
|
||||
* Avoid implicit conversions to `bool`.
|
||||
* Use `bool` for boolean values.
|
||||
* Do not use ints or pointers as (implicit) booleans with `&&`, `||`,
|
||||
`if`, `while`. Instead, compare explicitly, i.e. `if (x != 0)` or
|
||||
`if (ptr != nullptr)`, etc.
|
||||
* Do not use declarations in _condition_ forms, i.e. don't use
|
||||
`if (T v = value) { ... }`.
|
||||
|
||||
* Use functions from globalDefinitions.hpp and related files when
|
||||
performing bitwise
|
||||
operations on integers. Do not code directly as C operators, unless
|
||||
they are extremely simple. (Examples: `align_up`, `is_power_of_2`,
|
||||
`exact_log2`.)
|
||||
|
||||
* Use arrays with abstractions supporting range checks.
|
||||
|
||||
* Always enumerate all cases in a switch statement or provide a default
|
||||
case. It is ok to have an empty default with comment.
|
||||
|
||||
|
||||
## Use of C++ Features
|
||||
|
||||
HotSpot was originally written in a subset of the C++98/03 language.
|
||||
More recently, support for C++14 is provided, though again,
|
||||
HotSpot only uses a subset. (Backports to JDK versions lacking
|
||||
support for more recent Standards must of course stick with the
|
||||
original C++98/03 subset.)
|
||||
|
||||
This section describes that subset. Features from the C++98/03
|
||||
language may be used unless explicitly excluded here. Features from
|
||||
C++11 and C++14 may be explicitly permitted or explicitly excluded,
|
||||
and discussed accordingly here. There is a third category, undecided
|
||||
features, about which HotSpot developers have not yet reached a
|
||||
consensus, or perhaps have not discussed at all. Use of these
|
||||
features is also excluded.
|
||||
|
||||
(The use of some features may not be immediately obvious and may slip
|
||||
in anyway, since the compiler will accept them. The code review
|
||||
process is the main defense against this.)
|
||||
|
||||
Some features are discussed in their own subsection, typically to provide
|
||||
more extensive discussion or rationale for limitations. Features that
|
||||
don't have their own subsection are listed in omnibus feature sections
|
||||
for permitted, excluded, and undecided features.
|
||||
|
||||
Lists of new features for C++11 and C++14, along with links to their
|
||||
descriptions, can be found in the online documentation for some of the
|
||||
compilers and libraries. The C++14 Standard is the definitive
|
||||
description.
|
||||
|
||||
* [C++ Standards Support in GCC](https://gcc.gnu.org/projects/cxx-status.html)
|
||||
* [C++ Support in Clang](https://clang.llvm.org/cxx_status.html)
|
||||
* [Visual C++ Language Conformance](https://docs.microsoft.com/en-us/cpp/visual-cpp-language-conformance)
|
||||
* [libstdc++ Status](https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html)
|
||||
* [libc++ Status](https://libcxx.llvm.org/cxx1y_status.html)
|
||||
|
||||
As a rule of thumb, permitting features which simplify writing code
|
||||
and, especially, reading code, is encouraged.
|
||||
|
||||
Similar discussions for some other projects:
|
||||
|
||||
* [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html) —
|
||||
Currently (2020) targeting C++17.
|
||||
|
||||
* [C++11 and C++14 use in Chromium](https://chromium-cpp.appspot.com) —
|
||||
Categorizes features as allowed, banned, or to be discussed.
|
||||
|
||||
* [llvm Coding Standards](https://llvm.org/docs/CodingStandards.html) —
|
||||
Currently (2020) targeting C++14.
|
||||
|
||||
* [Using C++ in Mozilla code](https://firefox-source-docs.mozilla.org/code-quality/coding-style/using_cxx_in_firefox_code.html) —
|
||||
C++17 support is required for recent versions (2020).
|
||||
|
||||
### Error Handling
|
||||
|
||||
Do not use exceptions. Exceptions are disabled by the build configuration
|
||||
for some platforms.
|
||||
|
||||
Rationale: There is significant concern over the performance cost of
|
||||
exceptions and their usage model and implications for maintainable code.
|
||||
That's not just a matter of history that has been fixed; there remain
|
||||
questions and problems even today (2019). See, for example, [Zero cost
|
||||
deterministic
|
||||
exceptions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0709r0.pdf).
|
||||
Because of this, HotSpot has always used a build configuration that disables
|
||||
exceptions where that is available. As a result, HotSpot code uses error
|
||||
handling mechanisms such as two-phase construction, factory functions,
|
||||
returning error codes, and immediate termination. Even if the cost of
|
||||
exceptions were not a concern, the existing body of code was not written with
|
||||
exception safety in mind. Making HotSpot exception safe would be a very large
|
||||
undertaking.
|
||||
|
||||
In addition to the usual alternatives to exceptions, HotSpot provides its
|
||||
own exception mechanism. This is based on a set of macros defined in
|
||||
utilities/exceptions.hpp.
|
||||
|
||||
### RTTI (Runtime Type Information)
|
||||
|
||||
Do not use [Runtime Type Information][RTTI] (RTTI).
|
||||
[RTTI][] is disabled by the build configuration for some
|
||||
platforms. Among other things, this means `dynamic_cast` cannot be used.
|
||||
|
||||
Rationale: Other than to implement exceptions (which HotSpot doesn't use),
|
||||
most potential uses of [RTTI][] are better done via virtual functions. Some of
|
||||
the remainder can be replaced by bespoke mechanisms. The cost of the
|
||||
additional runtime data structures needed to support [RTTI][] are deemed not
|
||||
worthwhile, given the alternatives.
|
||||
|
||||
### Memory Allocation
|
||||
|
||||
Do not use the standard global allocation and deallocation functions
|
||||
(operator new and related functions). Use of these functions by HotSpot
|
||||
code is disabled for some platforms.
|
||||
|
||||
Rationale: HotSpot often uses "resource" or "arena" allocation. Even
|
||||
where heap allocation is used, the standard global functions are
|
||||
avoided in favor of wrappers around malloc and free that support the
|
||||
VM's Native Memory Tracking (NMT) feature.
|
||||
|
||||
Native memory allocation failures are often treated as non-recoverable.
|
||||
The place where "out of memory" is (first) detected may be an innocent
|
||||
bystander, unrelated to the actual culprit.
|
||||
|
||||
### Class Inheritance
|
||||
|
||||
Use public single inheritance.
|
||||
|
||||
Prefer composition rather than non-public inheritance.
|
||||
|
||||
Restrict inheritance to the "is-a" case; use composition rather than
|
||||
non-is-a related inheritance.
|
||||
|
||||
Avoid multiple inheritance. Never use virtual inheritance.
|
||||
|
||||
### Namespaces
|
||||
|
||||
Avoid using namespaces. HotSpot code normally uses "all static"
|
||||
classes rather than namespaces for grouping. An "all static" class is
|
||||
not instantiable, has only static members, and is normally derived
|
||||
(possibly indirectly) from the helper class `AllStatic`.
|
||||
|
||||
Benefits of using such classes include:
|
||||
|
||||
* Provides access control for members, which is unavailable with
|
||||
namespaces.
|
||||
|
||||
* Avoids [Argument Dependent Lookup][ADL] (ADL).
|
||||
|
||||
* Closed for additional members. Namespaces allow names to be added in
|
||||
multiple contexts, making it harder to see the complete API.
|
||||
|
||||
Namespaces should be used only in cases where one of those "benefits"
|
||||
is actually a hindrance.
|
||||
|
||||
In particular, don't use anonymous namespaces. They seem like they should
|
||||
be useful, and indeed have some real benefits for naming and generated code
|
||||
size on some platforms. Unfortunately, debuggers don't seem to like them at
|
||||
all.
|
||||
|
||||
<https://groups.google.com/forum/#!topic/mozilla.dev.platform/KsaG3lEEaRM><br>
|
||||
Suggests Visual Studio debugger might not be able to refer to
|
||||
anonymous namespace symbols, so can't set breakpoints in them.
|
||||
Though the discussion seems to go back and forth on that.
|
||||
|
||||
<https://firefox-source-docs.mozilla.org/code-quality/coding-style/coding_style_cpp.html><br>
|
||||
Search for "Anonymous namespaces"
|
||||
Suggests preferring "static" to anonymous namespaces where applicable,
|
||||
because of poor debugger support for anonymous namespaces.
|
||||
|
||||
<https://sourceware.org/bugzilla/show_bug.cgi?id=16874><br>
|
||||
Bug for similar gdb problems.
|
||||
|
||||
### C++ Standard Library
|
||||
|
||||
Avoid using the C++ Standard Library.
|
||||
|
||||
Historically, HotSpot has mostly avoided use of the Standard
|
||||
Library.
|
||||
|
||||
(It used to be impossible to use most of it in shared code,
|
||||
because the build configuration for Solaris with Solaris Studio made
|
||||
all but a couple of pieces inaccessible. Support for header-only
|
||||
parts was added in mid-2017. Support for Solaris was removed
|
||||
in 2020.)
|
||||
|
||||
Some reasons for this include
|
||||
|
||||
* Exceptions. Perhaps the largest core issue with adopting the use of
|
||||
Standard Library facilities is exceptions. HotSpot does not use
|
||||
exceptions and, for platforms which allow doing so, builds with them
|
||||
turned off. Many Standard Library facilities implicitly or explicitly
|
||||
use exceptions.
|
||||
|
||||
* `assert`. An issue that is quickly encountered is the `assert` macro name
|
||||
collision ([JDK-8007770](https://bugs.openjdk.java.net/browse/JDK-8007770)).
|
||||
Some mechanism for addressing this would be needed before much of the
|
||||
Standard Library could be used. (Not all Standard Library implementations
|
||||
use assert in header files, but some do.)
|
||||
|
||||
* Memory allocation. HotSpot requires explicit control over where
|
||||
allocations occur. The C++98/03 `std::allocator` class is too limited
|
||||
to support our usage. (Changes in more recent Standards may remove
|
||||
this limitation.)
|
||||
|
||||
* Implementation vagaries. Bugs, or simply different implementation choices,
|
||||
can lead to different behaviors among the various Standard Libraries we need
|
||||
to deal with.
|
||||
|
||||
* Inconsistent naming conventions. HotSpot and the C++ Standard use
|
||||
different naming conventions. The coexistence of those different conventions
|
||||
might appear jarring and reduce readability.
|
||||
|
||||
There are a few exceptions to this rule.
|
||||
|
||||
* `#include <new>` to use placement `new`, `std::nothrow`, and `std::nothrow_t`.
|
||||
* `#include <limits>` to use `std::numeric_limits`.
|
||||
* `#include <type_traits>`.
|
||||
* `#include <cstddef>` to use `std::nullptr_t`.
|
||||
|
||||
TODO: Rather than directly \#including (permitted) Standard Library
|
||||
headers, use a convention of \#including wrapper headers (in some
|
||||
location like hotspot/shared/stdcpp). This provides a single place
|
||||
for dealing with issues we might have for any given header, esp.
|
||||
platform-specific issues.
|
||||
|
||||
### Type Deduction
|
||||
|
||||
Use type deduction only if it makes the code clearer or safer. Do not
|
||||
use it merely to avoid the inconvenience of writing an explicit type,
|
||||
unless that type is itself difficult to write. An example of the
|
||||
latter is a function template return type that depends on template
|
||||
parameters in a non-trivial way.
|
||||
|
||||
There are several contexts where types are deduced.
|
||||
|
||||
* Function argument deduction. This is always permitted, and indeed
|
||||
encouraged. It is nearly always better to allow the type of a
|
||||
function template argument to be deduced rather than explicitly
|
||||
specified.
|
||||
|
||||
* `auto` variable declarations
|
||||
([n1984](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf))<br>
|
||||
For local variables, this can be used to make the code clearer by
|
||||
eliminating type information that is obvious or irrelevant. Excessive
|
||||
use can make code much harder to understand.
|
||||
|
||||
* Function return type deduction
|
||||
([n3638](https://isocpp.org/files/papers/N3638.html))<br>
|
||||
Only use if the function body has a very small number of `return`
|
||||
statements, and generally relatively little other code.
|
||||
|
||||
* Generic lambdas. Lambdas are not (yet) permitted.
|
||||
|
||||
* Lambda init captures. Lambdas are not (yet) permitted.
|
||||
|
||||
### Expression SFINAE
|
||||
|
||||
[Substitution Failure Is Not An Error][SFINAE] (SFINAE)
|
||||
is a template metaprogramming technique that makes use of
|
||||
template parameter substitution failures to make compile-time decisions.
|
||||
|
||||
C++11 relaxed the rules for what constitutes a hard-error when
|
||||
attempting to substitute template parameters with template arguments,
|
||||
making most deduction errors be substitution errors; see
|
||||
([n2634](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html)).
|
||||
This makes [SFINAE][] more powerful and easier to use. However, the
|
||||
implementation complexity for this change is significant, and this
|
||||
seems to be a place where obscure corner-case bugs in various
|
||||
compilers can be found. So while this feature can (and indeed should)
|
||||
be used (and would be difficult to avoid), caution should be used when
|
||||
pushing to extremes.
|
||||
|
||||
Here are a few closely related example bugs:<br>
|
||||
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95468><br>
|
||||
<https://developercommunity.visualstudio.com/content/problem/396562/sizeof-deduced-type-is-sometimes-not-a-constant-ex.html>
|
||||
|
||||
### enum
|
||||
|
||||
Where appropriate, _scoped-enums_ should be used.
|
||||
([n2347](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf))
|
||||
|
||||
Use of _unscoped-enums_ is permitted, though ordinary constants may be
|
||||
preferable when the automatic initializer feature isn't used.
|
||||
|
||||
The underlying type (the _enum-base_) of an unscoped enum type should
|
||||
always be specified explicitly. When unspecified, the underlying type
|
||||
is dependent on the range of the enumerator values and the platform.
|
||||
|
||||
The underlying type of a _scoped-enum_ should also be specified
|
||||
explicitly if conversions may be applied to values of that type.
|
||||
|
||||
Due to bugs in certain (very old) compilers, there is widespread use
|
||||
of enums and avoidance of in-class initialization of static integral
|
||||
constant members. Compilers having such bugs are no longer supported.
|
||||
Except where an enum is semantically appropriate, new code should use
|
||||
integral constants.
|
||||
|
||||
### thread_local
|
||||
|
||||
Do not use `thread_local`
|
||||
([n2659](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm));
|
||||
instead, use the HotSpot macro `THREAD_LOCAL`. The initializer must
|
||||
be a constant expression.
|
||||
|
||||
As was discussed in the review for
|
||||
[JDK-8230877](https://mail.openjdk.java.net/pipermail/hotspot-dev/2019-September/039487.html),
|
||||
`thread_local` allows dynamic initialization and destruction
|
||||
semantics. However, that support requires a run-time penalty for
|
||||
references to non-function-local `thread_local` variables defined in a
|
||||
different translation unit, even if they don't need dynamic
|
||||
initialization. Dynamic initialization and destruction of
|
||||
namespace-scoped thread local variables also has the same ordering
|
||||
problems as for ordinary namespace-scoped variables.
|
||||
|
||||
### nullptr
|
||||
|
||||
Prefer `nullptr`
|
||||
([n2431](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf))
|
||||
to `NULL`. Don't use (constexpr or literal) 0 for pointers.
|
||||
|
||||
For historical reasons there are widespread uses of both `NULL` and of
|
||||
integer 0 as a pointer value.
|
||||
|
||||
### <atomic>
|
||||
|
||||
Do not use facilities provided by the `<atomic>` header
|
||||
([n2427](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html)),
|
||||
([n2752](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2752.htm));
|
||||
instead, use the HotSpot `Atomic` class and related facilities.
|
||||
|
||||
Atomic operations in HotSpot code must have semantics which are
|
||||
consistent with those provided by the JDK's compilers for Java. There
|
||||
are platform-specific implementation choices that a C++ compiler might
|
||||
make or change that are outside the scope of the C++ Standard, and
|
||||
might differ from what the Java compilers implement.
|
||||
|
||||
In addition, HotSpot `Atomic` has a concept of "conservative" memory
|
||||
ordering, which may differ from (may be stronger than) sequentially
|
||||
consistent. There are algorithms in HotSpot that are believed to rely
|
||||
on that ordering.
|
||||
|
||||
### Additional Permitted Features
|
||||
|
||||
* `constexpr`
|
||||
([n2235](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf))
|
||||
([n3652](https://isocpp.org/files/papers/N3652.html))
|
||||
|
||||
* Sized deallocation
|
||||
([n3778](https://isocpp.org/files/papers/n3778.html))
|
||||
|
||||
* Variadic templates
|
||||
([n2242](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf))
|
||||
([n2555](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf))
|
||||
|
||||
* Static assertions
|
||||
([n1720](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html))
|
||||
|
||||
* `decltype`
|
||||
([n2343](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf))
|
||||
([n3276](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3276.pdf))
|
||||
|
||||
* Right angle brackets
|
||||
([n1757](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html))
|
||||
|
||||
* Default template arguments for function templates
|
||||
([CWG D226](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226))
|
||||
|
||||
* Template aliases
|
||||
([n2258](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf))
|
||||
|
||||
* Delegating constructors
|
||||
([n1986](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf))
|
||||
|
||||
* Explicit conversion operators
|
||||
([n2437](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf))
|
||||
|
||||
* Standard Layout Types
|
||||
([n2342](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm))
|
||||
|
||||
* Defaulted and deleted functions
|
||||
([n2346](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm))
|
||||
|
||||
* Dynamic initialization and destruction with concurrency
|
||||
([n2660](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm))
|
||||
|
||||
* `final` virtual specifiers for classes and virtual functions
|
||||
([n2928](http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm)),
|
||||
([n3206](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm)),
|
||||
([n3272](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm))
|
||||
|
||||
* Local and unnamed types as template parameters
|
||||
([n2657](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm))
|
||||
|
||||
### Excluded Features
|
||||
|
||||
* New string and character literals
|
||||
* New character types
|
||||
([n2249](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html))
|
||||
* Unicode string literals
|
||||
([n2442](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm))
|
||||
* Raw string literals
|
||||
([n2442](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm))
|
||||
* Universal character name literals
|
||||
([n2170](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html))
|
||||
|
||||
HotSpot doesn't need any of the new character and string literal
|
||||
types.
|
||||
|
||||
* User-defined literals
|
||||
([n2765](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf)) —
|
||||
User-defined literals should not be added casually, but only
|
||||
through a proposal to add a specific UDL.
|
||||
|
||||
* Inline namespaces
|
||||
([n2535](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm)) —
|
||||
HotSpot makes very limited use of namespaces.
|
||||
|
||||
* `using namespace` directives. In particular, don't use `using
|
||||
namespace std;` to avoid needing to qualify Standard Library names.
|
||||
|
||||
* Propagating exceptions
|
||||
([n2179](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html)) —
|
||||
HotSpot does not permit the use of exceptions, so this feature isn't useful.
|
||||
|
||||
* Avoid namespace-scoped variables with non-constexpr initialization.
|
||||
In particular, avoid variables with types requiring non-trivial
|
||||
initialization or destruction. Initialization order problems can be
|
||||
difficult to deal with and lead to surprises, as can destruction
|
||||
ordering. HotSpot doesn't generally try to cleanup on exit, and
|
||||
running destructors at exit can also lead to problems.
|
||||
|
||||
* `[[deprecated]]` attribute
|
||||
([n3760](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3760.html)) —
|
||||
Not relevant in HotSpot code.
|
||||
|
||||
* Avoid most operator overloading, preferring named functions. When
|
||||
operator overloading is used, ensure the semantics conform to the
|
||||
normal expected behavior of the operation.
|
||||
|
||||
* Avoid most implicit conversion constructors and (implicit or explicit)
|
||||
conversion operators. (Note that conversion to `bool` isn't needed
|
||||
in HotSpot code because of the "no implicit boolean" guideline.)
|
||||
|
||||
* Avoid covariant return types.
|
||||
|
||||
* Avoid `goto` statements.
|
||||
|
||||
### Undecided Features
|
||||
|
||||
This list is incomplete; it serves to explicitly call out some
|
||||
features that have not yet been discussed.
|
||||
|
||||
* `overrides` virtual specifiers for virtual functions
|
||||
([n3272](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm))
|
||||
|
||||
* Trailing return type syntax for functions
|
||||
([n2541](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm))
|
||||
|
||||
* Variable templates
|
||||
([n3651](https://isocpp.org/files/papers/N3651.pdf))
|
||||
|
||||
* Member initializers and aggregates
|
||||
([n3653](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3653.html))
|
||||
|
||||
* `[[noreturn]]` attribute
|
||||
([n2761](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf))
|
||||
|
||||
* Rvalue references and move semantics
|
||||
|
||||
* Lambdas
|
||||
|
||||
|
||||
[ADL]: https://en.cppreference.com/w/cpp/language/adl
|
||||
"Argument Dependent Lookup"
|
||||
|
||||
[ODR]: https://en.cppreference.com/w/cpp/language/definition
|
||||
"One Definition Rule"
|
||||
|
||||
[RAII]: https://en.cppreference.com/w/cpp/language/raii
|
||||
"Resource Acquisition Is Initialization"
|
||||
|
||||
[RTTI]: https://en.wikipedia.org/wiki/Run-time_type_information
|
||||
"Runtime Type Information"
|
||||
|
||||
[SFINAE]: https://en.cppreference.com/w/cpp/language/sfinae
|
||||
"Substitution Failure Is Not An Error"
|
||||
223
doc/hotspot-unit-tests.html
Normal file
223
doc/hotspot-unit-tests.html
Normal file
@@ -0,0 +1,223 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<title>Native/Unit Test Development Guidelines</title>
|
||||
<style type="text/css">
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
span.underline{text-decoration: underline;}
|
||||
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="../make/data/docs-resources/resources/jdk-default.css" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<header id="title-block-header">
|
||||
<h1 class="title">Native/Unit Test Development Guidelines</h1>
|
||||
</header>
|
||||
<nav id="TOC">
|
||||
<ul>
|
||||
<li><a href="#good-test-properties">Good test properties</a><ul>
|
||||
<li><a href="#lightness">Lightness</a></li>
|
||||
<li><a href="#isolation">Isolation</a></li>
|
||||
<li><a href="#atomicity-and-self-containment">Atomicity and self-containment</a></li>
|
||||
<li><a href="#repeatability">Repeatability</a></li>
|
||||
<li><a href="#informativeness">Informativeness</a></li>
|
||||
<li><a href="#testing-instead-of-visiting">Testing instead of visiting</a></li>
|
||||
<li><a href="#nearness">Nearness</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#asserts">Asserts</a><ul>
|
||||
<li><a href="#several-checks">Several checks</a></li>
|
||||
<li><a href="#first-parameter-is-expected-value">First parameter is expected value</a></li>
|
||||
<li><a href="#floating-point-comparison">Floating-point comparison</a></li>
|
||||
<li><a href="#c-string-comparison">C string comparison</a></li>
|
||||
<li><a href="#error-messages">Error messages</a></li>
|
||||
<li><a href="#uncluttered-output">Uncluttered output</a></li>
|
||||
<li><a href="#failures-propagation">Failures propagation</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#naming-and-grouping">Naming and Grouping</a><ul>
|
||||
<li><a href="#test-group-names">Test group names</a></li>
|
||||
<li><a href="#filename">Filename</a></li>
|
||||
<li><a href="#file-location">File location</a></li>
|
||||
<li><a href="#test-names">Test names</a></li>
|
||||
<li><a href="#fixture-classes">Fixture classes</a></li>
|
||||
<li><a href="#friend-classes">Friend classes</a></li>
|
||||
<li><a href="#oscpu-specific-tests">OS/CPU specific tests</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#miscellaneous">Miscellaneous</a><ul>
|
||||
<li><a href="#hotspot-style">Hotspot style</a></li>
|
||||
<li><a href="#codetest-metrics">Code/test metrics</a></li>
|
||||
<li><a href="#access-to-non-public-members">Access to non-public members</a></li>
|
||||
<li><a href="#death-tests">Death tests</a></li>
|
||||
<li><a href="#external-flags">External flags</a></li>
|
||||
<li><a href="#test-specific-flags">Test-specific flags</a></li>
|
||||
<li><a href="#flag-restoring">Flag restoring</a></li>
|
||||
<li><a href="#googletest-documentation">GoogleTest documentation</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#todo">TODO</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<p>The purpose of these guidelines is to establish a shared vision on what kind of native tests and how we want to develop them for Hotspot using GoogleTest. Hence these guidelines include style items as well as test approach items.</p>
|
||||
<p>First section of this document describes properties of good tests which are common for almost all types of test regardless of language, framework, etc. Further sections provide recommendations to achieve those properties and other HotSpot and/or GoogleTest specific guidelines.</p>
|
||||
<h2 id="good-test-properties">Good test properties</h2>
|
||||
<h3 id="lightness">Lightness</h3>
|
||||
<p>Use the most lightweight type of tests.</p>
|
||||
<p>In Hotspot, there are 3 different types of tests regarding their dependency on a JVM, each next level is slower than previous</p>
|
||||
<ul>
|
||||
<li><p><code>TEST</code> : a test does not depend on a JVM</p></li>
|
||||
<li><p><code>TEST_VM</code> : a test does depend on an initialized JVM, but are supposed not to break a JVM, i.e. leave it in a workable state.</p></li>
|
||||
<li><p><code>TEST_OTHER_VM</code> : a test depends on a JVM and requires a freshly initialized JVM or leaves a JVM in non-workable state</p></li>
|
||||
</ul>
|
||||
<h3 id="isolation">Isolation</h3>
|
||||
<p>Tests have to be isolated: not to have visible side-effects, influences on other tests results.</p>
|
||||
<p>Results of one test should not depend on test execution order, other tests, otherwise it is becoming almost impossible to find out why a test failed. Due to hotspot-specific, it is not so easy to get a full isolation, e.g. we share an initialized JVM between all <code>TEST_VM</code> tests, so if your test changes JVM's state too drastically and does not change it back, you had better consider <code>TEST_OTHER_VM</code>.</p>
|
||||
<h3 id="atomicity-and-self-containment">Atomicity and self-containment</h3>
|
||||
<p>Tests should be <em>atomic</em> and <em>self-contained</em> at the same time.</p>
|
||||
<p>One test should check a particular part of a class, subsystem, functionality, etc. Then it is quite easy to determine what parts of a product are broken basing on test failures. On the other hand, a test should test that part more-or-less entirely, because when one sees a test <code>FooTest::bar</code>, they assume all aspects of bar from <code>Foo</code> are tested.</p>
|
||||
<p>However, it is impossible to cover all aspects even of a method, not to mention a subsystem. In such cases, it is recommended to have several tests, one for each aspect of a thing under test. For example one test to tests how <code>Foo::bar</code> works if an argument is <code>null</code>, another test to test how it works if an argument is acceptable but <code>Foo</code> is not in the right state to accept it and so on. This helps not only to make tests atomic, self-contained but also makes test name self-descriptive (discussed in more details in <a href="#test-names">Test names</a>).</p>
|
||||
<h3 id="repeatability">Repeatability</h3>
|
||||
<p>Tests have to be repeatable.</p>
|
||||
<p>Reproducibility is very crucial for a test. No one likes sporadic test failures, they are hard to investigate, fix and verify a fix.</p>
|
||||
<p>In some cases, it is quite hard to write a 100% repeatable test, since besides a test there can be other moving parts, e.g. in case of <code>TEST_VM</code> there are several concurrently running threads. Despite this, we should try to make a test as reproducible as possible.</p>
|
||||
<h3 id="informativeness">Informativeness</h3>
|
||||
<p>In case of a failure, a test should be as <em>informative</em> as possible.</p>
|
||||
<p>Having more information about a test failure than just compared values can be very useful for failure troubleshooting, it can reduce or even completely eliminate debugging hours. This is even more important in case of not 100% reproducible failures.</p>
|
||||
<p>Achieving this property, one can easily make a test too verbose, so it will be really hard to find useful information in the ocean of useless information. Hence they should not only think about how to provide <a href="#error-messages">good information</a>, but also <a href="#uncluttered-output">when to do it</a>.</p>
|
||||
<h3 id="testing-instead-of-visiting">Testing instead of visiting</h3>
|
||||
<p>Tests should <em>test</em>.</p>
|
||||
<p>It is not enough just to "visit" some code, a test should check that code does that it has to do, compare return values with expected values, check that desired side effects are done, and undesired are not, and so on. In other words, a test should contain at least one GoogleTest assertion and do not rely on JVM asserts.</p>
|
||||
<p>Generally speaking to write a good test, one should create a model of the system under tests, a model of possible bugs (or bugs which one wants to find) and design tests using those models.</p>
|
||||
<h3 id="nearness">Nearness</h3>
|
||||
<p>Prefer having checks inside test code.</p>
|
||||
<p>Not only does having test logic outside, e.g. verification method, depending on asserts in product code contradict with several items above but also decreases test’s readability and stability. It is much easier to understand that a test is testing when all testing logic is located inside a test or nearby in shared test libraries. As a rule of thumb, the closer a check to a test, the better.</p>
|
||||
<h2 id="asserts">Asserts</h2>
|
||||
<h3 id="several-checks">Several checks</h3>
|
||||
<p>Prefer <code>EXPECT</code> over <code>ASSERT</code> if possible.</p>
|
||||
<p>This is related to the <a href="#informativeness">informativeness</a> property of tests, information for other checks can help to better localize a defect’s root-cause. One should use <code>ASSERT</code> if it is impossible to continue test execution or if it does not make much sense. Later in the text, <code>EXPECT</code> forms will be used to refer to both <code>ASSERT/EXPECT</code>.</p>
|
||||
<p>When it is possible to make several different checks, but impossible to continue test execution if at least one check fails, you can use <code>::testing::Test::HasNonfatalFailure()</code> function. The recommended way to express that is <code>ASSERT_FALSE(::testing::Test::HasNonfatalFailure())</code>. Besides making it clear why a test is aborted, it also allows you to provide more information about a failure.</p>
|
||||
<h3 id="first-parameter-is-expected-value">First parameter is expected value</h3>
|
||||
<p>In all equality assertions, expected values should be passed as the first parameter.</p>
|
||||
<p>This convention is adopted by GoogleTest, and there is a slight difference in how GoogleTest treats parameters, the most important one is <code>null</code> detection. Due to different reasons, <code>null</code> detection is enabled only for the first parameter, that is to said <code>EXPECT_EQ(NULL, object)</code> checks that object is <code>null</code>, while <code>EXPECT_EQ(object, NULL)</code> checks that object equals to <code>NULL</code>, GoogleTest is very strict regarding types of compared values so the latter will generates a compile-time error.</p>
|
||||
<h3 id="floating-point-comparison">Floating-point comparison</h3>
|
||||
<p>Use floating-point special macros to compare <code>float/double</code> values.</p>
|
||||
<p>Because of floating-point number representations and round-off errors, regular equality comparison will not return true in most cases. There are special <code>EXPECT_FLOAT_EQ/EXPECT_DOUBLE_EQ</code> assertions which check that the distance between compared values is not more than 4 ULPs, there is also <code>EXPECT_NEAR(v1, v2, eps)</code> which checks that the absolute value of the difference between <code>v1</code> and <code>v2</code> is not greater than <code>eps</code>.</p>
|
||||
<h3 id="c-string-comparison">C string comparison</h3>
|
||||
<p>Use string special macros for C strings comparisons.</p>
|
||||
<p><code>EXPECT_EQ</code> just compares pointers’ values, which is hardly what one wants comparing C strings. GoogleTest provides <code>EXPECT_STREQ</code> and <code>EXPECT_STRNE</code> macros to compare C string contents. There are also case-insensitive versions <code>EXPECT_STRCASEEQ</code>, <code>EXPECT_STRCASENE</code>.</p>
|
||||
<h3 id="error-messages">Error messages</h3>
|
||||
<p>Provide informative, but not too verbose error messages.</p>
|
||||
<p>All GoogleTest asserts print compared expressions and their values, so there is no need to have them in error messages. Asserts print only compared values, they do not print any of interim variables, e.g. <code>ASSERT_TRUE((val1 == val2 && isFail(foo(8)) || i == 18)</code> prints only one value. If you use some complex predicates, please consider <code>EXPECT_PRED*</code> or <code>EXPECT_FORMAT_PRED</code> assertions family, they check that a predicate returns true/success and print out all parameters values.</p>
|
||||
<p>However in some cases, default information is not enough, a commonly used example is an assert inside a loop, GoogleTest will not print iteration values (unless it is an assert's parameter). Other demonstrative examples are printing error code and a corresponding error message; printing internal states which might have an impact on results. One should add this information to assert message using <code><<</code> operator.</p>
|
||||
<h3 id="uncluttered-output">Uncluttered output</h3>
|
||||
<p>Print information only if it is needed.</p>
|
||||
<p>Too verbose tests which print all information even if they pass are very bad practice. They just pollute output, so it becomes harder to find useful information. In order not print information till it is really needed, one should consider saving it to a temporary buffer and pass to an assert. <a href="https://hg.openjdk.java.net/jdk/jdk/file/tip/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp" class="uri">https://hg.openjdk.java.net/jdk/jdk/file/tip/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp</a> has a good example how to do that.</p>
|
||||
<h3 id="failures-propagation">Failures propagation</h3>
|
||||
<p>Wrap a subroutine call into <code>EXPECT_NO_FATAL_FAILURE</code> macro to propagate failures.</p>
|
||||
<p><code>ASSERT</code> and <code>FAIL</code> abort only the current function, so if you have them in a subroutine, a test will not be aborted after the subroutine even if <code>ASSERT</code> or <code>FAIL</code> fails. You should call such subroutines in <code>ASSERT_NO_FATAL_FAILURE</code> macro to propagate fatal failures and abort a test. <code>(EXPECT|ASSERT)_NO_FATAL_FAILURE</code> can also be used to provide more information.</p>
|
||||
<p>Due to obvious reasons, there are no <code>(EXPECT|ASSERT)_NO_NONFATAL_FAILURE</code> macros. However, if you need to check if a subroutine generated a nonfatal failure (failed an <code>EXPECT</code>), you can use <code>::testing::Test::HasNonfatalFailure</code> function, or <code>::testing::Test::HasFailure</code> function to check if a subroutine generated any failures, see <a href="#several-checks">Several checks</a>.</p>
|
||||
<h2 id="naming-and-grouping">Naming and Grouping</h2>
|
||||
<h3 id="test-group-names">Test group names</h3>
|
||||
<p>Test group names should be in CamelCase, start and end with a letter. A test group should be named after tested class, functionality, subsystem, etc.</p>
|
||||
<p>This naming scheme helps to find tests, filter them and simplifies test failure analysis. For example, class <code>Foo</code> - test group <code>Foo</code>, compiler logging subsystem - test group <code>CompilerLogging</code>, G1 GC — test group <code>G1GC</code>, and so forth.</p>
|
||||
<h3 id="filename">Filename</h3>
|
||||
<p>A test file must have <code>test_</code> prefix and <code>.cpp</code> suffix.</p>
|
||||
<p>Both are actually requirements from the current build system to recognize your tests.</p>
|
||||
<h3 id="file-location">File location</h3>
|
||||
<p>Test file location should reflect a location of the tested part of the product.</p>
|
||||
<ul>
|
||||
<li><p>All unit tests for a class from <code>foo/bar/baz.cpp</code> should be placed <code>foo/bar/test_baz.cpp</code> in <code>hotspot/test/native/</code> directory. Having all tests for a class in one file is a common practice for unit tests, it helps to see all existing tests at once, share functions and/or resources without losing encapsulation.</p></li>
|
||||
<li><p>For tests which test more than one class, directory hierarchy should be the same as product hierarchy, and file name should reflect the name of the tested subsystem/functionality. For example, if a sub-system under tests belongs to <code>gc/g1</code>, tests should be placed in <code>gc/g1</code> directory.</p></li>
|
||||
</ul>
|
||||
<p>Please note that framework prepends directory name to a test group name. For example, if <code>TEST(foo, check_this)</code> and <code>TEST(bar, check_that)</code> are defined in <code>hotspot/test/native/gc/shared/test_foo.cpp</code> file, they will be reported as <code>gc/shared/foo::check_this</code> and <code>gc/shared/bar::check_that</code>.</p>
|
||||
<h3 id="test-names">Test names</h3>
|
||||
<p>Test names should be in small_snake_case, start and end with a letter. A test name should reflect that a test checks.</p>
|
||||
<p>Such naming makes tests self-descriptive and helps a lot during the whole test life cycle. It is easy to do test planning, test inventory, to see what things are not tested, to review tests, to analyze test failures, to evolve a test, etc. For example <code>foo_return_0_if_name_is_null</code> is better than <code>foo_sanity</code> or <code>foo_basic</code> or just <code>foo</code>, <code>humongous_objects_can_not_be_moved_by_young_gc</code> is better than <code>ho_young_gc</code>.</p>
|
||||
<p>Actually using underscore is against GoogleTest project convention, because it can lead to illegal identifiers, however, this is too strict. Restricting usage of underscore for test names only and prohibiting test name starts or ends with an underscore are enough to be safe.</p>
|
||||
<h3 id="fixture-classes">Fixture classes</h3>
|
||||
<p>Fixture classes should be named after tested classes, subsystems, etc (follow <a href="#test-group-names">Test group names rule</a>) and have <code>Test</code> suffix to prevent class name conflicts.</p>
|
||||
<h3 id="friend-classes">Friend classes</h3>
|
||||
<p>All test purpose friends should have either <code>Test</code> or <code>Testable</code> suffix.</p>
|
||||
<p>It greatly simplifies understanding of friendship’s purpose and allows statically check that private members are not exposed unexpectedly. Having <code>FooTest</code> as a friend of <code>Foo</code> without any comments will be understood as a necessary evil to get testability.</p>
|
||||
<h3 id="oscpu-specific-tests">OS/CPU specific tests</h3>
|
||||
<p>Guard OS/CPU specific tests by <code>#ifdef</code> and have OS/CPU name in filename.</p>
|
||||
<p>For the time being, we do not support separate directories for OS, CPU, OS-CPU specific tests, in case we will have lots of such tests, we will change directory layout and build system to support that in the same way it is done in hotspot.</p>
|
||||
<h2 id="miscellaneous">Miscellaneous</h2>
|
||||
<h3 id="hotspot-style">Hotspot style</h3>
|
||||
<p>Abide the norms and rules accepted in Hotspot style guide.</p>
|
||||
<p>Tests are a part of Hotspot, so everything (if applicable) we use for Hotspot, should be used for tests as well. Those guidelines cover test-specific things.</p>
|
||||
<h3 id="codetest-metrics">Code/test metrics</h3>
|
||||
<p>Coverage information and other code/test metrics are quite useful to decide what tests should be written, what tests should be improved and what can be removed.</p>
|
||||
<p>For unit tests, widely used and well-known coverage metric is branch coverage, which provides good quality of tests with relatively easy test development process. For other levels of testing, branch coverage is not as good, and one should consider others metrics, e.g. transaction flow coverage, data flow coverage.</p>
|
||||
<h3 id="access-to-non-public-members">Access to non-public members</h3>
|
||||
<p>Use explicit friend class to get access to non-public members.</p>
|
||||
<p>We do not use GoogleTest macro to declare friendship relation, because, from our point of view, it is less clear than an explicit declaration.</p>
|
||||
<p>Declaring a test fixture class as a friend class of a tested test is the easiest and the clearest way to get access. However, it has some disadvantages, here is some of them:</p>
|
||||
<ul>
|
||||
<li>Each test has to be declared as a friend</li>
|
||||
<li>Subclasses do not inheritance friendship relation</li>
|
||||
</ul>
|
||||
<p>In other words, it is harder to share code between tests. Hence if you want to share code or expect it to be useful in other tests, you should consider making members in a tested class protected and introduce a shared test-only class which expose those members via public functions, or even making members publicly accessible right away in a product class. If it is not an option to change members visibility, one can create a friend class which exposes members.</p>
|
||||
<h3 id="death-tests">Death tests</h3>
|
||||
<p>You can not use death tests inside <code>TEST_OTHER_VM</code> and <code>TEST_VM_ASSERT*</code>.</p>
|
||||
<p>We tried to make Hotspot-GoogleTest integration as transparent as possible, however, due to the current implementation of <code>TEST_OTHER_VM</code> and <code>TEST_VM_ASSERT*</code> tests, you cannot use death test functionality in them. These tests are implemented as GoogleTest death tests, and GoogleTest does not allow to have a death test inside another death test.</p>
|
||||
<h3 id="external-flags">External flags</h3>
|
||||
<p>Passing external flags to a tested JVM is not supported.</p>
|
||||
<p>The rationality of such design decision is to simplify both tests and a test framework and to avoid failures related to incompatible flags combination till there is a good solution for that. However there are cases when one wants to test a JVM with specific flags combination, <code>_JAVA_OPTIONS</code> environment variable can be used to do that. Flags from <code>_JAVA_OPTIONS</code> will be used in <code>TEST_VM</code>, <code>TEST_OTHER_VM</code> and <code>TEST_VM_ASSERT*</code> tests.</p>
|
||||
<h3 id="test-specific-flags">Test-specific flags</h3>
|
||||
<p>Passing flags to a tested JVM in <code>TEST_OTHER_VM</code> and <code>TEST_VM_ASSERT*</code> should be possible, but is not implemented yet.</p>
|
||||
<p>Facility to pass test-specific flags is needed for system, regression or other types of tests which require a fully initialized JVM in some particular configuration, e.g. with Serial GC selected. There is no support for such tests now, however, there is a plan to add that in upcoming releases.</p>
|
||||
<p>For now, if a test depends on flags values, it should have <code>if (!<flag>) { return }</code> guards in the very beginning and <code>@requires</code> comment similar to jtreg <code>@requires</code> directive right before test macros. <a href="https://hg.openjdk.java.net/jdk/jdk/file/tip/test/hotspot/gtest/gc/g1/test_g1IHOPControl.cpp" class="uri">https://hg.openjdk.java.net/jdk/jdk/file/tip/test/hotspot/gtest/gc/g1/test_g1IHOPControl.cpp</a> ha an example of this temporary workaround. It is important to follow that pattern as it allows us to easily find all such tests and update them as soon as there is an implementation of flag passing facility.</p>
|
||||
<p>In long-term, we expect jtreg to support GoogleTest tests as first class citizens, that is to say, jtreg will parse <span class="citation" data-cites="requires">@requires</span> comments and filter out inapplicable tests.</p>
|
||||
<h3 id="flag-restoring">Flag restoring</h3>
|
||||
<p>Restore changed flags.</p>
|
||||
<p>It is quite common for tests to configure JVM in a certain way changing flags’ values. GoogleTest provides two ways to set up environment before a test and restore it afterward: using either constructor and destructor or <code>SetUp</code> and <code>TearDown</code> functions. Both ways require to use a test fixture class, which sometimes is too wordy. The simpler facilities like <code>FLAG_GUARD</code> macro or <code>*FlagSetting</code> classes could be used in such cases to restore/set values.</p>
|
||||
<p>Caveats:</p>
|
||||
<ul>
|
||||
<li><p>Changing a flag’s value could break the invariants between flags' values and hence could lead to unexpected/unsupported JVM state.</p></li>
|
||||
<li><p><code>FLAG_SET_*</code> macros can change more than one flag (in order to maintain invariants) so it is hard to predict what flags will be changed and it makes restoring all changed flags a nontrivial task. Thus in case one uses <code>FLAG_SET_*</code> macros, they should use <code>TEST_OTHER_VM</code> test type.</p></li>
|
||||
</ul>
|
||||
<h3 id="googletest-documentation">GoogleTest documentation</h3>
|
||||
<p>In case you have any questions regarding GoogleTest itself, its asserts, test declaration macros, other macros, etc, please consult its documentation.</p>
|
||||
<h2 id="todo">TODO</h2>
|
||||
<p>Although this document provides guidelines on the most important parts of test development using GTest, it still misses a few items:</p>
|
||||
<ul>
|
||||
<li><p>Examples, esp for <a href="#access-to-non-public-members">access to non-public members</a></p></li>
|
||||
<li>test types: purpose, drawbacks, limitation
|
||||
<ul>
|
||||
<li><code>TEST_VM</code></li>
|
||||
<li><code>TEST_VM_F</code></li>
|
||||
<li><code>TEST_OTHER_VM</code></li>
|
||||
<li><code>TEST_VM_ASSERT</code></li>
|
||||
<li><code>TEST_VM_ASSERT_MSG</code></li>
|
||||
</ul></li>
|
||||
<li>Miscellaneous
|
||||
<ul>
|
||||
<li>Test libraries
|
||||
<ul>
|
||||
<li>where to place</li>
|
||||
<li>how to write</li>
|
||||
<li>how to use</li>
|
||||
</ul></li>
|
||||
<li>test your tests
|
||||
<ul>
|
||||
<li>how to run tests in random order</li>
|
||||
<li>how to run only specific tests</li>
|
||||
<li>how to run each test separately</li>
|
||||
<li>check that a test can find bugs it is supposed to by introducing them</li>
|
||||
</ul></li>
|
||||
<li>mocks/stubs/dependency injection</li>
|
||||
<li>setUp/tearDown
|
||||
<ul>
|
||||
<li>vs c-tor/d-tor</li>
|
||||
<li>empty test to test them</li>
|
||||
</ul></li>
|
||||
<li>internal (declared in .cpp) struct/classes</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
451
doc/hotspot-unit-tests.md
Normal file
451
doc/hotspot-unit-tests.md
Normal file
@@ -0,0 +1,451 @@
|
||||
% Native/Unit Test Development Guidelines
|
||||
|
||||
The purpose of these guidelines is to establish a shared vision on
|
||||
what kind of native tests and how we want to develop them for Hotspot
|
||||
using GoogleTest. Hence these guidelines include style items as well
|
||||
as test approach items.
|
||||
|
||||
First section of this document describes properties of good tests
|
||||
which are common for almost all types of test regardless of language,
|
||||
framework, etc. Further sections provide recommendations to achieve
|
||||
those properties and other HotSpot and/or GoogleTest specific
|
||||
guidelines.
|
||||
|
||||
## Good test properties
|
||||
|
||||
### Lightness
|
||||
|
||||
Use the most lightweight type of tests.
|
||||
|
||||
In Hotspot, there are 3 different types of tests regarding their
|
||||
dependency on a JVM, each next level is slower than previous
|
||||
|
||||
* `TEST` : a test does not depend on a JVM
|
||||
|
||||
* `TEST_VM` : a test does depend on an initialized JVM, but are
|
||||
supposed not to break a JVM, i.e. leave it in a workable state.
|
||||
|
||||
* `TEST_OTHER_VM` : a test depends on a JVM and requires a freshly
|
||||
initialized JVM or leaves a JVM in non-workable state
|
||||
|
||||
### Isolation
|
||||
|
||||
Tests have to be isolated: not to have visible side-effects,
|
||||
influences on other tests results.
|
||||
|
||||
Results of one test should not depend on test execution order, other
|
||||
tests, otherwise it is becoming almost impossible to find out why a
|
||||
test failed. Due to hotspot-specific, it is not so easy to get a full
|
||||
isolation, e.g. we share an initialized JVM between all `TEST_VM` tests,
|
||||
so if your test changes JVM's state too drastically and does not
|
||||
change it back, you had better consider `TEST_OTHER_VM`.
|
||||
|
||||
### Atomicity and self-containment
|
||||
|
||||
Tests should be *atomic* and *self-contained* at the same time.
|
||||
|
||||
One test should check a particular part of a class, subsystem,
|
||||
functionality, etc. Then it is quite easy to determine what parts of a
|
||||
product are broken basing on test failures. On the other hand, a test
|
||||
should test that part more-or-less entirely, because when one sees a
|
||||
test `FooTest::bar`, they assume all aspects of bar from `Foo` are tested.
|
||||
|
||||
However, it is impossible to cover all aspects even of a method, not
|
||||
to mention a subsystem. In such cases, it is recommended to have
|
||||
several tests, one for each aspect of a thing under test. For example
|
||||
one test to tests how `Foo::bar` works if an argument is `null`, another
|
||||
test to test how it works if an argument is acceptable but `Foo` is not
|
||||
in the right state to accept it and so on. This helps not only to make
|
||||
tests atomic, self-contained but also makes test name self-descriptive
|
||||
(discussed in more details in [Test names](#test-names)).
|
||||
|
||||
### Repeatability
|
||||
|
||||
Tests have to be repeatable.
|
||||
|
||||
Reproducibility is very crucial for a test. No one likes sporadic test
|
||||
failures, they are hard to investigate, fix and verify a fix.
|
||||
|
||||
In some cases, it is quite hard to write a 100% repeatable test, since
|
||||
besides a test there can be other moving parts, e.g. in case of
|
||||
`TEST_VM` there are several concurrently running threads. Despite this,
|
||||
we should try to make a test as reproducible as possible.
|
||||
|
||||
### Informativeness
|
||||
|
||||
In case of a failure, a test should be as *informative* as possible.
|
||||
|
||||
Having more information about a test failure than just compared values
|
||||
can be very useful for failure troubleshooting, it can reduce or even
|
||||
completely eliminate debugging hours. This is even more important in
|
||||
case of not 100% reproducible failures.
|
||||
|
||||
Achieving this property, one can easily make a test too verbose, so it
|
||||
will be really hard to find useful information in the ocean of useless
|
||||
information. Hence they should not only think about how to provide
|
||||
[good information](#error-messages), but also
|
||||
[when to do it](#uncluttered-output).
|
||||
|
||||
### Testing instead of visiting
|
||||
|
||||
Tests should *test*.
|
||||
|
||||
It is not enough just to "visit" some code, a test should check that
|
||||
code does that it has to do, compare return values with expected
|
||||
values, check that desired side effects are done, and undesired are
|
||||
not, and so on. In other words, a test should contain at least one
|
||||
GoogleTest assertion and do not rely on JVM asserts.
|
||||
|
||||
Generally speaking to write a good test, one should create a model of
|
||||
the system under tests, a model of possible bugs (or bugs which one
|
||||
wants to find) and design tests using those models.
|
||||
|
||||
### Nearness
|
||||
|
||||
Prefer having checks inside test code.
|
||||
|
||||
Not only does having test logic outside, e.g. verification method,
|
||||
depending on asserts in product code contradict with several items
|
||||
above but also decreases test’s readability and stability. It is much
|
||||
easier to understand that a test is testing when all testing logic is
|
||||
located inside a test or nearby in shared test libraries. As a rule of
|
||||
thumb, the closer a check to a test, the better.
|
||||
|
||||
## Asserts
|
||||
|
||||
### Several checks
|
||||
|
||||
Prefer `EXPECT` over `ASSERT` if possible.
|
||||
|
||||
This is related to the [informativeness](#informativeness) property of
|
||||
tests, information for other checks can help to better localize a
|
||||
defect’s root-cause. One should use `ASSERT` if it is impossible to
|
||||
continue test execution or if it does not make much sense. Later in
|
||||
the text, `EXPECT` forms will be used to refer to both
|
||||
`ASSERT/EXPECT`.
|
||||
|
||||
When it is possible to make several different checks, but impossible
|
||||
to continue test execution if at least one check fails, you can
|
||||
use `::testing::Test::HasNonfatalFailure()` function. The recommended
|
||||
way to express that is
|
||||
`ASSERT_FALSE(::testing::Test::HasNonfatalFailure())`. Besides making it
|
||||
clear why a test is aborted, it also allows you to provide more
|
||||
information about a failure.
|
||||
|
||||
### First parameter is expected value
|
||||
|
||||
In all equality assertions, expected values should be passed as the
|
||||
first parameter.
|
||||
|
||||
This convention is adopted by GoogleTest, and there is a slight
|
||||
difference in how GoogleTest treats parameters, the most important one
|
||||
is `null` detection. Due to different reasons, `null` detection is enabled
|
||||
only for the first parameter, that is to said `EXPECT_EQ(NULL, object)`
|
||||
checks that object is `null`, while `EXPECT_EQ(object, NULL)` checks that
|
||||
object equals to `NULL`, GoogleTest is very strict regarding types of
|
||||
compared values so the latter will generates a compile-time error.
|
||||
|
||||
### Floating-point comparison
|
||||
|
||||
Use floating-point special macros to compare `float/double` values.
|
||||
|
||||
Because of floating-point number representations and round-off errors,
|
||||
regular equality comparison will not return true in most cases. There
|
||||
are special `EXPECT_FLOAT_EQ/EXPECT_DOUBLE_EQ` assertions which check
|
||||
that the distance between compared values is not more than 4 ULPs,
|
||||
there is also `EXPECT_NEAR(v1, v2, eps)` which checks that the absolute
|
||||
value of the difference between `v1` and `v2` is not greater than `eps`.
|
||||
|
||||
### C string comparison
|
||||
|
||||
Use string special macros for C strings comparisons.
|
||||
|
||||
`EXPECT_EQ` just compares pointers’ values, which is hardly what one
|
||||
wants comparing C strings. GoogleTest provides `EXPECT_STREQ` and
|
||||
`EXPECT_STRNE` macros to compare C string contents. There are also
|
||||
case-insensitive versions `EXPECT_STRCASEEQ`, `EXPECT_STRCASENE`.
|
||||
|
||||
### Error messages
|
||||
|
||||
Provide informative, but not too verbose error messages.
|
||||
|
||||
All GoogleTest asserts print compared expressions and their values, so
|
||||
there is no need to have them in error messages. Asserts print only
|
||||
compared values, they do not print any of interim variables, e.g.
|
||||
`ASSERT_TRUE((val1 == val2 && isFail(foo(8)) || i == 18)` prints only
|
||||
one value. If you use some complex predicates, please consider
|
||||
`EXPECT_PRED*` or `EXPECT_FORMAT_PRED` assertions family, they check that
|
||||
a predicate returns true/success and print out all parameters values.
|
||||
|
||||
However in some cases, default information is not enough, a commonly
|
||||
used example is an assert inside a loop, GoogleTest will not print
|
||||
iteration values (unless it is an assert's parameter). Other
|
||||
demonstrative examples are printing error code and a corresponding
|
||||
error message; printing internal states which might have an impact on
|
||||
results. One should add this information to assert message using `<<`
|
||||
operator.
|
||||
|
||||
### Uncluttered output
|
||||
|
||||
Print information only if it is needed.
|
||||
|
||||
Too verbose tests which print all information even if they pass are
|
||||
very bad practice. They just pollute output, so it becomes harder to
|
||||
find useful information. In order not print information till it is
|
||||
really needed, one should consider saving it to a temporary buffer and
|
||||
pass to an assert.
|
||||
<https://hg.openjdk.java.net/jdk/jdk/file/tip/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp>
|
||||
has a good example how to do that.
|
||||
|
||||
### Failures propagation
|
||||
|
||||
Wrap a subroutine call into `EXPECT_NO_FATAL_FAILURE` macro to
|
||||
propagate failures.
|
||||
|
||||
`ASSERT` and `FAIL` abort only the current function, so if you have them
|
||||
in a subroutine, a test will not be aborted after the subroutine even
|
||||
if `ASSERT` or `FAIL` fails. You should call such subroutines in
|
||||
`ASSERT_NO_FATAL_FAILURE` macro to propagate fatal failures and abort a
|
||||
test. `(EXPECT|ASSERT)_NO_FATAL_FAILURE` can also be used to provide
|
||||
more information.
|
||||
|
||||
Due to obvious reasons, there are no
|
||||
`(EXPECT|ASSERT)_NO_NONFATAL_FAILURE` macros. However, if you need to
|
||||
check if a subroutine generated a nonfatal failure (failed an `EXPECT`),
|
||||
you can use `::testing::Test::HasNonfatalFailure` function,
|
||||
or `::testing::Test::HasFailure` function to check if a subroutine
|
||||
generated any failures, see [Several checks](#several-checks).
|
||||
|
||||
## Naming and Grouping
|
||||
|
||||
### Test group names
|
||||
|
||||
Test group names should be in CamelCase, start and end with a letter.
|
||||
A test group should be named after tested class, functionality,
|
||||
subsystem, etc.
|
||||
|
||||
This naming scheme helps to find tests, filter them and simplifies
|
||||
test failure analysis. For example, class `Foo` - test group `Foo`,
|
||||
compiler logging subsystem - test group `CompilerLogging`, G1 GC — test
|
||||
group `G1GC`, and so forth.
|
||||
|
||||
### Filename
|
||||
|
||||
A test file must have `test_` prefix and `.cpp` suffix.
|
||||
|
||||
Both are actually requirements from the current build system to
|
||||
recognize your tests.
|
||||
|
||||
### File location
|
||||
|
||||
Test file location should reflect a location of the tested part of the product.
|
||||
|
||||
* All unit tests for a class from `foo/bar/baz.cpp` should be placed
|
||||
`foo/bar/test_baz.cpp` in `hotspot/test/native/` directory. Having all
|
||||
tests for a class in one file is a common practice for unit tests, it
|
||||
helps to see all existing tests at once, share functions and/or
|
||||
resources without losing encapsulation.
|
||||
|
||||
* For tests which test more than one class, directory hierarchy should
|
||||
be the same as product hierarchy, and file name should reflect the
|
||||
name of the tested subsystem/functionality. For example, if a
|
||||
sub-system under tests belongs to `gc/g1`, tests should be placed in
|
||||
`gc/g1` directory.
|
||||
|
||||
Please note that framework prepends directory name to a test group
|
||||
name. For example, if `TEST(foo, check_this)` and `TEST(bar, check_that)`
|
||||
are defined in `hotspot/test/native/gc/shared/test_foo.cpp` file, they
|
||||
will be reported as `gc/shared/foo::check_this` and
|
||||
`gc/shared/bar::check_that`.
|
||||
|
||||
### Test names
|
||||
|
||||
Test names should be in small_snake_case, start and end with a letter.
|
||||
A test name should reflect that a test checks.
|
||||
|
||||
Such naming makes tests self-descriptive and helps a lot during the
|
||||
whole test life cycle. It is easy to do test planning, test inventory,
|
||||
to see what things are not tested, to review tests, to analyze test
|
||||
failures, to evolve a test, etc. For example
|
||||
`foo_return_0_if_name_is_null` is better than `foo_sanity` or `foo_basic` or
|
||||
just `foo`, `humongous_objects_can_not_be_moved_by_young_gc` is better
|
||||
than `ho_young_gc`.
|
||||
|
||||
Actually using underscore is against GoogleTest project convention,
|
||||
because it can lead to illegal identifiers, however, this is too
|
||||
strict. Restricting usage of underscore for test names only and
|
||||
prohibiting test name starts or ends with an underscore are enough to
|
||||
be safe.
|
||||
|
||||
### Fixture classes
|
||||
|
||||
Fixture classes should be named after tested classes, subsystems, etc
|
||||
(follow [Test group names rule](#test-group-names)) and have
|
||||
`Test` suffix to prevent class name conflicts.
|
||||
|
||||
### Friend classes
|
||||
|
||||
All test purpose friends should have either `Test` or `Testable` suffix.
|
||||
|
||||
It greatly simplifies understanding of friendship’s purpose and allows
|
||||
statically check that private members are not exposed unexpectedly.
|
||||
Having `FooTest` as a friend of `Foo` without any comments will be
|
||||
understood as a necessary evil to get testability.
|
||||
|
||||
### OS/CPU specific tests
|
||||
|
||||
Guard OS/CPU specific tests by `#ifdef` and have OS/CPU name in filename.
|
||||
|
||||
For the time being, we do not support separate directories for OS,
|
||||
CPU, OS-CPU specific tests, in case we will have lots of such tests,
|
||||
we will change directory layout and build system to support that in
|
||||
the same way it is done in hotspot.
|
||||
|
||||
## Miscellaneous
|
||||
|
||||
### Hotspot style
|
||||
|
||||
Abide the norms and rules accepted in Hotspot style guide.
|
||||
|
||||
Tests are a part of Hotspot, so everything (if applicable) we use for
|
||||
Hotspot, should be used for tests as well. Those guidelines cover
|
||||
test-specific things.
|
||||
|
||||
### Code/test metrics
|
||||
|
||||
Coverage information and other code/test metrics are quite useful to
|
||||
decide what tests should be written, what tests should be improved and
|
||||
what can be removed.
|
||||
|
||||
For unit tests, widely used and well-known coverage metric is branch
|
||||
coverage, which provides good quality of tests with relatively easy
|
||||
test development process. For other levels of testing, branch coverage
|
||||
is not as good, and one should consider others metrics, e.g.
|
||||
transaction flow coverage, data flow coverage.
|
||||
|
||||
### Access to non-public members
|
||||
|
||||
Use explicit friend class to get access to non-public members.
|
||||
|
||||
We do not use GoogleTest macro to declare friendship relation,
|
||||
because, from our point of view, it is less clear than an explicit
|
||||
declaration.
|
||||
|
||||
Declaring a test fixture class as a friend class of a tested test is
|
||||
the easiest and the clearest way to get access. However, it has some
|
||||
disadvantages, here is some of them:
|
||||
|
||||
* Each test has to be declared as a friend
|
||||
* Subclasses do not inheritance friendship relation
|
||||
|
||||
In other words, it is harder to share code between tests. Hence if you
|
||||
want to share code or expect it to be useful in other tests, you
|
||||
should consider making members in a tested class protected and
|
||||
introduce a shared test-only class which expose those members via
|
||||
public functions, or even making members publicly accessible right
|
||||
away in a product class. If it is not an option to change members
|
||||
visibility, one can create a friend class which exposes members.
|
||||
|
||||
### Death tests
|
||||
|
||||
You can not use death tests inside `TEST_OTHER_VM` and `TEST_VM_ASSERT*`.
|
||||
|
||||
We tried to make Hotspot-GoogleTest integration as transparent as
|
||||
possible, however, due to the current implementation of `TEST_OTHER_VM`
|
||||
and `TEST_VM_ASSERT*` tests, you cannot use death test functionality in
|
||||
them. These tests are implemented as GoogleTest death tests, and
|
||||
GoogleTest does not allow to have a death test inside another death
|
||||
test.
|
||||
|
||||
### External flags
|
||||
|
||||
Passing external flags to a tested JVM is not supported.
|
||||
|
||||
The rationality of such design decision is to simplify both tests and
|
||||
a test framework and to avoid failures related to incompatible flags
|
||||
combination till there is a good solution for that. However there are
|
||||
cases when one wants to test a JVM with specific flags combination,
|
||||
`_JAVA_OPTIONS` environment variable can be used to do that. Flags from
|
||||
`_JAVA_OPTIONS` will be used in `TEST_VM`, `TEST_OTHER_VM` and
|
||||
`TEST_VM_ASSERT*` tests.
|
||||
|
||||
### Test-specific flags
|
||||
|
||||
Passing flags to a tested JVM in `TEST_OTHER_VM` and `TEST_VM_ASSERT*`
|
||||
should be possible, but is not implemented yet.
|
||||
|
||||
Facility to pass test-specific flags is needed for system, regression
|
||||
or other types of tests which require a fully initialized JVM in some
|
||||
particular configuration, e.g. with Serial GC selected. There is no
|
||||
support for such tests now, however, there is a plan to add that in
|
||||
upcoming releases.
|
||||
|
||||
For now, if a test depends on flags values, it should have `if
|
||||
(!<flag>) { return }` guards in the very beginning and `@requires`
|
||||
comment similar to jtreg `@requires` directive right before test macros.
|
||||
<https://hg.openjdk.java.net/jdk/jdk/file/tip/test/hotspot/gtest/gc/g1/test_g1IHOPControl.cpp>
|
||||
ha an example of this temporary workaround. It is important to follow
|
||||
that pattern as it allows us to easily find all such tests and update
|
||||
them as soon as there is an implementation of flag passing facility.
|
||||
|
||||
In long-term, we expect jtreg to support GoogleTest tests as first
|
||||
class citizens, that is to say, jtreg will parse @requires comments
|
||||
and filter out inapplicable tests.
|
||||
|
||||
### Flag restoring
|
||||
|
||||
Restore changed flags.
|
||||
|
||||
It is quite common for tests to configure JVM in a certain way
|
||||
changing flags’ values. GoogleTest provides two ways to set up
|
||||
environment before a test and restore it afterward: using either
|
||||
constructor and destructor or `SetUp` and `TearDown` functions. Both ways
|
||||
require to use a test fixture class, which sometimes is too wordy. The
|
||||
simpler facilities like `FLAG_GUARD` macro or `*FlagSetting` classes could
|
||||
be used in such cases to restore/set values.
|
||||
|
||||
Caveats:
|
||||
|
||||
* Changing a flag’s value could break the invariants between flags' values and hence could lead to unexpected/unsupported JVM state.
|
||||
|
||||
* `FLAG_SET_*` macros can change more than one flag (in order to
|
||||
maintain invariants) so it is hard to predict what flags will be
|
||||
changed and it makes restoring all changed flags a nontrivial task.
|
||||
Thus in case one uses `FLAG_SET_*` macros, they should use `TEST_OTHER_VM`
|
||||
test type.
|
||||
|
||||
### GoogleTest documentation
|
||||
|
||||
In case you have any questions regarding GoogleTest itself, its
|
||||
asserts, test declaration macros, other macros, etc, please consult
|
||||
its documentation.
|
||||
|
||||
## TODO
|
||||
|
||||
Although this document provides guidelines on the most important parts
|
||||
of test development using GTest, it still misses a few items:
|
||||
|
||||
* Examples, esp for [access to non-public members](#access-to-non-public-members)
|
||||
|
||||
* test types: purpose, drawbacks, limitation
|
||||
* `TEST_VM`
|
||||
* `TEST_VM_F`
|
||||
* `TEST_OTHER_VM`
|
||||
* `TEST_VM_ASSERT`
|
||||
* `TEST_VM_ASSERT_MSG`
|
||||
|
||||
* Miscellaneous
|
||||
* Test libraries
|
||||
* where to place
|
||||
* how to write
|
||||
* how to use
|
||||
* test your tests
|
||||
* how to run tests in random order
|
||||
* how to run only specific tests
|
||||
* how to run each test separately
|
||||
* check that a test can find bugs it is supposed to by introducing them
|
||||
* mocks/stubs/dependency injection
|
||||
* setUp/tearDown
|
||||
* vs c-tor/d-tor
|
||||
* empty test to test them
|
||||
* internal (declared in .cpp) struct/classes
|
||||
@@ -1,631 +0,0 @@
|
||||
This document describes system properties that are used for internal
|
||||
debugging and instrumentation purposes, along with the system loggers,
|
||||
which are used for the same thing.
|
||||
|
||||
This document is intended as a developer resource, and it is not
|
||||
needed as Nashorn documentation for normal usage. Flags and system
|
||||
properties described herein are subject to change without notice.
|
||||
|
||||
=====================================
|
||||
1. System properties used internally
|
||||
=====================================
|
||||
|
||||
This documentation of the system property flags assume that the
|
||||
default value of the flag is false, unless otherwise specified.
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.args=<string>
|
||||
|
||||
This property takes as its value a space separated list of Nashorn
|
||||
command line options that should be passed to Nashorn. This might be
|
||||
useful in environments where it is hard to tell how a nashorn.jar is
|
||||
launched.
|
||||
|
||||
Example:
|
||||
|
||||
> java -Dnashorn.args="--lazy-complation --log=compiler" large-java-app-with-nashorn.jar
|
||||
> ant -Dnashorn.args="--log=codegen" antjob
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.args.prepend=<string>
|
||||
|
||||
This property behaves like nashorn.args, but adds the given arguments
|
||||
before the existing ones instead of after them. Later arguments will
|
||||
overwrite earlier ones, so this is useful for setting default arguments
|
||||
that can be overwritten.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.unstable.relink.threshold=x
|
||||
|
||||
NOTE: This property is deprecated in favor of the
|
||||
"--unstable-relink-threshold" command line option. It controls how many
|
||||
call site misses are allowed before a callsite is relinked with "apply"
|
||||
semantics to never change again. In the case of megamorphic callsites,
|
||||
this is necessary, or the program would spend all its time swapping out
|
||||
callsite targets. When neither the system property nor the command line
|
||||
option are specified, defaults to 8, or 16 with optimistic types turned
|
||||
on.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.compiler.splitter.threshold=x
|
||||
|
||||
This will change the node weight that requires a subgraph of the IR to
|
||||
be split into several classes in order not to run out of bytecode space.
|
||||
The default value is 0x8000 (32768).
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.serialize.compression=<x>
|
||||
|
||||
This property sets the compression level used when deflating serialized
|
||||
AST structures of anonymous split functions. Valid values range from 0 to 9,
|
||||
the default value is 4. Higher values will reduce memory size of serialized
|
||||
AST but increase CPU usage required for compression.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.codegen.debug.trace=<x>
|
||||
|
||||
See the description of the codegen logger below.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.fields.objects, -Dnashorn.fields.dual
|
||||
|
||||
When the nashorn.fields.objects property is true, Nashorn will always
|
||||
use object fields for AccessorProperties, requiring boxing for all
|
||||
primitive property values. When nashorn.fields.dual is set, Nashorn
|
||||
will always use dual long/object fields, which allows primitives to be
|
||||
stored without boxing. When neither system property is set, Nashorn
|
||||
chooses a setting depending on the optimistic types setting (dual
|
||||
fields when optimistic types are enabled, object-only fields otherwise).
|
||||
|
||||
With dual fields, Nashorn uses long fields to store primitive values.
|
||||
Ints are represented as the 32 low bits of the long fields. Doubles
|
||||
are represented as the doubleToLongBits of their value. This way a
|
||||
single field can be used for all primitive types. Packing and
|
||||
unpacking doubles to their bit representation is intrinsified by
|
||||
the JVM and extremely fast.
|
||||
|
||||
In the future, this might complement or be replaced by experimental
|
||||
feature sun.misc.TaggedArray, which has been discussed on the mlvm
|
||||
mailing list. TaggedArrays are basically a way to share data space
|
||||
between primitives and references, and have the GC understand this.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.compiler.symbol.trace=[<x>[,*]],
|
||||
-Dnashorn.compiler.symbol.stacktrace=[<x>[,*]]
|
||||
|
||||
When this property is set, creation and manipulation of any symbol
|
||||
named "x" will show information about when the compiler changes its
|
||||
type assumption, bytecode local variable slot assignment and other
|
||||
data. This is useful if, for example, a symbol shows up as an Object,
|
||||
when you believe it should be a primitive. Usually there is an
|
||||
explanation for this, for example that it exists in the global scope
|
||||
and type analysis has to be more conservative.
|
||||
|
||||
Several symbols names to watch can be specified by comma separation.
|
||||
|
||||
If no variable name is specified (and no equals sign), all symbols
|
||||
will be watched
|
||||
|
||||
By using "stacktrace" instead of or together with "trace", stack
|
||||
traces will be displayed upon symbol changes according to the same
|
||||
semantics.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.lexer.xmlliterals
|
||||
|
||||
If this property it set, it means that the Lexer should attempt to
|
||||
parse XML literals, which would otherwise generate syntax
|
||||
errors. Warning: there are currently no unit tests for this
|
||||
functionality.
|
||||
|
||||
XML literals, when this is enabled, end up as standard LiteralNodes in
|
||||
the IR.
|
||||
|
||||
|
||||
SYSTEM_PROPERTY: -Dnashorn.debug
|
||||
|
||||
If this property is set to true, Nashorn runs in Debug mode. Debug
|
||||
mode is slightly slower, as for example statistics counters are enabled
|
||||
during the run. Debug mode makes available a NativeDebug instance
|
||||
called "Debug" in the global space that can be used to print property
|
||||
maps and layout for script objects, as well as a "dumpCounters" method
|
||||
that will print the current values of the previously mentioned stats
|
||||
counters.
|
||||
|
||||
These functions currently exists for Debug:
|
||||
|
||||
"map" - print(Debug.map(x)) will dump the PropertyMap for object x to
|
||||
stdout (currently there also exist functions called "embedX", where X
|
||||
is a value from 0 to 3, that will dump the contents of the embed pool
|
||||
for the first spill properties in any script object and "spill", that
|
||||
will dump the contents of the growing spill pool of spill properties
|
||||
in any script object. This is of course subject to change without
|
||||
notice, should we change the script object layout.
|
||||
|
||||
"methodHandle" - this method returns the method handle that is used
|
||||
for invoking a particular script function.
|
||||
|
||||
"identical" - this method compares two script objects for reference
|
||||
equality. It is a == Java comparison
|
||||
|
||||
"equals" - Returns true if two objects are either referentially
|
||||
identical or equal as defined by java.lang.Object.equals.
|
||||
|
||||
"dumpCounters" - will dump the debug counters' current values to
|
||||
stdout.
|
||||
|
||||
Currently we count number of ScriptObjects in the system, number of
|
||||
Scope objects in the system, number of ScriptObject listeners added,
|
||||
removed and dead (without references).
|
||||
|
||||
We also count number of ScriptFunctions, ScriptFunction invocations
|
||||
and ScriptFunction allocations.
|
||||
|
||||
Furthermore we count PropertyMap statistics: how many property maps
|
||||
exist, how many times were property maps cloned, how many times did
|
||||
the property map history cache hit, prevent new allocations, how many
|
||||
prototype invalidations were done, how many time the property map
|
||||
proto cache hit.
|
||||
|
||||
Finally we count callsite misses on a per callsite bases, which occur
|
||||
when a callsite has to be relinked, due to a previous assumption of
|
||||
object layout being invalidated.
|
||||
|
||||
"getContext" - return the current Nashorn context.
|
||||
|
||||
"equalWithoutType" - Returns true if if the two objects are both
|
||||
property maps, and they have identical properties in the same order,
|
||||
but allows the properties to differ in their types.
|
||||
|
||||
"diffPropertyMaps" Returns a diagnostic string representing the difference
|
||||
of two property maps.
|
||||
|
||||
"getClass" - Returns the Java class of an object, or undefined if null.
|
||||
|
||||
"toJavaString" - Returns the Java toString representation of an object.
|
||||
|
||||
"toIdentString" - Returns a string representation of an object consisting
|
||||
of its java class name and hash code.
|
||||
|
||||
"getListenerCount" - Return the number of property listeners for a
|
||||
script object.
|
||||
|
||||
"getEventQueueCapacity" - Get the capacity of the event queue.
|
||||
|
||||
"setEventQueueCapacity" - Set the event queue capacity.
|
||||
|
||||
"addRuntimeEvent" - Add a runtime event to the runtime event queue.
|
||||
The queue has a fixed size (see -Dnashorn.runtime.event.queue.size)
|
||||
and the oldest entry will be thrown out of the queue is about to overflow.
|
||||
|
||||
"expandEventQueueCapacity" - Expands the event queue capacity,
|
||||
or truncates if capacity is lower than current capacity. Then only
|
||||
the newest entries are kept.
|
||||
|
||||
"clearRuntimeEvents" - Clear the runtime event queue.
|
||||
|
||||
"removeRuntimeEvent" - Remove a specific runtime event from the event queue.
|
||||
|
||||
"getRuntimeEvents" - Return all runtime events in the queue as an array.
|
||||
|
||||
"getLastRuntimeEvent" - Return the last runtime event in the queue.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.methodhandles.debug.stacktrace
|
||||
|
||||
This enhances methodhandles logging (see below) to also dump the
|
||||
stack trace for every instrumented method handle operation.
|
||||
Warning: This is enormously verbose, but provides a pretty
|
||||
decent "grep:able" picture of where the calls are coming from.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.cce
|
||||
|
||||
Setting this system property causes the Nashorn linker to rely on
|
||||
ClassCastExceptions for triggering a callsite relink. If not set, the linker
|
||||
will add an explicit instanceof guard.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.spill.threshold=<x>
|
||||
|
||||
This property sets the number of fields in an object from which to use
|
||||
generic array based spill storage instead of Java fields. The default value
|
||||
is 256.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.tcs.miss.samplePercent=<x>
|
||||
|
||||
When running with the trace callsite option (-tcs), Nashorn will count
|
||||
and instrument any callsite misses that require relinking. As the
|
||||
number of relinks is large and usually produces a lot of output, this
|
||||
system property can be used to constrain the percentage of misses that
|
||||
should be logged. Typically this is set to 1 or 5 (percent). 1% is the
|
||||
default value.
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.persistent.code.cache
|
||||
|
||||
This property can be used to set the directory where Nashorn stores
|
||||
serialized script classes generated with the -pcc/--persistent-code-cache
|
||||
option. The default directory name is "nashorn_code_cache".
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.typeInfo.maxFiles
|
||||
|
||||
Maximum number of files to store in the type info cache. The type info cache
|
||||
is used to cache type data of JavaScript functions when running with
|
||||
optimistic types (-ot/--optimistic-types). There is one file per JavaScript
|
||||
function in the cache.
|
||||
|
||||
The default value is 0 which means the feature is disabled. Setting this
|
||||
to something like 20000 is probably good enough for most applications and
|
||||
will usually cap the cache directory to about 80MB presuming a 4kB
|
||||
filesystem allocation unit. Set this to "unlimited" to run without limit.
|
||||
|
||||
If the value is not 0 or "unlimited", Nashorn will spawn a cleanup thread
|
||||
that makes sure the number of files in the cache does not exceed the given
|
||||
value by deleting the least recently modified files.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.typeInfo.cacheDir
|
||||
|
||||
This property can be used to set the directory where Nashorn stores the
|
||||
type info cache when -Dnashorn.typeInfo.maxFiles is set to a nonzero
|
||||
value. The default location is platform specific. On Windows, it is
|
||||
"${java.io.tmpdir}\com.oracle.java.NashornTypeInfo". On Linux and
|
||||
Solaris it is "~/.cache/com.oracle.java.NashornTypeInfo". On Mac OS X,
|
||||
it is "~/Library/Caches/com.oracle.java.NashornTypeInfo".
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.typeInfo.cleanupDelaySeconds=<value>
|
||||
|
||||
This sets the delay between cleanups of the typeInfo cache, in seconds.
|
||||
The default delay is 20 seconds.
|
||||
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.profilefile=<filename>
|
||||
|
||||
When running with the profile callsite options (-pcs), Nashorn will
|
||||
dump profiling data for all callsites to stderr as a shutdown hook. To
|
||||
instead redirect this to a file, specify the path to the file using
|
||||
this system property.
|
||||
|
||||
|
||||
SYSTEM_PROPERTY: -Dnashorn.regexp.impl=[jdk|joni]
|
||||
|
||||
This property defines the regular expression engine to be used by
|
||||
Nashorn. Set this flag to "jdk" to get an implementation based on the
|
||||
JDK's java.util.regex package. Set this property to "joni" to install
|
||||
an implementation based on Joni, the regular expression engine used by
|
||||
the JRuby project. The default value for this flag is "joni"
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.runtime.event.queue.size=<value>
|
||||
|
||||
Nashorn provides a fixed sized runtime event queue for debugging purposes.
|
||||
See -Dnashorn.debug for methods to access the event queue.
|
||||
The default value is 1024.
|
||||
|
||||
SYSTEM PROPERTY: -Dnashorn.anonymous.classes.threshold=<value>
|
||||
|
||||
Nashorn can use anonymous classes for loading compiled scripts, depending
|
||||
on the --anonymous-classes=[auto|true|false] option. Anonymous classes load
|
||||
faster, but the loaded classes get less optimization applied to them and
|
||||
therefore usually run slower. In the default "auto" setting, scripts are
|
||||
loaded as anonymous classes if the script size does not exceed 512 bytes.
|
||||
The above system property allows to set this threshold to a user defined
|
||||
value.
|
||||
|
||||
===============
|
||||
2. The loggers.
|
||||
===============
|
||||
|
||||
It is very simple to create your own logger. Use the DebugLogger class
|
||||
and give the subsystem name as a constructor argument.
|
||||
|
||||
The Nashorn loggers can be used to print per-module or per-subsystem
|
||||
debug information with different levels of verbosity. The loggers for
|
||||
a given subsystem are available are enabled by using
|
||||
|
||||
--log=<systemname>[:<level>]
|
||||
|
||||
on the command line.
|
||||
|
||||
Here <systemname> identifies the name of the subsystem to be logged
|
||||
and the optional colon and level argument is a standard
|
||||
java.util.logging.Level name (severe, warning, info, config, fine,
|
||||
finer, finest). If the level is left out for a particular subsystem,
|
||||
it defaults to "info". Any log message logged as the level or a level
|
||||
that is more important will be output to stderr by the logger.
|
||||
|
||||
Several loggers can be enabled by a single command line option, by
|
||||
putting a comma after each subsystem/level tuple (or each subsystem if
|
||||
level is unspecified). The --log option can also be given multiple
|
||||
times on the same command line, with the same effect.
|
||||
|
||||
For example: --log=codegen,fields:finest is equivalent to
|
||||
--log=codegen:info --log=fields:finest
|
||||
|
||||
The following is an incomplete list of subsystems that currently
|
||||
support logging. Look for classes implementing
|
||||
jdk.nashorn.internal.runtime.logging.Loggable for more loggers.
|
||||
|
||||
|
||||
* compiler
|
||||
|
||||
The compiler is in charge of turning source code and function nodes
|
||||
into byte code, and installs the classes into a class loader
|
||||
controlled from the Context. Log messages are, for example, about
|
||||
things like new compile units being allocated. The compiler has global
|
||||
settings that all the tiers of codegen (e.g. Lower and CodeGenerator)
|
||||
use.s
|
||||
|
||||
|
||||
* recompile
|
||||
|
||||
This logger shows information about recompilation of scripts and
|
||||
functions at runtime. Recompilation may happen because a function
|
||||
was called with different parameter types, or because an optimistic
|
||||
assumption failed while executing a function with -ot/--optimistic-types.
|
||||
|
||||
|
||||
* codegen
|
||||
|
||||
The code generator is the emitter stage of the code pipeline, and
|
||||
turns the lowest tier of a FunctionNode into bytecode. Codegen logging
|
||||
shows byte codes as they are being emitted, line number information
|
||||
and jumps. It also shows the contents of the bytecode stack prior to
|
||||
each instruction being emitted. This is a good debugging aid. For
|
||||
example:
|
||||
|
||||
[codegen] #41 line:2 (f)_afc824e
|
||||
[codegen] #42 load symbol x slot=2
|
||||
[codegen] #43 {1:O} load int 0
|
||||
[codegen] #44 {2:I O} dynamic_runtime_call GT:ZOI_I args=2 returnType=boolean
|
||||
[codegen] #45 signature (Ljava/lang/Object;I)Z
|
||||
[codegen] #46 {1:Z} ifeq ternary_false_5402fe28
|
||||
[codegen] #47 load symbol x slot=2
|
||||
[codegen] #48 {1:O} goto ternary_exit_107c1f2f
|
||||
[codegen] #49 ternary_false_5402fe28
|
||||
[codegen] #50 load symbol x slot=2
|
||||
[codegen] #51 {1:O} convert object -> double
|
||||
[codegen] #52 {1:D} neg
|
||||
[codegen] #53 {1:D} convert double -> object
|
||||
[codegen] #54 {1:O} ternary_exit_107c1f2f
|
||||
[codegen] #55 {1:O} return object
|
||||
|
||||
shows a ternary node being generated for the sequence "return x > 0 ?
|
||||
x : -x"
|
||||
|
||||
The first number on the log line is a unique monotonically increasing
|
||||
emission id per bytecode. There is no guarantee this is the same id
|
||||
between runs. depending on non deterministic code
|
||||
execution/compilation, but for small applications it usually is. If
|
||||
the system variable -Dnashorn.codegen.debug.trace=<x> is set, where x
|
||||
is a bytecode emission id, a stack trace will be shown as the
|
||||
particular bytecode is about to be emitted. This can be a quick way to
|
||||
determine where it comes from without attaching the debugger. "Who
|
||||
generated that neg?"
|
||||
|
||||
The --log=codegen option is equivalent to setting the system variable
|
||||
"nashorn.codegen.debug" to true.
|
||||
|
||||
* fold
|
||||
|
||||
Shows constant folding taking place before lowering
|
||||
|
||||
* lower
|
||||
|
||||
This is the first lowering pass.
|
||||
|
||||
Lower is a code generation pass that turns high level IR nodes into
|
||||
lower level one, for example substituting comparisons to RuntimeNodes
|
||||
and inlining finally blocks.
|
||||
|
||||
Lower is also responsible for determining control flow information
|
||||
like end points.
|
||||
|
||||
* symbols
|
||||
|
||||
The symbols logger tracks the assignment os symbols to identifiers.
|
||||
|
||||
* scopedepths
|
||||
|
||||
This logs the calculation of scope depths for non-local symbols.
|
||||
|
||||
* fields
|
||||
|
||||
The --log=fields option (at info level) is equivalent to setting the
|
||||
system variable "nashorn.fields.debug" to true. At the info level it
|
||||
will only show info about type assumptions that were invalidated. If
|
||||
the level is set to finest, it will also trace every AccessorProperty
|
||||
getter and setter in the program, show arguments, return values
|
||||
etc. It will also show the internal representation of respective field
|
||||
(Object in the normal case, unless running with the dual field
|
||||
representation)
|
||||
|
||||
* time
|
||||
|
||||
This enables timers for various phases of script compilation. The timers
|
||||
will be dumped when the Nashorn process exits. We see a percentage value
|
||||
of how much time was spent not executing bytecode (i.e. compilation and
|
||||
internal tasks) at the end of the report.
|
||||
|
||||
A finer level than "info" will show individual compilation timings as they
|
||||
happen.
|
||||
|
||||
Here is an example:
|
||||
|
||||
[time] Accumulated complation phase Timings:
|
||||
[time]
|
||||
[time] 'JavaScript Parsing' 1076 ms
|
||||
[time] 'Constant Folding' 159 ms
|
||||
[time] 'Control Flow Lowering' 303 ms
|
||||
[time] 'Program Point Calculation' 282 ms
|
||||
[time] 'Builtin Replacement' 71 ms
|
||||
[time] 'Code Splitting' 670 ms
|
||||
[time] 'Symbol Assignment' 474 ms
|
||||
[time] 'Scope Depth Computation' 249 ms
|
||||
[time] 'Optimistic Type Assignment' 186 ms
|
||||
[time] 'Local Variable Type Calculation' 526 ms
|
||||
[time] 'Bytecode Generation' 5177 ms
|
||||
[time] 'Class Installation' 1854 ms
|
||||
[time]
|
||||
[time] Total runtime: 11994 ms (Non-runtime: 11027 ms [91%])
|
||||
|
||||
* methodhandles
|
||||
|
||||
If this logger is enabled, each MethodHandle related call that uses
|
||||
the java.lang.invoke package gets its MethodHandle intercepted and an
|
||||
instrumentation printout of arguments and return value appended to
|
||||
it. This shows exactly which method handles are executed and from
|
||||
where. (Also MethodTypes and SwitchPoints).
|
||||
|
||||
* classcache
|
||||
|
||||
This logger shows information about reusing code classes using the
|
||||
in-memory class cache. Nashorn will try to avoid compilation of
|
||||
scripts by using existing classes. This can significantly improve
|
||||
performance when repeatedly evaluating the same script.
|
||||
|
||||
=======================
|
||||
3. Undocumented options
|
||||
=======================
|
||||
|
||||
Here follows a short description of undocumented options for Nashorn.
|
||||
To see a list of all undocumented options, use the (undocumented) flag
|
||||
"-xhelp".
|
||||
|
||||
i.e. jjs -xhelp or java -jar nashorn.jar -xhelp
|
||||
|
||||
Undocumented options are not guaranteed to work, run correctly or be
|
||||
bug free. They are experimental and for internal or debugging use.
|
||||
They are also subject to change without notice.
|
||||
|
||||
In practice, though, all options below not explicitly documented as
|
||||
EXPERIMENTAL can be relied upon, for example --dump-on-error is useful
|
||||
for any JavaScript/Nashorn developer, but there is no guarantee.
|
||||
|
||||
A short summary follows:
|
||||
|
||||
-D (-Dname=value. Set a system property. This option can be repeated.)
|
||||
|
||||
-ccs, --class-cache-size (Size of the Class cache size per global scope.)
|
||||
|
||||
-cp, -classpath (-cp path. Specify where to find user class files.)
|
||||
|
||||
-co, --compile-only (Compile without running.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-d, --dump-debug-dir (specify a destination directory to dump class files.)
|
||||
param: <path>
|
||||
|
||||
--debug-lines (Generate line number table in .class files.)
|
||||
param: [true|false] default: true
|
||||
|
||||
--debug-locals (Generate local variable table in .class files.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-doe, -dump-on-error (Dump a stack trace on errors.)
|
||||
param: [true|false] default: false
|
||||
|
||||
--early-lvalue-error (invalid lvalue expressions should be reported as early errors.)
|
||||
param: [true|false] default: true
|
||||
|
||||
--empty-statements (Preserve empty statements in AST.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-fv, -fullversion (Print full version info of Nashorn.)
|
||||
param: [true|false] default: false
|
||||
|
||||
--function-statement-error (Report an error when function declaration is used as a statement.)
|
||||
param: [true|false] default: false
|
||||
|
||||
--function-statement-warning (Warn when function declaration is used as a statement.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-fx (Launch script as an fx application.)
|
||||
param: [true|false] default: false
|
||||
|
||||
--global-per-engine (Use single Global instance per script engine instance.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-h, -help (Print help for command line flags.)
|
||||
param: [true|false] default: false
|
||||
|
||||
--loader-per-compile (Create a new class loader per compile.)
|
||||
param: [true|false] default: true
|
||||
|
||||
-l, --locale (Set Locale for script execution.)
|
||||
param: <locale> default: en-US
|
||||
|
||||
--log (Enable logging of a given level for a given number of sub systems.
|
||||
[for example: --log=fields:finest,codegen:info].)
|
||||
param: <module:level>,*
|
||||
|
||||
-nj, --no-java (Disable Java support.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-nse, --no-syntax-extensions (Disallow non-standard syntax extensions.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-nta, --no-typed-arrays (Disable typed arrays support.)
|
||||
param: [true|false] default: false
|
||||
|
||||
--parse-only (Parse without compiling.)
|
||||
param: [true|false] default: false
|
||||
|
||||
--print-ast (Print abstract syntax tree.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-pc, --print-code (Print generated bytecode. If a directory is specified, nothing will
|
||||
be dumped to stderr. Also, in that case, .dot files will be generated
|
||||
for all functions or for the function with the specified name only.)
|
||||
param: [dir:<output-dir>,function:<name>]
|
||||
|
||||
--print-lower-ast (Print lowered abstract syntax tree.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-plp, --print-lower-parse (Print the parse tree after lowering.)
|
||||
param: [true|false] default: false
|
||||
|
||||
--print-no-newline (Print function will not print new line char.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-pp, --print-parse (Print the parse tree.)
|
||||
param: [true|false] default: false
|
||||
|
||||
--print-symbols (Print the symbol table.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-pcs, --profile-callsites (Dump callsite profile data.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-scripting (Enable scripting features.)
|
||||
param: [true|false] default: false
|
||||
|
||||
--stderr (Redirect stderr to a filename or to another tty, e.g. stdout.)
|
||||
param: <output console>
|
||||
|
||||
--stdout (Redirect stdout to a filename or to another tty, e.g. stderr.)
|
||||
param: <output console>
|
||||
|
||||
-strict (Run scripts in strict mode.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-t, -timezone (Set timezone for script execution.)
|
||||
param: <timezone> default: Europe/Stockholm
|
||||
|
||||
-tcs, --trace-callsites (Enable callsite trace mode. Options are: miss [trace callsite misses]
|
||||
enterexit [trace callsite enter/exit], objects [print object properties].)
|
||||
param: [=[option,]*]
|
||||
|
||||
-urt, --unstable-relink-threshold (Number of times a dynamic call site has to be relinked before it
|
||||
is considered unstable, when the runtime will try to link it as
|
||||
if it is megamorphic.)
|
||||
|
||||
--verify-code (Verify byte code before running.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-v, -version (Print version info of Nashorn.)
|
||||
param: [true|false] default: false
|
||||
|
||||
-xhelp (Print extended help for command line flags.)
|
||||
param: [true|false] default: false
|
||||
|
||||
@@ -1,988 +0,0 @@
|
||||
<!--
|
||||
Copyright (c) 2010, 2013, 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
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Oracle designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Oracle in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
or visit www.oracle.com if you need additional information or have any
|
||||
questions.
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html class=" regenabled gecko radius jsenabled regloaded" xmlns="http://www.w3.org/1999/xhtml"><head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Java Scripting Programmer's Guide</title>
|
||||
|
||||
<!-- ============ -->
|
||||
<!-- MAIN CONTENT -->
|
||||
<!-- ============ -->
|
||||
<table summary="layout" border="0" width="100%">
|
||||
<tbody><tr>
|
||||
<td>
|
||||
|
||||
<div id="sharepage" class="smallpagetitle"><h1>Java Scripting Programmer's Guide</h1><div class="sharepage"> <div class="sharepagew1 share-mailto"> <table summary="" cellpadding="0" cellspacing="0"><tbody><tr> <td id="share-mailto"><a href="mailto:?subject=Java%20Documentation%20Page:%20Java%20Scripting%20Programmer%27s%20Guide&body=Check%20out%20this%20page:%20%0A%0Ahttp%3A%2F%2Fdocs.oracle.com%2Fjavase%2F6%2Fdocs%2Ftechnotes%2Fguides%2Fscripting%2Fprogrammer_guide%2Findex.html" class="sharelink mailto" title="Email this page to a friend"></a></td> <td id="share-technorati"><a href="http://technorati.com/search/http%3A%2F%2Fdocs.oracle.com%2Fjavase%2F6%2Fdocs%2Ftechnotes%2Fguides%2Fscripting%2Fprogrammer_guide%2Findex.html" class="sharelink technorati" title="See who links to this page on Technorati"></a></td> <td id="share-delicious"><a href="http://del.icio.us/post?v=4;url=http%3A%2F%2Fdocs.oracle.com%2Fjavase%2F6%2Fdocs%2Ftechnotes%2Fguides%2Fscripting%2Fprogrammer_guide%2Findex.html;title=Java%20Scripting%20Programmer%27s%20Guide" class="sharelink delicious" title="Bookmark this page in del.icio.us"></a></td> <td id="share-digg"><a href="http://digg.com/submit?phase=2&url=http%3A%2F%2Fdocs.oracle.com%2Fjavase%2F6%2Fdocs%2Ftechnotes%2Fguides%2Fscripting%2Fprogrammer_guide%2Findex.html&title=Java%20Scripting%20Programmer%27s%20Guide" class="sharelink digg" title="Submit this page to Digg"></a></td> <td id="share-slashdot"><a href="http://slashdot.org/bookmark.pl?title=Java%20Scripting%20Programmer%27s%20Guide&url=http%3A%2F%2Fdocs.oracle.com%2Fjavase%2F6%2Fdocs%2Ftechnotes%2Fguides%2Fscripting%2Fprogrammer_guide%2Findex.html" class="sharelink slashdot" title="Submit this page to Slashdot"></a></td> <td id="share-blank"> </td></tr></tbody></table></div></div></div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<!-- Body text begins here -->
|
||||
<ul>
|
||||
<li><span><a href="#who">Who is the Java Scripting API
|
||||
For?</a></span></li>
|
||||
<li><span><a href="#package">Scripting Package</a></span></li>
|
||||
<li><span><a href="#examples">Examples</a></span>
|
||||
<ul>
|
||||
<li><span><a href="#helloworld">"Hello, World"</a></span></li>
|
||||
<li><span><a href="#evalfile">Evaluating a Script
|
||||
File</a></span></li>
|
||||
<li><span><a href="#scriptvars">Script Variables</a></span></li>
|
||||
<li><span><a href="#invoke">Invoking Script Functions and
|
||||
Methods</a></span></li>
|
||||
<li><span><a href="#interfaces">Implementing Java Interfaces by
|
||||
Scripts</a></span></li>
|
||||
<li><span><a href="#scopes">Multiple Scopes for
|
||||
Scripts</a></span></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><span><a href="#jsengine">JavaScript Script
|
||||
Engine</a></span></li>
|
||||
<li><span><a href="#jstojava">JavaScript to Java
|
||||
Communication</a></span>
|
||||
<ul>
|
||||
<li><span><a href="#jsjavaclass">Accessing Java
|
||||
Classes</a></span></li>
|
||||
<li><span><a href="#jsimport">Importing Java Packages,
|
||||
Classes</a></span></li>
|
||||
<li><span><a href="#jsarrays">Creating, Converting and Using Java
|
||||
Arrays</a></span></li>
|
||||
<li><span><a href="#jsimplement">Implementing Java
|
||||
Interfaces</a></span></li>
|
||||
<li><span><a href="#jsextendabstract">Extending Abstract Java Classes
|
||||
</a></span></li>
|
||||
<li><span><a href="#jsextendconcrete">Extending Concrete Java Classes
|
||||
</a></span></li>
|
||||
<li><span><a href="#jsimplementmultiple">Implementing Multiple Java Interfaces
|
||||
</a></span></li>
|
||||
<li><span><a href="#classBoundImplementations">Class-Bound Implementations
|
||||
</a></span></li>
|
||||
<li><span><a href="#jsoverload">Overload Resolution</a></span></li>
|
||||
<li><span><a href="#dataTypeMapping">Mapping of Data Types Between Java
|
||||
and JavaScript</a></span></li>
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<li><span><a href="#engineimpl">Implementing Your Own Script
|
||||
Engine</a></span></li>
|
||||
<li><span><a href="#refs">References</a></span></li>
|
||||
</ul>
|
||||
<span><a name="who" id="who"></a></span>
|
||||
<h2><span>Who is the Java Scripting API For?</span></h2>
|
||||
<span>Some useful characteristics of scripting languages
|
||||
are:</span>
|
||||
<ul>
|
||||
<li><span><b>Convenience</b>: Most scripting languages are
|
||||
dynamically typed. You can usually create new variables without
|
||||
declaring the variable type, and you can reuse variables to store
|
||||
objects of different types. Also, scripting languages tend to
|
||||
perform many type conversions automatically, for example,
|
||||
converting the number 10 to the text "10" as necessary.</span></li>
|
||||
<li><span><b>Developing rapid prototypes</b>: You can avoid the
|
||||
edit-compile-run cycle and just use edit-run!</span></li>
|
||||
<li><span><b>Application extension/customization</b>: You can
|
||||
"externalize" parts of your application - like configuration
|
||||
scripts, business logic/rules and math expressions for financial
|
||||
applications.</span></li>
|
||||
<li><span><b>"Command line" shells for applications</b> -for
|
||||
debugging, runtime/deploy time configuration etc. Most applications
|
||||
have a web-based GUI configuaration tool these days. But
|
||||
sysadmins/deployers frequently prefer command line tools. Instead
|
||||
of inventing ad-hoc scripting language for that purpose, a
|
||||
"standard" scripting language can be used.</span></li>
|
||||
</ul>
|
||||
<p><span>The Java<font size="-1"><sup>TM</sup></font> Scripting API
|
||||
is a scripting language indepedent framework for using script
|
||||
engines from Java code. With the Java Scripting API, it is possible
|
||||
to write customizable/extendable applications in the Java language
|
||||
and leave the customization scripting language choice to the end
|
||||
user. The Java application developer need not choose the extension
|
||||
language during development. If you write your application with
|
||||
JSR-223 API, then your users can use any JSR-223 compliant
|
||||
scripting language.</span></p>
|
||||
<hr>
|
||||
<span><a name="package" id="package"></a></span>
|
||||
<h2><span>Scripting Package</span></h2>
|
||||
<p><span>The Java Scripting functionality is in the <code><a href="http://docs.oracle.com/javase/9/docs/api/javax/script/package-summary.html">javax.script</a></code>
|
||||
package. This is a relatively small, simple API. The starting point
|
||||
of the scripting API is the <code>ScriptEngineManager</code> class.
|
||||
A ScriptEngineManager object can discover script engines through
|
||||
the jar file service discovery mechanism. It can also instantiate
|
||||
ScriptEngine objects that interpret scripts written in a specific
|
||||
scripting language. The simplest way to use the scripting API is as
|
||||
follows:</span></p>
|
||||
<ol>
|
||||
<li><span>Create a <code>ScriptEngineManager</code>
|
||||
object.</span></li>
|
||||
<li><span>Get a <code>ScriptEngine</code> object from the
|
||||
manager.</span></li>
|
||||
<li><span>Evaluate script using the <code>ScriptEngine</code>'s
|
||||
<code>eval</code> methods.</span></li>
|
||||
</ol>
|
||||
<p><span>Now, it is time to look at some sample code. While it is
|
||||
not mandatory, it may be useful to know a bit of JavaScript to read
|
||||
these examples.</span></p>
|
||||
<hr>
|
||||
<span><a name="examples" id="examples"></a></span>
|
||||
<h2><span>Examples</span></h2>
|
||||
<span><a name="helloworld" id="helloworld"></a></span>
|
||||
<h3><span>"Hello, World"</span></h3>
|
||||
<p><span>From the <code>ScriptEngineManager</code> instance, we
|
||||
request a JavaScript engine instance using
|
||||
<code>getEngineByName</code> method. On the script engine, the
|
||||
<code>eval</code> method is called to execute a given String as
|
||||
JavaScript code! For brevity, in this as well as in subsequent
|
||||
examples, we have not shown exception handling. There are checked
|
||||
and runtime exceptions thrown from <code>javax.script</code> API.
|
||||
Needless to say, you have to handle the exceptions
|
||||
appropriately.</span></p>
|
||||
<pre>
|
||||
<span><code>
|
||||
// <a href="source/EvalScript.java">EvalScript.java</a>
|
||||
|
||||
import javax.script.*;
|
||||
public class EvalScript {
|
||||
public static void main(String[] args) throws Exception {
|
||||
// create a script engine manager
|
||||
<span class="classref">ScriptEngineManager</span> factory = new ScriptEngineManager();
|
||||
// create a JavaScript engine
|
||||
<span class="classref">ScriptEngine</span> engine = factory.<span class="methodref">getEngineByName</span>("nashorn");
|
||||
// evaluate JavaScript code from String
|
||||
engine.<span class="methodref">eval</span>("print('Hello, World')");
|
||||
}
|
||||
}
|
||||
</code></span>
|
||||
</pre>
|
||||
<hr>
|
||||
<a name="evalfile" id="evalfile"></a>
|
||||
<h3>Evaluating a Script File</h3>
|
||||
<p>In this example, we call the <code>eval</code> method that
|
||||
accepts <code>java.io.Reader</code> for the input source. The
|
||||
script read by the given reader is executed. This way it is
|
||||
possible to execute scripts from files, URLs and resources by
|
||||
wrapping the relevant input stream objects as readers.</p>
|
||||
<pre>
|
||||
<code>
|
||||
// <a href="source/EvalFile.java">EvalFile.java</a>
|
||||
|
||||
import javax.script.*;
|
||||
|
||||
public class EvalFile {
|
||||
public static void main(String[] args) throws Exception {
|
||||
// create a script engine manager
|
||||
<span class="classref">ScriptEngineManager</span> factory = new ScriptEngineManager();
|
||||
// create JavaScript engine
|
||||
<span class="classref">ScriptEngine</span> engine = factory.<span class="methodref">getEngineByName</span>("nashorn");
|
||||
// evaluate JavaScript code from given file - specified by first argument
|
||||
engine.<span class="methodref">eval</span>(new java.io.FileReader(args[0]));
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
Let us assume that we have the file named <a href="source/test.js">test.js</a> with the
|
||||
following text:
|
||||
<pre><code>
|
||||
print("This is hello from test.js");
|
||||
</code>
|
||||
</pre>
|
||||
We can run the above Java as
|
||||
<pre><code>
|
||||
java EvalFile test.js
|
||||
</code>
|
||||
</pre>
|
||||
<hr>
|
||||
<a name="scriptvars" id="scriptvars"></a>
|
||||
<h3>Script Variables</h3>
|
||||
<p>When you embed script engines and scripts with your Java
|
||||
application, you may want to expose your application objects as
|
||||
global variables to scripts. This example demonstrates how you can
|
||||
expose your application objects as global variables to a script. We
|
||||
create a <code>java.io.File</code> in the application and expose
|
||||
the same as a global variable with the name "file". The script can
|
||||
access the variable - for example, it can call public methods on
|
||||
it. Note that the syntax to access Java objects, methods and fields
|
||||
is dependent on the scripting language. JavaScript supports the
|
||||
most "natural" Java-like syntax.</p>
|
||||
<p>
|
||||
Nashorn script engine pre-defines two global variables named "context"
|
||||
and "engine". The "context" variable is of type javax.script.ScriptContext
|
||||
and refers to the current ScriptContext instance passed to script engine's
|
||||
eval method. The "engine" variable is of type javax.script.ScriptEngine and
|
||||
refers to the current nashorn script engine instance evaluating the script.
|
||||
Both of these variables are non-writable, non-enumerable and non-configurable
|
||||
- which implies script code can not write overwrite the value, for..loop iteration
|
||||
on global object will not iterate these variables and these variables can not be
|
||||
deleted by script.
|
||||
<pre><code>
|
||||
// <a href="source/ScriptVars.java">ScriptVars.java</a>
|
||||
|
||||
import javax.script.*;
|
||||
import java.io.*;
|
||||
|
||||
public class ScriptVars {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ScriptEngineManager manager = new ScriptEngineManager();
|
||||
ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
File f = new File("test.txt");
|
||||
// expose File object as variable to script
|
||||
engine.<span class="methodref">put</span>("file", f);
|
||||
|
||||
// evaluate a script string. The script accesses "file"
|
||||
// variable and calls method on it
|
||||
engine.eval("print(file.getAbsolutePath())");
|
||||
}
|
||||
}
|
||||
|
||||
</code>
|
||||
</pre>
|
||||
<hr>
|
||||
<a name="invoke" id="invoke"></a>
|
||||
<h3>Invoking Script Functions and Methods</h3>
|
||||
<p>Sometimes you may want to call a specific scripting function
|
||||
repeatedly - for example, your application menu functionality might
|
||||
be implemented by a script. In your menu's action event handler you
|
||||
may want to call a specific script function. The following example
|
||||
demonstrates invoking a specific script function from Java
|
||||
code.</p>
|
||||
<pre><code>
|
||||
// <a href="source/InvokeScriptFunction.java">InvokeScriptFunction.java</a>
|
||||
|
||||
import javax.script.*;
|
||||
|
||||
public class InvokeScriptFunction {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ScriptEngineManager manager = new ScriptEngineManager();
|
||||
ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
// JavaScript code in a String
|
||||
String script = "function hello(name) { print('Hello, ' + name); }";
|
||||
// evaluate script
|
||||
engine.eval(script);
|
||||
|
||||
// <code>javax.script.Invocable</code> is an optional interface.
|
||||
// Check whether your script engine implements it or not!
|
||||
// Note that the JavaScript engine implements Invocable interface.
|
||||
<span class="classref">Invocable</span> inv = (Invocable) engine;
|
||||
|
||||
// invoke the global function named "hello"
|
||||
inv.<span class="methodref">invokeFunction</span>("hello", "Scripting!!" );
|
||||
}
|
||||
}
|
||||
|
||||
</code>
|
||||
</pre>
|
||||
<p>If your scripting language is object based (like JavaScript) or
|
||||
object-oriented, then you can invoke a script method on a script
|
||||
object.</p>
|
||||
<pre><code>
|
||||
// <a href="source/InvokeScriptMethod.java">InvokeScriptMethod.java</a>
|
||||
|
||||
import javax.script.*;
|
||||
|
||||
public class InvokeScriptMethod {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ScriptEngineManager manager = new ScriptEngineManager();
|
||||
ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
// JavaScript code in a String. This code defines a script object 'obj'
|
||||
// with one method called 'hello'.
|
||||
String script = "var obj = new Object(); obj.hello = function(name) { print('Hello, ' + name); }";
|
||||
// evaluate script
|
||||
engine.eval(script);
|
||||
|
||||
// <code>javax.script.Invocable</code> is an optional interface.
|
||||
// Check whether your script engine implements or not!
|
||||
// Note that the JavaScript engine implements Invocable interface.
|
||||
<span class="classref">Invocable</span> inv = (Invocable) engine;
|
||||
|
||||
// get script object on which we want to call the method
|
||||
Object obj = engine.<span class="methodref">get</span>("obj");
|
||||
|
||||
// invoke the method named "hello" on the script object "obj"
|
||||
inv.<span class="methodref">invokeMethod</span>(obj, "hello", "Script Method !!" );
|
||||
}
|
||||
}
|
||||
|
||||
</code>
|
||||
</pre>
|
||||
<hr>
|
||||
<a name="interfaces" id="interfaces"></a>
|
||||
<h3>Implementing Java Interfaces by Scripts</h3>
|
||||
<p>Instead of calling specific script functions from Java,
|
||||
sometimes it is convenient to implement a Java interface by script
|
||||
functions or methods. Also, by using interfaces we can avoid having
|
||||
to use the <code>javax.script</code> API in many places. We can get
|
||||
an interface implementor object and pass it to various Java APIs.
|
||||
The following example demonstrates implementing the
|
||||
<code>java.lang.Runnable</code> interface with a script.</p>
|
||||
<pre><code>
|
||||
// <a href="source/RunnableImpl.java">RunnableImpl.java</a>
|
||||
|
||||
import javax.script.*;
|
||||
|
||||
public class RunnableImpl {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ScriptEngineManager manager = new ScriptEngineManager();
|
||||
ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
// JavaScript code in a String
|
||||
String script = "function run() { print('run called'); }";
|
||||
|
||||
// evaluate script
|
||||
engine.eval(script);
|
||||
|
||||
<span class="classref">Invocable</span> inv = (Invocable) engine;
|
||||
|
||||
// get Runnable interface object from engine. This interface methods
|
||||
// are implemented by script functions with the matching name.
|
||||
Runnable r = inv.<span class="methodref">getInterface</span>(Runnable.class);
|
||||
|
||||
// start a new thread that runs the script implemented
|
||||
// runnable interface
|
||||
Thread th = new Thread(r);
|
||||
th.start();
|
||||
th.join();
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
<p>If your scripting language is object-based or object-oriented,
|
||||
it is possible to implement a Java interface by script methods on
|
||||
script objects. This avoids having to call script global functions
|
||||
for interface methods. The script object can store the "state"
|
||||
associated with the interface implementor.</p>
|
||||
<pre><code>
|
||||
// <a href="source/RunnableImplObject.java">RunnableImplObject.java</a>
|
||||
|
||||
import javax.script.*;
|
||||
|
||||
public class RunnableImplObject {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ScriptEngineManager manager = new ScriptEngineManager();
|
||||
ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
// JavaScript code in a String
|
||||
String script = "var obj = new Object(); obj.run = function() { print('run method called'); }";
|
||||
|
||||
// evaluate script
|
||||
engine.eval(script);
|
||||
|
||||
// get script object on which we want to implement the interface with
|
||||
Object obj = engine.<span class="methodref">get</span>("obj");
|
||||
|
||||
<span class="classref">Invocable</span> inv = (Invocable) engine;
|
||||
|
||||
// get Runnable interface object from engine. This interface methods
|
||||
// are implemented by script methods of object 'obj'
|
||||
Runnable r = inv.<span class="methodref">getInterface</span>(obj, Runnable.class);
|
||||
|
||||
// start a new thread that runs the script implemented
|
||||
// runnable interface
|
||||
Thread th = new Thread(r);
|
||||
th.start();
|
||||
th.join();
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
<hr>
|
||||
<a name="scopes" id="scopes"></a>
|
||||
<h3>Multiple Scopes for Scripts</h3>
|
||||
<p>In the <a href="#scriptvars">script variables</a> example, we
|
||||
saw how to expose application objects as script global variables.
|
||||
It is possible to expose multiple global "scopes" for scripts. A
|
||||
single scope is an instance of <code>javax.script.Bindings</code>.
|
||||
This interface is derived from <code>java.util.Map<String,
|
||||
Object></code>. A scope a set of name-value pairs where name is
|
||||
any non-empty, non-null String.
|
||||
<code>javax.script.ScriptContext</code> interface supports multiple
|
||||
scopes with associated Bindings for each
|
||||
scope. By default, every script engine has a default script
|
||||
context. The default script context has atleast one scope called
|
||||
"ENGINE_SCOPE". Various scopes supported by a script context are
|
||||
available through <code>getScopes</code> method.</p>
|
||||
<pre><code>
|
||||
// <a href="source/MultiScopes.java">MultiScopes.java</a>
|
||||
|
||||
import javax.script.*;
|
||||
|
||||
public class MultiScopes {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ScriptEngineManager manager = new ScriptEngineManager();
|
||||
ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
engine.put("x", "hello");
|
||||
// print global variable "x"
|
||||
engine.eval("print(x);");
|
||||
// the above line prints "hello"
|
||||
|
||||
// Now, pass a different script context
|
||||
<span class="classref">ScriptContext</span> newContext = new <span class="classref">SimpleScriptContext</span>();
|
||||
newContext.setBindings(engine.createBindings(), ScriptContext.ENGINE_SCOPE);
|
||||
<span class="classref">Bindings</span> engineScope = newContext.<span class="methodref">getBindings</span>(ScriptContext.ENGINE_SCOPE);
|
||||
|
||||
// add new variable "x" to the new engineScope
|
||||
engineScope.<span class="methodref">put</span>("x", "world");
|
||||
|
||||
// execute the same script - but this time pass a different script context
|
||||
engine.eval("print(x);", newContext);
|
||||
// the above line prints "world"
|
||||
}
|
||||
}
|
||||
|
||||
</code>
|
||||
</pre>
|
||||
<hr>
|
||||
<a name="jsengine" id="jsengine"></a>
|
||||
<h2>JavaScript Script Engine</h2>
|
||||
<p>Oracle's implementation of JDK 8 is co-bundled with the Nashorn ECMAScript
|
||||
script engine.
|
||||
<hr>
|
||||
<a name="jstojava" id="jstojava"></a>
|
||||
<h2>JavaScript to Java Communication</h2>
|
||||
<p>For the most part, accessing Java classes, objects and methods
|
||||
is straightforward. In particular field and method access from
|
||||
JavaScript is the same as it is from Java. We highlight important
|
||||
aspects of JavaScript Java access here.
|
||||
The following examples are JavaScript snippets accessing Java. This
|
||||
section requires knowledge of JavaScript. This section can be
|
||||
skipped if you are planning to use some other JSR-223 scripting
|
||||
language rather than JavaScript.</p>
|
||||
<hr>
|
||||
<a name="jsjavaclass" id=jsjavalass"></a>
|
||||
<h3>Accessing Java Classes</h3>
|
||||
<pre>
|
||||
<code>
|
||||
// <a href="source/javatypes.js">javatypes.js</a>
|
||||
|
||||
var arrayListType = Java.type("java.util.ArrayList")
|
||||
var intType = Java.type("int")
|
||||
var stringArrayType = Java.type("java.lang.String[]")
|
||||
var int2DArrayType = Java.type("int[][]")
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
Note that the name of the type is always a string for a fully qualified name. You can use any of these expressions to create new instances, e.g.:
|
||||
|
||||
<pre><code>
|
||||
var anArrayList = new (Java.type("java.util.ArrayList"))
|
||||
</code></pre>
|
||||
|
||||
or
|
||||
|
||||
<pre><code>
|
||||
var ArrayList = Java.type("java.util.ArrayList")
|
||||
var anArrayList = new ArrayList
|
||||
var anArrayListWithSize = new ArrayList(16)
|
||||
</code></pre>
|
||||
|
||||
In the special case of inner classes, you can either use the JVM fully qualified name, meaning using the dollar sign in the class name, or you can use the dot:
|
||||
|
||||
<pre><code>
|
||||
var ftype = Java.type("java.awt.geom.Arc2D$Float")
|
||||
</code></pre>
|
||||
|
||||
and
|
||||
|
||||
<pre><code>
|
||||
var ftype = Java.type("java.awt.geom.Arc2D.Float")
|
||||
</code></pre>
|
||||
|
||||
both work. Note however that using the dollar sign is faster, as Java.type first tries to resolve the class name as it is originally specified, and the internal JVM names for inner classes use the dollar sign. If you use the dot, Java.type will internally get a ClassNotFoundException and subsequently retry by changing the last dot to dollar sign. As a matter of fact, it'll keep replacing dots with dollar signs until it either successfully loads the class or runs out of all dots in the name. This way it can correctly resolve and load even multiply nested inner classes with the dot notation. Again, this will be slower than using the dollar signs in the name. An alternative way to access the inner class is as a property of the outer class:
|
||||
|
||||
<pre><code>
|
||||
var arctype = Java.type("java.awt.geom.Arc2D")
|
||||
var ftype = arctype.Float
|
||||
</code></pre>
|
||||
<p>
|
||||
You can access both static and non-static inner classes. If you want to create an instance of a non-static inner class, remember to pass an instance of its outer class as the first argument to the constructor.
|
||||
</p>
|
||||
<p>
|
||||
In addition to creating new instances, the type objects returned from <code>Java.type</code> calls can also be used to access the
|
||||
static fields and methods of the classes:
|
||||
<pre><code>
|
||||
var File = Java.type("java.io.File")
|
||||
File.createTempFile("nashorn", ".tmp")
|
||||
</code></pre>
|
||||
<p>
|
||||
Methods with names of the form <code>isXxx()</code>, <code>getXxx()</code>, and <code>setXxx()</code> can also be used as properties, for both instances and statics.
|
||||
</p>
|
||||
<p>
|
||||
A type object returned from <code>Java.type</code> is distinct from a <code>java.lang.Class</code> object. You can obtain one from the other using properties <code>class</code> and <code>static</code> on them.
|
||||
<pre><code>
|
||||
var ArrayList = Java.type("java.util.ArrayList")
|
||||
var a = new ArrayList
|
||||
|
||||
// All of the following print true:
|
||||
print("Type acts as target of instanceof: " + (a instanceof ArrayList))
|
||||
print("Class doesn't act as target of instanceof: " + !(a instanceof a.getClass()))
|
||||
print("Type is not same as instance's getClass(): " + (a.getClass() !== ArrayList))
|
||||
print("Type's `class` property is same as instance getClass(): " + (a.getClass() === ArrayList.class))
|
||||
print("Type is same as instance getClass()'s `static` property: " + (a.getClass().static === ArrayList))
|
||||
</code></pre>
|
||||
<p>
|
||||
You can think of the type object as similar to the class names as used in Java source code: you use them as the
|
||||
arguments to the <code>new</code> and <code>instanceof</code> operators and as the namespace for the static fields
|
||||
and methods, but they are different than the runtime <code>Class</code> objects returned by <code>getClass()</code> calls.
|
||||
Syntactically and semantically, this separation produces code that is most similar to Java code, where a distinction
|
||||
between compile-time class expressions and runtime class objects also exists. (Also, Java can't have the equivalent of <code>static</code>
|
||||
property on a <code>Class</code> object since compile-time class expressions are never reified as objects).
|
||||
</p>
|
||||
<hr>
|
||||
<a name="jsimport" id="jsimport"></a>
|
||||
<h3>Importing Java Packages, Classes</h3>
|
||||
<p>The built-in functions <code>importPackage</code> (in compatibility script) and
|
||||
<code>importClass</code> can be used to import Java packages and
|
||||
classes.</p>
|
||||
<pre><code>
|
||||
|
||||
// <a href="source/importpackageclass.js">importpackageclass.js</a>
|
||||
|
||||
// load compatibility script
|
||||
load("nashorn:mozilla_compat.js");
|
||||
// Import Java packages and classes
|
||||
// like import package.*; in Java
|
||||
<span class="functionref">importPackage</span>(java.awt);
|
||||
// like import java.awt.Frame in Java
|
||||
<span class="functionref">importClass</span>(java.awt.Frame);
|
||||
// Create Java Objects by "new ClassName"
|
||||
var frame = new java.awt.Frame("hello");
|
||||
// Call Java public methods from script
|
||||
frame.setVisible(true);
|
||||
// Access "JavaBean" properties like "fields"
|
||||
print(frame.title);
|
||||
</code>
|
||||
</pre>
|
||||
<p>The <span class="objectref">Packages</span> global variable can
|
||||
be used to access Java packages. Examples:
|
||||
<code>Packages.java.util.Vector</code>,
|
||||
<code>Packages.javax.swing.JFrame</code>. Please note that "java"
|
||||
is a shortcut for "Packages.java". There are equivalent shortcuts
|
||||
for javax, org, edu, com, net prefixes, so pratically all JDK
|
||||
platform classes can be accessed without the "Packages" prefix.</p>
|
||||
<p>Note that java.lang is not imported by default (unlike Java)
|
||||
because that would result in conflicts with JavaScript's built-in
|
||||
Object, Boolean, Math and so on.</p>
|
||||
<p><code>importPackage</code> and <code>importClass</code>
|
||||
functions "pollute" the global variable scope of JavaScript. To
|
||||
avoid that, you may use <span class="functionref">JavaImporter</span>.</p>
|
||||
<pre><code>
|
||||
|
||||
// <a href="source/javaimporter.js">javaimporter.js</a>
|
||||
|
||||
// create JavaImporter with specific packages and classes to import
|
||||
|
||||
var SwingGui = new <span class="functionref">JavaImporter</span>(javax.swing,
|
||||
javax.swing.event,
|
||||
javax.swing.border,
|
||||
java.awt.event);
|
||||
with (SwingGui) {
|
||||
// within this 'with' statement, we can access Swing and AWT
|
||||
// classes by unqualified (simple) names.
|
||||
|
||||
var mybutton = new JButton("test");
|
||||
var myframe = new JFrame("test");
|
||||
}
|
||||
|
||||
</code>
|
||||
</pre>
|
||||
<hr>
|
||||
<a name="jsarrays" id="jsarrays"></a>
|
||||
<h3>Creating, Converting and Using Java Arrays</h3>
|
||||
<p>
|
||||
Array element access or length access is the same as in Java.</p>
|
||||
<pre><code>
|
||||
// <a href="source/javaarray.js">javaarray.js</a>
|
||||
|
||||
// create Java String array of 5 elements
|
||||
var StringArray = Java.type("java.lang.String[]");
|
||||
var a = new StringArray(5);
|
||||
|
||||
// Accessing elements and length access is by usual Java syntax
|
||||
a[0] = "scripting is great!";
|
||||
print(a.length);
|
||||
print(a[0]);
|
||||
</code>
|
||||
</pre>
|
||||
<p>
|
||||
It is also possible to convert between JavaScript and Java arrays.
|
||||
Given a JavaScript array and a Java type, <code>Java.to</code> returns a Java array with the same initial contents, and with the specified array type.
|
||||
</p>
|
||||
<pre><code>
|
||||
var anArray = [1, "13", false]
|
||||
var javaIntArray = Java.to(anArray, "int[]")
|
||||
print(javaIntArray[0]) // prints 1
|
||||
print(javaIntArray[1]) // prints 13, as string "13" was converted to number 13 as per ECMAScript ToNumber conversion
|
||||
print(javaIntArray[2]) // prints 0, as boolean false was converted to number 0 as per ECMAScript ToNumber conversion
|
||||
</code></pre>
|
||||
<p>
|
||||
You can use either a string or a type object returned from <code>Java.type()</code> to specify the type of the array.
|
||||
You can also omit the array type, in which case a <code>Object[]</code> will be created.
|
||||
</p>
|
||||
<p>
|
||||
Given a Java array or Collection, <code>Java.from</code> returns a JavaScript array with a shallow copy of its contents. Note that in most cases, you can use Java arrays and lists natively in Nashorn; in cases where for some reason you need to have an actual JavaScript native array (e.g. to work with the array comprehensions functions), you will want to use this method.
|
||||
</p>
|
||||
<pre><code>
|
||||
var File = Java.type("java.io.File");
|
||||
var listCurDir = new File(".").listFiles();
|
||||
var jsList = Java.from(listCurDir);
|
||||
print(jsList);
|
||||
</code></pre>
|
||||
<hr>
|
||||
<a name="jsimplement" id="jsimplement"></a>
|
||||
<h3>Implementing Java interfaces</h3>
|
||||
<p>A Java interface can be implemented in JavaScript by using a
|
||||
Java anonymous class-like syntax:</p>
|
||||
<pre><code>
|
||||
// <a href="source/runnable.js">runnable.js</a>
|
||||
|
||||
var r = new java.lang.Runnable() {
|
||||
run: function() {
|
||||
print("running...\n");
|
||||
}
|
||||
};
|
||||
|
||||
// "r" can be passed to Java methods that expect java.lang.Runnable
|
||||
var th = new java.lang.Thread(r);
|
||||
th.start();
|
||||
th.join();
|
||||
</code>
|
||||
</pre>
|
||||
<p>When an interface with a single method is expected, you can pass
|
||||
a script function directly.(auto conversion)</p>
|
||||
<pre><code>
|
||||
// <a href="source/samfunc.js">samfunc.js</a>
|
||||
|
||||
function func() {
|
||||
print("I am func!");
|
||||
}
|
||||
|
||||
// pass script function for java.lang.Runnable argument
|
||||
var th = new java.lang.Thread(func);
|
||||
th.start();
|
||||
th.join();
|
||||
</code>
|
||||
</pre>
|
||||
<hr>
|
||||
<a name="jsextendabstract" id="jsextendabstract"></a>
|
||||
<h3>Extending Abstract Java Classes</h3>
|
||||
<p>
|
||||
If a Java class is abstract, you can instantiate an anonymous subclass of it using an argument list that is applicable to any of its public or protected constructors, but inserting a JavaScript object with functions properties that provide JavaScript implementations of the abstract methods. If method names are overloaded, the JavaScript function will provide implementation for all overloads. E.g.:
|
||||
</p>
|
||||
|
||||
<pre><code>
|
||||
var TimerTask = Java.type("java.util.TimerTask")
|
||||
var task = new TimerTask({ run: function() { print("Hello World!") } })
|
||||
</code></pre>
|
||||
|
||||
Nashorn supports a syntactic extension where a "new" expression followed by an argument is identical to invoking the constructor and passing the argument to it, so you can write the above example also as:
|
||||
|
||||
<pre><code>
|
||||
var task = new TimerTask {
|
||||
run: function() {
|
||||
print("Hello World!")
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
which is very similar to Java anonymous inner class definition. On the other hand, if the type is an abstract type with a single abstract method (commonly referred to as a "SAM type") or all abstract methods it has share the same overloaded name), then instead of an object, you can just pass a function, so the above example can become even more simplified to:
|
||||
|
||||
<pre><code>
|
||||
var task = new TimerTask(function() { print("Hello World!") })
|
||||
</code></pre>
|
||||
|
||||
<p>
|
||||
Note that in every one of these cases if you are trying to instantiate an abstract class that has constructors that take some arguments, you can invoke those simply by specifying the arguments after the initial implementation object or function.
|
||||
</p>
|
||||
<p>
|
||||
The use of functions can be taken even further; if you are invoking a Java method that takes a SAM type, you can just pass in a function object, and Nashorn will know what you meant:
|
||||
</p>
|
||||
<code><pre>
|
||||
Java.type("java.util.Timer")
|
||||
timer.schedule(function() { print("Hello World!") })
|
||||
</code></pre>
|
||||
|
||||
Here, <code>Timer.schedule()</code> expects a <code>TimerTask</code> as its argument, so Nashorn creates an instance of a TimerTask subclass and uses the passed function to implement its only abstract method, run(). In this usage though, you can't use non-default constructors; the type must be either an interface, or must have a protected or public no-arg constructor.
|
||||
|
||||
<hr>
|
||||
<a name="jsextendconcrete" id="jsextendconcrete"></a>
|
||||
<h3>Extending Concrete Java Classes</h3>
|
||||
<p>
|
||||
To extend a concrete Java class, you have to use <code>Java.extend</code> function.
|
||||
<code>Java.extend</code> returns a type object for a subclass of the specified Java class (or implementation of the specified interface) that acts as a script-to-Java adapter for it.
|
||||
</p>
|
||||
<pre><code>
|
||||
// <a href="source/javaextend.js">javaextend.js</a>
|
||||
|
||||
var ArrayList = Java.type("java.util.ArrayList")
|
||||
var ArrayListExtender = Java.extend(ArrayList)
|
||||
var printSizeInvokedArrayList = new ArrayListExtender() {
|
||||
size: function() { print("size invoked!"); }
|
||||
}
|
||||
var printAddInvokedArrayList = new ArrayListExtender() {
|
||||
add: function(x, y) {
|
||||
if(typeof(y) === "undefined") {
|
||||
print("add(e) invoked!");
|
||||
} else {
|
||||
print("add(i, e) invoked!");
|
||||
}
|
||||
}
|
||||
};
|
||||
printSizeInvokedArrayList.size();
|
||||
printAddInvokedArrayList.add(33, 33);
|
||||
</code></pre>
|
||||
<p>
|
||||
The reason you must use <code>Java.extend()</code> with concrete classes is that with concrete classes, there can be a
|
||||
syntactic ambiguity if you just invoke their constructor. Consider this example:
|
||||
</p>
|
||||
<pre><code>
|
||||
var t = new java.lang.Thread({ run: function() { print("Hello!") } })
|
||||
</code></pre>
|
||||
<p>
|
||||
If we allowed subclassing of concrete classes with constructor syntax, Nashorn couldn't tell if you're creating a new
|
||||
<code>Thread</code> and passing it a <code>Runnable</code> at this point, or you are subclassing <code>Thread</code> and
|
||||
passing it a new implementation for its own <code>run()</code> method.
|
||||
</p>
|
||||
<hr>
|
||||
<a name="jsimplementmultiple" id="jsimplementmultiple"></a>
|
||||
<h3>Implementing Multiple Interfaces</h3>
|
||||
<p>
|
||||
<code>Java.extend</code> can in fact take a list of multiple types. At most one of the types can be a class, and the rest must
|
||||
be interfaces (the class doesn't have to be the first in the list). You will get back an object that extends the class and
|
||||
implements all the interfaces. (Obviously, if you only specify interfaces and no class, the object will extend <code>java.lang.Object</code>).
|
||||
<hr>
|
||||
<a name="classBoundImplementations" id="classBoundImplementations"></a>
|
||||
<h3>Class-Bound Implementations</h3>
|
||||
<p>
|
||||
The methods shown so far for extending Java classes and implementing interfaces – passing an implementation JavaScript object
|
||||
or function to a constructor, or using <code>Java.extend</code> with <code>new</code> – all produce classes that take an
|
||||
extra JavaScript object parameter in their constructors that specifies the implementation. The implementation is therefore always bound
|
||||
to the actual instance being created with <code>new</code>, and not to the whole class. This has some advantages, for example in the
|
||||
memory footprint of the runtime, as Nashorn can just create a single "universal adapter" for every combination of types being implemented.
|
||||
In reality, the below code shows that different instantiations of, say, <code>Runnable</code> have the same class regardless of them having
|
||||
different JavaScript implementation objects:
|
||||
</p>
|
||||
<pre><code>
|
||||
var Runnable = java.lang.Runnable;
|
||||
var r1 = new Runnable(function() { print("I'm runnable 1!") })
|
||||
var r2 = new Runnable(function() { print("I'm runnable 2!") })
|
||||
r1.run()
|
||||
r2.run()
|
||||
print("We share the same class: " + (r1.class === r2.class))
|
||||
</code></pre>
|
||||
<p>
|
||||
prints:
|
||||
</p>
|
||||
<pre><code>
|
||||
I'm runnable 1!
|
||||
I'm runnable 2!
|
||||
We share the same class: true
|
||||
</code></pre>
|
||||
<p>
|
||||
Sometimes, however, you'll want to extend a Java class or implement an interface with implementation bound to the class, not to
|
||||
its instances. Such a need arises, for example, when you need to pass the class for instantiation to an external API; prime example
|
||||
of this is the JavaFX framework where you need to pass an Application class to the FX API and let it instantiate it.
|
||||
</p>
|
||||
<p>
|
||||
Fortunately, there's a solution for that: <code>Java.extend()</code> – aside from being able to take any number of type parameters
|
||||
denoting a class to extend and interfaces to implement – can also take one last argument that has to be a JavaScript object
|
||||
that serves as the implementation for the methods. In this case, <code>Java.extend()</code> will create a class that has the same
|
||||
constructors as the original class had, as they don't need to take an an extra implementation object parameter. The example below
|
||||
shows how you can create class-bound implementations, and shows that in this case, the implementation classes for different invocations
|
||||
are indeed different:
|
||||
</p>
|
||||
<pre><code>
|
||||
var RunnableImpl1 = Java.extend(java.lang.Runnable, function() { print("I'm runnable 1!") })
|
||||
var RunnableImpl2 = Java.extend(java.lang.Runnable, function() { print("I'm runnable 2!") })
|
||||
var r1 = new RunnableImpl1()
|
||||
var r2 = new RunnableImpl2()
|
||||
r1.run()
|
||||
r2.run()
|
||||
print("We share the same class: " + (r1.class === r2.class))
|
||||
</code></pre>
|
||||
<p>
|
||||
prints:
|
||||
</p>
|
||||
<pre><code>
|
||||
I'm runnable 1!
|
||||
I'm runnable 2!
|
||||
We share the same class: false
|
||||
</code></pre>
|
||||
<p>
|
||||
As you can see, the major difference here is that we moved the implementation object into the invocation of <code>Java.extend</code>
|
||||
from the constructor invocations – indeed the constructor invocations now don't even need to take an extra parameter! Since
|
||||
the implementations are bound to a class, the two classes obviously can't be the same, and we indeed see that the two runnables no
|
||||
longer share the same class – every invocation of <code>Java.extend()</code> with a class-specific implementation object triggers
|
||||
the creation of a new Java adapter class.
|
||||
</p>
|
||||
<p>
|
||||
Finally, the adapter classes with class-bound implementations can <i>still</i> take an additional constructor parameter to further
|
||||
override the behavior on a per-instance basis. Thus, you can even combine the two approaches: you can provide part of the implementation
|
||||
in a class-based JavaScript implementation object passed to <code>Java.extend</code>, and part in another object passed to the constructor.
|
||||
Whatever functions are provided by the constructor-passed object will override the functions in the class-bound object.
|
||||
</p>
|
||||
<pre><code>
|
||||
var RunnableImpl = Java.extend(java.lang.Runnable, function() { print("I'm runnable 1!") })
|
||||
var r1 = new RunnableImpl()
|
||||
var r2 = new RunnableImpl(function() { print("I'm runnable 2!") })
|
||||
r1.run()
|
||||
r2.run()
|
||||
print("We share the same class: " + (r1.class === r2.class))
|
||||
</code></pre>
|
||||
<p>
|
||||
prints:
|
||||
</p>
|
||||
<pre><code>
|
||||
I'm runnable 1!
|
||||
I'm runnable 2!
|
||||
We share the same class: true
|
||||
</code></pre>
|
||||
<hr>
|
||||
<a name="jsoverload" id="jsoverload"></a>
|
||||
<h3>Overload Resolution</h3>
|
||||
<p>Java methods can be overloaded by argument types. In Java,
|
||||
overload resolution occurs at compile time (performed by javac).
|
||||
When calling Java methods from Nashorn, the appropriate method will be
|
||||
selected based on the argument types at invocation time. You do not need
|
||||
to do anything special – the correct Java method overload variant
|
||||
is selected based automatically. You still have the option of explicitly
|
||||
specifying a particular overload variant. Reasons for this include
|
||||
either running into a genuine ambiguity with actual argument types, or
|
||||
rarely reasons of performance – if you specify the actual overload
|
||||
then the engine doesn't have to perform resolution during invocation.
|
||||
Individual overloads of a Java methods are exposed as special properties
|
||||
with the name of the method followed with its signature in parentheses.
|
||||
You can invoke them like this:</p>
|
||||
<pre><code>
|
||||
// <a href="source/overload.js">overload.js</a>
|
||||
|
||||
var out = java.lang.System.out;
|
||||
|
||||
// select a particular print function
|
||||
out["println(Object)"]("hello");
|
||||
</code>
|
||||
</pre>
|
||||
<p>
|
||||
Note that you normally don't even have to use qualified class names in
|
||||
the signatures as long as the unqualified name of the type is sufficient
|
||||
for uniquely identifying the signature. In practice this means that only
|
||||
in the extremely unlikely case that two overloads only differ in
|
||||
parameter types that have identical unqualified names but come from
|
||||
different packages would you need to use the fully qualified name of the
|
||||
class.
|
||||
</p>
|
||||
<hr>
|
||||
<a name="dataTypeMapping" id="dataTypeMapping"></a>
|
||||
<h3>Mapping of Data Types Between Java and JavaScript</h3>
|
||||
<p>
|
||||
We have previously shown some of the data type mappings between Java and JavaScript.
|
||||
We saw that arrays need to be explicitly converted. We have also shown that JavaScript functions
|
||||
are automatically converted to SAM types when passed as parameters to Java methods. Most other
|
||||
conversions work as you would expect.
|
||||
</p>
|
||||
<p>
|
||||
Every JavaScript object is also a <code>java.util.Map</code> so APIs receiving maps will receive them directly.
|
||||
</p>
|
||||
<p>
|
||||
When numbers are passed to a Java API, they will be converted to the expected target numeric type, either boxed or
|
||||
primitive, but if the target type is less specific, say <code>Number</code> or <code>Object</code>, you can only
|
||||
count on them being a <code>Number</code>, and have to test specifically for whether it's a boxed <code>Double</code>,
|
||||
<code>Integer</code>, <code>Long</code>, etc. – it can be any of these due to internal optimizations. Also, you
|
||||
can pass any JavaScript value to a Java API expecting either a boxed or primitive number; the JavaScript specification's
|
||||
<code>ToNumber</code> conversion algorithm will be applied to the value.
|
||||
</p>
|
||||
<p>
|
||||
In a similar vein, if a Java method expects a <code>String</code> or a <code>Boolean</code>, the values will be
|
||||
converted using all conversions allowed by the JavaScript specification's <code>ToString</code> and <code>ToBoolean</code>
|
||||
conversions.
|
||||
</p>
|
||||
<p>
|
||||
Finally, a word of caution about strings. Due to internal performance optimizations of string operations, JavaScript strings are
|
||||
not always necessarily of type <code>java.lang.String</code>, but they will always be of type <code>java.lang.CharSequence</code>.
|
||||
If you pass them to a Java method that expects a <code>java.lang.String</code> parameter, then you will naturally receive a Java
|
||||
String, but if the signature of your method is more generic, i.e. it receives a <code>java.lang.Object</code> parameter, you can
|
||||
end up with an object of private engine implementation class that implements <code>CharSequence</code> but is not a Java String.
|
||||
</p>
|
||||
<hr>
|
||||
<a name="engineimpl" id="engineimpl"></a>
|
||||
<h2>Implementing Your Own Script Engine</h2>
|
||||
<p>We will not cover implementation of JSR-223 compliant script
|
||||
engines in detail. Minimally, you need to implement the
|
||||
<code>javax.script.ScriptEngine</code> and
|
||||
<code>javax.script.ScriptEngineFactory</code> interfaces. The
|
||||
abstract class <code>javax.script.AbstractScriptEngine</code>
|
||||
provides useful defaults for a few methods of the
|
||||
<code>ScriptEngine</code> interface.</p>
|
||||
<p>Before starting to implement a JSR-223 engine, you may want to
|
||||
check <a href="http://java.net/projects/Scripting">http://java.net/projects/Scripting</a>
|
||||
project. This project maintains JSR-223 implementations for many
|
||||
popular open source scripting languages.</p>
|
||||
<hr>
|
||||
<a name="refs" id="refs"></a>
|
||||
<h2>References</h2>
|
||||
<ul>
|
||||
<li><a href="http://jcp.org/en/jsr/detail?id=223">JSR-223 Scripting
|
||||
for the Java Platform</a></li>
|
||||
<li><a href="http://java.net/projects/Scripting">http://java.net/projects/Scripting
|
||||
</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<div class="hr"><hr></div>
|
||||
<table summary="layout" border="0" width="100%">
|
||||
<tbody><tr valign="TOP">
|
||||
<td width="30%"> <img src="Java%20Scripting%20Programmer%27s%20Guide_files/logo_oracle_footer.gif" alt="Oracle and/or its affiliates" border="0" height="29" width="100"><br>
|
||||
<font size="+1"> <i>Java Technology</i></font> </td>
|
||||
|
||||
<td width="30%">
|
||||
<p><font size="-2">
|
||||
<a href="http://docs.oracle.com/javase/6/docs/legal/cpyr.html">Copyright <20></a> 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
</font></p>
|
||||
</td>
|
||||
<td width="30%">
|
||||
<p align="right"><font size="-2"><a href="http://download.oracle.com/javase/feedback.html">Contact Us</a></font></p><font size="-2">
|
||||
</font></td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<div class="hr"><hr></div>
|
||||
</div>
|
||||
|
||||
<!-- Start SiteCatalyst code -->
|
||||
<script language="JavaScript" src="Java%20Scripting%20Programmer%27s%20Guide_files/s_code_download.js"></script>
|
||||
<script language="JavaScript" src="Java%20Scripting%20Programmer%27s%20Guide_files/s_code.js"></script>
|
||||
|
||||
<!-- ********** DO NOT ALTER ANYTHING BELOW THIS LINE ! *********** -->
|
||||
<!-- Below code will send the info to Omniture server -->
|
||||
<script language="javascript">var s_code=s.t();if(s_code)document.write(s_code)</script>
|
||||
|
||||
<!-- End SiteCatalyst code -->
|
||||
|
||||
|
||||
|
||||
</body></html>
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
|
||||
@SuppressWarnings("javadoc")
|
||||
public class EvalFile {
|
||||
public static void main(final String[] args) throws Exception {
|
||||
// create a script engine manager
|
||||
final ScriptEngineManager factory = new ScriptEngineManager();
|
||||
// create JavaScript engine
|
||||
final ScriptEngine engine = factory.getEngineByName("nashorn");
|
||||
// evaluate JavaScript code from given file - specified by first argument
|
||||
engine.eval(new java.io.FileReader(args[0]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
|
||||
@SuppressWarnings("javadoc")
|
||||
public class EvalScript {
|
||||
public static void main(final String[] args) throws Exception {
|
||||
// create a script engine manager
|
||||
final ScriptEngineManager factory = new ScriptEngineManager();
|
||||
// create a JavaScript engine
|
||||
final ScriptEngine engine = factory.getEngineByName("nashorn");
|
||||
// evaluate JavaScript code from String
|
||||
engine.eval("print('Hello, World')");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import javax.script.Invocable;
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
|
||||
@SuppressWarnings("javadoc")
|
||||
public class InvokeScriptFunction {
|
||||
public static void main(final String[] args) throws Exception {
|
||||
final ScriptEngineManager manager = new ScriptEngineManager();
|
||||
final ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
// JavaScript code in a String
|
||||
final String script = "function hello(name) { print('Hello, ' + name); }";
|
||||
// evaluate script
|
||||
engine.eval(script);
|
||||
|
||||
// javax.script.Invocable is an optional interface.
|
||||
// Check whether your script engine implements or not!
|
||||
// Note that the JavaScript engine implements Invocable interface.
|
||||
final Invocable inv = (Invocable) engine;
|
||||
|
||||
// invoke the global function named "hello"
|
||||
inv.invokeFunction("hello", "Scripting!!" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import javax.script.Invocable;
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
|
||||
@SuppressWarnings("javadoc")
|
||||
public class InvokeScriptMethod {
|
||||
public static void main(final String[] args) throws Exception {
|
||||
final ScriptEngineManager manager = new ScriptEngineManager();
|
||||
final ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
// JavaScript code in a String. This code defines a script object 'obj'
|
||||
// with one method called 'hello'.
|
||||
final String script = "var obj = new Object(); obj.hello = function(name) { print('Hello, ' + name); }";
|
||||
// evaluate script
|
||||
engine.eval(script);
|
||||
|
||||
// javax.script.Invocable is an optional interface.
|
||||
// Check whether your script engine implements or not!
|
||||
// Note that the JavaScript engine implements Invocable interface.
|
||||
final Invocable inv = (Invocable) engine;
|
||||
|
||||
// get script object on which we want to call the method
|
||||
final Object obj = engine.get("obj");
|
||||
|
||||
// invoke the method named "hello" on the script object "obj"
|
||||
inv.invokeMethod(obj, "hello", "Script Method !!" );
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import javax.script.Bindings;
|
||||
import javax.script.ScriptContext;
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
import javax.script.SimpleScriptContext;
|
||||
|
||||
@SuppressWarnings("javadoc")
|
||||
public class MultiScopes {
|
||||
public static void main(final String[] args) throws Exception {
|
||||
final ScriptEngineManager manager = new ScriptEngineManager();
|
||||
final ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
engine.put("x", "hello");
|
||||
// print global variable "x"
|
||||
engine.eval("print(x);");
|
||||
// the above line prints "hello"
|
||||
|
||||
// Now, pass a different script context
|
||||
final ScriptContext newContext = new SimpleScriptContext();
|
||||
newContext.setBindings(engine.createBindings(), ScriptContext.ENGINE_SCOPE);
|
||||
final Bindings engineScope = newContext.getBindings(ScriptContext.ENGINE_SCOPE);
|
||||
|
||||
// add new variable "x" to the new engineScope
|
||||
engineScope.put("x", "world");
|
||||
|
||||
// execute the same script - but this time pass a different script context
|
||||
engine.eval("print(x);", newContext);
|
||||
// the above line prints "world"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import javax.script.Invocable;
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
|
||||
@SuppressWarnings("javadoc")
|
||||
public class RunnableImpl {
|
||||
public static void main(final String[] args) throws Exception {
|
||||
final ScriptEngineManager manager = new ScriptEngineManager();
|
||||
final ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
// JavaScript code in a String
|
||||
final String script = "function run() { print('run called'); }";
|
||||
|
||||
// evaluate script
|
||||
engine.eval(script);
|
||||
|
||||
final Invocable inv = (Invocable) engine;
|
||||
|
||||
// get Runnable interface object from engine. This interface methods
|
||||
// are implemented by script functions with the matching name.
|
||||
final Runnable r = inv.getInterface(Runnable.class);
|
||||
|
||||
// start a new thread that runs the script implemented
|
||||
// runnable interface
|
||||
final Thread th = new Thread(r);
|
||||
th.start();
|
||||
th.join();
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import javax.script.Invocable;
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
|
||||
@SuppressWarnings("javadoc")
|
||||
public class RunnableImplObject {
|
||||
public static void main(final String[] args) throws Exception {
|
||||
final ScriptEngineManager manager = new ScriptEngineManager();
|
||||
final ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
// JavaScript code in a String
|
||||
final String script = "var obj = new Object(); obj.run = function() { print('run method called'); }";
|
||||
|
||||
// evaluate script
|
||||
engine.eval(script);
|
||||
|
||||
// get script object on which we want to implement the interface with
|
||||
final Object obj = engine.get("obj");
|
||||
|
||||
final Invocable inv = (Invocable) engine;
|
||||
|
||||
// get Runnable interface object from engine. This interface methods
|
||||
// are implemented by script methods of object 'obj'
|
||||
final Runnable r = inv.getInterface(obj, Runnable.class);
|
||||
|
||||
// start a new thread that runs the script implemented
|
||||
// runnable interface
|
||||
final Thread th = new Thread(r);
|
||||
th.start();
|
||||
th.join();
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import java.io.File;
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
|
||||
@SuppressWarnings("javadoc")
|
||||
public class ScriptVars {
|
||||
public static void main(final String[] args) throws Exception {
|
||||
final ScriptEngineManager manager = new ScriptEngineManager();
|
||||
final ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
|
||||
final File f = new File("test.txt");
|
||||
// expose File object as variable to script
|
||||
engine.put("file", f);
|
||||
|
||||
// evaluate a script string. The script accesses "file"
|
||||
// variable and calls method on it
|
||||
engine.eval("print(file.getAbsolutePath())");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
// load compatibility script
|
||||
load("nashorn:mozilla_compat.js");
|
||||
|
||||
// Import Java packages and classes
|
||||
// like import package.*; in Java
|
||||
importPackage(java.awt);
|
||||
// like import java.awt.Frame in Java
|
||||
importClass(java.awt.Frame);
|
||||
// Create Java Objects by "new ClassName"
|
||||
var frame = new java.awt.Frame("hello");
|
||||
// Call Java public methods from script
|
||||
frame.setVisible(true);
|
||||
// Access "JavaBean" properties like "fields"
|
||||
print(frame.title);
|
||||
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
// create Java String array of 5 elements
|
||||
var StringArray = Java.type("java.lang.String[]");
|
||||
var a = new StringArray(5);
|
||||
|
||||
// Accessing elements and length access is by usual Java syntax
|
||||
a[0] = "scripting is great!";
|
||||
print(a.length);
|
||||
print(a[0]);
|
||||
|
||||
// convert a script array to Java array
|
||||
var anArray = [1, "13", false];
|
||||
var javaIntArray = Java.to(anArray, "int[]");
|
||||
print(javaIntArray[0]);// prints 1
|
||||
print(javaIntArray[1]); // prints 13, as string "13" was converted to number 13 as per ECMAScript ToNumber conversion
|
||||
print(javaIntArray[2]);// prints 0, as boolean false was converted to number 0 as per ECMAScript ToNumber conversion
|
||||
|
||||
// convert a Java array to a JavaScript array
|
||||
var File = Java.type("java.io.File");
|
||||
var listCurDir = new File(".").listFiles();
|
||||
var jsList = Java.from(listCurDir);
|
||||
print(jsList);
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
var ArrayList = Java.type("java.util.ArrayList")
|
||||
var ArrayListExtender = Java.extend(ArrayList)
|
||||
var printSizeInvokedArrayList = new ArrayListExtender() {
|
||||
size: function() { print("size invoked!"); }
|
||||
}
|
||||
var printAddInvokedArrayList = new ArrayListExtender() {
|
||||
add: function(x, y) {
|
||||
if(typeof(y) === "undefined") {
|
||||
print("add(e) invoked!");
|
||||
} else {
|
||||
print("add(i, e) invoked!");
|
||||
}
|
||||
}
|
||||
};
|
||||
printSizeInvokedArrayList.size();
|
||||
printAddInvokedArrayList.add(33, 33);
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
// create JavaImporter with specific packages and classes to import
|
||||
|
||||
var SwingGui = new JavaImporter(javax.swing,
|
||||
javax.swing.event,
|
||||
javax.swing.border,
|
||||
java.awt.event);
|
||||
with (SwingGui) {
|
||||
// within this 'with' statement, we can access Swing and AWT
|
||||
// classes by unqualified (simple) names.
|
||||
|
||||
var mybutton = new JButton("test");
|
||||
print(mybutton);
|
||||
var myframe = new JFrame("test");
|
||||
print(myframe);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
// accessing java types
|
||||
var arrayListType = Java.type("java.util.ArrayList")
|
||||
var intType = Java.type("int")
|
||||
var stringArrayType = Java.type("java.lang.String[]")
|
||||
var int2DArrayType = Java.type("int[][]")
|
||||
|
||||
// Using java types
|
||||
var ArrayList = Java.type("java.util.ArrayList")
|
||||
var anArrayList = new ArrayList
|
||||
var anArrayListWithSize = new ArrayList(16)
|
||||
|
||||
// fully qualified name
|
||||
var ftype = Java.type("java.awt.geom.Arc2D$Float")
|
||||
|
||||
// inner class property
|
||||
var arctype = Java.type("java.awt.geom.Arc2D")
|
||||
var ftype = arctype.Float
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
var out = java.lang.System.out;
|
||||
|
||||
// select a particular print function
|
||||
out["println(java.lang.Object)"]("hello");
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
var r = new java.lang.Runnable() {
|
||||
run: function() {
|
||||
print("running...\n");
|
||||
}
|
||||
};
|
||||
|
||||
// "r" can be passed to Java methods that expect java.lang.Runnable
|
||||
var th = new java.lang.Thread(r);
|
||||
th.start();
|
||||
th.join();
|
||||
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
function func() {
|
||||
print("I am func!");
|
||||
}
|
||||
|
||||
// pass script function for java.lang.Runnable argument
|
||||
var th = new java.lang.Thread(func);
|
||||
th.start();
|
||||
th.join();
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
print("This is hello from test.js");
|
||||
@@ -56,7 +56,7 @@
|
||||
$ make test-jdk_lang JTREG="JOBS=8"
|
||||
$ make test TEST=jdk_lang
|
||||
$ make test-only TEST="gtest:LogTagSet gtest:LogTagSetDescriptions" GTEST="REPEAT=-1"
|
||||
$ make test TEST="hotspot:hotspot_gc" JTREG="JOBS=1;TIMEOUT_FACTOR=8;VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug"
|
||||
$ make test TEST="hotspot:hotspot_gc" JTREG="JOBS=1;TIMEOUT_FACTOR=8;JAVA_OPTIONS=-XshowSettings -Xlog:gc+ref=debug"
|
||||
$ make test TEST="jtreg:test/hotspot:hotspot_gc test/hotspot/jtreg/native_sanity/JniVersion.java"
|
||||
$ make test TEST="micro:java.lang.reflect" MICRO="FORK=1;WARMUP_ITER=2"
|
||||
$ make exploded-test TEST=tier2</code></pre>
|
||||
@@ -106,8 +106,8 @@ TEST FAILURE</code></pre>
|
||||
<h2 id="test-suite-control">Test suite control</h2>
|
||||
<p>It is possible to control various aspects of the test suites using make control variables.</p>
|
||||
<p>These variables use a keyword=value approach to allow multiple values to be set. So, for instance, <code>JTREG="JOBS=1;TIMEOUT_FACTOR=8"</code> will set the JTReg concurrency level to 1 and the timeout factor to 8. This is equivalent to setting <code>JTREG_JOBS=1 JTREG_TIMEOUT_FACTOR=8</code>, but using the keyword format means that the <code>JTREG</code> variable is parsed and verified for correctness, so <code>JTREG="TMIEOUT_FACTOR=8"</code> would give an error, while <code>JTREG_TMIEOUT_FACTOR=8</code> would just pass unnoticed.</p>
|
||||
<p>To separate multiple keyword=value pairs, use <code>;</code> (semicolon). Since the shell normally eats <code>;</code>, the recommended usage is to write the assignment inside qoutes, e.g. <code>JTREG="...;..."</code>. This will also make sure spaces are preserved, as in <code>JTREG="VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug"</code>.</p>
|
||||
<p>(Other ways are possible, e.g. using backslash: <code>JTREG=JOBS=1\;TIMEOUT_FACTOR=8</code>. Also, as a special technique, the string <code>%20</code> will be replaced with space for certain options, e.g. <code>JTREG=VM_OPTIONS=-XshowSettings%20-Xlog:gc+ref=debug</code>. This can be useful if you have layers of scripts and have trouble getting proper quoting of command line arguments through.)</p>
|
||||
<p>To separate multiple keyword=value pairs, use <code>;</code> (semicolon). Since the shell normally eats <code>;</code>, the recommended usage is to write the assignment inside qoutes, e.g. <code>JTREG="...;..."</code>. This will also make sure spaces are preserved, as in <code>JTREG="JAVA_OPTIONS=-XshowSettings -Xlog:gc+ref=debug"</code>.</p>
|
||||
<p>(Other ways are possible, e.g. using backslash: <code>JTREG=JOBS=1\;TIMEOUT_FACTOR=8</code>. Also, as a special technique, the string <code>%20</code> will be replaced with space for certain options, e.g. <code>JTREG=JAVA_OPTIONS=-XshowSettings%20-Xlog:gc+ref=debug</code>. This can be useful if you have layers of scripts and have trouble getting proper quoting of command line arguments through.)</p>
|
||||
<p>As far as possible, the names of the keywords have been standardized between test suites.</p>
|
||||
<h3 id="general-keywords-test_opts">General keywords (TEST_OPTS)</h3>
|
||||
<p>Some keywords are valid across different test suites. If you want to run tests from multiple test suites, or just don't want to care which test suite specific control variable to use, then you can use the general TEST_OPTS control variable.</p>
|
||||
@@ -116,16 +116,16 @@ TEST FAILURE</code></pre>
|
||||
<p>Currently only applies to JTReg.</p>
|
||||
<h4 id="timeout_factor">TIMEOUT_FACTOR</h4>
|
||||
<p>Currently only applies to JTReg.</p>
|
||||
<h4 id="vm_options">VM_OPTIONS</h4>
|
||||
<p>Applies to JTReg, GTest and Micro.</p>
|
||||
<h4 id="java_options">JAVA_OPTIONS</h4>
|
||||
<p>Applies to JTReg, GTest and Micro.</p>
|
||||
<h4 id="vm_options">VM_OPTIONS</h4>
|
||||
<p>Applies to JTReg, GTest and Micro.</p>
|
||||
<h4 id="aot_modules">AOT_MODULES</h4>
|
||||
<p>Applies to JTReg and GTest.</p>
|
||||
<h4 id="jcov">JCOV</h4>
|
||||
<p>This keywords applies globally to the test runner system. If set to <code>true</code>, it enables JCov coverage reporting for all tests run. To be useful, the JDK under test must be run with a JDK built with JCov instrumentation (<code>configure --with-jcov=<path to directory containing lib/jcov.jar></code>, <code>make jcov-image</code>).</p>
|
||||
<p>The simplest way to run tests with JCov coverage report is to use the special target <code>jcov-test</code> instead of <code>test</code>, e.g. <code>make jcov-test TEST=jdk_lang</code>. This will make sure the JCov image is built, and that JCov reporting is enabled.</p>
|
||||
<p>The JCov report is stored in <code>build/$BUILD/test-results/jcov-output</code>.</p>
|
||||
<p>The JCov report is stored in <code>build/$BUILD/test-results/jcov-output/report</code>.</p>
|
||||
<p>Please note that running with JCov reporting can be very memory intensive.</p>
|
||||
<h4 id="jcov_diff_changeset">JCOV_DIFF_CHANGESET</h4>
|
||||
<p>While collecting code coverage with JCov, it is also possible to find coverage for only recently changed code. JCOV_DIFF_CHANGESET specifies a source revision. A textual report will be generated showing coverage of the diff between the specified revision and the repository tip.</p>
|
||||
@@ -133,10 +133,12 @@ TEST FAILURE</code></pre>
|
||||
<h3 id="jtreg-keywords">JTReg keywords</h3>
|
||||
<h4 id="jobs-1">JOBS</h4>
|
||||
<p>The test concurrency (<code>-concurrency</code>).</p>
|
||||
<p>Defaults to TEST_JOBS (if set by <code>--with-test-jobs=</code>), otherwise it defaults to JOBS, except for Hotspot, where the default is <em>number of CPU cores/2</em> (for sparc, if more than 16 cpus, then <em>number of CPU cores/5</em>, otherwise <em>number of CPU cores/4</em>), but never more than <em>memory size in GB/2</em>.</p>
|
||||
<p>Defaults to TEST_JOBS (if set by <code>--with-test-jobs=</code>), otherwise it defaults to JOBS, except for Hotspot, where the default is <em>number of CPU cores/2</em>, but never more than <em>memory size in GB/2</em>.</p>
|
||||
<h4 id="timeout_factor-1">TIMEOUT_FACTOR</h4>
|
||||
<p>The timeout factor (<code>-timeoutFactor</code>).</p>
|
||||
<p>Defaults to 4.</p>
|
||||
<h4 id="failure_handler_timeout">FAILURE_HANDLER_TIMEOUT</h4>
|
||||
<p>Sets the argument <code>-timeoutHandlerTimeout</code> for JTReg. The default value is 0. This is only valid if the failure handler is built.</p>
|
||||
<h4 id="test_mode">TEST_MODE</h4>
|
||||
<p>The test mode (<code>agentvm</code> or <code>othervm</code>).</p>
|
||||
<p>Defaults to <code>agentvm</code>.</p>
|
||||
@@ -153,8 +155,10 @@ TEST FAILURE</code></pre>
|
||||
<p>Limit memory consumption (<code>-Xmx</code> and <code>-vmoption:-Xmx</code>, or none).</p>
|
||||
<p>Limit memory consumption for JTReg test framework and VM under test. Set to 0 to disable the limits.</p>
|
||||
<p>Defaults to 512m, except for hotspot, where it defaults to 0 (no limit).</p>
|
||||
<h4 id="max_output">MAX_OUTPUT</h4>
|
||||
<p>Set the property <code>javatest.maxOutputSize</code> for the launcher, to change the default JTReg log limit.</p>
|
||||
<h4 id="keywords">KEYWORDS</h4>
|
||||
<p>JTReg kewords sent to JTReg using <code>-k</code>. Please be careful in making sure that spaces and special characters (like <code>!</code>) are properly quoted. To avoid some issues, the special value <code>%20</code> can be used instead of space.</p>
|
||||
<p>JTReg keywords sent to JTReg using <code>-k</code>. Please be careful in making sure that spaces and special characters (like <code>!</code>) are properly quoted. To avoid some issues, the special value <code>%20</code> can be used instead of space.</p>
|
||||
<h4 id="extra_problem_lists">EXTRA_PROBLEM_LISTS</h4>
|
||||
<p>Use additional problem lists file or files, in addition to the default ProblemList.txt located at the JTReg test roots.</p>
|
||||
<p>If multiple file names are specified, they should be separated by space (or, to help avoid quoting issues, the special value <code>%20</code>).</p>
|
||||
@@ -166,9 +170,12 @@ TEST FAILURE</code></pre>
|
||||
<p>Additional options to the JTReg test framework.</p>
|
||||
<p>Use <code>JTREG="OPTIONS=--help all"</code> to see all available JTReg options.</p>
|
||||
<h4 id="java_options-1">JAVA_OPTIONS</h4>
|
||||
<p>Additional Java options to JTReg (<code>-javaoption</code>).</p>
|
||||
<p>Additional Java options for running test classes (sent to JTReg as <code>-javaoption</code>).</p>
|
||||
<h4 id="vm_options-1">VM_OPTIONS</h4>
|
||||
<p>Additional VM options to JTReg (<code>-vmoption</code>).</p>
|
||||
<p>Additional Java options to be used when compiling and running classes (sent to JTReg as <code>-vmoption</code>).</p>
|
||||
<p>This option is only needed in special circumstances. To pass Java options to your test classes, use <code>JAVA_OPTIONS</code>.</p>
|
||||
<h4 id="launcher_options">LAUNCHER_OPTIONS</h4>
|
||||
<p>Additional Java options that are sent to the java launcher that starts the JTReg harness.</p>
|
||||
<h4 id="aot_modules-1">AOT_MODULES</h4>
|
||||
<p>Generate AOT modules before testing for the specified module, or set of modules. If multiple modules are specified, they should be separated by space (or, to help avoid quoting issues, the special value <code>%20</code>).</p>
|
||||
<h4 id="retry_count">RETRY_COUNT</h4>
|
||||
@@ -204,14 +211,19 @@ TEST FAILURE</code></pre>
|
||||
<p>Docker tests with default parameters may fail on systems with glibc versions not compatible with the one used in the default docker image (e.g., Oracle Linux 7.6 for x86). For example, they pass on Ubuntu 16.04 but fail on Ubuntu 18.04 if run like this on x86:</p>
|
||||
<pre><code>$ make test TEST="jtreg:test/hotspot/jtreg/containers/docker"</code></pre>
|
||||
<p>To run these tests correctly, additional parameters for the correct docker image are required on Ubuntu 18.04 by using <code>JAVA_OPTIONS</code>.</p>
|
||||
<pre><code>$ make test TEST="jtreg:test/hotspot/jtreg/containers/docker" JTREG="JAVA_OPTIONS=-Djdk.test.docker.image.name=ubuntu -Djdk.test.docker.image.version=latest"</code></pre>
|
||||
<pre><code>$ make test TEST="jtreg:test/hotspot/jtreg/containers/docker" \
|
||||
JTREG="JAVA_OPTIONS=-Djdk.test.docker.image.name=ubuntu
|
||||
-Djdk.test.docker.image.version=latest"</code></pre>
|
||||
<h3 id="non-us-locale">Non-US locale</h3>
|
||||
<p>If your locale is non-US, some tests are likely to fail. To work around this you can set the locale to US. On Unix platforms simply setting <code>LANG="en_US"</code> in the environment before running tests should work. On Windows, setting <code>JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US"</code> helps for most, but not all test cases. For example:</p>
|
||||
<p>If your locale is non-US, some tests are likely to fail. To work around this you can set the locale to US. On Unix platforms simply setting <code>LANG="en_US"</code> in the environment before running tests should work. On Windows, setting <code>JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US"</code> helps for most, but not all test cases.</p>
|
||||
<p>For example:</p>
|
||||
<pre><code>$ export LANG="en_US" && make test TEST=...
|
||||
$ make test JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US" TEST=...</code></pre>
|
||||
<h3 id="pkcs11-tests">PKCS11 Tests</h3>
|
||||
<p>It is highly recommended to use the latest NSS version when running PKCS11 tests. Improper NSS version may lead to unexpected failures which are hard to diagnose. For example, sun/security/pkcs11/Secmod/AddTrustedCert.java may fail on Ubuntu 18.04 with the default NSS version in the system. To run these tests correctly, the system property <code>test.nss.lib.paths</code> is required on Ubuntu 18.04 to specify the alternative NSS lib directories. For example:</p>
|
||||
<pre><code>$ make test TEST="jtreg:sun/security/pkcs11/Secmod/AddTrustedCert.java" JTREG="JAVA_OPTIONS=-Dtest.nss.lib.paths=/path/to/your/latest/NSS-libs"</code></pre>
|
||||
<p>It is highly recommended to use the latest NSS version when running PKCS11 tests. Improper NSS version may lead to unexpected failures which are hard to diagnose. For example, sun/security/pkcs11/Secmod/AddTrustedCert.java may fail on Ubuntu 18.04 with the default NSS version in the system. To run these tests correctly, the system property <code>test.nss.lib.paths</code> is required on Ubuntu 18.04 to specify the alternative NSS lib directories.</p>
|
||||
<p>For example:</p>
|
||||
<pre><code>$ make test TEST="jtreg:sun/security/pkcs11/Secmod/AddTrustedCert.java" \
|
||||
JTREG="JAVA_OPTIONS=-Dtest.nss.lib.paths=/path/to/your/latest/NSS-libs"</code></pre>
|
||||
<p>For more notes about the PKCS11 tests, please refer to test/jdk/sun/security/pkcs11/README.</p>
|
||||
<h3 id="client-ui-tests">Client UI Tests</h3>
|
||||
<p>Some Client UI tests use key sequences which may be reserved by the operating system. Usually that causes the test failure. So it is highly recommended to disable system key shortcuts prior testing. The steps to access and disable system key shortcuts for various platforms are provided below.</p>
|
||||
|
||||
184
doc/testing.md
184
doc/testing.md
@@ -23,7 +23,7 @@ Some example command-lines:
|
||||
$ make test-jdk_lang JTREG="JOBS=8"
|
||||
$ make test TEST=jdk_lang
|
||||
$ make test-only TEST="gtest:LogTagSet gtest:LogTagSetDescriptions" GTEST="REPEAT=-1"
|
||||
$ make test TEST="hotspot:hotspot_gc" JTREG="JOBS=1;TIMEOUT_FACTOR=8;VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug"
|
||||
$ make test TEST="hotspot:hotspot_gc" JTREG="JOBS=1;TIMEOUT_FACTOR=8;JAVA_OPTIONS=-XshowSettings -Xlog:gc+ref=debug"
|
||||
$ make test TEST="jtreg:test/hotspot:hotspot_gc test/hotspot/jtreg/native_sanity/JniVersion.java"
|
||||
$ make test TEST="micro:java.lang.reflect" MICRO="FORK=1;WARMUP_ITER=2"
|
||||
$ make exploded-test TEST=tier2
|
||||
@@ -37,11 +37,11 @@ Note that this option should point to the JTReg home, i.e. the top directory,
|
||||
containing `lib/jtreg.jar` etc. (An alternative is to set the `JT_HOME`
|
||||
environment variable to point to the JTReg home before running `configure`.)
|
||||
|
||||
To be able to run microbenchmarks, `configure` needs to know where to find
|
||||
the JMH dependency. Use `--with-jmh=<path to JMH jars>` to point to a directory
|
||||
containing the core JMH and transitive dependencies. The recommended dependencies
|
||||
can be retrieved by running `sh make/devkit/createJMHBundle.sh`, after which
|
||||
`--with-jmh=build/jmh/jars` should work.
|
||||
To be able to run microbenchmarks, `configure` needs to know where to find the
|
||||
JMH dependency. Use `--with-jmh=<path to JMH jars>` to point to a directory
|
||||
containing the core JMH and transitive dependencies. The recommended
|
||||
dependencies can be retrieved by running `sh make/devkit/createJMHBundle.sh`,
|
||||
after which `--with-jmh=build/jmh/jars` should work.
|
||||
|
||||
## Test selection
|
||||
|
||||
@@ -182,19 +182,19 @@ variables.
|
||||
These variables use a keyword=value approach to allow multiple values to be
|
||||
set. So, for instance, `JTREG="JOBS=1;TIMEOUT_FACTOR=8"` will set the JTReg
|
||||
concurrency level to 1 and the timeout factor to 8. This is equivalent to
|
||||
setting `JTREG_JOBS=1 JTREG_TIMEOUT_FACTOR=8`, but using the keyword format means that
|
||||
the `JTREG` variable is parsed and verified for correctness, so
|
||||
`JTREG="TMIEOUT_FACTOR=8"` would give an error, while `JTREG_TMIEOUT_FACTOR=8` would just
|
||||
pass unnoticed.
|
||||
setting `JTREG_JOBS=1 JTREG_TIMEOUT_FACTOR=8`, but using the keyword format
|
||||
means that the `JTREG` variable is parsed and verified for correctness, so
|
||||
`JTREG="TMIEOUT_FACTOR=8"` would give an error, while `JTREG_TMIEOUT_FACTOR=8`
|
||||
would just pass unnoticed.
|
||||
|
||||
To separate multiple keyword=value pairs, use `;` (semicolon). Since the shell
|
||||
normally eats `;`, the recommended usage is to write the assignment inside
|
||||
qoutes, e.g. `JTREG="...;..."`. This will also make sure spaces are preserved,
|
||||
as in `JTREG="VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug"`.
|
||||
as in `JTREG="JAVA_OPTIONS=-XshowSettings -Xlog:gc+ref=debug"`.
|
||||
|
||||
(Other ways are possible, e.g. using backslash: `JTREG=JOBS=1\;TIMEOUT_FACTOR=8`.
|
||||
Also, as a special technique, the string `%20` will be replaced with space for
|
||||
certain options, e.g. `JTREG=VM_OPTIONS=-XshowSettings%20-Xlog:gc+ref=debug`.
|
||||
certain options, e.g. `JTREG=JAVA_OPTIONS=-XshowSettings%20-Xlog:gc+ref=debug`.
|
||||
This can be useful if you have layers of scripts and have trouble getting
|
||||
proper quoting of command line arguments through.)
|
||||
|
||||
@@ -203,9 +203,10 @@ test suites.
|
||||
|
||||
### General keywords (TEST_OPTS)
|
||||
|
||||
Some keywords are valid across different test suites. If you want to run
|
||||
tests from multiple test suites, or just don't want to care which test suite specific
|
||||
control variable to use, then you can use the general TEST_OPTS control variable.
|
||||
Some keywords are valid across different test suites. If you want to run tests
|
||||
from multiple test suites, or just don't want to care which test suite specific
|
||||
control variable to use, then you can use the general TEST_OPTS control
|
||||
variable.
|
||||
|
||||
There are also some keywords that applies globally to the test runner system,
|
||||
not to any specific test suites. These are also available as TEST_OPTS keywords.
|
||||
@@ -218,11 +219,11 @@ Currently only applies to JTReg.
|
||||
|
||||
Currently only applies to JTReg.
|
||||
|
||||
#### VM_OPTIONS
|
||||
#### JAVA_OPTIONS
|
||||
|
||||
Applies to JTReg, GTest and Micro.
|
||||
|
||||
#### JAVA_OPTIONS
|
||||
#### VM_OPTIONS
|
||||
|
||||
Applies to JTReg, GTest and Micro.
|
||||
|
||||
@@ -250,48 +251,59 @@ Please note that running with JCov reporting can be very memory intensive.
|
||||
While collecting code coverage with JCov, it is also possible to find coverage
|
||||
for only recently changed code. JCOV_DIFF_CHANGESET specifies a source
|
||||
revision. A textual report will be generated showing coverage of the diff
|
||||
between the specified revision and the repository tip.
|
||||
between the specified revision and the repository tip.
|
||||
|
||||
The report is stored in `build/$BUILD/test-results/jcov-output/diff_coverage_report`
|
||||
file.
|
||||
The report is stored in
|
||||
`build/$BUILD/test-results/jcov-output/diff_coverage_report` file.
|
||||
|
||||
### JTReg keywords
|
||||
|
||||
#### JOBS
|
||||
|
||||
The test concurrency (`-concurrency`).
|
||||
|
||||
Defaults to TEST_JOBS (if set by `--with-test-jobs=`), otherwise it defaults to
|
||||
JOBS, except for Hotspot, where the default is *number of CPU cores/2* (for
|
||||
sparc, if more than 16 cpus, then *number of CPU cores/5*, otherwise *number of
|
||||
CPU cores/4*), but never more than *memory size in GB/2*.
|
||||
JOBS, except for Hotspot, where the default is *number of CPU cores/2*,
|
||||
but never more than *memory size in GB/2*.
|
||||
|
||||
#### TIMEOUT_FACTOR
|
||||
|
||||
The timeout factor (`-timeoutFactor`).
|
||||
|
||||
Defaults to 4.
|
||||
|
||||
#### FAILURE_HANDLER_TIMEOUT
|
||||
|
||||
Sets the argument `-timeoutHandlerTimeout` for JTReg. The default value is 0.
|
||||
This is only valid if the failure handler is built.
|
||||
|
||||
#### TEST_MODE
|
||||
|
||||
The test mode (`agentvm` or `othervm`).
|
||||
|
||||
Defaults to `agentvm`.
|
||||
|
||||
#### ASSERT
|
||||
|
||||
Enable asserts (`-ea -esa`, or none).
|
||||
|
||||
Set to `true` or `false`. If true, adds `-ea -esa`. Defaults to true, except
|
||||
for hotspot.
|
||||
|
||||
#### VERBOSE
|
||||
|
||||
The verbosity level (`-verbose`).
|
||||
|
||||
Defaults to `fail,error,summary`.
|
||||
|
||||
#### RETAIN
|
||||
|
||||
What test data to retain (`-retain`).
|
||||
|
||||
Defaults to `fail,error`.
|
||||
|
||||
#### MAX_MEM
|
||||
|
||||
Limit memory consumption (`-Xmx` and `-vmoption:-Xmx`, or none).
|
||||
|
||||
Limit memory consumption for JTReg test framework and VM under test. Set to 0
|
||||
@@ -299,9 +311,14 @@ to disable the limits.
|
||||
|
||||
Defaults to 512m, except for hotspot, where it defaults to 0 (no limit).
|
||||
|
||||
#### MAX_OUTPUT
|
||||
|
||||
Set the property `javatest.maxOutputSize` for the launcher, to change the
|
||||
default JTReg log limit.
|
||||
|
||||
#### KEYWORDS
|
||||
|
||||
JTReg kewords sent to JTReg using `-k`. Please be careful in making sure that
|
||||
JTReg keywords sent to JTReg using `-k`. Please be careful in making sure that
|
||||
spaces and special characters (like `!`) are properly quoted. To avoid some
|
||||
issues, the special value `%20` can be used instead of space.
|
||||
|
||||
@@ -324,17 +341,29 @@ Set to `true` or `false`.
|
||||
If `true`, JTReg will use `-match:` option, otherwise `-exclude:` will be used.
|
||||
Default is `false`.
|
||||
|
||||
|
||||
#### OPTIONS
|
||||
|
||||
Additional options to the JTReg test framework.
|
||||
|
||||
Use `JTREG="OPTIONS=--help all"` to see all available JTReg options.
|
||||
|
||||
#### JAVA_OPTIONS
|
||||
Additional Java options to JTReg (`-javaoption`).
|
||||
|
||||
Additional Java options for running test classes (sent to JTReg as
|
||||
`-javaoption`).
|
||||
|
||||
#### VM_OPTIONS
|
||||
Additional VM options to JTReg (`-vmoption`).
|
||||
|
||||
Additional Java options to be used when compiling and running classes (sent to
|
||||
JTReg as `-vmoption`).
|
||||
|
||||
This option is only needed in special circumstances. To pass Java options to
|
||||
your test classes, use `JAVA_OPTIONS`.
|
||||
|
||||
#### LAUNCHER_OPTIONS
|
||||
|
||||
Additional Java options that are sent to the java launcher that starts the
|
||||
JTReg harness.
|
||||
|
||||
#### AOT_MODULES
|
||||
|
||||
@@ -349,6 +378,7 @@ Retry failed tests up to a set number of times. Defaults to 0.
|
||||
### Gtest keywords
|
||||
|
||||
#### REPEAT
|
||||
|
||||
The number of times to repeat the tests (`--gtest_repeat`).
|
||||
|
||||
Default is 1. Set to -1 to repeat indefinitely. This can be especially useful
|
||||
@@ -356,6 +386,7 @@ combined with `OPTIONS=--gtest_break_on_failure` to reproduce an intermittent
|
||||
problem.
|
||||
|
||||
#### OPTIONS
|
||||
|
||||
Additional options to the Gtest test framework.
|
||||
|
||||
Use `GTEST="OPTIONS=--help"` to see all available Gtest options.
|
||||
@@ -369,98 +400,127 @@ modules. If multiple modules are specified, they should be separated by space
|
||||
### Microbenchmark keywords
|
||||
|
||||
#### FORK
|
||||
|
||||
Override the number of benchmark forks to spawn. Same as specifying `-f <num>`.
|
||||
|
||||
#### ITER
|
||||
|
||||
Number of measurement iterations per fork. Same as specifying `-i <num>`.
|
||||
|
||||
#### TIME
|
||||
|
||||
Amount of time to spend in each measurement iteration, in seconds. Same as
|
||||
specifying `-r <num>`
|
||||
|
||||
#### WARMUP_ITER
|
||||
|
||||
Number of warmup iterations to run before the measurement phase in each fork.
|
||||
Same as specifying `-wi <num>`.
|
||||
|
||||
#### WARMUP_TIME
|
||||
|
||||
Amount of time to spend in each warmup iteration. Same as specifying `-w <num>`.
|
||||
|
||||
#### RESULTS_FORMAT
|
||||
|
||||
Specify to have the test run save a log of the values. Accepts the same values
|
||||
as `-rff`, i.e., `text`, `csv`, `scsv`, `json`, or `latex`.
|
||||
|
||||
#### VM_OPTIONS
|
||||
|
||||
Additional VM arguments to provide to forked off VMs. Same as `-jvmArgs <args>`
|
||||
|
||||
#### OPTIONS
|
||||
|
||||
Additional arguments to send to JMH.
|
||||
|
||||
## Notes for Specific Tests
|
||||
|
||||
### Docker Tests
|
||||
|
||||
Docker tests with default parameters may fail on systems with glibc versions not
|
||||
compatible with the one used in the default docker image (e.g., Oracle Linux 7.6 for x86).
|
||||
For example, they pass on Ubuntu 16.04 but fail on Ubuntu 18.04 if run like this on x86:
|
||||
Docker tests with default parameters may fail on systems with glibc versions
|
||||
not compatible with the one used in the default docker image (e.g., Oracle
|
||||
Linux 7.6 for x86). For example, they pass on Ubuntu 16.04 but fail on Ubuntu
|
||||
18.04 if run like this on x86:
|
||||
|
||||
$ make test TEST="jtreg:test/hotspot/jtreg/containers/docker"
|
||||
```
|
||||
$ make test TEST="jtreg:test/hotspot/jtreg/containers/docker"
|
||||
```
|
||||
|
||||
To run these tests correctly, additional parameters for the correct docker image are
|
||||
required on Ubuntu 18.04 by using `JAVA_OPTIONS`.
|
||||
To run these tests correctly, additional parameters for the correct docker
|
||||
image are required on Ubuntu 18.04 by using `JAVA_OPTIONS`.
|
||||
|
||||
$ make test TEST="jtreg:test/hotspot/jtreg/containers/docker" JTREG="JAVA_OPTIONS=-Djdk.test.docker.image.name=ubuntu -Djdk.test.docker.image.version=latest"
|
||||
```
|
||||
$ make test TEST="jtreg:test/hotspot/jtreg/containers/docker" \
|
||||
JTREG="JAVA_OPTIONS=-Djdk.test.docker.image.name=ubuntu
|
||||
-Djdk.test.docker.image.version=latest"
|
||||
```
|
||||
|
||||
### Non-US locale
|
||||
|
||||
If your locale is non-US, some tests are likely to fail. To work around this you can
|
||||
set the locale to US. On Unix platforms simply setting `LANG="en_US"` in the
|
||||
environment before running tests should work. On Windows, setting
|
||||
`JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US"` helps for most, but not all test cases.
|
||||
If your locale is non-US, some tests are likely to fail. To work around this
|
||||
you can set the locale to US. On Unix platforms simply setting `LANG="en_US"`
|
||||
in the environment before running tests should work. On Windows, setting
|
||||
`JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US"` helps for most, but
|
||||
not all test cases.
|
||||
|
||||
For example:
|
||||
|
||||
$ export LANG="en_US" && make test TEST=...
|
||||
$ make test JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US" TEST=...
|
||||
```
|
||||
$ export LANG="en_US" && make test TEST=...
|
||||
$ make test JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US" TEST=...
|
||||
```
|
||||
|
||||
### PKCS11 Tests
|
||||
|
||||
It is highly recommended to use the latest NSS version when running PKCS11 tests.
|
||||
Improper NSS version may lead to unexpected failures which are hard to diagnose.
|
||||
For example, sun/security/pkcs11/Secmod/AddTrustedCert.java may fail on Ubuntu
|
||||
18.04 with the default NSS version in the system.
|
||||
To run these tests correctly, the system property `test.nss.lib.paths` is required
|
||||
on Ubuntu 18.04 to specify the alternative NSS lib directories.
|
||||
It is highly recommended to use the latest NSS version when running PKCS11
|
||||
tests. Improper NSS version may lead to unexpected failures which are hard to
|
||||
diagnose. For example, sun/security/pkcs11/Secmod/AddTrustedCert.java may fail
|
||||
on Ubuntu 18.04 with the default NSS version in the system. To run these tests
|
||||
correctly, the system property `test.nss.lib.paths` is required on Ubuntu 18.04
|
||||
to specify the alternative NSS lib directories.
|
||||
|
||||
For example:
|
||||
|
||||
$ make test TEST="jtreg:sun/security/pkcs11/Secmod/AddTrustedCert.java" JTREG="JAVA_OPTIONS=-Dtest.nss.lib.paths=/path/to/your/latest/NSS-libs"
|
||||
```
|
||||
$ make test TEST="jtreg:sun/security/pkcs11/Secmod/AddTrustedCert.java" \
|
||||
JTREG="JAVA_OPTIONS=-Dtest.nss.lib.paths=/path/to/your/latest/NSS-libs"
|
||||
```
|
||||
|
||||
For more notes about the PKCS11 tests, please refer to test/jdk/sun/security/pkcs11/README.
|
||||
For more notes about the PKCS11 tests, please refer to
|
||||
test/jdk/sun/security/pkcs11/README.
|
||||
|
||||
### Client UI Tests
|
||||
|
||||
Some Client UI tests use key sequences which may be reserved by the operating
|
||||
system. Usually that causes the test failure. So it is highly recommended to disable
|
||||
system key shortcuts prior testing. The steps to access and disable system key shortcuts
|
||||
for various platforms are provided below.
|
||||
system. Usually that causes the test failure. So it is highly recommended to
|
||||
disable system key shortcuts prior testing. The steps to access and disable
|
||||
system key shortcuts for various platforms are provided below.
|
||||
|
||||
#### MacOS
|
||||
|
||||
Choose Apple menu; System Preferences, click Keyboard, then click Shortcuts;
|
||||
select or deselect desired shortcut.
|
||||
|
||||
For example, test/jdk/javax/swing/TooltipManager/JMenuItemToolTipKeyBindingsTest/JMenuItemToolTipKeyBindingsTest.java fails
|
||||
on MacOS because it uses `CTRL + F1` key sequence to show or hide tooltip message
|
||||
but the key combination is reserved by the operating system. To run the test correctly
|
||||
the default global key shortcut should be disabled using the steps described above, and then deselect
|
||||
"Turn keyboard access on or off" option which is responsible for `CTRL + F1` combination.
|
||||
For example,
|
||||
test/jdk/javax/swing/TooltipManager/JMenuItemToolTipKeyBindingsTest/JMenuItemToolTipKeyBindingsTest.java
|
||||
fails on MacOS because it uses `CTRL + F1` key sequence to show or hide tooltip
|
||||
message but the key combination is reserved by the operating system. To run the
|
||||
test correctly the default global key shortcut should be disabled using the
|
||||
steps described above, and then deselect "Turn keyboard access on or off"
|
||||
option which is responsible for `CTRL + F1` combination.
|
||||
|
||||
#### Linux
|
||||
Open the Activities overview and start typing Settings; Choose Settings, click Devices,
|
||||
then click Keyboard; set or override desired shortcut.
|
||||
|
||||
Open the Activities overview and start typing Settings; Choose Settings, click
|
||||
Devices, then click Keyboard; set or override desired shortcut.
|
||||
|
||||
#### Windows
|
||||
Type `gpedit` in the Search and then click Edit group policy; navigate to
|
||||
User Configuration -> Administrative Templates -> Windows Components -> File Explorer;
|
||||
in the right-side pane look for "Turn off Windows key hotkeys" and double click on it;
|
||||
enable or disable hotkeys.
|
||||
|
||||
Type `gpedit` in the Search and then click Edit group policy; navigate to User
|
||||
Configuration -> Administrative Templates -> Windows Components -> File
|
||||
Explorer; in the right-side pane look for "Turn off Windows key hotkeys" and
|
||||
double click on it; enable or disable hotkeys.
|
||||
|
||||
Note: restart is required to make the settings take effect.
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ define SetupBundleFileBody
|
||||
# If no subdir is specified and only one BASE_DIR, tar.gz can be done
|
||||
# directly from BASE_DIR.
|
||||
$(CD) $$($1_BASE_DIRS) \
|
||||
&& ( $(TAR) cf - $(TAR_CREATE_EXTRA_PARAM) \
|
||||
&& ( $(TAR) cf - \
|
||||
-$(TAR_INCLUDE_PARAM) $$($1_$$($1_BASE_DIRS)_LIST_FILE) \
|
||||
$(TAR_IGNORE_EXIT_VALUE) ) \
|
||||
| $(GZIP) > $$@
|
||||
@@ -110,7 +110,7 @@ define SetupBundleFileBody
|
||||
# If only one BASE_DIR, but with a SUBDIR set, tar.gz can use the
|
||||
# transform option to create bundle directly from the BASE_DIR.
|
||||
$(CD) $$($1_BASE_DIRS) \
|
||||
&& ( $(TAR) cf - $(TAR_CREATE_EXTRA_PARAM) \
|
||||
&& ( $(TAR) cf - \
|
||||
-$(TAR_INCLUDE_PARAM) $$($1_$$($1_BASE_DIRS)_LIST_FILE) \
|
||||
$$(if $$($1_SUBDIR), --transform 's|^|$$($1_SUBDIR)/|S') \
|
||||
$(TAR_IGNORE_EXIT_VALUE) ) \
|
||||
@@ -140,7 +140,7 @@ define SetupBundleFileBody
|
||||
endif
|
||||
ifeq ($$($1_TYPE), tar.gz)
|
||||
$(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1 && \
|
||||
( $(TAR) cf - $(TAR_CREATE_EXTRA_PARAM) \
|
||||
( $(TAR) cf - \
|
||||
$$(if $$($1_SUBDIR), $$($1_SUBDIR), .) $(TAR_IGNORE_EXIT_VALUE) ) \
|
||||
| $(GZIP) > $$@
|
||||
else ifeq ($$($1_TYPE), zip)
|
||||
|
||||
@@ -33,7 +33,6 @@ include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include JavaCompilation.gmk
|
||||
include NativeCompilation.gmk
|
||||
include SetupJavaCompilers.gmk
|
||||
include TextFileProcessing.gmk
|
||||
include ZipArchive.gmk
|
||||
|
||||
@@ -53,7 +52,6 @@ TARGETS =
|
||||
# READMEs and other files.
|
||||
|
||||
DEMO_SHARE_SRC := $(TOPDIR)/src/demo/share
|
||||
GLOBAL_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/common/version.rc
|
||||
|
||||
DEMO_MANIFEST := $(SUPPORT_OUTPUTDIR)/demos/java-main-manifest.mf
|
||||
|
||||
@@ -93,7 +91,6 @@ COPY_TO_IMAGE := *.html *.txt *.png *.xml README*
|
||||
# EXTRA_COPY_TO_IMAGE Additional files to copy to images (as wildcards)
|
||||
# EXTRA_MANIFEST_ATTR Extra manifest attribute
|
||||
# SKIP_COMPILATION Skip Java compilation iff true
|
||||
# DISABLE_SJAVAC Passed to SetupJavaCompilation
|
||||
# DISABLED_WARNINGS Additional disabled warnings
|
||||
SetupBuildDemo = $(NamedParamsMacroTemplate)
|
||||
define SetupBuildDemoBody
|
||||
@@ -126,7 +123,7 @@ define SetupBuildDemoBody
|
||||
|
||||
ifneq ($$($1_SKIP_COMPILATION), true)
|
||||
$$(eval $$(call SetupJavaCompilation, BUILD_DEMO_$1, \
|
||||
SETUP := GENERATE_USINGJDKBYTECODE, \
|
||||
TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \
|
||||
SRC := $$($1_MAIN_SRC) $$($1_EXTRA_SRC_DIR), \
|
||||
BIN := $(SUPPORT_OUTPUTDIR)/demos/classes/$$($1_DEMO_SUBDIR)/$1, \
|
||||
COPY := $(COPY_TO_JAR) $$($1_EXTRA_COPY_TO_JAR), \
|
||||
@@ -137,7 +134,6 @@ define SetupBuildDemoBody
|
||||
SRCZIP := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1/src.zip, \
|
||||
EXCLUDE_FILES := $$($1_EXCLUDE_FILES), \
|
||||
DISABLED_WARNINGS := $$($1_DISABLED_WARNINGS), \
|
||||
DISABLE_SJAVAC := $$($1_DISABLE_SJAVAC), \
|
||||
))
|
||||
|
||||
$1 += $$(BUILD_DEMO_$1)
|
||||
@@ -183,7 +179,6 @@ $(eval $(call SetupBuildDemo, SwingSet2, \
|
||||
EXTRA_COPY_TO_JAR := .java, \
|
||||
EXTRA_MANIFEST_ATTR := SplashScreen-Image: resources/images/splash.png, \
|
||||
DISABLED_WARNINGS := rawtypes deprecation unchecked static serial cast, \
|
||||
DISABLE_SJAVAC := true, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildDemo, Font2DTest, \
|
||||
@@ -244,15 +239,9 @@ $(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%: $(DEMO_SHARE_SRC)/nbproject/%
|
||||
$(call install-file)
|
||||
$(CHMOD) -f ug+w $@
|
||||
|
||||
ifeq ($(call isTargetOs, solaris), true)
|
||||
TARGETS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
|
||||
$(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%, \
|
||||
$(call FindFiles, $(DEMO_SHARE_SRC)/nbproject))
|
||||
else
|
||||
TARGETS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
|
||||
$(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%, \
|
||||
$(call FindFiles, $(DEMO_SHARE_SRC)/nbproject))
|
||||
endif
|
||||
TARGETS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
|
||||
$(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%, \
|
||||
$(call FindFiles, $(DEMO_SHARE_SRC)/nbproject))
|
||||
|
||||
################################################################################
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ default: all
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include JavaCompilation.gmk
|
||||
include SetupJavaCompilers.gmk
|
||||
include Modules.gmk
|
||||
|
||||
################################################################################
|
||||
@@ -66,8 +65,8 @@ TARGETS += $(COPY_PREVIEW_FEATURES)
|
||||
# Param 1 - Name of module to compile
|
||||
define SetupInterimModule
|
||||
$$(eval $$(call SetupJavaCompilation, BUILD_$1.interim, \
|
||||
SETUP := BOOT_JAVAC, \
|
||||
DISABLE_SJAVAC := true, \
|
||||
COMPILER := bootjdk, \
|
||||
TARGET_RELEASE := $$(TARGET_RELEASE_BOOTJDK), \
|
||||
SRC := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim \
|
||||
$$(wildcard $(SUPPORT_OUTPUTDIR)/gensrc/$1) \
|
||||
$(TOPDIR)/src/$1/share/classes, \
|
||||
@@ -77,8 +76,9 @@ define SetupInterimModule
|
||||
EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java, \
|
||||
COPY := .gif .png .xml .css .js javax.tools.JavaCompilerTool, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules/$1.interim, \
|
||||
DISABLED_WARNINGS := module, \
|
||||
ADD_JAVAC_FLAGS := --module-path $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules \
|
||||
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 \
|
||||
|
||||
@@ -30,7 +30,6 @@ include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include Modules.gmk
|
||||
include JavaCompilation.gmk
|
||||
include SetupJavaCompilers.gmk
|
||||
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, CompileJavaModules.gmk))
|
||||
@@ -38,8 +37,11 @@ $(eval $(call IncludeCustomExtension, CompileJavaModules.gmk))
|
||||
################################################################################
|
||||
# Module specific build settings
|
||||
|
||||
java.base_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference,-accessibility '-Xdoclint/package:java.*,javax.*' -XDstringConcat=inline
|
||||
java.base_COPY += .icu .dat .spp .nrm content-types.properties hijrah-config-Hijrah-umalqura_islamic-umalqura.properties
|
||||
java.base_DOCLINT += -Xdoclint:all/protected,-reference,-accessibility \
|
||||
'-Xdoclint/package:java.*,javax.*'
|
||||
java.base_JAVAC_FLAGS += -XDstringConcat=inline
|
||||
java.base_COPY += .icu .dat .spp .nrm content-types.properties \
|
||||
hijrah-config-Hijrah-umalqura_islamic-umalqura.properties
|
||||
java.base_CLEAN += intrinsic.properties
|
||||
|
||||
java.base_EXCLUDE_FILES += \
|
||||
@@ -51,14 +53,7 @@ java.base_EXCLUDES += java/lang/doc-files
|
||||
# data files and shouldn't go in the product
|
||||
java.base_EXCLUDE_FILES += sun/text/resources/BreakIteratorRules.java
|
||||
|
||||
ifeq ($(call isTargetOs, solaris), false)
|
||||
java.base_EXCLUDE_FILES += \
|
||||
SolarisLoginModule.java \
|
||||
SolarisSystem.java \
|
||||
#
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, solaris macosx aix), false)
|
||||
ifeq ($(call isTargetOs, macosx aix), false)
|
||||
java.base_EXCLUDE_FILES += sun/nio/fs/PollingWatchService.java
|
||||
endif
|
||||
|
||||
@@ -70,18 +65,20 @@ endif
|
||||
|
||||
################################################################################
|
||||
|
||||
java.compiler_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
|
||||
java.compiler_DOCLINT += -Xdoclint:all/protected \
|
||||
'-Xdoclint/package:java.*,javax.*'
|
||||
|
||||
################################################################################
|
||||
|
||||
java.datatransfer_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*'
|
||||
java.datatransfer_DOCLINT += -Xdoclint:all/protected,-reference \
|
||||
'-Xdoclint/package:java.*,javax.*'
|
||||
java.datatransfer_COPY += flavormap.properties
|
||||
|
||||
################################################################################
|
||||
|
||||
java.desktop_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference \
|
||||
'-Xdoclint/package:java.*,javax.*' \
|
||||
--doclint-format html4
|
||||
java.desktop_DISABLED_WARNINGS += missing-explicit-ctor
|
||||
java.desktop_DOCLINT += -Xdoclint:all/protected,-reference \
|
||||
'-Xdoclint/package:java.*,javax.*'
|
||||
java.desktop_COPY += .gif .png .wav .txt .xml .css .pf
|
||||
java.desktop_CLEAN += iio-plugin.properties cursors.properties
|
||||
|
||||
@@ -214,98 +211,116 @@ java.desktop_EXCLUDE_FILES += \
|
||||
|
||||
################################################################################
|
||||
|
||||
java.scripting_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
|
||||
java.scripting_DOCLINT += -Xdoclint:all/protected \
|
||||
'-Xdoclint/package:java.*,javax.*'
|
||||
java.scripting_COPY += .js
|
||||
java.scripting_CLEAN += .properties
|
||||
|
||||
################################################################################
|
||||
|
||||
java.instrument_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*'
|
||||
java.instrument_DOCLINT += -Xdoclint:all/protected,-accessibility \
|
||||
'-Xdoclint/package:java.*,javax.*'
|
||||
|
||||
################################################################################
|
||||
|
||||
java.logging_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference,-accessibility '-Xdoclint/package:java.*,javax.*'
|
||||
java.logging_DOCLINT += -Xdoclint:all/protected,-reference,-accessibility \
|
||||
'-Xdoclint/package:java.*,javax.*'
|
||||
|
||||
################################################################################
|
||||
|
||||
java.management_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference,-accessibility '-Xdoclint/package:java.*,javax.*'
|
||||
java.management_DOCLINT += -Xdoclint:all/protected,-reference,-accessibility \
|
||||
'-Xdoclint/package:java.*,javax.*'
|
||||
|
||||
################################################################################
|
||||
|
||||
java.management.rmi_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:javax.*'
|
||||
java.management.rmi_DOCLINT += -Xdoclint:all/protected \
|
||||
'-Xdoclint/package:javax.*'
|
||||
|
||||
################################################################################
|
||||
|
||||
java.prefs_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
|
||||
java.prefs_DOCLINT += -Xdoclint:all/protected \
|
||||
'-Xdoclint/package:java.*,javax.*'
|
||||
|
||||
################################################################################
|
||||
|
||||
java.transaction.xa_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:javax.*'
|
||||
java.transaction.xa_DOCLINT += -Xdoclint:all/protected \
|
||||
'-Xdoclint/package:javax.*'
|
||||
|
||||
################################################################################
|
||||
|
||||
java.sql_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
|
||||
java.sql_DOCLINT += -Xdoclint:all/protected \
|
||||
'-Xdoclint/package:java.*,javax.*'
|
||||
|
||||
################################################################################
|
||||
|
||||
java.sql.rowset_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*'
|
||||
java.sql.rowset_DOCLINT += -Xdoclint:all/protected,-accessibility \
|
||||
'-Xdoclint/package:java.*,javax.*'
|
||||
java.sql.rowset_CLEAN_FILES += $(wildcard \
|
||||
$(TOPDIR)/src/java.sql.rowset/share/classes/com/sun/rowset/*.properties \
|
||||
$(TOPDIR)/src/java.sql.rowset/share/classes/javax/sql/rowset/*.properties)
|
||||
|
||||
################################################################################
|
||||
|
||||
java.rmi_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
|
||||
java.rmi_DOCLINT += -Xdoclint:all/protected \
|
||||
'-Xdoclint/package:java.*,javax.*'
|
||||
java.rmi_CLEAN_FILES += $(wildcard \
|
||||
$(TOPDIR)/src/java.rmi/share/classes/sun/rmi/registry/resources/*.properties \
|
||||
$(TOPDIR)/src/java.rmi/share/classes/sun/rmi/server/resources/*.properties)
|
||||
|
||||
################################################################################
|
||||
|
||||
java.xml_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility \
|
||||
java.xml_DOCLINT += -Xdoclint:all/protected,-accessibility \
|
||||
'-Xdoclint/package:$(call CommaList, javax.xml.catalog javax.xml.datatype \
|
||||
javax.xml.transform javax.xml.validation javax.xml.xpath)'
|
||||
java.xml_CLEAN += .properties
|
||||
|
||||
################################################################################
|
||||
|
||||
java.naming_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*'
|
||||
java.naming_DOCLINT += -Xdoclint:all/protected,-accessibility \
|
||||
'-Xdoclint/package:java.*,javax.*'
|
||||
java.naming_CLEAN += jndiprovider.properties
|
||||
|
||||
################################################################################
|
||||
|
||||
java.security.jgss_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
|
||||
java.security.jgss_DOCLINT += -Xdoclint:all/protected \
|
||||
'-Xdoclint/package:java.*,javax.*'
|
||||
|
||||
################################################################################
|
||||
|
||||
java.smartcardio_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*'
|
||||
java.smartcardio_DOCLINT += -Xdoclint:all/protected,-accessibility \
|
||||
'-Xdoclint/package:java.*,javax.*'
|
||||
|
||||
################################################################################
|
||||
|
||||
java.xml.crypto_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
|
||||
java.xml.crypto_DOCLINT += -Xdoclint:all/protected \
|
||||
'-Xdoclint/package:java.*,javax.*'
|
||||
java.xml.crypto_COPY += .dtd .xml
|
||||
java.xml.crypto_CLEAN += .properties
|
||||
|
||||
################################################################################
|
||||
|
||||
jdk.accessibility_DISABLED_WARNINGS += missing-explicit-ctor
|
||||
|
||||
################################################################################
|
||||
|
||||
jdk.charsets_COPY += .dat
|
||||
|
||||
################################################################################
|
||||
|
||||
################################################################################
|
||||
|
||||
jdk.compiler_ADD_JAVAC_FLAGS += -Xdoclint:all/protected \
|
||||
'-Xdoclint/package:-com.sun.tools.*,-jdk.internal.*,sun.tools.serialver.resources.*' \
|
||||
-XDstringConcat=inline
|
||||
jdk.compiler_DOCLINT += -Xdoclint:all/protected \
|
||||
'-Xdoclint/package:-com.sun.tools.*,-jdk.internal.*,sun.tools.serialver.resources.*'
|
||||
jdk.compiler_JAVAC_FLAGS += -XDstringConcat=inline
|
||||
jdk.compiler_CLEAN_FILES += $(wildcard \
|
||||
$(patsubst %, $(TOPDIR)/src/jdk.compiler/share/classes/%/*.properties, \
|
||||
sun/tools/serialver/resources))
|
||||
|
||||
################################################################################
|
||||
|
||||
jdk.hotspot.agent_DISABLED_WARNINGS += deprecation rawtypes serial unchecked \
|
||||
cast static overrides fallthrough
|
||||
jdk.hotspot.agent_COPY += .gif .png sa.js .properties
|
||||
jdk.hotspot.agent_DISABLED_WARNINGS += rawtypes serial cast static overrides \
|
||||
fallthrough
|
||||
jdk.hotspot.agent_COPY += .gif .png .properties
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -337,22 +352,16 @@ jdk.javadoc_COPY += .xml .css .js .png
|
||||
|
||||
################################################################################
|
||||
|
||||
jdk.jartool_ADD_JAVAC_FLAGS += -XDstringConcat=inline
|
||||
jdk.jartool_DISABLED_WARNINGS += missing-explicit-ctor
|
||||
jdk.jartool_JAVAC_FLAGS += -XDstringConcat=inline
|
||||
|
||||
################################################################################
|
||||
|
||||
jdk.scripting.nashorn_DISABLED_WARNINGS += removal
|
||||
jdk.scripting.nashorn_COPY := .properties .js
|
||||
jdk.httpserver_DISABLED_WARNINGS += missing-explicit-ctor
|
||||
|
||||
################################################################################
|
||||
|
||||
jdk.scripting.nashorn.shell_DISABLED_WARNINGS += removal
|
||||
jdk.scripting.nashorn.shell_COPY += .js .properties
|
||||
|
||||
################################################################################
|
||||
|
||||
jdk.rmic_DISABLED_WARNINGS += deprecation
|
||||
jdk.rmic_CLEAN += .properties
|
||||
jdk.unsupported.desktop_DISABLED_WARNINGS += missing-explicit-ctor
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -380,8 +389,9 @@ endif
|
||||
|
||||
################################################################################
|
||||
|
||||
jdk.incubator.jpackage_COPY += .gif .png .txt .spec .script .prerm .preinst .postrm .postinst .list .sh \
|
||||
.desktop .copyright .control .plist .template .icns .scpt .entitlements .wxs .wxl .wxi .ico .bmp .tiff
|
||||
jdk.incubator.jpackage_COPY += .gif .png .txt .spec .script .prerm .preinst \
|
||||
.postrm .postinst .list .sh .desktop .copyright .control .plist .template \
|
||||
.icns .scpt .wxs .wxl .wxi .ico .bmp .tiff
|
||||
|
||||
jdk.incubator.jpackage_CLEAN += .properties
|
||||
|
||||
@@ -431,11 +441,11 @@ jdk.internal.jvmstat_COPY += aliasmap
|
||||
# The exports are needed since JVMCI is dynamically exported (see
|
||||
# jdk.vm.ci.services.internal.ReflectionAccessJDK::openJVMCITo).
|
||||
|
||||
jdk.internal.vm.ci_ADD_JAVAC_FLAGS += -parameters -XDstringConcat=inline
|
||||
jdk.internal.vm.ci_JAVAC_FLAGS += -parameters -XDstringConcat=inline
|
||||
|
||||
################################################################################
|
||||
|
||||
jdk.internal.vm.compiler_ADD_JAVAC_FLAGS += -parameters -XDstringConcat=inline \
|
||||
jdk.internal.vm.compiler_JAVAC_FLAGS += -parameters -XDstringConcat=inline \
|
||||
--add-exports jdk.internal.vm.ci/jdk.vm.ci.aarch64=jdk.internal.vm.compiler \
|
||||
--add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=jdk.internal.vm.compiler \
|
||||
--add-exports jdk.internal.vm.ci/jdk.vm.ci.code=jdk.internal.vm.compiler \
|
||||
@@ -445,10 +455,8 @@ jdk.internal.vm.compiler_ADD_JAVAC_FLAGS += -parameters -XDstringConcat=inline \
|
||||
--add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=jdk.internal.vm.compiler \
|
||||
--add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.aarch64=jdk.internal.vm.compiler \
|
||||
--add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.amd64=jdk.internal.vm.compiler \
|
||||
--add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.sparc=jdk.internal.vm.compiler \
|
||||
--add-exports jdk.internal.vm.ci/jdk.vm.ci.meta=jdk.internal.vm.compiler \
|
||||
--add-exports jdk.internal.vm.ci/jdk.vm.ci.runtime=jdk.internal.vm.compiler \
|
||||
--add-exports jdk.internal.vm.ci/jdk.vm.ci.sparc=jdk.internal.vm.compiler \
|
||||
#
|
||||
|
||||
jdk.internal.vm.compiler_EXCLUDES += \
|
||||
@@ -458,7 +466,6 @@ jdk.internal.vm.compiler_EXCLUDES += \
|
||||
org.graalvm.compiler.api.test \
|
||||
org.graalvm.compiler.asm.aarch64.test \
|
||||
org.graalvm.compiler.asm.amd64.test \
|
||||
org.graalvm.compiler.asm.sparc.test \
|
||||
org.graalvm.compiler.asm.test \
|
||||
org.graalvm.compiler.core.aarch64.test \
|
||||
org.graalvm.compiler.core.amd64.test \
|
||||
@@ -469,9 +476,9 @@ jdk.internal.vm.compiler_EXCLUDES += \
|
||||
org.graalvm.compiler.graph.test \
|
||||
org.graalvm.compiler.hotspot.aarch64.test \
|
||||
org.graalvm.compiler.hotspot.amd64.test \
|
||||
org.graalvm.compiler.hotspot.jdk15.test \
|
||||
org.graalvm.compiler.hotspot.jdk9.test \
|
||||
org.graalvm.compiler.hotspot.lir.test \
|
||||
org.graalvm.compiler.hotspot.sparc.test \
|
||||
org.graalvm.compiler.hotspot.test \
|
||||
org.graalvm.compiler.jtt \
|
||||
org.graalvm.compiler.lir.jtt \
|
||||
@@ -484,6 +491,7 @@ jdk.internal.vm.compiler_EXCLUDES += \
|
||||
org.graalvm.compiler.options.test \
|
||||
org.graalvm.compiler.phases.common.test \
|
||||
org.graalvm.compiler.processor \
|
||||
org.graalvm.compiler.replacements.jdk10.test \
|
||||
org.graalvm.compiler.replacements.jdk12.test \
|
||||
org.graalvm.compiler.replacements.jdk9.test \
|
||||
org.graalvm.compiler.replacements.processor \
|
||||
@@ -503,7 +511,7 @@ jdk.internal.vm.compiler_EXCLUDES += \
|
||||
# The exports are needed since JVMCI is dynamically exported (see
|
||||
# jdk.vm.ci.services.internal.ReflectionAccessJDK::openJVMCITo).
|
||||
|
||||
jdk.aot_ADD_JAVAC_FLAGS += -parameters -XDstringConcat=inline \
|
||||
jdk.aot_JAVAC_FLAGS += -parameters -XDstringConcat=inline \
|
||||
--add-exports jdk.internal.vm.ci/jdk.vm.ci.aarch64=jdk.internal.vm.compiler,jdk.aot \
|
||||
--add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=jdk.internal.vm.compiler,jdk.aot \
|
||||
--add-exports jdk.internal.vm.ci/jdk.vm.ci.code=jdk.internal.vm.compiler,jdk.aot \
|
||||
@@ -513,10 +521,8 @@ jdk.aot_ADD_JAVAC_FLAGS += -parameters -XDstringConcat=inline \
|
||||
--add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=jdk.internal.vm.compiler,jdk.aot \
|
||||
--add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.aarch64=jdk.internal.vm.compiler,jdk.aot \
|
||||
--add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.amd64=jdk.internal.vm.compiler,jdk.aot \
|
||||
--add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.sparc=jdk.internal.vm.compiler,jdk.aot \
|
||||
--add-exports jdk.internal.vm.ci/jdk.vm.ci.meta=jdk.internal.vm.compiler,jdk.aot \
|
||||
--add-exports jdk.internal.vm.ci/jdk.vm.ci.runtime=jdk.internal.vm.compiler,jdk.aot \
|
||||
--add-exports jdk.internal.vm.ci/jdk.vm.ci.sparc=jdk.internal.vm.compiler,jdk.aot \
|
||||
#
|
||||
|
||||
jdk.aot_EXCLUDES += \
|
||||
@@ -538,7 +544,7 @@ jdk.localedata_KEEP_ALL_TRANSLATIONS := true
|
||||
|
||||
jdk.jfr_DISABLED_WARNINGS += exports
|
||||
jdk.jfr_COPY := .xsd .xml .dtd
|
||||
jdk.jfr_ADD_JAVAC_FLAGS := -XDstringConcat=inline
|
||||
jdk.jfr_JAVAC_FLAGS := -XDstringConcat=inline
|
||||
|
||||
################################################################################
|
||||
# If this is an imported module that has prebuilt classes, only compile
|
||||
@@ -601,7 +607,7 @@ ifeq ($(MODULE), jdk.aot)
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJavaCompilation, $(MODULE), \
|
||||
SETUP := $(if $($(MODULE)_SETUP), $($(MODULE)_SETUP), GENERATE_JDKBYTECODE), \
|
||||
SMALL_JAVA := false, \
|
||||
MODULE := $(MODULE), \
|
||||
SRC := $(wildcard $(MODULE_SRC_DIRS)), \
|
||||
INCLUDES := $(JDK_USER_DEFINED_FILTER), \
|
||||
@@ -609,8 +615,9 @@ $(eval $(call SetupJavaCompilation, $(MODULE), \
|
||||
BIN := $(if $($(MODULE)_BIN), $($(MODULE)_BIN), $(JDK_OUTPUTDIR)/modules), \
|
||||
HEADERS := $(SUPPORT_OUTPUTDIR)/headers, \
|
||||
CREATE_API_DIGEST := true, \
|
||||
ADD_JAVAC_FLAGS := \
|
||||
$($(MODULE)_ADD_JAVAC_FLAGS) \
|
||||
JAVAC_FLAGS := \
|
||||
$($(MODULE)_DOCLINT) \
|
||||
$($(MODULE)_JAVAC_FLAGS) \
|
||||
--module-source-path $(MODULESOURCEPATH) \
|
||||
--module-path $(MODULEPATH) \
|
||||
--system none, \
|
||||
@@ -673,12 +680,6 @@ endif
|
||||
|
||||
################################################################################
|
||||
|
||||
ifeq ($(MODULE), jdk.scripting.nashorn)
|
||||
include CompileJavaModulesNashorn.gmk
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
$(eval $(call IncludeCustomExtension, CompileJavaModules-post.gmk))
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2010, 2018, 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
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
NASGEN_SRC := $(TOPDIR)/make/nashorn/buildtools/nasgen/src
|
||||
ASM_SRC := $(TOPDIR)/src/java.base/share/classes/jdk/internal/org/objectweb/asm
|
||||
|
||||
# Build nasgen
|
||||
$(eval $(call SetupJavaCompilation, BUILD_NASGEN, \
|
||||
SETUP := GENERATE_OLDBYTECODE, \
|
||||
SRC := $(NASGEN_SRC) $(ASM_SRC), \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/nasgen_classes, \
|
||||
))
|
||||
|
||||
NASHORN_CLASSES_DIR := $(JDK_OUTPUTDIR)/modules/$(MODULE)
|
||||
NASGEN_RUN_FILE := $(NASHORN_CLASSES_DIR)/_the.nasgen.run
|
||||
|
||||
NASGEN_OPTIONS := \
|
||||
-cp $(BUILDTOOLS_OUTPUTDIR)/nasgen_classes \
|
||||
--patch-module java.base=$(BUILDTOOLS_OUTPUTDIR)/nasgen_classes \
|
||||
--add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
|
||||
--add-exports java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED \
|
||||
#
|
||||
|
||||
# Run nasgen to modify classes in jdk.nashorn.internal.objects package
|
||||
$(NASGEN_RUN_FILE): $(BUILD_NASGEN) $($(MODULE))
|
||||
$(ECHO) Running nasgen
|
||||
$(JAVA_SMALL) $(NASGEN_OPTIONS) \
|
||||
jdk.nashorn.internal.tools.nasgen.Main $(@D) \
|
||||
jdk.nashorn.internal.objects $(@D)
|
||||
$(TOUCH) $@
|
||||
|
||||
TARGETS += $(NASGEN_RUN_FILE)
|
||||
@@ -28,14 +28,13 @@ default: all
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include JavaCompilation.gmk
|
||||
include SetupJavaCompilers.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
TOOLS_CLASSES_DIR := $(BUILDTOOLS_OUTPUTDIR)/tools_jigsaw_classes
|
||||
|
||||
$(eval $(call SetupJavaCompilation,BUILD_JIGSAW_TOOLS, \
|
||||
SETUP := GENERATE_USINGJDKBYTECODE, \
|
||||
$(eval $(call SetupJavaCompilation, BUILD_JIGSAW_TOOLS, \
|
||||
TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \
|
||||
SRC := $(TOPDIR)/make/jdk/src/classes, \
|
||||
INCLUDES := build/tools/deps \
|
||||
build/tools/docs \
|
||||
@@ -43,10 +42,10 @@ $(eval $(call SetupJavaCompilation,BUILD_JIGSAW_TOOLS, \
|
||||
COPY := .properties .html, \
|
||||
BIN := $(TOOLS_CLASSES_DIR), \
|
||||
DISABLED_WARNINGS := fallthrough, \
|
||||
ADD_JAVAC_FLAGS := \
|
||||
JAVAC_FLAGS := \
|
||||
--add-modules jdk.jdeps \
|
||||
--add-exports java.base/jdk.internal.module=ALL-UNNAMED \
|
||||
--add-exports jdk.jdeps/com.sun.tools.jdeps=ALL-UNNAMED \
|
||||
--add-exports jdk.jdeps/com.sun.tools.jdeps=ALL-UNNAMED, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_JIGSAW_TOOLS)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2016, 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
|
||||
@@ -30,13 +30,30 @@ include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include JavaCompilation.gmk
|
||||
include SetupJavaCompilers.gmk
|
||||
|
||||
TARGETS :=
|
||||
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, hotspot/CompileTools.gmk))
|
||||
|
||||
################################################################################
|
||||
# Build tools needed for the JFR source code generation
|
||||
|
||||
HOTSPOT_TOOLS_SRCDIR := $(TOPDIR)/make/src/classes
|
||||
|
||||
HOTSPOT_TOOLS_OUTPUTDIR := $(BUILDTOOLS_OUTPUTDIR)/buildtools/hotspot_tools_classes
|
||||
|
||||
$(eval $(call SetupJavaCompilation, BUILD_TOOLS_HOTSPOT, \
|
||||
COMPILER := bootjdk, \
|
||||
SRC := $(HOTSPOT_TOOLS_SRCDIR), \
|
||||
BIN := $(HOTSPOT_TOOLS_OUTPUTDIR), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_TOOLS_HOTSPOT)
|
||||
|
||||
|
||||
################################################################################
|
||||
# Graal build tools
|
||||
ifeq ($(INCLUDE_GRAAL), true)
|
||||
VM_CI_SRC_DIR := $(TOPDIR)/src/jdk.internal.vm.ci/share/classes
|
||||
|
||||
@@ -45,7 +62,7 @@ ifeq ($(INCLUDE_GRAAL), true)
|
||||
##############################################################################
|
||||
# Compile the annotation processors
|
||||
$(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_MATCH_PROCESSOR, \
|
||||
SETUP := GENERATE_OLDBYTECODE, \
|
||||
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
|
||||
SRC := \
|
||||
$(SRC_DIR)/org.graalvm.compiler.processor/src \
|
||||
$(SRC_DIR)/org.graalvm.compiler.core.match.processor/src \
|
||||
@@ -53,6 +70,7 @@ ifeq ($(INCLUDE_GRAAL), true)
|
||||
EXCLUDE_FILES := $(EXCLUDE_FILES), \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.match.processor, \
|
||||
JAR := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.match.processor.jar, \
|
||||
DISABLED_WARNINGS := options, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_VM_COMPILER_MATCH_PROCESSOR)
|
||||
@@ -60,13 +78,14 @@ ifeq ($(INCLUDE_GRAAL), true)
|
||||
##############################################################################
|
||||
|
||||
$(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_NODEINFO_PROCESSOR, \
|
||||
SETUP := GENERATE_OLDBYTECODE, \
|
||||
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
|
||||
SRC := \
|
||||
$(SRC_DIR)/org.graalvm.compiler.processor/src \
|
||||
$(SRC_DIR)/org.graalvm.compiler.nodeinfo.processor/src \
|
||||
, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.nodeinfo.processor, \
|
||||
JAR := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.nodeinfo.processor.jar, \
|
||||
DISABLED_WARNINGS := options, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_VM_COMPILER_NODEINFO_PROCESSOR)
|
||||
@@ -74,7 +93,8 @@ ifeq ($(INCLUDE_GRAAL), true)
|
||||
##############################################################################
|
||||
|
||||
$(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_OPTIONS_PROCESSOR, \
|
||||
SETUP := GENERATE_OLDBYTECODE, \
|
||||
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
|
||||
DISABLED_WARNINGS := options, \
|
||||
SRC := \
|
||||
$(SRC_DIR)/org.graalvm.compiler.processor/src \
|
||||
$(SRC_DIR)/org.graalvm.compiler.options.processor/src \
|
||||
@@ -88,7 +108,7 @@ ifeq ($(INCLUDE_GRAAL), true)
|
||||
##############################################################################
|
||||
|
||||
$(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_REPLACEMENTS_PROCESSOR, \
|
||||
SETUP := GENERATE_OLDBYTECODE, \
|
||||
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
|
||||
SRC := \
|
||||
$(SRC_DIR)/org.graalvm.compiler.processor/src \
|
||||
$(SRC_DIR)/org.graalvm.compiler.replacements.processor/src \
|
||||
@@ -96,6 +116,7 @@ ifeq ($(INCLUDE_GRAAL), true)
|
||||
EXCLUDE_FILES := $(EXCLUDE_FILES), \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.replacements.verifier, \
|
||||
JAR := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.replacements.verifier.jar, \
|
||||
DISABLED_WARNINGS := options, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_VM_COMPILER_REPLACEMENTS_PROCESSOR)
|
||||
@@ -103,7 +124,7 @@ ifeq ($(INCLUDE_GRAAL), true)
|
||||
##############################################################################
|
||||
|
||||
$(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_SERVICEPROVIDER_PROCESSOR, \
|
||||
SETUP := GENERATE_OLDBYTECODE, \
|
||||
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
|
||||
SRC := \
|
||||
$(SRC_DIR)/org.graalvm.compiler.processor/src \
|
||||
$(SRC_DIR)/org.graalvm.compiler.serviceprovider.processor/src \
|
||||
@@ -111,6 +132,7 @@ ifeq ($(INCLUDE_GRAAL), true)
|
||||
EXCLUDE_FILES := $(EXCLUDE_FILES), \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.serviceprovider.processor, \
|
||||
JAR := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.serviceprovider.processor.jar, \
|
||||
DISABLED_WARNINGS := options, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_VM_COMPILER_SERVICEPROVIDER_PROCESSOR)
|
||||
|
||||
@@ -28,7 +28,6 @@ default: all
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include JavaCompilation.gmk
|
||||
include SetupJavaCompilers.gmk
|
||||
include TextFileProcessing.gmk
|
||||
|
||||
################################################################################
|
||||
@@ -43,8 +42,8 @@ BUILD_TOOLS_SRC_DIRS += \
|
||||
$(BUILDTOOLS_OUTPUTDIR)/interim_tzdb_classes \
|
||||
#
|
||||
|
||||
$(eval $(call SetupJavaCompilation,BUILD_TOOLS_JDK, \
|
||||
SETUP := GENERATE_OLDBYTECODE, \
|
||||
$(eval $(call SetupJavaCompilation, BUILD_TOOLS_JDK, \
|
||||
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
|
||||
SRC := $(BUILD_TOOLS_SRC_DIRS), \
|
||||
EXCLUDES := \
|
||||
build/tools/classlist \
|
||||
@@ -53,12 +52,11 @@ $(eval $(call SetupJavaCompilation,BUILD_TOOLS_JDK, \
|
||||
build/tools/jigsaw \
|
||||
build/tools/depend \
|
||||
, \
|
||||
DISABLED_WARNINGS := unchecked rawtypes deprecation cast, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes, \
|
||||
ADD_JAVAC_FLAGS := \
|
||||
DISABLED_WARNINGS := options, \
|
||||
JAVAC_FLAGS := \
|
||||
--add-exports java.desktop/sun.awt=ALL-UNNAMED \
|
||||
--add-exports java.base/sun.text=ALL-UNNAMED \
|
||||
, \
|
||||
--add-exports java.base/sun.text=ALL-UNNAMED, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_TOOLS_JDK)
|
||||
@@ -73,10 +71,11 @@ TARGETS += $(COPY_NIMBUS_TEMPLATES)
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupJavaCompilation, COMPILE_DEPEND, \
|
||||
SETUP := GENERATE_OLDBYTECODE, \
|
||||
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
|
||||
SRC := $(TOPDIR)/make/jdk/src/classes, \
|
||||
INCLUDES := build/tools/depend, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/depend, \
|
||||
DISABLED_WARNINGS := options, \
|
||||
))
|
||||
|
||||
DEPEND_SERVICE_PROVIDER := $(BUILDTOOLS_OUTPUTDIR)/depend/META-INF/services/com.sun.source.util.Plugin
|
||||
@@ -104,9 +103,8 @@ ifeq ($(ENABLE_PANDOC), true)
|
||||
SOURCE_FILES := $(TOPDIR)/make/scripts/pandoc-troff-manpage-filter.sh.template, \
|
||||
OUTPUT_FILE := $(PANDOC_TROFF_MANPAGE_FILTER), \
|
||||
REPLACEMENTS := \
|
||||
@@BOOT_JDK@@ => $(BOOT_JDK) ; \
|
||||
@@TOPDIR@@ => $(TOPDIR) ; \
|
||||
@@JJS_FLAGS@@ => $(addprefix -J, $(JAVA_FLAGS_SMALL)), \
|
||||
@@JAVA_SMALL@@ => $(JAVA_SMALL) ; \
|
||||
@@BUILDTOOLS_OUTPUTDIR@@ => $(BUILDTOOLS_OUTPUTDIR) ; \
|
||||
))
|
||||
|
||||
# Created script must be made executable
|
||||
@@ -128,9 +126,8 @@ ifeq ($(ENABLE_PANDOC), true)
|
||||
SOURCE_FILES := $(TOPDIR)/make/scripts/pandoc-html-manpage-filter.sh.template, \
|
||||
OUTPUT_FILE := $(PANDOC_HTML_MANPAGE_FILTER), \
|
||||
REPLACEMENTS := \
|
||||
@@BOOT_JDK@@ => $(BOOT_JDK) ; \
|
||||
@@TOPDIR@@ => $(TOPDIR) ; \
|
||||
@@JJS_FLAGS@@ => $(addprefix -J, $(JAVA_FLAGS_SMALL)), \
|
||||
@@JAVA_SMALL@@ => $(JAVA_SMALL) ; \
|
||||
@@BUILDTOOLS_OUTPUTDIR@@ => $(BUILDTOOLS_OUTPUTDIR) ; \
|
||||
))
|
||||
|
||||
# Created script must be made executable
|
||||
|
||||
@@ -177,6 +177,11 @@ else # not java.base
|
||||
JMOD_FLAGS += --exclude '$(notdir $(MSVCR_DLL))'
|
||||
endif
|
||||
endif
|
||||
ifneq ($(VCRUNTIME_1_DLL), )
|
||||
ifneq ($(wildcard $(LIBS_DIR)/$(notdir $(VCRUNTIME_1_DLL))), )
|
||||
JMOD_FLAGS += --exclude '$(notdir $(VCRUNTIME_1_DLL))'
|
||||
endif
|
||||
endif
|
||||
ifneq ($(MSVCP_DLL), )
|
||||
ifneq ($(wildcard $(LIBS_DIR)/$(notdir $(MSVCP_DLL))), )
|
||||
JMOD_FLAGS += --exclude '$(notdir $(MSVCP_DLL))'
|
||||
|
||||
@@ -63,7 +63,7 @@ MODULES_SOURCE_PATH := $(call PathList, $(call GetModuleSrcPath) )
|
||||
JAVADOC_BASE_URL := https://docs.oracle.com/pls/topic/lookup?ctx=javase$(VERSION_NUMBER)&id=homepage
|
||||
BUG_SUBMIT_URL := https://bugreport.java.com/bugreport/
|
||||
COPYRIGHT_URL := legal/copyright.html
|
||||
LICENSE_URL := https://www.oracle.com/technetwork/java/javase/terms/license/java$(VERSION_NUMBER)speclicense.html
|
||||
LICENSE_URL := https://www.oracle.com/java/javase/terms/license/java$(VERSION_NUMBER)speclicense.html
|
||||
REDISTRIBUTION_URL := https://www.oracle.com/technetwork/java/redist-137594.html
|
||||
|
||||
# In order to get a specific ordering it's necessary to specify the total
|
||||
@@ -610,9 +610,9 @@ ifeq ($(ENABLE_PANDOC), true)
|
||||
# PANDOC_HTML_MANPAGE_FILTER, a wrapper around
|
||||
# PANDOC_HTML_MANPAGE_FILTER_JAVASCRIPT. This is created by buildtools-jdk.
|
||||
|
||||
# We should also depend on the source javascript filter
|
||||
PANDOC_HTML_MANPAGE_FILTER_JAVASCRIPT := \
|
||||
$(TOPDIR)/make/scripts/pandoc-html-manpage-filter.js
|
||||
# We should also depend on the source code for the filter
|
||||
PANDOC_HTML_MANPAGE_FILTER_SOURCE := $(call FindFiles, \
|
||||
$(TOPDIR)/make/jdk/src/classes/build/tools/pandocfilter)
|
||||
|
||||
$(foreach m, $(ALL_MODULES), \
|
||||
$(eval MAN_$m := $(call FindModuleManDirs, $m)) \
|
||||
@@ -632,7 +632,7 @@ ifeq ($(ENABLE_PANDOC), true)
|
||||
OPTIONS := --toc -V include-before='$(SPECS_TOP)' -V include-after='$(SPECS_BOTTOM_1)', \
|
||||
POST_PROCESS := $(TOOL_FIXUPPANDOC), \
|
||||
EXTRA_DEPS := $(PANDOC_HTML_MANPAGE_FILTER) \
|
||||
$(PANDOC_HTML_MANPAGE_FILTER_JAVASCRIPT), \
|
||||
$(PANDOC_HTML_MANPAGE_FILTER_SOURCE), \
|
||||
)) \
|
||||
$(eval JDK_SPECS_TARGETS += $($($m_$f_NAME))) \
|
||||
) \
|
||||
|
||||
@@ -31,14 +31,14 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include SetupJavaCompilers.gmk
|
||||
include JavaCompilation.gmk
|
||||
|
||||
################################################################################
|
||||
# Create a jar with our generator class. Using a jar is intentional since it
|
||||
# will load more classes
|
||||
|
||||
$(eval $(call SetupJavaCompilation, CLASSLIST_JAR, \
|
||||
SETUP := GENERATE_JDKBYTECODE, \
|
||||
SMALL_JAVA := false, \
|
||||
SRC := $(TOPDIR)/make/jdk/src/classes, \
|
||||
INCLUDES := build/tools/classlist, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/classlist_classes, \
|
||||
@@ -69,10 +69,12 @@ $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXE_SUFFIX) $(CLASSLIST_JAR)
|
||||
-Duser.language=en -Duser.country=US \
|
||||
-cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
|
||||
build.tools.classlist.HelloClasslist $(LOG_DEBUG)
|
||||
$(GREP) -v HelloClasslist $@.raw > $(INTERIM_IMAGE_DIR)/lib/classlist
|
||||
$(GREP) -v HelloClasslist $@.raw > $@.interim
|
||||
$(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -Xshare:dump \
|
||||
-XX:SharedClassListFile=$@.interim -XX:SharedArchiveFile=$@.jsa \
|
||||
-Xmx128M -Xms128M $(LOG_INFO)
|
||||
$(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@.raw \
|
||||
$(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@.raw.2 \
|
||||
-XX:SharedClassListFile=$@.interim -XX:SharedArchiveFile=$@.jsa \
|
||||
-Djava.lang.invoke.MethodHandle.TRACE_RESOLVE=true \
|
||||
-Duser.language=en -Duser.country=US \
|
||||
--module-path $(SUPPORT_OUTPUTDIR)/classlist.jar \
|
||||
@@ -86,7 +88,7 @@ $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXE_SUFFIX) $(CLASSLIST_JAR)
|
||||
$(CAT) $(LINK_OPT_DIR)/stderr $(JLI_TRACE_FILE) ; \
|
||||
exit $$exitcode \
|
||||
)
|
||||
$(GREP) -v HelloClasslist $@.raw > $@
|
||||
$(GREP) -v HelloClasslist $@.raw.2 > $@
|
||||
|
||||
# The jli trace is created by the same recipe as classlist. By declaring these
|
||||
# dependencies, make will correctly rebuild both jli trace and classlist
|
||||
|
||||
@@ -101,9 +101,9 @@ help:
|
||||
$(info $(_) # method is 'auto', 'ignore' or 'fail' (default))
|
||||
$(info $(_) TEST="test1 ..." # Use the given test descriptor(s) for testing, e.g.)
|
||||
$(info $(_) # make test TEST="jdk_lang gtest:all")
|
||||
$(info $(_) JTREG="OPT1=x;OPT2=y" # Control the JTREG test harness)
|
||||
$(info $(_) GTEST="OPT1=x;OPT2=y" # Control the GTEST test harness)
|
||||
$(info $(_) MICRO="OPT1=x;OPT2=y" # Control the MICRO test harness)
|
||||
$(info $(_) JTREG="OPT1=x;OPT2=y" # Control the JTREG test harness, use 'help' to list)
|
||||
$(info $(_) GTEST="OPT1=x;OPT2=y" # Control the GTEST test harness, use 'help' to list)
|
||||
$(info $(_) MICRO="OPT1=x;OPT2=y" # Control the MICRO test harness, use 'help' to list)
|
||||
$(info $(_) TEST_OPTS="OPT1=x;..." # Generic control of all test harnesses)
|
||||
$(info $(_) TEST_VM_OPTS="ARG ..." # Same as setting TEST_OPTS to VM_OPTIONS="ARG ...")
|
||||
$(info )
|
||||
|
||||
@@ -85,6 +85,8 @@ ifeq ($(JLINK_KEEP_PACKAGED_MODULES), true)
|
||||
JLINK_JDK_EXTRA_OPTS := --keep-packaged-modules $(JDK_IMAGE_DIR)/jmods
|
||||
endif
|
||||
|
||||
JLINK_DISABLE_WARNINGS := | ( $(GREP) -v -e "WARNING: Using incubator module" || test "$$?" = "1" )
|
||||
|
||||
$(eval $(call SetupExecute, jlink_jdk, \
|
||||
WARN := Creating jdk image, \
|
||||
DEPS := $(JMODS) $(BASE_RELEASE_FILE) \
|
||||
@@ -93,7 +95,8 @@ $(eval $(call SetupExecute, jlink_jdk, \
|
||||
SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jdk, \
|
||||
PRE_COMMAND := $(RM) -r $(JDK_IMAGE_DIR), \
|
||||
COMMAND := $(JLINK_TOOL) --add-modules $(JDK_MODULES_LIST) \
|
||||
$(JLINK_JDK_EXTRA_OPTS) --output $(JDK_IMAGE_DIR), \
|
||||
$(JLINK_JDK_EXTRA_OPTS) --output $(JDK_IMAGE_DIR) \
|
||||
$(JLINK_DISABLE_WARNINGS), \
|
||||
))
|
||||
|
||||
JLINK_JDK_TARGETS := $(jlink_jdk)
|
||||
@@ -114,8 +117,10 @@ JLINK_JRE_TARGETS := $(jlink_jre)
|
||||
ifeq ($(BUILD_CDS_ARCHIVE), true)
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
CDS_ARCHIVE := bin/server/classes.jsa
|
||||
CDS_NOCOOPS_ARCHIVE := bin/server/classes_nocoops.jsa
|
||||
else
|
||||
CDS_ARCHIVE := lib/server/classes.jsa
|
||||
CDS_NOCOOPS_ARCHIVE := lib/server/classes_nocoops.jsa
|
||||
endif
|
||||
|
||||
$(eval $(call SetupExecute, gen_cds_archive_jdk, \
|
||||
@@ -124,6 +129,7 @@ ifeq ($(BUILD_CDS_ARCHIVE), true)
|
||||
OUTPUT_FILE := $(JDK_IMAGE_DIR)/$(CDS_ARCHIVE), \
|
||||
SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jdk, \
|
||||
COMMAND := $(FIXPATH) $(JDK_IMAGE_DIR)/bin/java -Xshare:dump \
|
||||
-XX:SharedArchiveFile=$(JDK_IMAGE_DIR)/$(CDS_ARCHIVE) \
|
||||
-Xmx128M -Xms128M $(LOG_INFO), \
|
||||
))
|
||||
|
||||
@@ -135,10 +141,40 @@ ifeq ($(BUILD_CDS_ARCHIVE), true)
|
||||
OUTPUT_FILE := $(JRE_IMAGE_DIR)/$(CDS_ARCHIVE), \
|
||||
SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jre, \
|
||||
COMMAND := $(FIXPATH) $(JRE_IMAGE_DIR)/bin/java -Xshare:dump \
|
||||
-XX:SharedArchiveFile=$(JRE_IMAGE_DIR)/$(CDS_ARCHIVE) \
|
||||
-Xmx128M -Xms128M $(LOG_INFO), \
|
||||
))
|
||||
|
||||
JRE_TARGETS += $(gen_cds_archive_jre)
|
||||
|
||||
ifeq ($(call isTargetCpuBits, 64), true)
|
||||
$(eval $(call SetupExecute, gen_cds_nocoops_archive_jdk, \
|
||||
WARN := Creating CDS-NOCOOPS archive for jdk image, \
|
||||
DEPS := $(jlink_jdk), \
|
||||
OUTPUT_FILE := $(JDK_IMAGE_DIR)/$(CDS_NOCOOPS_ARCHIVE), \
|
||||
SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jdk, \
|
||||
COMMAND := $(FIXPATH) $(JDK_IMAGE_DIR)/bin/java -Xshare:dump \
|
||||
-XX:SharedArchiveFile=$(JDK_IMAGE_DIR)/$(CDS_NOCOOPS_ARCHIVE) \
|
||||
-XX:-UseCompressedOops \
|
||||
-Xmx128M -Xms128M $(LOG_INFO), \
|
||||
))
|
||||
|
||||
JDK_TARGETS += $(gen_cds_nocoops_archive_jdk)
|
||||
|
||||
$(eval $(call SetupExecute, gen_cds_nocoops_archive_jre, \
|
||||
WARN := Creating CDS-NOCOOPS archive for jre image, \
|
||||
DEPS := $(jlink_jre), \
|
||||
OUTPUT_FILE := $(JRE_IMAGE_DIR)/$(CDS_NOCOOPS_ARCHIVE), \
|
||||
SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jre, \
|
||||
COMMAND := $(FIXPATH) $(JRE_IMAGE_DIR)/bin/java -Xshare:dump \
|
||||
-XX:SharedArchiveFile=$(JRE_IMAGE_DIR)/$(CDS_NOCOOPS_ARCHIVE) \
|
||||
-XX:-UseCompressedOops \
|
||||
-Xmx128M -Xms128M $(LOG_INFO), \
|
||||
))
|
||||
|
||||
JRE_TARGETS += $(gen_cds_nocoops_archive_jre)
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -197,7 +197,7 @@ ifeq ($(HAS_SPEC),)
|
||||
COMPARE_BUILD="$(COMPARE_BUILD)" pre-compare-build && \
|
||||
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -j 1 -f $(topdir)/make/Init.gmk \
|
||||
SPEC=$(spec) HAS_SPEC=true $(MAKE_INIT_WITH_SPEC_ARGUMENTS) \
|
||||
COMPARE_BUILD="$(COMPARE_BUILD)" main && \
|
||||
COMPARE_BUILD="$(COMPARE_BUILD):NODRYRUN=true" main && \
|
||||
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -f $(topdir)/make/Init.gmk \
|
||||
SPEC=$(spec) HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) \
|
||||
COMPARE_BUILD="$(COMPARE_BUILD)" post-compare-build && \
|
||||
@@ -226,6 +226,9 @@ else # HAS_SPEC=true
|
||||
# Parse COMPARE_BUILD (for makefile development)
|
||||
$(eval $(call ParseCompareBuild))
|
||||
|
||||
# Setup reproducible build environment
|
||||
$(eval $(call SetupReproducibleBuild))
|
||||
|
||||
# If no LOG= was given on command line, but we have a non-standard default
|
||||
# value, use that instead and re-parse log level.
|
||||
ifeq ($(LOG), )
|
||||
|
||||
@@ -306,6 +306,15 @@ else # $(HAS_SPEC)=true
|
||||
topdir=$(TOPDIR)
|
||||
endif
|
||||
|
||||
# Setup the build environment to match the requested specification on
|
||||
# level of reproducible builds
|
||||
define SetupReproducibleBuild
|
||||
ifeq ($$(SOURCE_DATE), updated)
|
||||
SOURCE_DATE := $$(shell $$(DATE) +"%s")
|
||||
endif
|
||||
export SOURCE_DATE_EPOCH := $$(SOURCE_DATE)
|
||||
endef
|
||||
|
||||
# Parse COMPARE_BUILD into COMPARE_BUILD_*
|
||||
# Syntax: COMPARE_BUILD=CONF=<configure options>:PATCH=<patch file>:
|
||||
# MAKE=<make targets>:COMP_OPTS=<compare script options>:
|
||||
@@ -341,6 +350,9 @@ else # $(HAS_SPEC)=true
|
||||
$$(if $$(filter FAIL=%, $$(part)), \
|
||||
$$(eval COMPARE_BUILD_FAIL=$$(strip $$(subst +, , $$(patsubst FAIL=%, %, $$(part))))) \
|
||||
) \
|
||||
$$(if $$(filter NODRYRUN=%, $$(part)), \
|
||||
$$(eval COMPARE_BUILD_NODRYRUN=$$(strip $$(subst +, , $$(patsubst NODRYRUN=%, %, $$(part))))) \
|
||||
) \
|
||||
)
|
||||
else
|
||||
# Separate handling for single field case, to allow for spaces in values.
|
||||
@@ -363,6 +375,12 @@ else # $(HAS_SPEC)=true
|
||||
else ifeq ($$(wildcard $$(COMPARE_BUILD_PATCH)), )
|
||||
$$(error Patch file $$(COMPARE_BUILD_PATCH) does not exist)
|
||||
endif
|
||||
ifneq ($$(COMPARE_BUILD_NODRYRUN), true)
|
||||
PATCH_DRY_RUN := $$(shell cd $$(topdir) && $$(PATCH) --dry-run -p1 < $$(COMPARE_BUILD_PATCH) > /dev/null 2>&1 || $$(ECHO) FAILED)
|
||||
ifeq ($$(PATCH_DRY_RUN), FAILED)
|
||||
$$(error Patch file $$(COMPARE_BUILD_PATCH) does not apply cleanly)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
ifneq ($$(COMPARE_BUILD_FAIL), true)
|
||||
COMPARE_BUILD_IGNORE_RESULT := || true
|
||||
@@ -471,15 +489,15 @@ else # $(HAS_SPEC)=true
|
||||
# Remove any javac server logs and port files. This
|
||||
# prevents a new make run to reuse the previous servers.
|
||||
define PrepareSmartJavac
|
||||
$(if $(SJAVAC_SERVER_DIR), \
|
||||
$(RM) -r $(SJAVAC_SERVER_DIR) 2> /dev/null && \
|
||||
$(MKDIR) -p $(SJAVAC_SERVER_DIR) \
|
||||
$(if $(JAVAC_SERVER_DIR), \
|
||||
$(RM) -r $(JAVAC_SERVER_DIR) 2> /dev/null && \
|
||||
$(MKDIR) -p $(JAVAC_SERVER_DIR) \
|
||||
)
|
||||
endef
|
||||
|
||||
define CleanupSmartJavac
|
||||
[ -f $(SJAVAC_SERVER_DIR)/server.port ] && $(ECHO) Stopping sjavac server && \
|
||||
$(TOUCH) $(SJAVAC_SERVER_DIR)/server.port.stop; true
|
||||
[ -f $(JAVAC_SERVER_DIR)/server.port ] && $(ECHO) Stopping sjavac server && \
|
||||
$(TOUCH) $(JAVAC_SERVER_DIR)/server.port.stop; true
|
||||
endef
|
||||
|
||||
ifeq ($(call isBuildOs, windows), true)
|
||||
@@ -488,7 +506,7 @@ else # $(HAS_SPEC)=true
|
||||
# synchronization process, wait for a while and hope it helps. This is only
|
||||
# used by build comparisons.
|
||||
define WaitForSmartJavacFinish
|
||||
$(if $(SJAVAC_SERVER_DIR), \
|
||||
$(if $(JAVAC_SERVER_DIR), \
|
||||
sleep 5\
|
||||
)
|
||||
endef
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 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
|
||||
@@ -27,8 +27,8 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include JavaCompilation.gmk
|
||||
include JarArchive.gmk
|
||||
include SetupJavaCompilers.gmk
|
||||
include TextFileProcessing.gmk
|
||||
|
||||
# This rule will be depended on due to the MANIFEST line
|
||||
@@ -47,11 +47,13 @@ JIMAGE_PKGS := \
|
||||
#
|
||||
|
||||
$(eval $(call SetupJavaCompilation, BUILD_JRTFS, \
|
||||
SETUP := GENERATE_8_BYTECODE, \
|
||||
COMPILER := bootjdk, \
|
||||
TARGET_RELEASE := $(TARGET_RELEASE_JDK8), \
|
||||
SRC := $(TOPDIR)/src/java.base/share/classes, \
|
||||
EXCLUDE_FILES := module-info.java, \
|
||||
INCLUDES := $(JIMAGE_PKGS), \
|
||||
BIN := $(SUPPORT_OUTPUTDIR)/jrtfs_classes))
|
||||
BIN := $(SUPPORT_OUTPUTDIR)/jrtfs_classes, \
|
||||
))
|
||||
|
||||
# Because of the explicit INCLUDES in the compilation setup above, the service provider
|
||||
# file will not be copied unless META-INF/services would also be added to the INCLUDES.
|
||||
@@ -62,7 +64,7 @@ $(eval $(call SetupCopyFiles, COPY_JIMAGE_SERVICE_PROVIDER, \
|
||||
DEST := $(SUPPORT_OUTPUTDIR)/jrtfs_classes, \
|
||||
FILES := META-INF/services/java.nio.file.spi.FileSystemProvider))
|
||||
|
||||
$(eval $(call SetupJarArchive,BUILD_JRTFS_JAR, \
|
||||
$(eval $(call SetupJarArchive, BUILD_JRTFS_JAR, \
|
||||
DEPENDENCIES := $(BUILD_JRTFS) $(COPY_JIMAGE_SERVICE_PROVIDER), \
|
||||
SRCS := $(SUPPORT_OUTPUTDIR)/jrtfs_classes, \
|
||||
JAR := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/jrt-fs.jar, \
|
||||
|
||||
711
make/Main.gmk
711
make/Main.gmk
@@ -38,13 +38,18 @@ endif
|
||||
# Now load the spec
|
||||
include $(SPEC)
|
||||
|
||||
include $(TOPDIR)/make/MainSupport.gmk
|
||||
|
||||
# Load the vital tools for all the makefiles.
|
||||
include $(TOPDIR)/make/common/MakeBase.gmk
|
||||
include $(TOPDIR)/make/common/Modules.gmk
|
||||
include $(TOPDIR)/make/common/FindTests.gmk
|
||||
|
||||
include $(TOPDIR)/make/MainSupport.gmk
|
||||
|
||||
# Are we requested to ignore dependencies?
|
||||
ifneq ($(findstring -only, $(MAKECMDGOALS)), )
|
||||
DEPS := none
|
||||
endif
|
||||
|
||||
# Declare ALL_TARGETS as an immediate variable. This variable is a list of all
|
||||
# valid top level targets. It's used to declare them all as PHONY and to
|
||||
# generate the -only targets.
|
||||
@@ -66,36 +71,40 @@ ALL_MODULES := $(call FindAllModules)
|
||||
################################################################################
|
||||
# Interim/build tools targets, compiling tools used during the build
|
||||
|
||||
buildtools-langtools:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ToolsLangtools.gmk)
|
||||
$(eval $(call SetupTarget, buildtools-langtools, \
|
||||
MAKEFILE := ToolsLangtools, \
|
||||
))
|
||||
|
||||
interim-langtools:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterimLangtools.gmk)
|
||||
$(eval $(call SetupTarget, interim-langtools, \
|
||||
MAKEFILE := CompileInterimLangtools, \
|
||||
))
|
||||
|
||||
interim-tzdb:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopyInterimTZDB.gmk)
|
||||
$(eval $(call SetupTarget, interim-tzdb, \
|
||||
MAKEFILE := CopyInterimTZDB, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, buildtools-jdk, \
|
||||
MAKEFILE := CompileToolsJdk, \
|
||||
DEPS := interim-langtools interim-tzdb, \
|
||||
))
|
||||
|
||||
buildtools-jdk:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileToolsJdk.gmk)
|
||||
$(eval $(call SetupTarget, buildtools-modules, \
|
||||
MAKEFILE := CompileModuleTools, \
|
||||
DEPS := exploded-image-base, \
|
||||
))
|
||||
|
||||
buildtools-modules:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileModuleTools.gmk)
|
||||
|
||||
buildtools-hotspot:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileToolsHotspot.gmk)
|
||||
|
||||
ALL_TARGETS += buildtools-langtools interim-langtools \
|
||||
interim-tzdb buildtools-jdk buildtools-modules \
|
||||
buildtools-hotspot
|
||||
$(eval $(call SetupTarget, buildtools-hotspot, \
|
||||
MAKEFILE := CompileToolsHotspot, \
|
||||
DEPS := interim-langtools, \
|
||||
))
|
||||
|
||||
################################################################################
|
||||
# Special targets for certain modules
|
||||
|
||||
generate-exported-symbols:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildStatic.gmk)
|
||||
|
||||
ALL_TARGETS += generate-exported-symbols
|
||||
$(eval $(call SetupTarget, generate-exported-symbols, \
|
||||
MAKEFILE := BuildStatic, \
|
||||
DEPS := java.base-libs jdk.jdwp.agent-libs, \
|
||||
))
|
||||
|
||||
################################################################################
|
||||
# Gensrc targets, generating source before java compilation can be done
|
||||
@@ -127,7 +136,7 @@ GENSRC_TARGETS += $(sort $(GENSRC_MODULEINFO_TARGETS) \
|
||||
define DeclareModuleInfoRecipe
|
||||
$1-gensrc-moduleinfo:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) \
|
||||
-f gensrc/GensrcModuleInfo.gmk MODULE=$1)
|
||||
-f common/modules/GensrcModuleInfo.gmk MODULE=$1)
|
||||
|
||||
$1-gensrc: $1-gensrc-moduleinfo
|
||||
endef
|
||||
@@ -143,7 +152,7 @@ $(eval $(call DeclareRecipesForPhase, GENDATA, \
|
||||
FILE_PREFIX := Gendata, \
|
||||
MAKE_SUBDIR := gendata, \
|
||||
CHECK_MODULES := $(ALL_MODULES), \
|
||||
USE_WRAPPER := true))
|
||||
))
|
||||
|
||||
ALL_TARGETS += $(GENDATA_TARGETS)
|
||||
|
||||
@@ -154,7 +163,6 @@ $(eval $(call DeclareRecipesForPhase, COPY, \
|
||||
FILE_PREFIX := Copy, \
|
||||
MAKE_SUBDIR := copy, \
|
||||
CHECK_MODULES := $(ALL_MODULES), \
|
||||
USE_WRAPPER := true, \
|
||||
))
|
||||
|
||||
ALL_COPY_MODULES += $(COPY_MODULES)
|
||||
@@ -197,7 +205,7 @@ $(eval $(call DeclareRecipesForPhase, LIBS, \
|
||||
FILE_PREFIX := Lib, \
|
||||
MAKE_SUBDIR := lib, \
|
||||
CHECK_MODULES := $(ALL_MODULES), \
|
||||
USE_WRAPPER := true))
|
||||
))
|
||||
|
||||
ALL_TARGETS += $(LIBS_TARGETS)
|
||||
|
||||
@@ -209,8 +217,7 @@ $(eval $(call DeclareRecipesForPhase, STATIC_LIBS, \
|
||||
TARGET_SUFFIX := static-libs, \
|
||||
FILE_PREFIX := Lib, \
|
||||
MAKE_SUBDIR := lib, \
|
||||
CHECK_MODULES := $(STATIC_LIBS_MODULES), \
|
||||
USE_WRAPPER := true, \
|
||||
CHECK_MODULES := $(ALL_MODULES), \
|
||||
EXTRA_ARGS := STATIC_LIBS=true, \
|
||||
))
|
||||
|
||||
@@ -223,7 +230,7 @@ $(eval $(call DeclareRecipesForPhase, LAUNCHER, \
|
||||
FILE_PREFIX := Launcher, \
|
||||
MAKE_SUBDIR := launcher, \
|
||||
CHECK_MODULES := $(ALL_MODULES), \
|
||||
USE_WRAPPER := true))
|
||||
))
|
||||
|
||||
ALL_TARGETS += $(LAUNCHER_TARGETS)
|
||||
|
||||
@@ -251,11 +258,14 @@ endef
|
||||
|
||||
$(foreach v, $(JVM_VARIANTS), $(eval $(call DeclareHotspotLibsRecipe,$v)))
|
||||
|
||||
hotspot-ide-project:
|
||||
+($(CD) $(TOPDIR)/make/hotspot && $(MAKE) $(MAKE_ARGS) -f ide/CreateVSProject.gmk)
|
||||
$(eval $(call SetupTarget, hotspot-ide-project, \
|
||||
MAKEFILE := ide/visualstudio/hotspot/CreateVSProject, \
|
||||
DEPS := hotspot exploded-image, \
|
||||
ARGS := -I$(TOPDIR)/make/hotspot, \
|
||||
))
|
||||
|
||||
ALL_TARGETS += $(HOTSPOT_VARIANT_TARGETS) $(HOTSPOT_VARIANT_GENSRC_TARGETS) \
|
||||
$(HOTSPOT_VARIANT_LIBS_TARGETS) hotspot-ide-project
|
||||
$(HOTSPOT_VARIANT_LIBS_TARGETS)
|
||||
|
||||
################################################################################
|
||||
# Generate libs and launcher targets for creating compile_commands.json fragments
|
||||
@@ -276,51 +286,67 @@ $(foreach t, $(LIBS_TARGETS) $(LAUNCHER_TARGETS), \
|
||||
$(eval $(call DeclareCompileCommandsRecipe,$t,JDK)) \
|
||||
)
|
||||
|
||||
compile-commands compile-commands-hotspot:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileCommands.gmk)
|
||||
$(eval $(call SetupTarget, compile-commands, \
|
||||
MAKEFILE := CompileCommands, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, compile-commands-hotspot, \
|
||||
MAKEFILE := CompileCommands, \
|
||||
))
|
||||
|
||||
ALL_TARGETS += $(COMPILE_COMMANDS_TARGETS_HOTSPOT) $(COMPILE_COMMANDS_TARGETS_JDK)
|
||||
ALL_TARGETS += compile-commands compile-commands-hotspot
|
||||
|
||||
################################################################################
|
||||
# VS Code projects
|
||||
vscode-project:
|
||||
+($(CD) $(TOPDIR)/make/vscode && $(MAKE) $(MAKE_ARGS) -f CreateVSCodeProject.gmk \
|
||||
VSCODE_INDEXER=cpptools)
|
||||
|
||||
vscode-project-clangd:
|
||||
+($(CD) $(TOPDIR)/make/vscode && $(MAKE) $(MAKE_ARGS) -f CreateVSCodeProject.gmk \
|
||||
VSCODE_INDEXER=clangd)
|
||||
$(eval $(call SetupTarget, vscode-project, \
|
||||
MAKEFILE := ide/vscode/hotspot/CreateVSCodeProject, \
|
||||
ARGS := VSCODE_INDEXER=cpptools, \
|
||||
DEPS := compile-commands, \
|
||||
))
|
||||
|
||||
vscode-project-rtags:
|
||||
+($(CD) $(TOPDIR)/make/vscode && $(MAKE) $(MAKE_ARGS) -f CreateVSCodeProject.gmk \
|
||||
VSCODE_INDEXER=rtags)
|
||||
$(eval $(call SetupTarget, vscode-project-clangd, \
|
||||
MAKEFILE := ide/vscode/hotspot/CreateVSCodeProject, \
|
||||
ARGS := VSCODE_INDEXER=clangd, \
|
||||
DEPS := compile-commands, \
|
||||
))
|
||||
|
||||
vscode-project-ccls:
|
||||
+($(CD) $(TOPDIR)/make/vscode && $(MAKE) $(MAKE_ARGS) -f CreateVSCodeProject.gmk \
|
||||
VSCODE_INDEXER=ccls)
|
||||
$(eval $(call SetupTarget, vscode-project-rtags, \
|
||||
MAKEFILE := ide/vscode/hotspot/CreateVSCodeProject, \
|
||||
ARGS := VSCODE_INDEXER=rtags, \
|
||||
DEPS := compile-commands, \
|
||||
))
|
||||
|
||||
ALL_TARGETS += vscode-project vscode-project-clangd vscode-project-rtags \
|
||||
vscode-project-ccls
|
||||
$(eval $(call SetupTarget, vscode-project-ccls, \
|
||||
MAKEFILE := ide/vscode/hotspot/CreateVSCodeProject, \
|
||||
ARGS := VSCODE_INDEXER=ccls, \
|
||||
DEPS := compile-commands, \
|
||||
))
|
||||
|
||||
################################################################################
|
||||
# Build demos targets
|
||||
|
||||
demos-jdk:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileDemos.gmk)
|
||||
# The demos are currently linking to libjvm and libjava, just like all other
|
||||
# jdk libs, even though they don't need to. To avoid warnings, make sure they
|
||||
# aren't built until after libjava and libjvm are available to link to.
|
||||
$(eval $(call SetupTarget, demos-jdk, \
|
||||
MAKEFILE := CompileDemos, \
|
||||
DEPS := java.base-libs exploded-image, \
|
||||
))
|
||||
|
||||
test-image-demos-jdk:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileDemos.gmk images)
|
||||
|
||||
ALL_TARGETS += demos-jdk test-image-demos-jdk
|
||||
$(eval $(call SetupTarget, test-image-demos-jdk, \
|
||||
MAKEFILE := CompileDemos, \
|
||||
TARGET := images, \
|
||||
DEPS := demos-jdk, \
|
||||
))
|
||||
|
||||
################################################################################
|
||||
# Jigsaw specific data and analysis targets.
|
||||
|
||||
generate-summary:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f GenerateModuleSummary.gmk)
|
||||
|
||||
ALL_TARGETS += generate-summary
|
||||
$(eval $(call SetupTarget, generate-summary, \
|
||||
MAKEFILE := GenerateModuleSummary, \
|
||||
DEPS := jmods buildtools-modules, \
|
||||
))
|
||||
|
||||
################################################################################
|
||||
# Jmod targets
|
||||
@@ -341,11 +367,15 @@ ALL_TARGETS += $(JMOD_TARGETS)
|
||||
################################################################################
|
||||
# Images targets
|
||||
|
||||
store-source-revision:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f SourceRevision.gmk store-source-revision)
|
||||
$(eval $(call SetupTarget, store-source-revision, \
|
||||
MAKEFILE := SourceRevision, \
|
||||
TARGET := store-source-revision, \
|
||||
))
|
||||
|
||||
create-source-revision-tracker:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f SourceRevision.gmk create-source-revision-tracker)
|
||||
$(eval $(call SetupTarget, create-source-revision-tracker, \
|
||||
MAKEFILE := SourceRevision, \
|
||||
TARGET := create-source-revision-tracker, \
|
||||
))
|
||||
|
||||
BOOTCYCLE_TARGET := product-images
|
||||
bootcycle-images:
|
||||
@@ -358,97 +388,150 @@ bootcycle-images:
|
||||
$(call LogWarn, Boot cycle build disabled when cross compiling)
|
||||
endif
|
||||
|
||||
zip-security:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ZipSecurity.gmk)
|
||||
$(eval $(call SetupTarget, zip-security, \
|
||||
MAKEFILE := ZipSecurity, \
|
||||
DEPS := java.base-java java.security.jgss-java java.security.jgss-libs, \
|
||||
))
|
||||
|
||||
zip-source:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ZipSource.gmk)
|
||||
$(eval $(call SetupTarget, zip-source, \
|
||||
MAKEFILE := ZipSource, \
|
||||
DEPS := gensrc, \
|
||||
))
|
||||
|
||||
jrtfs-jar:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f JrtfsJar.gmk)
|
||||
$(eval $(call SetupTarget, jrtfs-jar, \
|
||||
MAKEFILE := JrtfsJar, \
|
||||
DEPS := interim-langtools, \
|
||||
))
|
||||
|
||||
jdk-image:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk jdk)
|
||||
$(eval $(call SetupTarget, jdk-image, \
|
||||
MAKEFILE := Images, \
|
||||
TARGET := jdk, \
|
||||
DEPS := jmods zip-source demos release-file, \
|
||||
))
|
||||
|
||||
legacy-jre-image:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk jre)
|
||||
$(eval $(call SetupTarget, legacy-jre-image, \
|
||||
MAKEFILE := Images, \
|
||||
TARGET := jre, \
|
||||
DEPS := jmods release-file, \
|
||||
))
|
||||
|
||||
symbols-image:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk symbols)
|
||||
$(eval $(call SetupTarget, symbols-image, \
|
||||
MAKEFILE := Images, \
|
||||
TARGET := symbols, \
|
||||
))
|
||||
|
||||
static-libs-image:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f StaticLibsImage.gmk)
|
||||
$(eval $(call SetupTarget, static-libs-image, \
|
||||
MAKEFILE := StaticLibsImage, \
|
||||
))
|
||||
|
||||
mac-jdk-bundle:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f MacBundles.gmk jdk-bundle)
|
||||
$(eval $(call SetupTarget, mac-jdk-bundle, \
|
||||
MAKEFILE := MacBundles, \
|
||||
TARGET := jdk-bundle, \
|
||||
DEPS := jdk-image, \
|
||||
))
|
||||
|
||||
mac-legacy-jre-bundle:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f MacBundles.gmk jre-bundle)
|
||||
$(eval $(call SetupTarget, mac-legacy-jre-bundle, \
|
||||
MAKEFILE := MacBundles, \
|
||||
TARGET := jre-bundle, \
|
||||
DEPS := legacy-jre-image, \
|
||||
))
|
||||
|
||||
release-file:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ReleaseFile.gmk)
|
||||
$(eval $(call SetupTarget, release-file, \
|
||||
MAKEFILE := ReleaseFile, \
|
||||
DEPS := create-source-revision-tracker, \
|
||||
))
|
||||
|
||||
exploded-image-optimize:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ExplodedImageOptimize.gmk)
|
||||
$(eval $(call SetupTarget, exploded-image-optimize, \
|
||||
MAKEFILE := ExplodedImageOptimize, \
|
||||
DEPS := java copy gendata java.base-libs java.base-launchers \
|
||||
buildtools-modules, \
|
||||
))
|
||||
|
||||
graal-builder-image:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f GraalBuilderImage.gmk)
|
||||
$(eval $(call SetupTarget, graal-builder-image, \
|
||||
MAKEFILE := GraalBuilderImage, \
|
||||
DEPS := jdk-image static-libs-image, \
|
||||
))
|
||||
|
||||
ifeq ($(JCOV_ENABLED), true)
|
||||
jcov-image:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Coverage.gmk jcov-image)
|
||||
$(eval $(call SetupTarget, jcov-image, \
|
||||
MAKEFILE := Coverage, \
|
||||
TARGET := jcov-image, \
|
||||
DEPS := jdk-image, \
|
||||
))
|
||||
endif
|
||||
|
||||
ALL_TARGETS += store-source-revision create-source-revision-tracker bootcycle-images zip-security \
|
||||
zip-source jrtfs-jar jdk-image legacy-jre-image \
|
||||
symbols-image static-libs-image mac-jdk-bundle mac-legacy-jre-bundle \
|
||||
release-file exploded-image-optimize graal-builder-image jcov-image
|
||||
ALL_TARGETS += bootcycle-images
|
||||
|
||||
################################################################################
|
||||
# Docs targets
|
||||
|
||||
# If building full docs, to complete docs-*-api we need both the javadoc and
|
||||
# modulegraph targets.
|
||||
docs-jdk-api-javadoc:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-jdk-api-javadoc)
|
||||
$(eval $(call SetupTarget, docs-jdk-api-javadoc, \
|
||||
MAKEFILE := Docs, \
|
||||
TARGET := docs-jdk-api-javadoc, \
|
||||
))
|
||||
|
||||
docs-jdk-api-modulegraph:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-jdk-api-modulegraph)
|
||||
$(eval $(call SetupTarget, docs-jdk-api-modulegraph, \
|
||||
MAKEFILE := Docs, \
|
||||
TARGET := docs-jdk-api-modulegraph, \
|
||||
DEPS := exploded-image buildtools-modules, \
|
||||
))
|
||||
|
||||
docs-javase-api-javadoc:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-javase-api-javadoc)
|
||||
$(eval $(call SetupTarget, docs-javase-api-javadoc, \
|
||||
MAKEFILE := Docs, \
|
||||
TARGET := docs-javase-api-javadoc, \
|
||||
))
|
||||
|
||||
docs-javase-api-modulegraph:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-javase-api-modulegraph)
|
||||
$(eval $(call SetupTarget, docs-javase-api-modulegraph, \
|
||||
MAKEFILE := Docs, \
|
||||
TARGET := docs-javase-api-modulegraph, \
|
||||
DEPS := exploded-image buildtools-modules, \
|
||||
))
|
||||
|
||||
docs-reference-api-javadoc:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-reference-api-javadoc)
|
||||
$(eval $(call SetupTarget, docs-reference-api-javadoc, \
|
||||
MAKEFILE := Docs, \
|
||||
TARGET := docs-reference-api-javadoc, \
|
||||
))
|
||||
|
||||
docs-reference-api-modulegraph:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-reference-api-modulegraph)
|
||||
$(eval $(call SetupTarget, docs-reference-api-modulegraph, \
|
||||
MAKEFILE := Docs, \
|
||||
TARGET := docs-reference-api-modulegraph, \
|
||||
DEPS := exploded-image buildtools-modules, \
|
||||
))
|
||||
|
||||
docs-jdk-specs:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-jdk-specs)
|
||||
# The gensrc steps for jdk.jdi create html spec files.
|
||||
$(eval $(call SetupTarget, docs-jdk-specs, \
|
||||
MAKEFILE := Docs, \
|
||||
TARGET := docs-jdk-specs, \
|
||||
DEPS := buildtools-jdk jdk.jdi-gensrc docs-jdk-index, \
|
||||
))
|
||||
|
||||
docs-jdk-index:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-jdk-index)
|
||||
$(eval $(call SetupTarget, docs-jdk-index, \
|
||||
MAKEFILE := Docs, \
|
||||
TARGET := docs-jdk-index, \
|
||||
))
|
||||
|
||||
docs-zip:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-zip)
|
||||
$(eval $(call SetupTarget, docs-zip, \
|
||||
MAKEFILE := Docs, \
|
||||
TARGET := docs-zip, \
|
||||
DEPS := docs-jdk, \
|
||||
))
|
||||
|
||||
docs-specs-zip:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-specs-zip)
|
||||
$(eval $(call SetupTarget, docs-specs-zip, \
|
||||
MAKEFILE := Docs, \
|
||||
TARGET := docs-specs-zip, \
|
||||
DEPS := docs-jdk-specs, \
|
||||
))
|
||||
|
||||
update-build-docs:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f UpdateBuildDocs.gmk)
|
||||
$(eval $(call SetupTarget, update-build-docs, \
|
||||
MAKEFILE := UpdateBuildDocs, \
|
||||
))
|
||||
|
||||
update-x11wrappers:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f UpdateX11Wrappers.gmk)
|
||||
|
||||
ALL_TARGETS += docs-jdk-api-javadoc docs-jdk-api-modulegraph \
|
||||
docs-javase-api-javadoc docs-javase-api-modulegraph \
|
||||
docs-reference-api-javadoc docs-reference-api-modulegraph docs-jdk-specs \
|
||||
docs-jdk-index docs-zip docs-specs-zip update-build-docs update-x11wrappers
|
||||
$(eval $(call SetupTarget, update-x11wrappers, \
|
||||
MAKEFILE := UpdateX11Wrappers, \
|
||||
DEPS := java.base-copy buildtools-jdk, \
|
||||
))
|
||||
|
||||
################################################################################
|
||||
# Cross compilation support
|
||||
@@ -462,17 +545,15 @@ endif
|
||||
BUILDJDK_MODULES := $(sort $(foreach m, jdk.jlink $(INTERIM_IMAGE_MODULES), \
|
||||
$(call FindTransitiveDepsForModule, $m) $m))
|
||||
|
||||
create-buildjdk-interim-image:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Main.gmk \
|
||||
$@-helper \
|
||||
SPEC=$(dir $(SPEC))buildjdk-spec.gmk \
|
||||
HOTSPOT_SPEC=$(dir $(SPEC))buildjdk-spec.gmk \
|
||||
CREATING_BUILDJDK=true \
|
||||
LOG_PREFIX="[buildjdk] " \
|
||||
JAVA_MODULES="$(BUILDJDK_MODULES)" \
|
||||
)
|
||||
|
||||
ALL_TARGETS += create-buildjdk-copy create-buildjdk-interim-image
|
||||
$(eval $(call SetupTarget, create-buildjdk-interim-image, \
|
||||
MAKEFILE := Main, \
|
||||
TARGET := create-buildjdk-interim-image-helper, \
|
||||
ARGS := SPEC=$(dir $(SPEC))buildjdk-spec.gmk \
|
||||
HOTSPOT_SPEC=$(dir $(SPEC))buildjdk-spec.gmk \
|
||||
CREATING_BUILDJDK=true \
|
||||
LOG_PREFIX="[buildjdk] " \
|
||||
JAVA_MODULES="$(BUILDJDK_MODULES)", \
|
||||
))
|
||||
|
||||
################################################################################
|
||||
# The interim-image is a small jlinked image that is used to generate artifacts
|
||||
@@ -492,16 +573,16 @@ endef
|
||||
|
||||
$(foreach m, $(INTERIM_IMAGE_MODULES), $(eval $(call DeclareInterimJmodRecipe,$m)))
|
||||
|
||||
interim-image:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f InterimImage.gmk)
|
||||
$(eval $(call SetupTarget, interim-image, \
|
||||
MAKEFILE := InterimImage, \
|
||||
))
|
||||
|
||||
ifeq ($(ENABLE_GENERATE_CLASSLIST), true)
|
||||
generate-link-opt-data:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f GenerateLinkOptData.gmk)
|
||||
$(eval $(call SetupTarget, generate-link-opt-data, \
|
||||
MAKEFILE := GenerateLinkOptData, \
|
||||
))
|
||||
endif
|
||||
|
||||
ALL_TARGETS += $(INTERIM_JMOD_TARGETS) interim-image generate-link-opt-data
|
||||
|
||||
################################################################################
|
||||
# Generate test names for all JTReg test groups
|
||||
#
|
||||
@@ -530,113 +611,177 @@ ALL_TARGETS += $(ALL_TEST_TARGETS) $(ALL_EXPLODED_TEST_TARGETS)
|
||||
# Build tests and microbenchmarks
|
||||
#
|
||||
|
||||
prepare-test-image:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f TestImage.gmk prepare-test-image)
|
||||
$(eval $(call SetupTarget, prepare-test-image, \
|
||||
MAKEFILE := TestImage, \
|
||||
TARGET := prepare-test-image, \
|
||||
))
|
||||
|
||||
build-test-hotspot-jtreg-native:
|
||||
+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNativeHotspot.gmk \
|
||||
build-test-hotspot-jtreg-native)
|
||||
$(eval $(call SetupTarget, build-test-hotspot-jtreg-native, \
|
||||
MAKEFILE := test/JtregNativeHotspot, \
|
||||
TARGET := build-test-hotspot-jtreg-native, \
|
||||
DEPS := buildtools-jdk, \
|
||||
))
|
||||
|
||||
test-image-hotspot-jtreg-native:
|
||||
+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNativeHotspot.gmk \
|
||||
test-image-hotspot-jtreg-native)
|
||||
$(eval $(call SetupTarget, test-image-hotspot-jtreg-native, \
|
||||
MAKEFILE := test/JtregNativeHotspot, \
|
||||
TARGET := test-image-hotspot-jtreg-native, \
|
||||
DEPS := build-test-hotspot-jtreg-native, \
|
||||
))
|
||||
|
||||
build-test-jdk-jtreg-native:
|
||||
+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNativeJdk.gmk \
|
||||
build-test-jdk-jtreg-native)
|
||||
$(eval $(call SetupTarget, build-test-jdk-jtreg-native, \
|
||||
MAKEFILE := test/JtregNativeJdk, \
|
||||
TARGET := build-test-jdk-jtreg-native, \
|
||||
DEPS := buildtools-jdk java.base-libs, \
|
||||
))
|
||||
|
||||
test-image-jdk-jtreg-native:
|
||||
+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNativeJdk.gmk \
|
||||
test-image-jdk-jtreg-native)
|
||||
$(eval $(call SetupTarget, test-image-jdk-jtreg-native, \
|
||||
MAKEFILE := test/JtregNativeJdk, \
|
||||
TARGET := test-image-jdk-jtreg-native, \
|
||||
DEPS := build-test-jdk-jtreg-native, \
|
||||
))
|
||||
|
||||
build-test-hotspot-jtreg-graal:
|
||||
+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregGraalUnit.gmk \
|
||||
build-test-hotspot-jtreg-graal)
|
||||
# Native files needed by the testlib
|
||||
$(eval $(call SetupTarget, build-test-lib-native, \
|
||||
MAKEFILE := test/BuildTestLibNative, \
|
||||
TARGET := build-test-lib-native, \
|
||||
DEPS := buildtools-jdk java.base-libs, \
|
||||
))
|
||||
|
||||
test-image-hotspot-jtreg-graal:
|
||||
+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregGraalUnit.gmk \
|
||||
test-image-hotspot-jtreg-graal)
|
||||
$(eval $(call SetupTarget, test-image-lib-native, \
|
||||
MAKEFILE := test/BuildTestLibNative, \
|
||||
TARGET := test-image-lib-native, \
|
||||
DEPS := build-test-lib-native, \
|
||||
))
|
||||
|
||||
ifeq ($(BUILD_GTEST), true)
|
||||
test-image-hotspot-gtest:
|
||||
+($(CD) $(TOPDIR)/make/hotspot/test && $(MAKE) $(MAKE_ARGS) -f GtestImage.gmk)
|
||||
# Native files needed when testing the testlib itself
|
||||
$(eval $(call SetupTarget, build-test-libtest-jtreg-native, \
|
||||
MAKEFILE := test/JtregNativeLibTest, \
|
||||
TARGET := build-test-libtest-jtreg-native, \
|
||||
DEPS := buildtools-jdk, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, test-image-libtest-jtreg-native, \
|
||||
MAKEFILE := test/JtregNativeLibTest, \
|
||||
TARGET := test-image-libtest-jtreg-native, \
|
||||
DEPS := build-test-libtest-jtreg-native, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, build-test-hotspot-jtreg-graal, \
|
||||
MAKEFILE := test/JtregGraalUnit, \
|
||||
TARGET := build-test-hotspot-jtreg-graal, \
|
||||
DEPS := exploded-image, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, test-image-hotspot-jtreg-graal, \
|
||||
MAKEFILE := test/JtregGraalUnit, \
|
||||
TARGET := test-image-hotspot-jtreg-graal, \
|
||||
DEPS := build-test-hotspot-jtreg-graal, \
|
||||
))
|
||||
|
||||
ifneq ($(GTEST_FRAMEWORK_SRC), )
|
||||
$(eval $(call SetupTarget, test-image-hotspot-gtest, \
|
||||
MAKEFILE := hotspot/test/GtestImage, \
|
||||
DEPS := hotspot, \
|
||||
))
|
||||
endif
|
||||
|
||||
build-test-lib:
|
||||
+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f BuildTestLib.gmk)
|
||||
$(eval $(call SetupTarget, build-test-lib, \
|
||||
MAKEFILE := test/BuildTestLib, \
|
||||
DEPS := exploded-image, \
|
||||
))
|
||||
|
||||
ifeq ($(BUILD_FAILURE_HANDLER), true)
|
||||
# Builds the failure handler jtreg extension
|
||||
build-test-failure-handler:
|
||||
+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) \
|
||||
-f BuildFailureHandler.gmk build)
|
||||
$(eval $(call SetupTarget, build-test-failure-handler, \
|
||||
MAKEFILE := test/BuildFailureHandler, \
|
||||
TARGET := build, \
|
||||
DEPS := interim-langtools, \
|
||||
))
|
||||
|
||||
# Copies the failure handler jtreg extension into the test image
|
||||
test-image-failure-handler:
|
||||
+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) \
|
||||
-f BuildFailureHandler.gmk images)
|
||||
$(eval $(call SetupTarget, test-image-failure-handler, \
|
||||
MAKEFILE := test/BuildFailureHandler, \
|
||||
TARGET := images, \
|
||||
DEPS := build-test-failure-handler, \
|
||||
))
|
||||
endif
|
||||
|
||||
build-microbenchmark:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f test/BuildMicrobenchmark.gmk)
|
||||
|
||||
ALL_TARGETS += prepare-test-image build-test-hotspot-jtreg-native \
|
||||
test-image-hotspot-jtreg-native build-test-jdk-jtreg-native \
|
||||
test-image-jdk-jtreg-native build-test-lib build-test-failure-handler \
|
||||
test-failure-handler test-image-failure-handler test-image-hotspot-gtest \
|
||||
test-image-hotspot-jtreg-graal build-test-hotspot-jtreg-graal \
|
||||
build-microbenchmark
|
||||
$(eval $(call SetupTarget, build-microbenchmark, \
|
||||
MAKEFILE := test/BuildMicrobenchmark, \
|
||||
DEPS := interim-langtools exploded-image, \
|
||||
))
|
||||
|
||||
################################################################################
|
||||
# Run tests
|
||||
|
||||
test:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk \
|
||||
TEST="$(TEST)")
|
||||
$(eval $(call SetupTarget, test, \
|
||||
MAKEFILE := RunTests, \
|
||||
ARGS := TEST="$(TEST)", \
|
||||
DEPS := jdk-image test-image, \
|
||||
))
|
||||
|
||||
exploded-test:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk \
|
||||
TEST="$(TEST)" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR))
|
||||
$(eval $(call SetupTarget, exploded-test, \
|
||||
MAKEFILE := RunTests, \
|
||||
ARGS := TEST="$(TEST)" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR), \
|
||||
DEPS := exploded-image test-image, \
|
||||
))
|
||||
|
||||
jcov-test:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk \
|
||||
TEST="$(TEST)" TEST_OPTS_JCOV=true)
|
||||
|
||||
ALL_TARGETS += test exploded-test jcov-test
|
||||
ifeq ($(JCOV_ENABLED), true)
|
||||
$(eval $(call SetupTarget, jcov-test, \
|
||||
MAKEFILE := RunTests, \
|
||||
ARGS := TEST="$(TEST)" TEST_OPTS_JCOV=true, \
|
||||
DEPS := jcov-image test-image, \
|
||||
))
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Bundles
|
||||
|
||||
product-bundles:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk product-bundles)
|
||||
$(eval $(call SetupTarget, product-bundles, \
|
||||
MAKEFILE := Bundles, \
|
||||
TARGET := product-bundles, \
|
||||
DEPS := product-images, \
|
||||
))
|
||||
|
||||
legacy-bundles:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk legacy-bundles)
|
||||
$(eval $(call SetupTarget, legacy-bundles, \
|
||||
MAKEFILE := Bundles, \
|
||||
TARGET := legacy-bundles, \
|
||||
DEPS := legacy-images, \
|
||||
))
|
||||
|
||||
test-bundles:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk test-bundles)
|
||||
$(eval $(call SetupTarget, test-bundles, \
|
||||
MAKEFILE := Bundles, \
|
||||
TARGET := test-bundles, \
|
||||
DEPS := test-image, \
|
||||
))
|
||||
|
||||
docs-bundles:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk docs-bundles)
|
||||
$(eval $(call SetupTarget, docs-bundles, \
|
||||
MAKEFILE := Bundles, \
|
||||
TARGET := docs-bundles, \
|
||||
DEPS := docs-image, \
|
||||
))
|
||||
|
||||
static-libs-bundles:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk static-libs-bundles)
|
||||
$(eval $(call SetupTarget, static-libs-bundles, \
|
||||
MAKEFILE := Bundles, \
|
||||
TARGET := static-libs-bundles, \
|
||||
DEPS := static-libs-image, \
|
||||
))
|
||||
|
||||
ifeq ($(JCOV_ENABLED), true)
|
||||
jcov-bundles:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk jcov-bundles)
|
||||
$(eval $(call SetupTarget, jcov-bundles, \
|
||||
MAKEFILE := Bundles, \
|
||||
TARGET := jcov-bundles, \
|
||||
DEPS := jcov-image, \
|
||||
))
|
||||
endif
|
||||
|
||||
ALL_TARGETS += product-bundles legacy-bundles test-bundles docs-bundles \
|
||||
static-libs-bundles jcov-bundles
|
||||
|
||||
################################################################################
|
||||
# Install targets
|
||||
|
||||
install:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Install.gmk)
|
||||
|
||||
ALL_TARGETS += install
|
||||
$(eval $(call SetupTarget, install, \
|
||||
MAKEFILE := Install, \
|
||||
DEPS := product-images, \
|
||||
))
|
||||
|
||||
################################################################################
|
||||
#
|
||||
@@ -654,19 +799,13 @@ ALL_TARGETS += install
|
||||
# recipe targets are disabled. This makes it possible to run a select set of
|
||||
# recipe targets in order. It's the responsibility of the user to make sure
|
||||
# all prerequisites are fulfilled.
|
||||
ifneq ($(findstring -only, $(MAKECMDGOALS)), )
|
||||
ifeq ($(DEPS), none)
|
||||
.NOTPARALLEL:
|
||||
else
|
||||
$(LANGTOOLS_GENSRC_TARGETS): buildtools-langtools
|
||||
|
||||
interim-langtools: $(INTERIM_LANGTOOLS_GENSRC_TARGETS)
|
||||
|
||||
buildtools-jdk: interim-langtools interim-tzdb
|
||||
|
||||
buildtools-hotspot: interim-langtools
|
||||
|
||||
buildtools-modules: exploded-image-base
|
||||
|
||||
$(HOTSPOT_GENSRC_TARGETS): interim-langtools buildtools-hotspot
|
||||
|
||||
$(JDK_GENSRC_TARGETS): interim-langtools buildtools-jdk
|
||||
@@ -679,32 +818,26 @@ else
|
||||
|
||||
# Declare dependencies between hotspot-<variant>* targets
|
||||
$(foreach v, $(JVM_VARIANTS), \
|
||||
$(eval hotspot-$v-gensrc: java.base-copy) \
|
||||
$(eval hotspot-$v-gensrc: java.base-copy buildtools-hotspot) \
|
||||
$(eval hotspot-$v-libs: hotspot-$v-gensrc java.base-copy) \
|
||||
)
|
||||
|
||||
hotspot-ide-project: hotspot exploded-image
|
||||
|
||||
generate-exported-symbols: java.base-libs jdk.jdwp.agent-libs
|
||||
|
||||
# If not already set, set the JVM variant target so that the JVM will be built.
|
||||
JVM_MAIN_LIB_TARGETS ?= hotspot-$(JVM_VARIANT_MAIN)-libs
|
||||
JVM_MAIN_GENSRC_TARGETS ?= hotspot-$(JVM_VARIANT_MAIN)-gensrc
|
||||
|
||||
# Building one JVM variant is enough to start building the other libs
|
||||
$(LIBS_TARGETS): $(JVM_MAIN_LIB_TARGETS)
|
||||
|
||||
# Static libs depend on hotspot gensrc
|
||||
$(STATIC_LIBS_TARGETS): $(JVM_MAIN_GENSRC_TARGETS)
|
||||
|
||||
$(LAUNCHER_TARGETS): java.base-libs
|
||||
|
||||
ifeq ($(STATIC_BUILD), true)
|
||||
$(LAUNCHER_TARGETS): generate-exported-symbols
|
||||
endif
|
||||
|
||||
# The demos are currently linking to libjvm and libjava, just like all other
|
||||
# jdk libs, even though they don't need to. To avoid warnings, make sure they
|
||||
# aren't built until after libjava and libjvm are available to link to.
|
||||
demos-jdk: java.base-libs exploded-image
|
||||
test-image-demos-jdk: demos-jdk
|
||||
|
||||
# Declare dependency from <module>-java to <module>-gensrc
|
||||
$(foreach m, $(GENSRC_MODULES), $(eval $m-java: $m-gensrc))
|
||||
|
||||
@@ -792,11 +925,6 @@ else
|
||||
compile-commands-hotspot: $(COMPILE_COMMANDS_TARGETS_HOTSPOT)
|
||||
compile-commands: $(COMPILE_COMMANDS_TARGETS_HOTSPOT) $(COMPILE_COMMANDS_TARGETS_JDK)
|
||||
|
||||
vscode-project: compile-commands
|
||||
vscode-project-clangd: compile-commands
|
||||
vscode-project-rtags: compile-commands
|
||||
vscode-project-ccls: compile-commands
|
||||
|
||||
# The -static-libs targets depend on -java as well as java.base-copy.
|
||||
$(foreach m, $(filter $(JAVA_MODULES), $(STATIC_LIBS_MODULES)), \
|
||||
$(eval $m-static-libs: $m-java java.base-copy))
|
||||
@@ -832,14 +960,7 @@ else
|
||||
# All modules include the main license files from java.base.
|
||||
$(JMOD_TARGETS): java.base-copy
|
||||
|
||||
zip-security: java.base-java java.security.jgss-java java.security.jgss-libs \
|
||||
$(filter jdk.crypto%, $(JAVA_TARGETS))
|
||||
|
||||
zip-source: gensrc
|
||||
|
||||
jrtfs-jar: interim-langtools
|
||||
|
||||
build-microbenchmark: interim-langtools exploded-image
|
||||
zip-security: $(filter jdk.crypto%, $(JAVA_TARGETS))
|
||||
|
||||
ifeq ($(ENABLE_GENERATE_CLASSLIST), true)
|
||||
ifeq ($(CREATE_BUILDJDK), true)
|
||||
@@ -857,29 +978,10 @@ else
|
||||
java.base-jmod jdk.jlink-jmod jdk-image legacy-jre-image: generate-link-opt-data
|
||||
endif
|
||||
|
||||
release-file: create-source-revision-tracker
|
||||
|
||||
jdk-image: jmods zip-source demos release-file
|
||||
legacy-jre-image: jmods release-file
|
||||
symbols-image: $(LIBS_TARGETS) $(LAUNCHER_TARGETS)
|
||||
|
||||
static-libs-image: $(STATIC_LIBS_TARGETS)
|
||||
|
||||
graal-builder-image: jdk-image static-libs-image
|
||||
|
||||
mac-jdk-bundle: jdk-image
|
||||
mac-legacy-jre-bundle: legacy-jre-image
|
||||
|
||||
ifeq ($(JCOV_INPUT_JDK), )
|
||||
jcov-image: jdk-image
|
||||
endif
|
||||
|
||||
# The optimize target can run as soon as the modules dir has been completely
|
||||
# populated (java, copy and gendata targets) and the basic libs and launchers
|
||||
# have been built.
|
||||
exploded-image-optimize: java copy gendata java.base-libs java.base-launchers \
|
||||
buildtools-modules
|
||||
|
||||
bootcycle-images: jdk-image
|
||||
|
||||
docs-jdk-api-javadoc: $(GENSRC_TARGETS)
|
||||
@@ -888,30 +990,13 @@ else
|
||||
|
||||
docs-reference-api-javadoc: $(GENSRC_TARGETS)
|
||||
|
||||
docs-jdk-api-modulegraph: exploded-image buildtools-modules
|
||||
|
||||
docs-javase-api-modulegraph: exploded-image buildtools-modules
|
||||
|
||||
docs-reference-api-modulegraph: exploded-image buildtools-modules
|
||||
|
||||
# If not already set, then set the JVM specific docs targets
|
||||
JVM_DOCS_TARGETS ?= hotspot-$(JVM_VARIANT_MAIN)-gensrc
|
||||
|
||||
# The gensrc steps for hotspot and jdk.jdi create html spec files.
|
||||
docs-jdk-specs: buildtools-jdk $(JVM_DOCS_TARGETS) jdk.jdi-gensrc \
|
||||
docs-jdk-index
|
||||
|
||||
docs-zip: docs-jdk
|
||||
|
||||
docs-specs-zip: docs-jdk-specs
|
||||
# The gensrc steps for hotspot create html spec files.
|
||||
docs-jdk-specs: $(JVM_DOCS_TARGETS)
|
||||
|
||||
# Tests
|
||||
test: jdk-image test-image
|
||||
|
||||
exploded-test: exploded-image test-image
|
||||
|
||||
jcov-test: jcov-image test-image
|
||||
|
||||
test-make: clean-test-make compile-commands
|
||||
|
||||
test-make-compile-commands: compile-commands
|
||||
@@ -922,44 +1007,8 @@ else
|
||||
|
||||
interim-image: $(INTERIM_JMOD_TARGETS)
|
||||
|
||||
build-test-lib: exploded-image
|
||||
|
||||
build-test-failure-handler: interim-langtools
|
||||
|
||||
test-image-failure-handler: build-test-failure-handler
|
||||
|
||||
build-test-hotspot-jtreg-native: buildtools-jdk \
|
||||
hotspot-$(JVM_VARIANT_MAIN)-libs
|
||||
|
||||
build-test-jdk-jtreg-native: buildtools-jdk java.base-libs
|
||||
|
||||
build-test-hotspot-jtreg-graal: exploded-image
|
||||
|
||||
test-image-hotspot-jtreg-native: build-test-hotspot-jtreg-native
|
||||
|
||||
test-image-jdk-jtreg-native: build-test-jdk-jtreg-native
|
||||
|
||||
test-image-hotspot-jtreg-graal: build-test-hotspot-jtreg-graal
|
||||
|
||||
test-image-hotspot-gtest: hotspot
|
||||
|
||||
install: product-images
|
||||
|
||||
product-bundles: product-images
|
||||
|
||||
legacy-bundles: legacy-images
|
||||
|
||||
test-bundles: test-image
|
||||
|
||||
docs-bundles: docs-image
|
||||
|
||||
jcov-bundles: jcov-image
|
||||
|
||||
static-libs-bundles: static-libs-image
|
||||
|
||||
generate-summary: jmods buildtools-modules
|
||||
|
||||
update-x11wrappers: java.base-copy buildtools-jdk
|
||||
build-test-hotspot-jtreg-native: hotspot-$(JVM_VARIANT_MAIN)-libs
|
||||
build-test-libtest-jtreg-native: hotspot-$(JVM_VARIANT_MAIN)-libs
|
||||
|
||||
endif
|
||||
|
||||
@@ -1082,17 +1131,29 @@ endif
|
||||
# This target builds the documentation image
|
||||
docs-image: docs-jdk
|
||||
|
||||
# If not already set, set the JVM specific targets to build the test image
|
||||
JVM_TEST_IMAGE_TARGETS ?= test-image-hotspot-jtreg-native test-image-hotspot-gtest
|
||||
# This target builds the test image
|
||||
test-image: prepare-test-image test-image-jdk-jtreg-native \
|
||||
test-image-demos-jdk test-image-libtest-jtreg-native \
|
||||
test-image-lib-native
|
||||
|
||||
ifeq ($(INCLUDE_GRAAL), true)
|
||||
JVM_TEST_IMAGE_TARGETS += test-image-hotspot-jtreg-graal
|
||||
ifneq ($(JVM_TEST_IMAGE_TARGETS), )
|
||||
# If JVM_TEST_IMAGE_TARGETS is externally defined, use it instead of the
|
||||
# standard hotspot set of tests.
|
||||
test-image: $(JVM_TEST_IMAGE_TARGETS)
|
||||
else
|
||||
test-image: test-image-hotspot-jtreg-native
|
||||
ifneq ($(GTEST_FRAMEWORK_SRC), )
|
||||
test-image: test-image-hotspot-gtest
|
||||
endif
|
||||
|
||||
ifeq ($(INCLUDE_GRAAL), true)
|
||||
test-image: test-image-hotspot-jtreg-graal
|
||||
endif
|
||||
endif
|
||||
|
||||
# This target builds the test image
|
||||
test-image: prepare-test-image \
|
||||
test-image-jdk-jtreg-native test-image-failure-handler \
|
||||
test-image-demos-jdk $(JVM_TEST_IMAGE_TARGETS)
|
||||
ifeq ($(BUILD_FAILURE_HANDLER), true)
|
||||
test-image: test-image-failure-handler
|
||||
endif
|
||||
|
||||
ifneq ($(JMH_CORE_JAR), )
|
||||
test-image: build-microbenchmark
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 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
|
||||
@@ -30,6 +30,27 @@
|
||||
ifndef _MAINSUPPORT_GMK
|
||||
_MAINSUPPORT_GMK := 1
|
||||
|
||||
# Setup make rules for creating a top-level target.
|
||||
# Parameter 1 is the name of the rule. This name is used as variable prefix.
|
||||
#
|
||||
# Remaining parameters are named arguments. These include:
|
||||
# MAKEFILE the makefile to delegate to
|
||||
# TARGET the makefile target
|
||||
# ARGS arguments to the makefile
|
||||
# DEPS the target(s) this new rule depends on
|
||||
#
|
||||
SetupTarget = $(NamedParamsMacroTemplate)
|
||||
define SetupTargetBody
|
||||
$1:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f $$($1_MAKEFILE).gmk $$($1_TARGET) $$($1_ARGS))
|
||||
|
||||
ALL_TARGETS += $1
|
||||
|
||||
ifneq ($(DEPS), none)
|
||||
$1: $$($1_DEPS)
|
||||
endif
|
||||
endef
|
||||
|
||||
define CleanDocs
|
||||
@$(PRINTF) "Cleaning docs ..."
|
||||
@$(PRINTF) "\n" $(LOG_DEBUG)
|
||||
@@ -127,24 +148,12 @@ PHASE_MAKEDIRS := $(TOPDIR)/make
|
||||
# Param 2: Module name
|
||||
define DeclareRecipeForModuleMakefile
|
||||
$2-$$($1_TARGET_SUFFIX):
|
||||
ifeq ($$($1_USE_WRAPPER), true)
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) \
|
||||
-f ModuleWrapper.gmk \
|
||||
$$(addprefix -I, $$(PHASE_MAKEDIRS) \
|
||||
$$(addsuffix /$$($1_MAKE_SUBDIR), $$(PHASE_MAKEDIRS)) \
|
||||
) \
|
||||
MODULE=$2 MAKEFILE_PREFIX=$$($1_FILE_PREFIX) $$($1_EXTRA_ARGS))
|
||||
else
|
||||
+($(CD) $$(dir $$(firstword $$(wildcard $$(addsuffix \
|
||||
/$$($1_MAKE_SUBDIR)/$$($1_FILE_PREFIX)-$2.gmk, $$(PHASE_MAKEDIRS))))) \
|
||||
&& $(MAKE) $(MAKE_ARGS) \
|
||||
-f $$($1_FILE_PREFIX)-$2.gmk \
|
||||
$$(addprefix -I, $$(PHASE_MAKEDIRS) \
|
||||
$$(addsuffix /$$($1_MAKE_SUBDIR), $$(PHASE_MAKEDIRS)) \
|
||||
) \
|
||||
MODULE=$2 $$($1_EXTRA_ARGS) \
|
||||
)
|
||||
endif
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) \
|
||||
-f ModuleWrapper.gmk -I $$(TOPDIR)/make/common/modules \
|
||||
$$(addprefix -I, $$(PHASE_MAKEDIRS) \
|
||||
$$(addsuffix /modules/$2, $$(PHASE_MAKEDIRS)) \
|
||||
) \
|
||||
MODULE=$2 MAKEFILE_PREFIX=$$($1_FILE_PREFIX) $$($1_EXTRA_ARGS))
|
||||
|
||||
endef
|
||||
|
||||
@@ -153,7 +162,7 @@ endef
|
||||
# Param 2: Module name
|
||||
define DeclareRecipesForPhaseAndModule
|
||||
$1_$2_MAKEFILES := $$(strip $$(wildcard \
|
||||
$$(addsuffix /$$($1_MAKE_SUBDIR)/$$($1_FILE_PREFIX)-$2.gmk, $$(PHASE_MAKEDIRS))))
|
||||
$$(addsuffix /modules/$2/$$($1_FILE_PREFIX).gmk, $$(PHASE_MAKEDIRS))))
|
||||
|
||||
# Only declare recipes if there are makefiles to call
|
||||
ifneq ($$($1_$2_MAKEFILES), )
|
||||
@@ -178,7 +187,6 @@ endef
|
||||
# TARGET_SUFFIX : Suffix of target to create for recipe
|
||||
# MAKE_SUBDIR : Subdir for this build phase
|
||||
# FILE_PREFIX : File prefix for this build phase
|
||||
# USE_WRAPPER : Set to true to use ModuleWrapper.gmk
|
||||
# CHECK_MODULES : List of modules to try
|
||||
# MULTIPLE_MAKEFILES : Set to true to handle makefiles for the same module and
|
||||
# phase in multiple repos
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 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
|
||||
@@ -44,7 +44,7 @@ TOOL_GENGRAPHS := $(BUILD_JAVA) -esa -ea -cp $(TOOLS_CLASSES_DIR) \
|
||||
TOOL_MODULESUMMARY := $(BUILD_JAVA) -esa -ea -cp $(TOOLS_CLASSES_DIR) \
|
||||
build.tools.jigsaw.ModuleSummary
|
||||
|
||||
TOOL_ADD_PACKAGES_ATTRIBUTE := $(BUILD_JAVA) $(JAVA_FLAGS_SMALL) \
|
||||
TOOL_ADD_PACKAGES_ATTRIBUTE := $(BUILD_JAVA) $(JAVA_FLAGS_SMALL_BUILDJDK) \
|
||||
-cp $(TOOLS_CLASSES_DIR) \
|
||||
--add-exports java.base/jdk.internal.module=ALL-UNNAMED \
|
||||
build.tools.jigsaw.AddPackagesAttribute
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 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
|
||||
@@ -39,7 +39,7 @@ include MakeBase.gmk
|
||||
TARGETS :=
|
||||
|
||||
# Include the file being wrapped.
|
||||
include $(MAKEFILE_PREFIX)-$(MODULE).gmk
|
||||
include modules/$(MODULE)/$(MAKEFILE_PREFIX).gmk
|
||||
|
||||
# Setup copy rules from the modules directories to the jdk image directory.
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
|
||||
@@ -143,9 +143,6 @@ endif
|
||||
# Optionally create AOT libraries for specified modules before running tests.
|
||||
# Note, this could not be done during JDK build time.
|
||||
################################################################################
|
||||
|
||||
# Note, this could not be done during JDK build time.
|
||||
|
||||
# Parameter 1 is the name of the rule.
|
||||
#
|
||||
# Remaining parameters are named arguments.
|
||||
@@ -198,6 +195,10 @@ define SetupAotModuleBody
|
||||
$1_AOT_TARGETS += $$($1_AOT_LIB)
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
# Optionally create AOT libraries before running tests.
|
||||
# Note, this could not be done during JDK build time.
|
||||
################################################################################
|
||||
# Parameter 1 is the name of the rule.
|
||||
#
|
||||
# Remaining parameters are named arguments.
|
||||
@@ -237,16 +238,6 @@ TEST_JOBS_FACTOR_MACHINE ?= 1
|
||||
|
||||
ifeq ($(TEST_JOBS), 0)
|
||||
CORES_DIVIDER := 2
|
||||
ifeq ($(call isTargetCpuArch, sparc), true)
|
||||
# For smaller SPARC machines we see reasonable scaling of throughput up to
|
||||
# cpus/4 without affecting test reliability. On the bigger machines, cpus/4
|
||||
# causes intermittent timeouts.
|
||||
ifeq ($(shell $(EXPR) $(NUM_CORES) \> 16), 1)
|
||||
CORES_DIVIDER := 5
|
||||
else
|
||||
CORES_DIVIDER := 4
|
||||
endif
|
||||
endif
|
||||
# For some big multi-core machines with low ulimit -u setting we hit the max
|
||||
# threads/process limit. In such a setup the memory/cores-only-guided
|
||||
# TEST_JOBS config is insufficient. From experience a concurrency setting of
|
||||
@@ -301,9 +292,9 @@ $(eval $(call SetTestOpt,FAILURE_HANDLER_TIMEOUT,JTREG))
|
||||
$(eval $(call ParseKeywordVariable, JTREG, \
|
||||
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR FAILURE_HANDLER_TIMEOUT \
|
||||
TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM RUN_PROBLEM_LISTS \
|
||||
RETRY_COUNT, \
|
||||
RETRY_COUNT MAX_OUTPUT, \
|
||||
STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS \
|
||||
EXTRA_PROBLEM_LISTS AOT_MODULES, \
|
||||
EXTRA_PROBLEM_LISTS AOT_MODULES LAUNCHER_OPTIONS, \
|
||||
))
|
||||
|
||||
ifneq ($(JTREG), )
|
||||
@@ -352,12 +343,13 @@ hotspot_JTREG_MAX_MEM := 0
|
||||
hotspot_JTREG_ASSERT := false
|
||||
hotspot_JTREG_NATIVEPATH := $(TEST_IMAGE_DIR)/hotspot/jtreg/native
|
||||
jdk_JTREG_NATIVEPATH := $(TEST_IMAGE_DIR)/jdk/jtreg/native
|
||||
lib-test_JTREG_NATIVEPATH := $(TEST_IMAGE_DIR)/lib-test/jtreg/native
|
||||
|
||||
jdk_JTREG_PROBLEM_LIST += $(TOPDIR)/test/jdk/ProblemList.txt
|
||||
jaxp_JTREG_PROBLEM_LIST += $(TOPDIR)/test/jaxp/ProblemList.txt
|
||||
langtools_JTREG_PROBLEM_LIST += $(TOPDIR)/test/langtools/ProblemList.txt
|
||||
nashorn_JTREG_PROBLEM_LIST += $(TOPDIR)/test/nashorn/ProblemList.txt
|
||||
hotspot_JTREG_PROBLEM_LIST += $(TOPDIR)/test/hotspot/jtreg/ProblemList.txt
|
||||
lib-test_JTREG_PROBLEM_LIST += $(TOPDIR)/test/lib-test/ProblemList.txt
|
||||
|
||||
langtools_JTREG_MAX_MEM := 768m
|
||||
|
||||
@@ -691,8 +683,6 @@ define SetupRunMicroTestBody
|
||||
|
||||
# Current tests needs to open java.io
|
||||
$1_MICRO_JAVA_OPTIONS += --add-opens=java.base/java.io=ALL-UNNAMED
|
||||
# Set library path for native dependencies
|
||||
$1_MICRO_JAVA_OPTIONS += -Djava.library.path=$$(TEST_IMAGE_DIR)/micro/native
|
||||
|
||||
# Save output as JSON or CSV file
|
||||
ifneq ($$(MICRO_RESULTS_FORMAT), )
|
||||
@@ -700,11 +690,15 @@ define SetupRunMicroTestBody
|
||||
$1_MICRO_BASIC_OPTIONS += -rff $$($1_TEST_RESULTS_DIR)/jmh-result.$(MICRO_RESULTS_FORMAT)
|
||||
endif
|
||||
|
||||
# Set library path for native dependencies
|
||||
$1_JMH_JVM_ARGS := -Djava.library.path=$$(TEST_IMAGE_DIR)/micro/native
|
||||
|
||||
ifneq ($$(MICRO_VM_OPTIONS)$$(MICRO_JAVA_OPTIONS), )
|
||||
JMH_JVM_ARGS := $$(MICRO_VM_OPTIONS) $$(MICRO_JAVA_OPTIONS)
|
||||
$1_MICRO_VM_OPTIONS := -jvmArgs $(call ShellQuote,$$(JMH_JVM_ARGS))
|
||||
$1_JMH_JVM_ARGS += $$(MICRO_VM_OPTIONS) $$(MICRO_JAVA_OPTIONS)
|
||||
endif
|
||||
|
||||
$1_MICRO_VM_OPTIONS := -jvmArgs $(call ShellQuote,$$($1_JMH_JVM_ARGS))
|
||||
|
||||
ifneq ($$(MICRO_ITER), )
|
||||
$1_MICRO_ITER := -i $$(MICRO_ITER)
|
||||
endif
|
||||
@@ -844,26 +838,34 @@ define SetupRunJtregTestBody
|
||||
# we may end up with a lot of JVM's
|
||||
$1_JTREG_MAX_RAM_PERCENTAGE := $$(shell $$(EXPR) 25 / $$($1_JTREG_JOBS))
|
||||
|
||||
# SPARC is in general slower per core so need to scale up timeouts a bit.
|
||||
ifeq ($(call isTargetCpuArch, sparc), true)
|
||||
JTREG_TIMEOUT_FACTOR ?= 8
|
||||
else
|
||||
JTREG_TIMEOUT_FACTOR ?= 4
|
||||
endif
|
||||
JTREG_TIMEOUT_FACTOR ?= 4
|
||||
|
||||
JTREG_VERBOSE ?= fail,error,summary
|
||||
JTREG_RETAIN ?= fail,error
|
||||
JTREG_RUN_PROBLEM_LISTS ?= false
|
||||
JTREG_RETRY_COUNT ?= 0
|
||||
|
||||
ifneq ($$(JTREG_LAUNCHER_OPTIONS), )
|
||||
$1_JTREG_LAUNCHER_OPTIONS += $$(JTREG_LAUNCHER_OPTIONS)
|
||||
endif
|
||||
|
||||
ifneq ($$(JTREG_MAX_OUTPUT), )
|
||||
$1_JTREG_LAUNCHER_OPTIONS += -Djavatest.maxOutputSize=$$(JTREG_MAX_OUTPUT)
|
||||
endif
|
||||
|
||||
ifneq ($$($1_JTREG_MAX_MEM), 0)
|
||||
$1_JTREG_BASIC_OPTIONS += -vmoption:-Xmx$$($1_JTREG_MAX_MEM)
|
||||
$1_JTREG_LAUNCHER_OPTIONS += -Xmx$$($1_JTREG_MAX_MEM)
|
||||
endif
|
||||
|
||||
# Make sure the tmp dir is normalized as some tests will react badly otherwise
|
||||
$1_TEST_TMP_DIR := $$(abspath $$($1_TEST_SUPPORT_DIR)/tmp)
|
||||
|
||||
$1_JTREG_BASIC_OPTIONS += -$$($1_JTREG_TEST_MODE) \
|
||||
-verbose:$$(JTREG_VERBOSE) -retain:$$(JTREG_RETAIN) \
|
||||
-concurrency:$$($1_JTREG_JOBS) -timeoutFactor:$$(JTREG_TIMEOUT_FACTOR) \
|
||||
-vmoption:-XX:MaxRAMPercentage=$$($1_JTREG_MAX_RAM_PERCENTAGE)
|
||||
-vmoption:-XX:MaxRAMPercentage=$$($1_JTREG_MAX_RAM_PERCENTAGE) \
|
||||
-vmoption:-Djava.io.tmpdir="$$($1_TEST_TMP_DIR)"
|
||||
|
||||
$1_JTREG_BASIC_OPTIONS += -automatic -ignore:quiet
|
||||
|
||||
@@ -979,7 +981,8 @@ define SetupRunJtregTestBody
|
||||
run-test-$1: pre-run-test clean-workdir-$1 $$($1_AOT_TARGETS)
|
||||
$$(call LogWarn)
|
||||
$$(call LogWarn, Running test '$$($1_TEST)')
|
||||
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
|
||||
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR) \
|
||||
$$($1_TEST_TMP_DIR))
|
||||
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/jtreg, ( \
|
||||
$$(COV_ENVIRONMENT) $$($1_COMMAND_LINE) \
|
||||
))
|
||||
|
||||
@@ -163,8 +163,6 @@ else
|
||||
OPENJDK_TARGET_OS := linux
|
||||
else ifeq ($(UNAME_OS), Darwin)
|
||||
OPENJDK_TARGET_OS := macosx
|
||||
else ifeq ($(UNAME_OS), SunOS)
|
||||
OPENJDK_TARGET_OS := solaris
|
||||
else
|
||||
OPENJDK_TARGET_OS := $(UNAME_OS)
|
||||
endif
|
||||
@@ -174,38 +172,20 @@ endif
|
||||
# Assume little endian unless otherwise specified
|
||||
OPENJDK_TARGET_CPU_ENDIAN := little
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
# On solaris, use uname -p
|
||||
UNAME_CPU := $(shell $(UNAME) -p)
|
||||
# Assume 64-bit platform
|
||||
OPENJDK_TARGET_CPU_BITS := 64
|
||||
ifeq ($(UNAME_CPU), i386)
|
||||
OPENJDK_TARGET_CPU := x86_64
|
||||
else ifeq ($(UNAME_CPU), sparc)
|
||||
OPENJDK_TARGET_CPU := sparcv9
|
||||
OPENJDK_TARGET_CPU_ENDIAN := big
|
||||
else
|
||||
OPENJDK_TARGET_CPU := $(UNAME_CPU)
|
||||
endif
|
||||
UNAME_CPU := $(shell $(UNAME) -m)
|
||||
ifeq ($(UNAME_CPU), i686)
|
||||
OPENJDK_TARGET_CPU := x86
|
||||
OPENJDK_TARGET_CPU_BITS := 32
|
||||
else
|
||||
# ... all others use uname -m
|
||||
UNAME_CPU := $(shell $(UNAME) -m)
|
||||
ifeq ($(UNAME_CPU), i686)
|
||||
OPENJDK_TARGET_CPU := x86
|
||||
OPENJDK_TARGET_CPU_BITS := 32
|
||||
else
|
||||
# Assume all others are 64-bit. We use the same CPU name as uname for
|
||||
# at least x86_64 and aarch64.
|
||||
OPENJDK_TARGET_CPU := $(UNAME_CPU)
|
||||
OPENJDK_TARGET_CPU_BITS := 64
|
||||
endif
|
||||
# Assume all others are 64-bit. We use the same CPU name as uname for
|
||||
# at least x86_64 and aarch64.
|
||||
OPENJDK_TARGET_CPU := $(UNAME_CPU)
|
||||
OPENJDK_TARGET_CPU_BITS := 64
|
||||
endif
|
||||
|
||||
OPENJDK_TARGET_CPU_ARCH := $(OPENJDK_TARGET_CPU)
|
||||
ifeq ($(OPENJDK_TARGET_CPU), x86_64)
|
||||
OPENJDK_TARGET_CPU_ARCH := x86
|
||||
else ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
|
||||
OPENJDK_TARGET_CPU_ARCH := sparc
|
||||
endif
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
@@ -229,11 +209,6 @@ ifeq ($(OPENJDK_TARGET_OS), linux)
|
||||
else ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
NUM_CORES := $(shell /usr/sbin/sysctl -n hw.ncpu)
|
||||
MEMORY_SIZE := $(shell $(EXPR) `/usr/sbin/sysctl -n hw.memsize` / 1024 / 1024)
|
||||
else ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
NUM_CORES := $(shell /usr/sbin/psrinfo -v | $(GREP) -c on-line)
|
||||
MEMORY_SIZE := $(shell \
|
||||
/usr/sbin/prtconf 2> /dev/null | $(GREP) "^Memory [Ss]ize" | $(AWK) '{print $$3}' \
|
||||
)
|
||||
else ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
NUM_CORES := $(NUMBER_OF_PROCESSORS)
|
||||
MEMORY_SIZE := $(shell \
|
||||
@@ -265,11 +240,6 @@ ifneq ($(DEVKIT_HOME), )
|
||||
LD_JAOTC := $(DEVKIT_HOME)/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
|
||||
LIBRARY_PREFIX := lib
|
||||
SHARED_LIBRARY_SUFFIX := .dylib
|
||||
else ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
# Prefer system linker for AOT on Solaris.
|
||||
LD_JAOTC := ld
|
||||
LIBRARY_PREFIX := lib
|
||||
SHARED_LIBRARY_SUFFIX := .so
|
||||
endif
|
||||
else
|
||||
LD := ld
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2017, 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
|
||||
@@ -63,8 +63,9 @@ TEST_JOBS ?= 0
|
||||
|
||||
# Use hard-coded values for java flags (one size, fits all!)
|
||||
JAVA_FLAGS := -Duser.language=en -Duser.country=US
|
||||
JAVA_FLAGS_BIG:= -Xms64M -Xmx1600M -XX:ThreadStackSize=1536
|
||||
JAVA_FLAGS_SMALL:= -XX:+UseSerialGC -Xms32M -Xmx512M -XX:TieredStopAtLevel=1
|
||||
JAVA_FLAGS_BIG := -Xms64M -Xmx1600M
|
||||
JAVA_FLAGS_SMALL := -XX:+UseSerialGC -Xms32M -Xmx512M -XX:TieredStopAtLevel=1
|
||||
BUILDJDK_JAVA_FLAGS_SMALL := -Xms32M -Xmx512M -XX:TieredStopAtLevel=1
|
||||
BUILD_JAVA_FLAGS := $(JAVA_FLAGS_BIG)
|
||||
|
||||
################################################################################
|
||||
@@ -81,7 +82,6 @@ SHELL := $(BASH) $(BASH_ARGS)
|
||||
# Set some reasonable defaults for features
|
||||
DEBUG_LEVEL := release
|
||||
HOTSPOT_DEBUG_LEVEL := release
|
||||
BUILD_GTEST := true
|
||||
BUILD_FAILURE_HANDLER := true
|
||||
|
||||
################################################################################
|
||||
@@ -120,7 +120,7 @@ JARSIGNER_CMD := $(BOOT_JDK)/bin/jarsigner
|
||||
|
||||
JAVA := $(FIXPATH) $(JAVA_CMD) $(JAVA_FLAGS_BIG) $(JAVA_FLAGS)
|
||||
JAVA_SMALL := $(FIXPATH) $(JAVA_CMD) $(JAVA_FLAGS_SMALL) $(JAVA_FLAGS)
|
||||
JAVA_JAVAC := $(FIXPATH) $(JAVA_CMD) $(JAVA_FLAGS_SMALL) $(JAVA_FLAGS)
|
||||
JAVA_DETACH := $(FIXPATH) $(FIXPATH_DETACH_FLAG) $(JAVA_CMD) $(JAVA_FLAGS_BIG) $(JAVA_FLAGS)
|
||||
JAVAC := $(FIXPATH) $(JAVAC_CMD)
|
||||
JAR := $(FIXPATH) $(JAR_CMD)
|
||||
JLINK := $(FIXPATH) $(JLINK_CMD)
|
||||
@@ -177,16 +177,6 @@ FILE := file
|
||||
HG := hg
|
||||
ULIMIT := ulimit
|
||||
|
||||
# On Solaris gnu versions of some tools are required.
|
||||
ifeq ($(OPENJDK_BUILD_OS), solaris)
|
||||
AWK := gawk
|
||||
GREP := ggrep
|
||||
EGREP := ggrep -E
|
||||
FGREP := grep -F
|
||||
SED := gsed
|
||||
TAR := gtar
|
||||
endif
|
||||
|
||||
ifeq ($(OPENJDK_BUILD_OS), windows)
|
||||
CYGPATH := cygpath
|
||||
endif
|
||||
|
||||
@@ -32,11 +32,13 @@ include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include Modules.gmk
|
||||
|
||||
ALL_MODULES = $(call FindAllModules)
|
||||
|
||||
################################################################################
|
||||
|
||||
TARGETS :=
|
||||
|
||||
$(foreach m, $(STATIC_LIBS_MODULES), \
|
||||
$(foreach m, $(ALL_MODULES), \
|
||||
$(eval $(call SetupCopyFiles, COPY_STATIC_LIBS_$m, \
|
||||
FLATTEN := true, \
|
||||
SRC := $(SUPPORT_OUTPUTDIR)/native/$m, \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2017, 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
|
||||
@@ -35,12 +35,29 @@ ifeq ($(call isTargetOs, windows), true)
|
||||
|
||||
$(FIXPATH_COPY): $(firstword $(FIXPATH))
|
||||
$(call install-file)
|
||||
|
||||
FIXPATH_WORKSPACE_ROOT := $(call FixPath, $(WORKSPACE_ROOT))
|
||||
FIXPATH_OUTPUTDIR := $(call FixPath, $(OUTPUTDIR))
|
||||
else
|
||||
FIXPATH_WORKSPACE_ROOT := $(WORKSPACE_ROOT)
|
||||
FIXPATH_OUTPUTDIR := $(OUTPUTDIR)
|
||||
endif
|
||||
|
||||
prepare-test-image: $(FIXPATH_COPY)
|
||||
|
||||
BUILD_INFO_PROPERTIES := $(TEST_IMAGE_DIR)/build-info.properties
|
||||
|
||||
$(BUILD_INFO_PROPERTIES):
|
||||
$(call MakeTargetDir)
|
||||
$(ECHO) "# Build info properties for JDK tests" > $@
|
||||
$(ECHO) "build.workspace.root=$(FIXPATH_WORKSPACE_ROOT)" >> $@
|
||||
$(ECHO) "build.output.root=$(FIXPATH_OUTPUTDIR)" >> $@
|
||||
|
||||
prepare-test-image: $(FIXPATH_COPY) $(BUILD_INFO_PROPERTIES)
|
||||
$(call MakeDir, $(TEST_IMAGE_DIR))
|
||||
$(ECHO) > $(TEST_IMAGE_DIR)/Readme.txt 'JDK test image'
|
||||
|
||||
################################################################################
|
||||
|
||||
all: prepare-test-image
|
||||
|
||||
.PHONY: default all prepare-test-image
|
||||
|
||||
47
make/ToolsHotspot.gmk
Normal file
47
make/ToolsHotspot.gmk
Normal file
@@ -0,0 +1,47 @@
|
||||
#
|
||||
# Copyright (c) 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
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
ifndef _TOOLS_HOTSPOT_GMK
|
||||
_TOOLS_HOTSPOT_GMK := 1
|
||||
|
||||
include JavaCompilation.gmk
|
||||
|
||||
HOTSPOT_TOOLS_OUTPUTDIR := $(BUILDTOOLS_OUTPUTDIR)/buildtools/hotspot_tools_classes
|
||||
|
||||
################################################################################
|
||||
# To avoid reevaluating the compilation setup for the tools each time this file
|
||||
# is included, the actual compilation is handled by CompileToolsHotspot.gmk. The
|
||||
# following trick is used to be able to declare a dependency on the built tools.
|
||||
BUILD_TOOLS_HOTSPOT := $(call SetupJavaCompilationCompileTarget, \
|
||||
BUILD_TOOLS_HOTSPOT, $(HOTSPOT_TOOLS_OUTPUTDIR))
|
||||
|
||||
################################################################################
|
||||
|
||||
TOOL_JFR_GEN := $(JAVA_SMALL) -cp $(HOTSPOT_TOOLS_OUTPUTDIR) \
|
||||
build.tools.jfr.GenerateJfrFiles
|
||||
|
||||
##########################################################################################
|
||||
|
||||
endif # _TOOLS_HOTSPOT_GMK
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 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
|
||||
@@ -29,18 +29,17 @@ default: all
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include JavaCompilation.gmk
|
||||
include SetupJavaCompilers.gmk
|
||||
|
||||
################################################################################
|
||||
# Setup the compilation of the properties compilation tool. You can depend
|
||||
# upon $(BUILD_TOOLS_LANGTOOLS) to trigger a compilation of the tools.
|
||||
$(eval $(call SetupJavaCompilation,BUILD_TOOLS_LANGTOOLS, \
|
||||
SETUP := BOOT_JAVAC, \
|
||||
DISABLE_SJAVAC := true, \
|
||||
ADD_JAVAC_FLAGS := -Xprefer:source, \
|
||||
$(eval $(call SetupJavaCompilation, BUILD_TOOLS_LANGTOOLS, \
|
||||
COMPILER := bootjdk, \
|
||||
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
|
||||
SRC := $(TOPDIR)/make/langtools/tools, \
|
||||
INCLUDES := compileproperties propertiesparser, \
|
||||
COPY := .properties, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/langtools_tools_classes))
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/langtools_tools_classes, \
|
||||
))
|
||||
|
||||
all: $(BUILD_TOOLS_LANGTOOLS)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 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
|
||||
@@ -45,7 +45,6 @@ $(eval $(call SetupZipArchive,BUILD_SEC_BIN_ZIP, \
|
||||
modules/jdk.crypto.mscapi/sun/security/mscapi \
|
||||
modules/jdk.crypto.cryptoki/sun/security/pkcs11 \
|
||||
modules/jdk.crypto.cryptoki/sun/security/pkcs11/wrapper \
|
||||
modules/jdk.crypto.ucrypto/com/oracle/security/ucrypto \
|
||||
modules/java.base/javax/net \
|
||||
modules/java.base/javax/security/cert \
|
||||
modules/java.base/com/sun/net/ssl \
|
||||
|
||||
@@ -87,8 +87,16 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
|
||||
AC_SUBST(CONFIGURE_START_DIR)
|
||||
|
||||
# We can only call UTIL_FIXUP_PATH after BASIC_CHECK_PATHS_WINDOWS.
|
||||
UTIL_FIXUP_PATH(CONFIGURE_START_DIR)
|
||||
UTIL_FIXUP_PATH(TOPDIR)
|
||||
UTIL_FIXUP_PATH(CONFIGURE_START_DIR)
|
||||
|
||||
if test "x$CUSTOM_ROOT" != x; then
|
||||
UTIL_FIXUP_PATH(CUSTOM_ROOT)
|
||||
WORKSPACE_ROOT="${CUSTOM_ROOT}"
|
||||
else
|
||||
WORKSPACE_ROOT="${TOPDIR}"
|
||||
fi
|
||||
AC_SUBST(WORKSPACE_ROOT)
|
||||
|
||||
# Locate the directory of this script.
|
||||
AUTOCONF_DIR=$TOPDIR/make/autoconf
|
||||
@@ -141,6 +149,8 @@ AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
|
||||
BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_VS_LIB])
|
||||
# Corresponds to --with-msvcr-dll
|
||||
BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_MSVCR_DLL])
|
||||
# Corresponds to --with-vcruntime-1-dll
|
||||
BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_VCRUNTIME_1_DLL])
|
||||
# Corresponds to --with-msvcp-dll
|
||||
BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_MSVCP_DLL])
|
||||
# Corresponds to --with-ucrt-dll-dir
|
||||
@@ -313,11 +323,6 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
|
||||
AC_MSG_RESULT([in build directory with custom name])
|
||||
fi
|
||||
|
||||
if test "x$CUSTOM_ROOT" != x; then
|
||||
WORKSPACE_ROOT="${CUSTOM_ROOT}"
|
||||
else
|
||||
WORKSPACE_ROOT="${TOPDIR}"
|
||||
fi
|
||||
OUTPUTDIR="${WORKSPACE_ROOT}/build/${CONF_NAME}"
|
||||
$MKDIR -p "$OUTPUTDIR"
|
||||
if test ! -d "$OUTPUTDIR"; then
|
||||
@@ -374,7 +379,6 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
|
||||
AC_SUBST(SPEC)
|
||||
AC_SUBST(CONF_NAME)
|
||||
AC_SUBST(OUTPUTDIR)
|
||||
AC_SUBST(WORKSPACE_ROOT)
|
||||
AC_SUBST(CONFIGURESUPPORT_OUTPUTDIR)
|
||||
|
||||
# The spec.gmk file contains all variables for the make system.
|
||||
@@ -420,24 +424,16 @@ AC_DEFUN([BASIC_CHECK_DIR_ON_LOCAL_DISK],
|
||||
# is the same. On older AIXes we just continue to live with a "not local build" warning.
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
DF_LOCAL_ONLY_OPTION='-T local'
|
||||
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl"; then
|
||||
# In WSL, we can only build on a drvfs file system (that is, a mounted real Windows drive)
|
||||
DF_LOCAL_ONLY_OPTION='-t drvfs'
|
||||
else
|
||||
DF_LOCAL_ONLY_OPTION='-l'
|
||||
fi
|
||||
if $DF $DF_LOCAL_ONLY_OPTION $1 > /dev/null 2>&1; then
|
||||
$2
|
||||
else
|
||||
# In WSL, local Windows drives are considered remote by df, but we are
|
||||
# required to build into a directory accessible from windows, so consider
|
||||
# them local here.
|
||||
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl"; then
|
||||
if $DF $1 | $GREP -q "^[[A-Z]]:"; then
|
||||
$2
|
||||
else
|
||||
$3
|
||||
fi
|
||||
else
|
||||
$3
|
||||
fi
|
||||
$3
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -72,7 +72,6 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
|
||||
UTIL_REQUIRE_PROGS(UNAME, uname)
|
||||
UTIL_REQUIRE_PROGS(UNIQ, uniq)
|
||||
UTIL_REQUIRE_PROGS(WC, wc)
|
||||
UTIL_REQUIRE_PROGS(WHICH, which)
|
||||
UTIL_REQUIRE_PROGS(XARGS, xargs)
|
||||
|
||||
# Then required tools that require some special treatment.
|
||||
@@ -97,7 +96,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
|
||||
UTIL_PATH_PROGS(NICE, nice)
|
||||
|
||||
UTIL_PATH_PROGS(LSB_RELEASE, lsb_release)
|
||||
UTIL_PATH_PROGS(CMD, [cmd.exe /mnt/c/Windows/System32/cmd.exe])
|
||||
UTIL_PATH_PROGS(CMD, cmd.exe, $PATH /cygdrive/c/Windows/System32 /mnt/c/Windows/System32)
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
@@ -270,23 +269,15 @@ AC_DEFUN([BASIC_CHECK_TAR],
|
||||
TAR_TYPE="bsd"
|
||||
elif test "x$($TAR -v | $GREP "bsdtar")" != "x"; then
|
||||
TAR_TYPE="bsd"
|
||||
elif test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
|
||||
TAR_TYPE="solaris"
|
||||
elif test "x$OPENJDK_BUILD_OS" = "xaix"; then
|
||||
TAR_TYPE="aix"
|
||||
fi
|
||||
AC_MSG_CHECKING([what type of tar was found])
|
||||
AC_MSG_RESULT([$TAR_TYPE])
|
||||
|
||||
TAR_CREATE_FILE_PARAM=""
|
||||
|
||||
if test "x$TAR_TYPE" = "xgnu"; then
|
||||
TAR_INCLUDE_PARAM="T"
|
||||
TAR_SUPPORTS_TRANSFORM="true"
|
||||
if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
|
||||
# When using gnu tar for Solaris targets, need to use compatibility mode
|
||||
TAR_CREATE_EXTRA_PARAM="--format=ustar"
|
||||
fi
|
||||
elif test "x$TAR_TYPE" = "aix"; then
|
||||
# -L InputList of aix tar: name of file listing the files and directories
|
||||
# that need to be archived or extracted
|
||||
@@ -297,7 +288,6 @@ AC_DEFUN([BASIC_CHECK_TAR],
|
||||
TAR_SUPPORTS_TRANSFORM="false"
|
||||
fi
|
||||
AC_SUBST(TAR_TYPE)
|
||||
AC_SUBST(TAR_CREATE_EXTRA_PARAM)
|
||||
AC_SUBST(TAR_INCLUDE_PARAM)
|
||||
AC_SUBST(TAR_SUPPORTS_TRANSFORM)
|
||||
])
|
||||
@@ -359,7 +349,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
|
||||
UTIL_PATH_PROGS(STAT, stat)
|
||||
UTIL_PATH_PROGS(TIME, time)
|
||||
UTIL_PATH_PROGS(FLOCK, flock)
|
||||
# Dtrace is usually found in /usr/sbin on Solaris, but that directory may not
|
||||
# Dtrace is usually found in /usr/sbin, but that directory may not
|
||||
# be in the user path.
|
||||
UTIL_PATH_PROGS(DTRACE, dtrace, $PATH:/usr/sbin)
|
||||
UTIL_PATH_PROGS(PATCH, [gpatch patch])
|
||||
@@ -415,8 +405,6 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
|
||||
fi
|
||||
fi
|
||||
UTIL_REQUIRE_PROGS(SETFILE, SetFile)
|
||||
elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
|
||||
UTIL_REQUIRE_PROGS(ELFEDIT, elfedit)
|
||||
fi
|
||||
if ! test "x$OPENJDK_TARGET_OS" = "xwindows"; then
|
||||
UTIL_REQUIRE_BUILTIN_PROGS(ULIMIT, ulimit)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 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
|
||||
@@ -31,18 +31,30 @@ AC_DEFUN([BASIC_CHECK_PATHS_WINDOWS],
|
||||
AC_MSG_ERROR([Your base path is too long. It is $SRC_ROOT_LENGTH characters long, but only 100 is supported])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([Windows version])
|
||||
# Additional [] needed to keep m4 from mangling shell constructs.
|
||||
[ WINDOWS_VERSION=`$CMD /c ver.exe | $EGREP -o '([0-9]+\.)+[0-9]+'` ]
|
||||
AC_MSG_RESULT([$WINDOWS_VERSION])
|
||||
|
||||
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
|
||||
AC_MSG_CHECKING([cygwin release])
|
||||
CYGWIN_VERSION=`$UNAME -r`
|
||||
AC_MSG_RESULT([$CYGWIN_VERSION])
|
||||
WINDOWS_ENV_VENDOR='cygwin'
|
||||
WINDOWS_ENV_VERSION="$CYGWIN_VERSION"
|
||||
CYGWIN_RELEASE=`$UNAME -r`
|
||||
AC_MSG_RESULT([$CYGWIN_RELEASE])
|
||||
|
||||
CYGWIN_VERSION_OLD=`$ECHO $CYGWIN_VERSION | $GREP -e '^1\.[0-6]'`
|
||||
AC_MSG_CHECKING([cygwin version])
|
||||
CYGWIN_VERSION=`$UNAME -v`
|
||||
AC_MSG_RESULT([$CYGWIN_VERSION])
|
||||
|
||||
# Additional [] needed to keep m4 from mangling shell constructs.
|
||||
[ CYGWIN_VERSION_OLD=`$ECHO $CYGWIN_RELEASE | $GREP -e '^1\.[0-6]'` ]
|
||||
if test "x$CYGWIN_VERSION_OLD" != x; then
|
||||
AC_MSG_NOTICE([Your cygwin is too old. You are running $CYGWIN_VERSION, but at least cygwin 1.7 is required. Please upgrade.])
|
||||
AC_MSG_NOTICE([Your cygwin is too old. You are running $CYGWIN_RELEASE, but at least cygwin 1.7 is required. Please upgrade.])
|
||||
AC_MSG_ERROR([Cannot continue])
|
||||
fi
|
||||
|
||||
WINDOWS_ENV_VENDOR='cygwin'
|
||||
WINDOWS_ENV_VERSION="$CYGWIN_RELEASE, $CYGWIN_VERSION"
|
||||
|
||||
if test "x$CYGPATH" = x; then
|
||||
AC_MSG_ERROR([Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path])
|
||||
fi
|
||||
@@ -59,11 +71,15 @@ AC_DEFUN([BASIC_CHECK_PATHS_WINDOWS],
|
||||
fi
|
||||
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
|
||||
AC_MSG_CHECKING([msys release])
|
||||
MSYS_VERSION=`$UNAME -r`
|
||||
MSYS_RELEASE=`$UNAME -r`
|
||||
AC_MSG_RESULT([$MSYS_RELEASE])
|
||||
|
||||
AC_MSG_CHECKING([msys version])
|
||||
MSYS_VERSION=`$UNAME -v`
|
||||
AC_MSG_RESULT([$MSYS_VERSION])
|
||||
|
||||
WINDOWS_ENV_VENDOR='msys'
|
||||
WINDOWS_ENV_VERSION="$MSYS_VERSION"
|
||||
WINDOWS_ENV_VERSION="$MSYS_RELEASE, $MSYS_VERSION"
|
||||
|
||||
AC_MSG_CHECKING([msys root directory as unix-style path])
|
||||
# The cmd output ends with Windows line endings (CR/LF), the grep command will strip that away
|
||||
@@ -72,10 +88,6 @@ AC_DEFUN([BASIC_CHECK_PATHS_WINDOWS],
|
||||
AC_MSG_RESULT([$MSYS_ROOT_PATH])
|
||||
WINDOWS_ENV_ROOT_PATH="$MSYS_ROOT_PATH"
|
||||
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl"; then
|
||||
AC_MSG_CHECKING([Windows version])
|
||||
# m4 replaces [ and ] so we use @<:@ and @:>@ instead
|
||||
WINDOWS_VERSION=`$CMD /c ver.exe | $EGREP -o '(@<:@0-9@:>@+\.)+@<:@0-9@:>@+'`
|
||||
AC_MSG_RESULT([$WINDOWS_VERSION])
|
||||
|
||||
AC_MSG_CHECKING([WSL kernel version])
|
||||
WSL_KERNEL_VERSION=`$UNAME -v`
|
||||
@@ -89,8 +101,8 @@ AC_DEFUN([BASIC_CHECK_PATHS_WINDOWS],
|
||||
WSL_DISTRIBUTION=`$LSB_RELEASE -d | sed 's/Description:\t//'`
|
||||
AC_MSG_RESULT([$WSL_DISTRIBUTION])
|
||||
|
||||
WINDOWS_ENV_VENDOR='WSL'
|
||||
WINDOWS_ENV_VERSION="$WSL_DISTRIBUTION $WSL_KERNEL_VERSION $WSL_KERNEL_RELEASE (on Windows build $WINDOWS_VERSION)"
|
||||
WINDOWS_ENV_VENDOR='wsl'
|
||||
WINDOWS_ENV_VERSION="$WSL_KERNEL_RELEASE, $WSL_KERNEL_VERSION ($WSL_DISTRIBUTION)"
|
||||
else
|
||||
AC_MSG_ERROR([Unknown Windows environment. Neither cygwin, msys, nor wsl was detected.])
|
||||
fi
|
||||
@@ -138,10 +150,10 @@ AC_DEFUN_ONCE([BASIC_COMPILE_FIXPATH],
|
||||
fi
|
||||
FIXPATH_SRC_W="$FIXPATH_SRC"
|
||||
FIXPATH_BIN_W="$FIXPATH_BIN"
|
||||
UTIL_REWRITE_AS_WINDOWS_MIXED_PATH([FIXPATH_SRC_W])
|
||||
UTIL_REWRITE_AS_WINDOWS_MIXED_PATH([FIXPATH_BIN_W])
|
||||
$RM -rf $FIXPATH_BIN $FIXPATH_DIR
|
||||
$MKDIR -p $FIXPATH_DIR $CONFIGURESUPPORT_OUTPUTDIR/bin
|
||||
UTIL_REWRITE_AS_WINDOWS_MIXED_PATH([FIXPATH_SRC_W])
|
||||
UTIL_REWRITE_AS_WINDOWS_MIXED_PATH([FIXPATH_BIN_W])
|
||||
cd $FIXPATH_DIR
|
||||
$CC $FIXPATH_SRC_W -Fe$FIXPATH_BIN_W > $FIXPATH_DIR/fixpath1.log 2>&1
|
||||
cd $CONFIGURE_START_DIR
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 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
|
||||
@@ -74,7 +74,8 @@ AC_DEFUN([BOOTJDK_DO_CHECK],
|
||||
BOOT_JDK_FOUND=no
|
||||
else
|
||||
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
|
||||
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java$EXE_SUFFIX" $USER_BOOT_JDK_OPTIONS -version 2>&1 | $HEAD -n 1`
|
||||
# Additional [] needed to keep m4 from mangling shell constructs.
|
||||
[ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java$EXE_SUFFIX" $USER_BOOT_JDK_OPTIONS -version 2>&1 | $AWK '/version \"[0-9a-zA-Z\._\-]+\"/{print $ 0; exit;}'` ]
|
||||
if [ [[ "$BOOT_JDK_VERSION" =~ "Picked up" ]] ]; then
|
||||
AC_MSG_NOTICE([You have _JAVA_OPTIONS or JAVA_TOOL_OPTIONS set. This can mess up the build. Please use --with-boot-jdk-jvmargs instead.])
|
||||
AC_MSG_NOTICE([Java reports: "$BOOT_JDK_VERSION".])
|
||||
@@ -345,11 +346,12 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK],
|
||||
|
||||
# When compiling code to be executed by the Boot JDK, force compatibility with the
|
||||
# oldest supported bootjdk.
|
||||
BOOT_JDK_SOURCETARGET="-source 13 -target 13"
|
||||
OLDEST_BOOT_JDK=`$ECHO $DEFAULT_ACCEPTABLE_BOOT_VERSIONS \
|
||||
| $TR " " "\n" | $SORT -n | $HEAD -n1`
|
||||
# -Xlint:-options is added to avoid "warning: [options] system modules path not set in conjunction with -source"
|
||||
BOOT_JDK_SOURCETARGET="-source $OLDEST_BOOT_JDK -target $OLDEST_BOOT_JDK -Xlint:-options"
|
||||
AC_SUBST(BOOT_JDK_SOURCETARGET)
|
||||
|
||||
AC_SUBST(JAVAC_FLAGS)
|
||||
|
||||
# Check if the boot jdk is 32 or 64 bit
|
||||
if "$JAVA" -version 2>&1 | $GREP -q "64-Bit"; then
|
||||
BOOT_JDK_BITS="64"
|
||||
@@ -416,12 +418,10 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
|
||||
UTIL_ADD_JVM_ARG_IF_OK([-Xms64M],boot_jdk_jvmargs_big,[$JAVA])
|
||||
BOOTCYCLE_JVM_ARGS_BIG=-Xms64M
|
||||
|
||||
# Maximum amount of heap memory and stack size.
|
||||
# Maximum amount of heap memory.
|
||||
JVM_HEAP_LIMIT_32="768"
|
||||
# Running a 64 bit JVM allows for and requires a bigger heap
|
||||
JVM_HEAP_LIMIT_64="1600"
|
||||
STACK_SIZE_32=768
|
||||
STACK_SIZE_64=1536
|
||||
JVM_HEAP_LIMIT_GLOBAL=`expr $MEMORY_SIZE / 2`
|
||||
if test "$JVM_HEAP_LIMIT_GLOBAL" -lt "$JVM_HEAP_LIMIT_32"; then
|
||||
JVM_HEAP_LIMIT_32=$JVM_HEAP_LIMIT_GLOBAL
|
||||
@@ -435,14 +435,11 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
|
||||
fi
|
||||
|
||||
if test "x$BOOT_JDK_BITS" = "x32"; then
|
||||
STACK_SIZE=$STACK_SIZE_32
|
||||
JVM_MAX_HEAP=$JVM_HEAP_LIMIT_32
|
||||
else
|
||||
STACK_SIZE=$STACK_SIZE_64
|
||||
JVM_MAX_HEAP=$JVM_HEAP_LIMIT_64
|
||||
fi
|
||||
UTIL_ADD_JVM_ARG_IF_OK([-Xmx${JVM_MAX_HEAP}M],boot_jdk_jvmargs_big,[$JAVA])
|
||||
UTIL_ADD_JVM_ARG_IF_OK([-XX:ThreadStackSize=$STACK_SIZE],boot_jdk_jvmargs_big,[$JAVA])
|
||||
|
||||
AC_MSG_RESULT([$boot_jdk_jvmargs_big])
|
||||
|
||||
@@ -451,21 +448,14 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
|
||||
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = "x32"; then
|
||||
BOOTCYCLE_MAX_HEAP=$JVM_HEAP_LIMIT_32
|
||||
BOOTCYCLE_STACK_SIZE=$STACK_SIZE_32
|
||||
else
|
||||
BOOTCYCLE_MAX_HEAP=$JVM_HEAP_LIMIT_64
|
||||
BOOTCYCLE_STACK_SIZE=$STACK_SIZE_64
|
||||
fi
|
||||
BOOTCYCLE_JVM_ARGS_BIG="$BOOTCYCLE_JVM_ARGS_BIG -Xmx${BOOTCYCLE_MAX_HEAP}M"
|
||||
BOOTCYCLE_JVM_ARGS_BIG="$BOOTCYCLE_JVM_ARGS_BIG -XX:ThreadStackSize=$BOOTCYCLE_STACK_SIZE"
|
||||
AC_MSG_CHECKING([flags for bootcycle boot jdk java command for big workloads])
|
||||
AC_MSG_RESULT([$BOOTCYCLE_JVM_ARGS_BIG])
|
||||
AC_SUBST(BOOTCYCLE_JVM_ARGS_BIG)
|
||||
|
||||
# By default, the main javac compilations use big
|
||||
JAVA_FLAGS_JAVAC="$JAVA_FLAGS_BIG"
|
||||
AC_SUBST(JAVA_FLAGS_JAVAC)
|
||||
|
||||
AC_MSG_CHECKING([flags for boot jdk java command for small workloads])
|
||||
|
||||
# Use serial gc for small short lived tools if possible
|
||||
@@ -479,6 +469,11 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
|
||||
JAVA_FLAGS_SMALL=$boot_jdk_jvmargs_small
|
||||
AC_SUBST(JAVA_FLAGS_SMALL)
|
||||
|
||||
# Don't presuppose SerialGC is present in the buildjdk. Also, we cannot test
|
||||
# the buildjdk, but on the other hand we know what it will support.
|
||||
BUILDJDK_JAVA_FLAGS_SMALL="-Xms32M -Xmx512M -XX:TieredStopAtLevel=1"
|
||||
AC_SUBST(BUILDJDK_JAVA_FLAGS_SMALL)
|
||||
|
||||
JAVA_TOOL_FLAGS_SMALL=""
|
||||
for f in $JAVA_FLAGS_SMALL; do
|
||||
JAVA_TOOL_FLAGS_SMALL="$JAVA_TOOL_FLAGS_SMALL -J$f"
|
||||
@@ -520,7 +515,8 @@ AC_DEFUN([BOOTJDK_CHECK_BUILD_JDK],
|
||||
BUILD_JDK_FOUND=no
|
||||
else
|
||||
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
|
||||
BUILD_JDK_VERSION=`"$BUILD_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
|
||||
# Additional [] needed to keep m4 from mangling shell constructs.
|
||||
[ BUILD_JDK_VERSION=`"$BUILD_JDK/bin/java" -version 2>&1 | $AWK '/version \"[0-9a-zA-Z\._\-]+\"/{print $ 0; exit;}'` ]
|
||||
|
||||
# Extra M4 quote needed to protect [] in grep expression.
|
||||
[FOUND_CORRECT_VERSION=`echo $BUILD_JDK_VERSION | $EGREP "\"$VERSION_FEATURE([\.+-].*)?\""`]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 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
|
||||
@@ -35,10 +35,6 @@ ifeq ($(firstword $(JAVA)),$(FIXPATH))
|
||||
else
|
||||
JAVA_EXEC_POS=1
|
||||
endif
|
||||
ifneq ($(word $(JAVA_EXEC_POS),$(SJAVAC_SERVER_JAVA)),$(word $(JAVA_EXEC_POS),$(JAVA)))
|
||||
$(error Bootcycle builds are not possible if --with-sjavac-server-java is specified)
|
||||
endif
|
||||
|
||||
|
||||
# Override specific values to do a boot cycle build
|
||||
|
||||
@@ -48,21 +44,19 @@ BOOT_JDK := $(JDK_IMAGE_DIR)
|
||||
# The bootcycle build has a different output directory
|
||||
OLD_OUTPUTDIR:=@OUTPUTDIR@
|
||||
OUTPUTDIR:=$(OLD_OUTPUTDIR)/bootcycle-build
|
||||
SJAVAC_SERVER_DIR:=$(patsubst $(OLD_OUTPUTDIR)%, $(OUTPUTDIR)%, $(SJAVAC_SERVER_DIR))
|
||||
# No spaces in patsubst to avoid leading space in variable
|
||||
JAVAC_SERVER_DIR:=$(patsubst $(OLD_OUTPUTDIR)%,$(OUTPUTDIR)%,$(JAVAC_SERVER_DIR))
|
||||
|
||||
JAVA_CMD:=$(BOOT_JDK)/bin/java
|
||||
JAVAC_CMD:=$(BOOT_JDK)/bin/javac
|
||||
JAR_CMD:=$(BOOT_JDK)/bin/jar
|
||||
JARSIGNER_CMD:=$(BOOT_JDK)/bin/jarsigner
|
||||
SJAVAC_SERVER_JAVA_CMD:=$(JAVA_CMD)
|
||||
# When building a 32bit target, make sure the sjavac server flags are compatible
|
||||
# with a 32bit JVM.
|
||||
ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
|
||||
SJAVAC_SERVER_JAVA_FLAGS := @BOOTCYCLE_JVM_ARGS_BIG@
|
||||
endif
|
||||
# The bootcycle JVM arguments may differ from the original boot jdk.
|
||||
JAVA_FLAGS_BIG := @BOOTCYCLE_JVM_ARGS_BIG@
|
||||
# Any CDS settings generated for the bootjdk are invalid in the bootcycle build.
|
||||
# By filtering out those JVM args, the bootcycle JVM will use its default
|
||||
# settings for CDS.
|
||||
JAVA_FLAGS := $(filter-out -XX:SharedArchiveFile% -Xshare%, $(JAVA_FLAGS))
|
||||
|
||||
# Pandoc cannot be used without the jjs plugin, which was removed with Nashorn.
|
||||
ENABLE_PANDOC := false
|
||||
|
||||
18
make/autoconf/build-aux/config.guess
vendored
18
make/autoconf/build-aux/config.guess
vendored
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012, 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
|
||||
@@ -30,22 +30,6 @@
|
||||
DIR=`dirname $0`
|
||||
OUT=`. $DIR/autoconf-config.guess`
|
||||
|
||||
# Test and fix solaris on x86_64
|
||||
echo $OUT | grep i386-pc-solaris > /dev/null 2> /dev/null
|
||||
if test $? = 0; then
|
||||
# isainfo -n returns either i386 or amd64
|
||||
REAL_CPU=`isainfo -n`
|
||||
OUT=$REAL_CPU`echo $OUT | sed -e 's/[^-]*//'`
|
||||
fi
|
||||
|
||||
# Test and fix solaris on sparcv9
|
||||
echo $OUT | grep sparc-sun-solaris > /dev/null 2> /dev/null
|
||||
if test $? = 0; then
|
||||
# isainfo -n returns either sparc or sparcv9
|
||||
REAL_CPU=`isainfo -n`
|
||||
OUT=$REAL_CPU`echo $OUT | sed -e 's/[^-]*//'`
|
||||
fi
|
||||
|
||||
# Test and fix cygwin on x86_64
|
||||
echo $OUT | grep 86-pc-cygwin > /dev/null 2> /dev/null
|
||||
if test $? != 0; then
|
||||
|
||||
@@ -32,11 +32,12 @@ AC_DEFUN([BPERF_CHECK_CORES],
|
||||
if test -f /proc/cpuinfo; then
|
||||
# Looks like a Linux (or cygwin) system
|
||||
NUM_CORES=`cat /proc/cpuinfo | grep -c processor`
|
||||
FOUND_CORES=yes
|
||||
elif test -x /usr/sbin/psrinfo; then
|
||||
# Looks like a Solaris system
|
||||
NUM_CORES=`/usr/sbin/psrinfo -v | grep -c on-line`
|
||||
FOUND_CORES=yes
|
||||
if test "$NUM_CORES" -eq "0"; then
|
||||
NUM_CORES=`cat /proc/cpuinfo | grep -c ^CPU`
|
||||
fi
|
||||
if test "$NUM_CORES" -ne "0"; then
|
||||
FOUND_CORES=yes
|
||||
fi
|
||||
elif test -x /usr/sbin/sysctl; then
|
||||
# Looks like a MacOSX system
|
||||
NUM_CORES=`/usr/sbin/sysctl -n hw.ncpu`
|
||||
@@ -74,7 +75,7 @@ AC_DEFUN([BPERF_CHECK_MEMORY_SIZE],
|
||||
MEMORY_SIZE=`expr $MEMORY_SIZE / 1024`
|
||||
FOUND_MEM=yes
|
||||
elif test -x /usr/sbin/prtconf; then
|
||||
# Looks like a Solaris or AIX system
|
||||
# Looks like an AIX system
|
||||
MEMORY_SIZE=`/usr/sbin/prtconf 2> /dev/null | grep "^Memory [[Ss]]ize" | awk '{ print [$]3 }'`
|
||||
FOUND_MEM=yes
|
||||
elif test -x /usr/sbin/sysctl; then
|
||||
@@ -365,9 +366,6 @@ AC_DEFUN_ONCE([BPERF_SETUP_PRECOMPILED_HEADERS],
|
||||
if test "x$ICECC" != "x"; then
|
||||
AC_MSG_RESULT([no, does not work effectively with icecc])
|
||||
PRECOMPILED_HEADERS_AVAILABLE=false
|
||||
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
AC_MSG_RESULT([no, does not work with Solaris Studio])
|
||||
PRECOMPILED_HEADERS_AVAILABLE=false
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
AC_MSG_RESULT([no, does not work with xlc])
|
||||
PRECOMPILED_HEADERS_AVAILABLE=false
|
||||
@@ -393,72 +391,11 @@ AC_DEFUN_ONCE([BPERF_SETUP_PRECOMPILED_HEADERS],
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN_ONCE([BPERF_SETUP_SMART_JAVAC],
|
||||
AC_DEFUN_ONCE([BPERF_SETUP_JAVAC_SERVER],
|
||||
[
|
||||
AC_ARG_WITH(sjavac-server-java, [AS_HELP_STRING([--with-sjavac-server-java],
|
||||
[use this java binary for running the sjavac background server @<:@Boot JDK java@:>@])])
|
||||
|
||||
if test "x$with_sjavac_server_java" != x; then
|
||||
SJAVAC_SERVER_JAVA="$with_sjavac_server_java"
|
||||
FOUND_VERSION=`$SJAVAC_SERVER_JAVA -version 2>&1 | grep " version \""`
|
||||
if test "x$FOUND_VERSION" = x; then
|
||||
AC_MSG_ERROR([Could not execute server java: $SJAVAC_SERVER_JAVA])
|
||||
fi
|
||||
else
|
||||
SJAVAC_SERVER_JAVA="$JAVA"
|
||||
fi
|
||||
AC_SUBST(SJAVAC_SERVER_JAVA)
|
||||
|
||||
if test "$MEMORY_SIZE" -gt "3000"; then
|
||||
if "$JAVA" -version 2>&1 | $GREP -q "64-Bit"; then
|
||||
JVM_64BIT=true
|
||||
fi
|
||||
fi
|
||||
|
||||
MX_VALUE=`expr $MEMORY_SIZE / 2`
|
||||
if test "$JVM_64BIT" = true; then
|
||||
# Set ms lower than mx since more than one instance of the server might
|
||||
# get launched at the same time before they figure out which instance won.
|
||||
MS_VALUE=512
|
||||
if test "$MX_VALUE" -gt "2048"; then
|
||||
MX_VALUE=2048
|
||||
fi
|
||||
else
|
||||
MS_VALUE=256
|
||||
if test "$MX_VALUE" -gt "1500"; then
|
||||
MX_VALUE=1500
|
||||
fi
|
||||
fi
|
||||
if test "$MX_VALUE" -lt "512"; then
|
||||
MX_VALUE=512
|
||||
fi
|
||||
|
||||
JAVAC_SERVER_AVAILABLE=true
|
||||
SJAVAC_MEMORY_OPT="-Xms${MS_VALUE}M -Xmx${MX_VALUE}M"
|
||||
UTIL_ADD_JVM_ARG_IF_OK([$SJAVAC_MEMORY_OPT],SJAVAC_SERVER_JAVA_FLAGS,[$SJAVAC_SERVER_JAVA])
|
||||
if test "x$JVM_ARG_OK" = "xfalse"; then
|
||||
AC_MSG_WARN([Could not set '$SJAVAC_MEMORY_OPT' on bootjdk, disabling sjavac and javac server])
|
||||
JAVAC_SERVER_AVAILABLE=false
|
||||
fi
|
||||
AC_SUBST(SJAVAC_SERVER_JAVA_FLAGS)
|
||||
|
||||
UTIL_ARG_ENABLE(NAME: sjavac, DEFAULT: false, AVAILABLE: $JAVAC_SERVER_AVAILABLE,
|
||||
DESC: [use sjavac to do fast incremental compiles],
|
||||
CHECKING_MSG: [whether to use sjavac],
|
||||
IF_ENABLED: [ ENABLE_SJAVAC="yes" ],
|
||||
IF_DISABLED: [ ENABLE_SJAVAC="no" ])
|
||||
AC_SUBST(ENABLE_SJAVAC)
|
||||
|
||||
UTIL_ARG_ENABLE(NAME: javac-server, DEFAULT: true, AVAILABLE: $JAVAC_SERVER_AVAILABLE,
|
||||
UTIL_ARG_ENABLE(NAME: javac-server, DEFAULT: true,
|
||||
RESULT: ENABLE_JAVAC_SERVER,
|
||||
DESC: [enable javac server],
|
||||
CHECKING_MSG: [whether to use javac server],
|
||||
IF_ENABLED: [ ENABLE_JAVAC_SERVER="yes" ],
|
||||
IF_DISABLED: [ ENABLE_JAVAC_SERVER="no" ])
|
||||
CHECKING_MSG: [whether to use javac server])
|
||||
AC_SUBST(ENABLE_JAVAC_SERVER)
|
||||
|
||||
if test "x$ENABLE_JAVAC_SERVER" = "xyes" || test "x$ENABLE_SJAVAC" = "xyes"; then
|
||||
# When using a server javac, the small client instances do not need much
|
||||
# resources.
|
||||
JAVA_FLAGS_JAVAC="$JAVA_FLAGS_SMALL"
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -91,9 +91,6 @@ DISABLE_WARNING_PREFIX := @BUILD_CC_DISABLE_WARNING_PREFIX@
|
||||
# Save speed and disk space by not enabling debug symbols for the buildjdk
|
||||
ENABLE_DEBUG_SYMBOLS := false
|
||||
|
||||
# Control whether Hotspot builds gtest tests
|
||||
BUILD_GTEST := false
|
||||
|
||||
JVM_VARIANTS := server
|
||||
JVM_VARIANT_MAIN := server
|
||||
JVM_FEATURES_server := cds compiler1 compiler2 g1gc serialgc
|
||||
|
||||
@@ -95,6 +95,9 @@ if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
export HOTSPOT_BUILD_TIME="@HOTSPOT_BUILD_TIME@"
|
||||
export USE_PRECOMPILED_HEADER="@USE_PRECOMPILED_HEADER@"
|
||||
|
||||
# Now locate the main script and run it.
|
||||
REAL_COMPARE_SCRIPT="$TOPDIR/make/scripts/compare.sh"
|
||||
if [ ! -e "$REAL_COMPARE_SCRIPT" ]; then
|
||||
|
||||
12
make/autoconf/configure
vendored
12
make/autoconf/configure
vendored
@@ -78,11 +78,11 @@ generated_script="$build_support_dir/generated-configure.sh"
|
||||
###
|
||||
|
||||
autoconf_missing_help() {
|
||||
APT_GET="`which apt-get 2> /dev/null | grep -v '^no apt-get in'`"
|
||||
YUM="`which yum 2> /dev/null | grep -v '^no yum in'`"
|
||||
BREW="`which brew 2> /dev/null | grep -v '^no brew in'`"
|
||||
ZYPPER="`which zypper 2> /dev/null | grep -v '^no zypper in'`"
|
||||
CYGWIN="`which cygpath 2> /dev/null | grep -v '^no cygpath in'`"
|
||||
APT_GET="`type -p apt-get 2> /dev/null`"
|
||||
YUM="`type -p yum 2> /dev/null`"
|
||||
BREW="`type -p brew 2> /dev/null`"
|
||||
ZYPPER="`type -p zypper 2> /dev/null`"
|
||||
CYGWIN="`type -p cygpath 2> /dev/null`"
|
||||
|
||||
if test "x$ZYPPER" != x; then
|
||||
PKGHANDLER_COMMAND="sudo zypper install autoconf"
|
||||
@@ -111,7 +111,7 @@ generate_configure_script() {
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
AUTOCONF="`which autoconf 2> /dev/null | grep -v '^no autoconf in'`"
|
||||
AUTOCONF="`type -p autoconf 2> /dev/null`"
|
||||
if test "x$AUTOCONF" = x; then
|
||||
echo
|
||||
echo "Autoconf is not found on the PATH, and AUTOCONF is not set."
|
||||
|
||||
@@ -97,6 +97,9 @@ HOTSPOT_SETUP_JVM_VARIANTS
|
||||
# With basic setup done, call the custom early hook.
|
||||
CUSTOM_EARLY_HOOK
|
||||
|
||||
# This only needs debug level to be setup
|
||||
JDKOPT_ALLOW_ABSOLUTE_PATHS_IN_OUTPUT
|
||||
|
||||
# Check if we have devkits, extra paths or sysroot set.
|
||||
BASIC_SETUP_DEVKIT
|
||||
|
||||
@@ -123,12 +126,11 @@ BASIC_SETUP_DEFAULT_LOG
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Determine OpenJDK variants, options and version numbers.
|
||||
# Determine OpenJDK variants and version numbers.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
# We need build & target for this.
|
||||
JDKOPT_SETUP_JDK_OPTIONS
|
||||
JDKOPT_SETUP_JLINK_OPTIONS
|
||||
JDKVER_SETUP_JDK_VERSION_NUMBERS
|
||||
|
||||
@@ -141,6 +143,14 @@ JDKVER_SETUP_JDK_VERSION_NUMBERS
|
||||
BOOTJDK_SETUP_BOOT_JDK
|
||||
BOOTJDK_SETUP_BUILD_JDK
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Determine JDK specific build time options.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
JDKOPT_SETUP_JDK_OPTIONS
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Configure the sources to use. We can add or override individual directories.
|
||||
@@ -224,7 +234,6 @@ LIB_SETUP_LIBRARIES
|
||||
JVM_FEATURES_PARSE_OPTIONS
|
||||
JVM_FEATURES_SETUP
|
||||
|
||||
HOTSPOT_ENABLE_DISABLE_GTEST
|
||||
HOTSPOT_SETUP_MISC
|
||||
|
||||
###############################################################################
|
||||
@@ -239,6 +248,7 @@ JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST
|
||||
JDKOPT_EXCLUDE_TRANSLATIONS
|
||||
JDKOPT_ENABLE_DISABLE_MANPAGES
|
||||
JDKOPT_ENABLE_DISABLE_CDS_ARCHIVE
|
||||
JDKOPT_SETUP_REPRODUCIBLE_BUILD
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
@@ -251,13 +261,11 @@ BPERF_SETUP_BUILD_CORES
|
||||
BPERF_SETUP_BUILD_MEMORY
|
||||
BPERF_SETUP_BUILD_JOBS
|
||||
BPERF_SETUP_TEST_JOBS
|
||||
BPERF_SETUP_JAVAC_SERVER
|
||||
|
||||
# Setup arguments for the boot jdk (after cores and memory have been setup)
|
||||
BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS
|
||||
|
||||
# Setup smart javac (after cores and memory have been setup)
|
||||
BPERF_SETUP_SMART_JAVAC
|
||||
|
||||
# Setup use of icecc if requested
|
||||
BPERF_SETUP_ICECC
|
||||
|
||||
|
||||
@@ -35,8 +35,6 @@
|
||||
AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
|
||||
[
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
C_FLAG_REORDER=''
|
||||
|
||||
# Default works for linux, might work on other platforms as well.
|
||||
SHARED_LIBRARY_FLAGS='-shared'
|
||||
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1'
|
||||
@@ -45,8 +43,6 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
|
||||
SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1'
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
C_FLAG_REORDER=''
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
# Linking is different on MacOSX
|
||||
SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0"
|
||||
@@ -71,16 +67,7 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
|
||||
fi
|
||||
fi
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
C_FLAG_REORDER='-xF'
|
||||
SHARED_LIBRARY_FLAGS="-G"
|
||||
SET_EXECUTABLE_ORIGIN='-R\$$ORIGIN[$]1'
|
||||
SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
|
||||
SET_SHARED_LIBRARY_NAME='-h [$]1'
|
||||
SET_SHARED_LIBRARY_MAPFILE='-M[$]1'
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
C_FLAG_REORDER=''
|
||||
SHARED_LIBRARY_FLAGS="-qmkshrobj -bM:SRE -bnoentry"
|
||||
SET_EXECUTABLE_ORIGIN=""
|
||||
SET_SHARED_LIBRARY_ORIGIN=''
|
||||
@@ -88,7 +75,6 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
|
||||
SET_SHARED_LIBRARY_MAPFILE=''
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
C_FLAG_REORDER=''
|
||||
SHARED_LIBRARY_FLAGS="-dll"
|
||||
SET_EXECUTABLE_ORIGIN=''
|
||||
SET_SHARED_LIBRARY_ORIGIN=''
|
||||
@@ -96,7 +82,6 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
|
||||
SET_SHARED_LIBRARY_MAPFILE='-def:[$]1'
|
||||
fi
|
||||
|
||||
AC_SUBST(C_FLAG_REORDER)
|
||||
AC_SUBST(SET_EXECUTABLE_ORIGIN)
|
||||
AC_SUBST(SET_SHARED_LIBRARY_ORIGIN)
|
||||
AC_SUBST(SET_SHARED_LIBRARY_NAME)
|
||||
@@ -117,9 +102,6 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
CFLAGS_DEBUG_SYMBOLS="-g"
|
||||
ASFLAGS_DEBUG_SYMBOLS="-g"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
# -g0 enables debug symbols without disabling inlining.
|
||||
CFLAGS_DEBUG_SYMBOLS="-g0 -xs"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
CFLAGS_DEBUG_SYMBOLS="-g1"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
@@ -154,17 +136,6 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
|
||||
DISABLED_WARNINGS="4800"
|
||||
;;
|
||||
|
||||
solstudio)
|
||||
DISABLE_WARNING_PREFIX="-erroff="
|
||||
CFLAGS_WARNINGS_ARE_ERRORS="-errwarn=%all"
|
||||
|
||||
WARNINGS_ENABLE_ALL_CFLAGS="-v -fd -xtransition"
|
||||
WARNINGS_ENABLE_ALL_CXXFLAGS="+w +w2"
|
||||
|
||||
DISABLED_WARNINGS_C="E_OLD_STYLE_FUNC_DECL E_OLD_STYLE_FUNC_DEF E_SEMANTICS_OF_OP_CHG_IN_ANSI_C E_NO_REPLACEMENT_IN_STRING E_DECLARATION_IN_CODE"
|
||||
DISABLED_WARNINGS_CXX="inllargeuse inllargeint notused wemptydecl notemsource"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
DISABLE_WARNING_PREFIX="-Wno-"
|
||||
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
|
||||
@@ -244,25 +215,7 @@ AC_DEFUN([FLAGS_SETUP_QUALITY_CHECKS],
|
||||
|
||||
AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
|
||||
[
|
||||
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
CC_HIGHEST="-fns -fsimple -fsingle -xbuiltin=%all -xdepend -xrestrict -xlibmil"
|
||||
|
||||
C_O_FLAG_HIGHEST_JVM="-xO4"
|
||||
C_O_FLAG_DEBUG_JVM=""
|
||||
C_O_FLAG_SIZE=""
|
||||
C_O_FLAG_DEBUG=""
|
||||
C_O_FLAG_NONE=""
|
||||
if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86"; then
|
||||
C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST"
|
||||
C_O_FLAG_HI="-xO4 -Wu,-O4~yz"
|
||||
C_O_FLAG_NORM="-xO2 -Wu,-O2~yz"
|
||||
elif test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then
|
||||
C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 \
|
||||
-xprefetch=auto,explicit $CC_HIGHEST"
|
||||
C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0"
|
||||
C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0"
|
||||
fi
|
||||
elif test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
C_O_FLAG_HIGHEST_JVM="-O3"
|
||||
C_O_FLAG_HIGHEST="-O3"
|
||||
C_O_FLAG_HI="-O3"
|
||||
@@ -286,21 +239,11 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
|
||||
C_O_FLAG_NONE="${C_O_FLAG_NONE} ${DISABLE_FORTIFY_CFLAGS}"
|
||||
fi
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
# On MacOSX we optimize for size, something
|
||||
# we should do for all platforms?
|
||||
C_O_FLAG_HIGHEST_JVM="-Os"
|
||||
C_O_FLAG_HIGHEST="-Os"
|
||||
C_O_FLAG_HI="-Os"
|
||||
C_O_FLAG_NORM="-Os"
|
||||
C_O_FLAG_DEBUG_JVM=""
|
||||
else
|
||||
C_O_FLAG_HIGHEST_JVM="-O3"
|
||||
C_O_FLAG_HIGHEST="-O3"
|
||||
C_O_FLAG_HI="-O3"
|
||||
C_O_FLAG_NORM="-O2"
|
||||
C_O_FLAG_DEBUG_JVM="-O0"
|
||||
fi
|
||||
C_O_FLAG_HIGHEST_JVM="-O3"
|
||||
C_O_FLAG_HIGHEST="-O3"
|
||||
C_O_FLAG_HI="-O3"
|
||||
C_O_FLAG_NORM="-O2"
|
||||
C_O_FLAG_DEBUG_JVM="-O0"
|
||||
C_O_FLAG_SIZE="-Os"
|
||||
C_O_FLAG_DEBUG="-O0"
|
||||
C_O_FLAG_NONE="-O0"
|
||||
@@ -334,11 +277,6 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
|
||||
CXX_O_FLAG_NONE="$C_O_FLAG_NONE"
|
||||
CXX_O_FLAG_SIZE="$C_O_FLAG_SIZE"
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
# In solstudio, also add this to C (but not C++) flags...
|
||||
C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xalias_level=basic"
|
||||
fi
|
||||
|
||||
# Adjust optimization flags according to debug level.
|
||||
case $DEBUG_LEVEL in
|
||||
release )
|
||||
@@ -431,9 +369,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
CFLAGS_OS_DEF_JVM="-DLINUX"
|
||||
CFLAGS_OS_DEF_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
|
||||
elif test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
CFLAGS_OS_DEF_JVM="-DSOLARIS"
|
||||
CFLAGS_OS_DEF_JDK="-D__solaris__"
|
||||
elif test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
CFLAGS_OS_DEF_JVM="-D_ALLBSD_SOURCE -D_DARWIN_C_SOURCE -D_XOPEN_SOURCE"
|
||||
CFLAGS_OS_DEF_JDK="-D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
|
||||
@@ -469,9 +404,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
# Setup debug/release defines
|
||||
if test "x$DEBUG_LEVEL" = xrelease; then
|
||||
DEBUG_CFLAGS_JDK="-DNDEBUG"
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
DEBUG_CFLAGS_JDK="$DEBUG_CFLAGS_JDK -DTRIMMED"
|
||||
fi
|
||||
else
|
||||
DEBUG_CFLAGS_JDK="-DDEBUG"
|
||||
|
||||
@@ -494,10 +426,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
ALWAYS_DEFINES_JVM="-D_GNU_SOURCE -D_REENTRANT"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
ALWAYS_DEFINES_JVM="-D_GNU_SOURCE"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
ALWAYS_DEFINES_JVM="-DSPARC_WORKS -D_Crun_inline_placement"
|
||||
ALWAYS_DEFINES_JDK="-DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
|
||||
ALWAYS_DEFINES_JDK_CXXONLY="-DCC_NOEX"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
ALWAYS_DEFINES_JVM="-D_REENTRANT"
|
||||
ALWAYS_DEFINES_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
|
||||
@@ -554,20 +482,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
TOOLCHAIN_CFLAGS_JDK="-pipe"
|
||||
TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing" # technically NOT for CXX
|
||||
fi
|
||||
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
TOOLCHAIN_FLAGS="-errtags -errfmt"
|
||||
TOOLCHAIN_CFLAGS="-errshort=tags"
|
||||
|
||||
TOOLCHAIN_CFLAGS_JDK="-mt $TOOLCHAIN_FLAGS"
|
||||
TOOLCHAIN_CFLAGS_JDK_CONLY="-W0,-noglobal $TOOLCHAIN_CFLAGS" # C only
|
||||
TOOLCHAIN_CFLAGS_JDK_CXXONLY="-features=no%except -norunpath -xnolib" # CXX only
|
||||
TOOLCHAIN_CFLAGS_JVM="-template=no%extdef -features=no%split_init \
|
||||
-library=stlport4 -mt -features=no%except $TOOLCHAIN_FLAGS"
|
||||
if test "x$DEBUG_LEVEL" = xslowdebug; then
|
||||
# Previously -g was used instead of -g0 for slowdebug; this is equivalent
|
||||
# to setting +d.
|
||||
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM +d"
|
||||
fi
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
# Suggested additions: -qsrcmsg to get improved error reporting
|
||||
@@ -588,11 +502,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang || test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
# Explicitly set C99. clang and xlclang support the same flag.
|
||||
LANGSTD_CFLAGS="-std=c99"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
# We can't turn on -std=c99 without breaking compilation of the splashscreen/png
|
||||
# utilities. But we can enable c99 as below (previously achieved by using -Xa).
|
||||
# It is the no_lib that makes the difference.
|
||||
LANGSTD_CFLAGS="-xc99=all,no_lib"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
# MSVC doesn't support C99/C11 explicitly, unless you compile as C++:
|
||||
# LANGSTD_CFLAGS="-TP"
|
||||
@@ -603,6 +512,18 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
fi
|
||||
TOOLCHAIN_CFLAGS_JDK_CONLY="$LANGSTD_CFLAGS $TOOLCHAIN_CFLAGS_JDK_CONLY"
|
||||
|
||||
# CXXFLAGS C++ language level for all of JDK, including Hotspot.
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang || test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
LANGSTD_CXXFLAGS="-std=c++14"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
LANGSTD_CXXFLAGS="-std:c++14"
|
||||
else
|
||||
AC_MSG_ERROR([Don't know how to enable C++14 for this toolchain])
|
||||
fi
|
||||
TOOLCHAIN_CFLAGS_JDK_CXXONLY="$TOOLCHAIN_CFLAGS_JDK_CXXONLY $LANGSTD_CXXFLAGS"
|
||||
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM $LANGSTD_CXXFLAGS"
|
||||
ADLC_LANGSTD_CXXFLAGS="$LANGSTD_CXXFLAGS"
|
||||
|
||||
# CFLAGS WARNINGS STUFF
|
||||
# Set JVM_CFLAGS warning handling
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
@@ -613,11 +534,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
WARNING_CFLAGS="$WARNINGS_ENABLE_ALL"
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
WARNING_CFLAGS_JDK_CONLY="$WARNINGS_ENABLE_ALL_CFLAGS"
|
||||
WARNING_CFLAGS_JDK_CXXONLY="$WARNINGS_ENABLE_ALL_CXXFLAGS"
|
||||
WARNING_CFLAGS_JVM="$WARNINGS_ENABLE_ALL_CXXFLAGS"
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
WARNING_CFLAGS="$WARNINGS_ENABLE_ALL"
|
||||
|
||||
@@ -641,8 +557,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
# Where does this really belong??
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
PICFLAG="-fPIC"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
PICFLAG="-KPIC"
|
||||
PIEFLAG="-fPIE"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
# '-qpic' defaults to 'qpic=small'. This means that the compiler generates only
|
||||
# one instruction for accessing the TOC. If the TOC grows larger than 64K, the linker
|
||||
@@ -697,7 +612,10 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
# JDK libraries.
|
||||
STATIC_LIBS_CFLAGS="-DSTATIC_BUILD=1"
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
STATIC_LIBS_CFLAGS="$STATIC_LIBS_CFLAGS -ffunction-sections -fdata-sections"
|
||||
STATIC_LIBS_CFLAGS="$STATIC_LIBS_CFLAGS -ffunction-sections -fdata-sections \
|
||||
-DJNIEXPORT='__attribute__((visibility(\"hidden\")))'"
|
||||
else
|
||||
STATIC_LIBS_CFLAGS="$STATIC_LIBS_CFLAGS -DJNIEXPORT="
|
||||
fi
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
# Disable relax-relocation to enable compatibility with older linkers
|
||||
@@ -721,21 +639,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
# Setup endianness
|
||||
if test "x$FLAGS_CPU_ENDIAN" = xlittle; then
|
||||
$1_DEFINES_CPU_JVM="-DVM_LITTLE_ENDIAN"
|
||||
fi
|
||||
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
# The macro _LITTLE_ENDIAN needs to be defined the same to avoid the
|
||||
# Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN
|
||||
if test "x$FLAGS_CPU_ENDIAN" = xlittle; then
|
||||
$1_DEFINES_CPU_JDK="-D_LITTLE_ENDIAN="
|
||||
else
|
||||
$1_DEFINES_CPU_JDK="-D_BIG_ENDIAN="
|
||||
fi
|
||||
$1_DEFINES_CPU_JDK="-D_LITTLE_ENDIAN"
|
||||
else
|
||||
if test "x$FLAGS_CPU_ENDIAN" = xlittle; then
|
||||
$1_DEFINES_CPU_JDK="-D_LITTLE_ENDIAN"
|
||||
else
|
||||
$1_DEFINES_CPU_JDK="-D_BIG_ENDIAN"
|
||||
fi
|
||||
$1_DEFINES_CPU_JDK="-D_BIG_ENDIAN"
|
||||
fi
|
||||
|
||||
# setup CPU bit size
|
||||
@@ -748,19 +654,14 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
if test "x$FLAGS_OS" = xlinux || test "x$FLAGS_OS" = xmacosx; then
|
||||
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_LP64=1"
|
||||
fi
|
||||
if test "x$FLAGS_OS" != xsolaris && test "x$FLAGS_OS" != xaix; then
|
||||
# Solaris does not have _LP64=1 in the old build.
|
||||
if test "x$FLAGS_OS" != xaix; then
|
||||
# xlc on AIX defines _LP64=1 by default and issues a warning if we redefine it.
|
||||
$1_DEFINES_CPU_JVM="${$1_DEFINES_CPU_JVM} -D_LP64=1"
|
||||
fi
|
||||
fi
|
||||
|
||||
# toolchain dependend, per-cpu
|
||||
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
if test "x$FLAGS_CPU_ARCH" = xx86; then
|
||||
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -DcpuIntel -Di586 -D$FLAGS_CPU_LEGACY_LIB"
|
||||
fi
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
if test "x$FLAGS_CPU" = xx86_64; then
|
||||
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_AMD64_ -Damd64"
|
||||
else
|
||||
@@ -778,7 +679,10 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
fi
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
if test "x$FLAGS_CPU" = xarm; then
|
||||
if test "x$FLAGS_CPU" = xaarch64; then
|
||||
# -Wno-psabi to get rid of annoying "note: parameter passing for argument of type '<type> changed in GCC 9.1"
|
||||
$1_CFLAGS_CPU="-Wno-psabi"
|
||||
elif test "x$FLAGS_CPU" = xarm; then
|
||||
# -Wno-psabi to get rid of annoying "note: the mangling of 'va_list' has changed in GCC 4.4"
|
||||
$1_CFLAGS_CPU="-fsigned-char -Wno-psabi $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS -DJDK_ARCH_ABI_PROP_NAME='\"\$(JDK_ARCH_ABI_PROP_NAME)\"'"
|
||||
$1_CFLAGS_CPU_JVM="-DARM"
|
||||
@@ -802,13 +706,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
$1_CFLAGS_CPU_JDK="${$1_CFLAGS_CPU_JDK} -fno-omit-frame-pointer"
|
||||
fi
|
||||
|
||||
$1_CXXSTD_CXXFLAG="-std=gnu++98"
|
||||
FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${$1_CXXSTD_CXXFLAG}],
|
||||
PREFIX: $3, IF_FALSE: [$1_CXXSTD_CXXFLAG=""])
|
||||
$1_TOOLCHAIN_CFLAGS_JDK_CXXONLY="${$1_CXXSTD_CXXFLAG}"
|
||||
$1_TOOLCHAIN_CFLAGS_JVM="${$1_TOOLCHAIN_CFLAGS_JVM} ${$1_CXXSTD_CXXFLAG}"
|
||||
$2ADLC_CXXFLAG="${$1_CXXSTD_CXXFLAG}"
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
if test "x$FLAGS_OS" = xlinux; then
|
||||
# ppc test not really needed for clang
|
||||
@@ -818,15 +715,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
fi
|
||||
fi
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
if test "x$FLAGS_CPU" = xx86_64; then
|
||||
# NOTE: -xregs=no%frameptr is supposed to be default on x64
|
||||
$1_CFLAGS_CPU_JDK="-xregs=no%frameptr"
|
||||
elif test "x$FLAGS_CPU" = xsparcv9; then
|
||||
$1_CFLAGS_CPU_JVM="-xarch=sparc"
|
||||
$1_CFLAGS_CPU_JDK_LIBONLY="-xregs=no%appl"
|
||||
fi
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
if test "x$FLAGS_CPU" = xppc64; then
|
||||
$1_CFLAGS_CPU_JVM="-qarch=ppc64"
|
||||
@@ -851,18 +739,27 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
$1_WARNING_CFLAGS_JVM="-Wno-format-zero-length -Wtype-limits -Wuninitialized"
|
||||
fi
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
# Check if compiler supports -fmacro-prefix-map. If so, use that to make
|
||||
# the __FILE__ macro resolve to paths relative to the workspace root.
|
||||
workspace_root_trailing_slash="${WORKSPACE_ROOT%/}/"
|
||||
FILE_MACRO_CFLAGS="-fmacro-prefix-map=${workspace_root_trailing_slash}="
|
||||
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${FILE_MACRO_CFLAGS}],
|
||||
PREFIX: $3,
|
||||
IF_FALSE: [
|
||||
FILE_MACRO_CFLAGS=
|
||||
]
|
||||
)
|
||||
# Prevent the __FILE__ macro from generating absolute paths into the built
|
||||
# binaries. Depending on toolchain, different mitigations are possible.
|
||||
# * GCC and Clang of new enough versions have -fmacro-prefix-map.
|
||||
# * For most other toolchains, supplying all source files and -I flags as
|
||||
# relative paths fixes the issue.
|
||||
FILE_MACRO_CFLAGS=
|
||||
if test "x$ALLOW_ABSOLUTE_PATHS_IN_OUTPUT" = "xfalse"; then
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
# Check if compiler supports -fmacro-prefix-map. If so, use that to make
|
||||
# the __FILE__ macro resolve to paths relative to the workspace root.
|
||||
workspace_root_trailing_slash="${WORKSPACE_ROOT%/}/"
|
||||
FILE_MACRO_CFLAGS="-fmacro-prefix-map=${workspace_root_trailing_slash}="
|
||||
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${FILE_MACRO_CFLAGS}],
|
||||
PREFIX: $3,
|
||||
IF_FALSE: [
|
||||
FILE_MACRO_CFLAGS=
|
||||
]
|
||||
)
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(FILE_MACRO_CFLAGS)
|
||||
|
||||
# EXPORT to API
|
||||
CFLAGS_JVM_COMMON="$ALWAYS_CFLAGS_JVM $ALWAYS_DEFINES_JVM \
|
||||
@@ -891,17 +788,19 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
|
||||
$2JVM_CFLAGS="$CFLAGS_JVM_COMMON ${$1_CFLAGS_JVM} ${$2EXTRA_CXXFLAGS}"
|
||||
|
||||
$2CFLAGS_JDKEXE="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CONLY ${$1_CFLAGS_JDK}"
|
||||
$2CXXFLAGS_JDKEXE="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CXXONLY ${$1_CFLAGS_JDK}"
|
||||
$2CFLAGS_JDKLIB="${$2CFLAGS_JDKEXE} $JDK_PICFLAG ${$1_CFLAGS_CPU_JDK_LIBONLY}"
|
||||
$2CXXFLAGS_JDKLIB="${$2CXXFLAGS_JDKEXE} $JDK_PICFLAG ${$1_CFLAGS_CPU_JDK_LIBONLY}"
|
||||
$2CFLAGS_JDKEXE="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CONLY ${$1_CFLAGS_JDK} $PIEFLAG"
|
||||
$2CXXFLAGS_JDKEXE="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CXXONLY ${$1_CFLAGS_JDK} $PIEFLAG"
|
||||
$2CFLAGS_JDKLIB="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CONLY ${$1_CFLAGS_JDK} \
|
||||
$JDK_PICFLAG ${$1_CFLAGS_CPU_JDK_LIBONLY}"
|
||||
$2CXXFLAGS_JDKLIB="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CXXONLY ${$1_CFLAGS_JDK} \
|
||||
$JDK_PICFLAG ${$1_CFLAGS_CPU_JDK_LIBONLY}"
|
||||
|
||||
AC_SUBST($2JVM_CFLAGS)
|
||||
AC_SUBST($2CFLAGS_JDKLIB)
|
||||
AC_SUBST($2CFLAGS_JDKEXE)
|
||||
AC_SUBST($2CXXFLAGS_JDKLIB)
|
||||
AC_SUBST($2CXXFLAGS_JDKEXE)
|
||||
AC_SUBST($2ADLC_CXXFLAG)
|
||||
AC_SUBST($2ADLC_LANGSTD_CXXFLAGS)
|
||||
|
||||
COMPILER_FP_CONTRACT_OFF_FLAG="-ffp-contract=off"
|
||||
# Check that the compiler supports -ffp-contract=off flag
|
||||
@@ -937,27 +836,3 @@ AC_DEFUN([FLAGS_SETUP_GCC6_COMPILER_FLAGS],
|
||||
PREFIX: $2, IF_FALSE: [NO_LIFETIME_DSE_CFLAG=""])
|
||||
$1_GCC6_CFLAGS="${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
|
||||
])
|
||||
|
||||
# Documentation on common flags used for solstudio in HIGHEST.
|
||||
#
|
||||
# WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be
|
||||
# done with care, there are some assumptions below that need to
|
||||
# be understood about the use of pointers, and IEEE behavior.
|
||||
#
|
||||
# -fns: Use non-standard floating point mode (not IEEE 754)
|
||||
# -fsimple: Do some simplification of floating point arithmetic (not IEEE 754)
|
||||
# -fsingle: Use single precision floating point with 'float'
|
||||
# -xalias_level=basic: Assume memory references via basic pointer types do not alias
|
||||
# (Source with excessing pointer casting and data access with mixed
|
||||
# pointer types are not recommended)
|
||||
# -xbuiltin=%all: Use intrinsic or inline versions for math/std functions
|
||||
# (If you expect perfect errno behavior, do not use this)
|
||||
# -xdepend: Loop data dependency optimizations (need -xO3 or higher)
|
||||
# -xrestrict: Pointer parameters to functions do not overlap
|
||||
# (Similar to -xalias_level=basic usage, but less obvious sometimes.
|
||||
# If you pass in multiple pointers to the same data, do not use this)
|
||||
# -xlibmil: Inline some library routines
|
||||
# (If you expect perfect errno behavior, do not use this)
|
||||
# -xlibmopt: Use optimized math routines (CURRENTLY DISABLED)
|
||||
# (If you expect perfect errno behavior, do not use this)
|
||||
# Can cause undefined external on Solaris 8 X86 on __sincos, removing for now
|
||||
|
||||
@@ -53,6 +53,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS],
|
||||
|
||||
LDFLAGS_TESTEXE="${TARGET_LDFLAGS_JDK_LIBPATH}"
|
||||
AC_SUBST(LDFLAGS_TESTEXE)
|
||||
AC_SUBST(ADLC_LDFLAGS)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
@@ -62,16 +63,10 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
|
||||
[
|
||||
# Setup basic LDFLAGS
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
# If this is a --hash-style=gnu system, use --hash-style=both, why?
|
||||
# We have previously set HAS_GNU_HASH if this is the case
|
||||
if test -n "$HAS_GNU_HASH"; then
|
||||
BASIC_LDFLAGS="-Wl,--hash-style=both"
|
||||
LIBJSIG_HASHSTYLE_LDFLAGS="-Wl,--hash-style=both"
|
||||
fi
|
||||
|
||||
# Add -z defs, to forbid undefined symbols in object files.
|
||||
# add relro (mark relocations read only) for all libs
|
||||
BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,-z,defs -Wl,-z,relro"
|
||||
# Add -z,defs, to forbid undefined symbols in object files.
|
||||
# add -z,relro (mark relocations read only) for all libs
|
||||
# add -z,now ("full relro" - more of the Global Offset Table GOT is marked read only)
|
||||
BASIC_LDFLAGS="-Wl,--hash-style=gnu -Wl,-z,defs -Wl,-z,relro -Wl,-z,now"
|
||||
# Linux : remove unused code+data in link step
|
||||
if test "x$ENABLE_LINKTIME_GC" = xtrue; then
|
||||
if test "x$OPENJDK_TARGET_CPU" = xs390x; then
|
||||
@@ -87,14 +82,6 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
|
||||
BASIC_LDFLAGS_JVM_ONLY="-mno-omit-leaf-frame-pointer -mstack-alignment=16 \
|
||||
-fPIC"
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
BASIC_LDFLAGS="-Wl,-z,defs"
|
||||
BASIC_LDFLAGS_ONLYCXX="-norunpath"
|
||||
BASIC_LDFLAGS_ONLYCXX_JDK_ONLY="-xnolib"
|
||||
|
||||
BASIC_LDFLAGS_JDK_ONLY="-ztext"
|
||||
BASIC_LDFLAGS_JVM_ONLY="-library=%none -mt -z noversion"
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
BASIC_LDFLAGS="-b64 -brtl -bnorwexec -bnolibpath -bexpall -bernotok -btextpsize:64K \
|
||||
-bdatapsize:64K -bstackpsize:64K"
|
||||
@@ -129,10 +116,6 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
|
||||
if test x$DEBUG_LEVEL = xrelease; then
|
||||
DEBUGLEVEL_LDFLAGS_JDK_ONLY="$DEBUGLEVEL_LDFLAGS_JDK_ONLY -Wl,-O1"
|
||||
fi
|
||||
if test x$DEBUG_LEVEL = xslowdebug; then
|
||||
# do relocations at load
|
||||
DEBUGLEVEL_LDFLAGS="-Wl,-z,now"
|
||||
fi
|
||||
fi
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
@@ -144,24 +127,25 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
|
||||
fi
|
||||
fi
|
||||
|
||||
# Setup warning flags
|
||||
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
LDFLAGS_WARNINGS_ARE_ERRORS="-Wl,-z,fatal-warnings"
|
||||
else
|
||||
LDFLAGS_WARNINGS_ARE_ERRORS=""
|
||||
fi
|
||||
AC_SUBST(LDFLAGS_WARNINGS_ARE_ERRORS)
|
||||
|
||||
# Setup LDFLAGS for linking executables
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
EXECUTABLE_LDFLAGS="$EXECUTABLE_LDFLAGS -Wl,--allow-shlib-undefined"
|
||||
# Enabling pie on 32 bit builds prevents the JVM from allocating a continuous
|
||||
# java heap.
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" != "x32"; then
|
||||
EXECUTABLE_LDFLAGS="$EXECUTABLE_LDFLAGS -pie"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$ALLOW_ABSOLUTE_PATHS_IN_OUTPUT" = "xfalse"; then
|
||||
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
BASIC_LDFLAGS="$BASIC_LDFLAGS -pdbaltpath:%_PDB%"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Export some intermediate variables for compatibility
|
||||
LDFLAGS_CXX_JDK="$BASIC_LDFLAGS_ONLYCXX $BASIC_LDFLAGS_ONLYCXX_JDK_ONLY $DEBUGLEVEL_LDFLAGS_JDK_ONLY"
|
||||
AC_SUBST(LDFLAGS_CXX_JDK)
|
||||
AC_SUBST(LIBJSIG_HASHSTYLE_LDFLAGS)
|
||||
AC_SUBST(LIBJSIG_NOEXECSTACK_LDFLAGS)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
@@ -180,11 +164,6 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_CPU_DEP],
|
||||
$1_CPU_LDFLAGS="$ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS"
|
||||
fi
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
if test "x${OPENJDK_$1_CPU}" = "xsparcv9"; then
|
||||
$1_CPU_LDFLAGS_JVM_ONLY="-xarch=sparc"
|
||||
fi
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
if test "x${OPENJDK_$1_CPU}" = "xx86"; then
|
||||
$1_CPU_LDFLAGS="-safeseh"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 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
|
||||
@@ -47,12 +47,10 @@ AC_DEFUN([FLAGS_SETUP_STRIPFLAGS],
|
||||
[
|
||||
## Setup strip.
|
||||
# FIXME: should this really be per platform, or should it be per toolchain type?
|
||||
# strip is not provided by clang or solstudio; so guessing platform makes most sense.
|
||||
# strip is not provided by clang; so guessing platform makes most sense.
|
||||
# FIXME: we should really only export STRIPFLAGS from here, not POST_STRIP_CMD.
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
STRIPFLAGS="-g"
|
||||
elif test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
STRIPFLAGS="-x"
|
||||
elif test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
STRIPFLAGS="-S"
|
||||
elif test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
@@ -66,39 +64,12 @@ AC_DEFUN([FLAGS_SETUP_RCFLAGS],
|
||||
[
|
||||
# On Windows, we need to set RC flags.
|
||||
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
RC_FLAGS="-nologo -l0x409"
|
||||
JVM_RCFLAGS="-nologo"
|
||||
RCFLAGS="-nologo"
|
||||
if test "x$DEBUG_LEVEL" = xrelease; then
|
||||
RC_FLAGS="$RC_FLAGS -DNDEBUG"
|
||||
JVM_RCFLAGS="$JVM_RCFLAGS -DNDEBUG"
|
||||
RCFLAGS="$RCFLAGS -DNDEBUG"
|
||||
fi
|
||||
|
||||
# The version variables used to create RC_FLAGS may be overridden
|
||||
# in a custom configure script, or possibly the command line.
|
||||
# Let those variables be expanded at make time in spec.gmk.
|
||||
# The \$ are escaped to the shell, and the $(...) variables
|
||||
# are evaluated by make.
|
||||
RC_FLAGS="$RC_FLAGS \
|
||||
-D\"JDK_VERSION_STRING=\$(VERSION_STRING)\" \
|
||||
-D\"JDK_COMPANY=\$(COMPANY_NAME)\" \
|
||||
-D\"JDK_FILEDESC=\$(JDK_RC_NAME) binary\" \
|
||||
-D\"JDK_VER=\$(VERSION_NUMBER)\" \
|
||||
-D\"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \
|
||||
-D\"JDK_NAME=\$(JDK_RC_NAME) \$(VERSION_FEATURE)\" \
|
||||
-D\"JDK_FVER=\$(subst .,\$(COMMA),\$(VERSION_NUMBER_FOUR_POSITIONS))\""
|
||||
|
||||
JVM_RCFLAGS="$JVM_RCFLAGS \
|
||||
-D\"HS_VERSION_STRING=\$(VERSION_STRING)\" \
|
||||
-D\"HS_COMPANY=\$(COMPANY_NAME)\" \
|
||||
-D\"HS_VER=\$(VERSION_NUMBER_FOUR_POSITIONS)\" \
|
||||
-D\"HS_INTERNAL_NAME=jvm\" \
|
||||
-D\"HS_COPYRIGHT=Copyright $COPYRIGHT_YEAR\" \
|
||||
-D\"HS_FNAME=jvm.dll\" \
|
||||
-D\"HS_NAME=\$(PRODUCT_NAME) \$(VERSION_SHORT)\" \
|
||||
-D\"HS_FVER=\$(subst .,\$(COMMA),\$(VERSION_NUMBER_FOUR_POSITIONS))\""
|
||||
fi
|
||||
AC_SUBST(RC_FLAGS)
|
||||
AC_SUBST(JVM_RCFLAGS)
|
||||
AC_SUBST(RCFLAGS)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -205,27 +205,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_USER_SUPPLIED_FLAGS],
|
||||
AC_DEFUN([FLAGS_SETUP_SYSROOT_FLAGS],
|
||||
[
|
||||
if test "x[$]$1SYSROOT" != "x"; then
|
||||
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
# Solaris Studio does not have a concept of sysroot. Instead we must
|
||||
# make sure the default include and lib dirs are appended to each
|
||||
# compile and link command line. Must also add -I-xbuiltin to enable
|
||||
# inlining of system functions and intrinsics.
|
||||
$1SYSROOT_CFLAGS="-I-xbuiltin -I[$]$1SYSROOT/usr/include"
|
||||
$1SYSROOT_LDFLAGS="-L[$]$1SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \
|
||||
-L[$]$1SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR"
|
||||
# If the devkit contains the ld linker, make sure we use it.
|
||||
AC_PATH_PROG(SOLARIS_LD, ld, , $DEVKIT_TOOLCHAIN_PATH:$DEVKIT_EXTRA_PATH)
|
||||
# Make sure this ld is runnable.
|
||||
if test -f "$SOLARIS_LD"; then
|
||||
if "$SOLARIS_LD" -V > /dev/null 2> /dev/null; then
|
||||
$1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -Yl,$(dirname $SOLARIS_LD)"
|
||||
else
|
||||
AC_MSG_WARN([Could not run $SOLARIS_LD found in devkit, reverting to system ld])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
elif test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
$1SYSROOT_CFLAGS="--sysroot=[$]$1SYSROOT"
|
||||
$1SYSROOT_LDFLAGS="--sysroot=[$]$1SYSROOT"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
@@ -238,10 +218,12 @@ AC_DEFUN([FLAGS_SETUP_SYSROOT_FLAGS],
|
||||
# We also need -iframework<path>/System/Library/Frameworks
|
||||
$1SYSROOT_CFLAGS="[$]$1SYSROOT_CFLAGS -iframework [$]$1SYSROOT/System/Library/Frameworks"
|
||||
$1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -iframework [$]$1SYSROOT/System/Library/Frameworks"
|
||||
# These always need to be set, or we can't find the frameworks embedded in JavaVM.framework
|
||||
# set this here so it doesn't have to be peppered throughout the forest
|
||||
$1SYSROOT_CFLAGS="[$]$1SYSROOT_CFLAGS -F [$]$1SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks"
|
||||
$1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -F [$]$1SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks"
|
||||
if test -d "[$]$1SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks" ; then
|
||||
# These always need to be set on macOS 10.X, or we can't find the frameworks embedded in JavaVM.framework
|
||||
# set this here so it doesn't have to be peppered throughout the forest
|
||||
$1SYSROOT_CFLAGS="[$]$1SYSROOT_CFLAGS -F [$]$1SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks"
|
||||
$1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -F [$]$1SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks"
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST($1SYSROOT_CFLAGS)
|
||||
@@ -255,17 +237,14 @@ AC_DEFUN_ONCE([FLAGS_PRE_TOOLCHAIN],
|
||||
# The sysroot flags are needed for configure to be able to run the compilers
|
||||
FLAGS_SETUP_SYSROOT_FLAGS
|
||||
|
||||
# For solstudio and xlc, the word size flag is required for correct behavior.
|
||||
# For xlc, the word size flag is required for correct behavior.
|
||||
# For clang/gcc, the flag is only strictly required for reduced builds, but
|
||||
# set it always where possible (x86, sparc and ppc).
|
||||
# set it always where possible (x86 and ppc).
|
||||
if test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
MACHINE_FLAG="-q${OPENJDK_TARGET_CPU_BITS}"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
MACHINE_FLAG="-m${OPENJDK_TARGET_CPU_BITS}"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
if test "x$OPENJDK_TARGET_CPU_ARCH" = xx86 &&
|
||||
test "x$OPENJDK_TARGET_CPU" != xx32 ||
|
||||
test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc ||
|
||||
test "x$OPENJDK_TARGET_CPU_ARCH" = xppc; then
|
||||
MACHINE_FLAG="-m${OPENJDK_TARGET_CPU_BITS}"
|
||||
fi
|
||||
@@ -318,11 +297,6 @@ AC_DEFUN([FLAGS_SETUP_TOOLCHAIN_CONTROL],
|
||||
COMPILER_COMMAND_FILE_FLAG="@"
|
||||
COMPILER_BINDCMD_FILE_FLAG=""
|
||||
|
||||
# The solstudio linker does not support @-files.
|
||||
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
COMPILER_COMMAND_FILE_FLAG=
|
||||
fi
|
||||
|
||||
# Check if @file is supported by gcc
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
AC_MSG_CHECKING([if @file is supported by gcc])
|
||||
@@ -376,8 +350,6 @@ AC_DEFUN([FLAGS_SETUP_TOOLCHAIN_CONTROL],
|
||||
C_FLAG_DEPS="-MMD -MF"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
C_FLAG_DEPS="-MMD -MF"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
C_FLAG_DEPS="-xMMD -xMF"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
C_FLAG_DEPS="-qmakedep=gcc -MF"
|
||||
fi
|
||||
|
||||
@@ -101,6 +101,8 @@ apt_help() {
|
||||
PKGHANDLER_COMMAND="sudo apt-get install libfontconfig1-dev" ;;
|
||||
freetype)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;;
|
||||
harfbuzz)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install libharfbuzz-dev" ;;
|
||||
ffi)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install libffi-dev" ;;
|
||||
x11)
|
||||
@@ -124,6 +126,8 @@ zypper_help() {
|
||||
PKGHANDLER_COMMAND="sudo zypper install fontconfig-devel" ;;
|
||||
freetype)
|
||||
PKGHANDLER_COMMAND="sudo zypper install freetype-devel" ;;
|
||||
harfbuzz)
|
||||
PKGHANDLER_COMMAND="sudo zypper install harfbuzz-devel" ;;
|
||||
x11)
|
||||
PKGHANDLER_COMMAND="sudo zypper install libX11-devel libXext-devel libXrender-devel libXrandr-devel libXtst-devel libXt-devel libXi-devel" ;;
|
||||
ccache)
|
||||
@@ -143,6 +147,8 @@ yum_help() {
|
||||
PKGHANDLER_COMMAND="sudo yum install fontconfig-devel" ;;
|
||||
freetype)
|
||||
PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;;
|
||||
harfbuzz)
|
||||
PKGHANDLER_COMMAND="sudo yum install harfbuzz-devel" ;;
|
||||
x11)
|
||||
PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel libXrandr-devel libXi-devel" ;;
|
||||
ccache)
|
||||
@@ -250,7 +256,11 @@ AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
|
||||
printf "\n"
|
||||
printf "Tools summary:\n"
|
||||
if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
|
||||
printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n"
|
||||
printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION. Windows version $WINDOWS_VERSION"
|
||||
if test "x$WINDOWS_ENV_ROOT_PATH" != "x"; then
|
||||
printf ". Root at $WINDOWS_ENV_ROOT_PATH"
|
||||
fi
|
||||
printf "\n"
|
||||
fi
|
||||
printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n"
|
||||
printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)\n"
|
||||
|
||||
@@ -111,40 +111,6 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_VARIANTS],
|
||||
AC_SUBST(JVM_VARIANT_MAIN)
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
# Check if gtest should be built
|
||||
#
|
||||
AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_GTEST],
|
||||
[
|
||||
GTEST_AVAILABLE=true
|
||||
|
||||
AC_MSG_CHECKING([if Hotspot gtest test source is present])
|
||||
if test -e "${TOPDIR}/test/hotspot/gtest"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no, cannot build gtest])
|
||||
GTEST_AVAILABLE=false
|
||||
fi
|
||||
|
||||
# On solaris, we also must have the libstlport.so.1 library, setup in
|
||||
# LIB_SETUP_LIBRARIES.
|
||||
if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
|
||||
AC_MSG_CHECKING([if the libstlport.so.1 library is present])
|
||||
if test "x$STLPORT_LIB" != "x"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no, cannot build gtest])
|
||||
GTEST_AVAILABLE=false
|
||||
fi
|
||||
fi
|
||||
|
||||
UTIL_ARG_ENABLE(NAME: hotspot-gtest, DEFAULT: auto,
|
||||
RESULT: BUILD_GTEST, AVAILABLE: $GTEST_AVAILABLE,
|
||||
DEFAULT_DESC: [enabled if possible to build],
|
||||
DESC: [enable building of the Hotspot unit tests])
|
||||
AC_SUBST(BUILD_GTEST)
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
# Misc hotspot setup that does not fit elsewhere.
|
||||
#
|
||||
@@ -157,6 +123,15 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_MISC],
|
||||
HOTSPOT_TARGET_CPU_ARCH=zero
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([hotspot-build-time], [AS_HELP_STRING([--with-hotspot-build-time],
|
||||
[timestamp to use in hotspot version string, empty for on-the-fly @<:@empty@:>@])])
|
||||
|
||||
if test "x$with_hotspot_build_time" != x; then
|
||||
HOTSPOT_BUILD_TIME="$with_hotspot_build_time"
|
||||
fi
|
||||
AC_SUBST(HOTSPOT_BUILD_TIME)
|
||||
|
||||
|
||||
# Override hotspot cpu definitions for ARM platforms
|
||||
if test "x$OPENJDK_TARGET_CPU" = xarm; then
|
||||
HOTSPOT_TARGET_CPU=arm_32
|
||||
@@ -165,4 +140,7 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_MISC],
|
||||
|
||||
# --with-cpu-port is no longer supported
|
||||
UTIL_DEPRECATED_ARG_WITH(with-cpu-port)
|
||||
|
||||
# in jdk15 hotspot-gtest was replaced with --with-gtest
|
||||
UTIL_DEPRECATED_ARG_ENABLE(hotspot-gtest)
|
||||
])
|
||||
|
||||
@@ -140,7 +140,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for pandoc])
|
||||
if test "x$PANDOC" != "x"; then
|
||||
if test "x$ENABLE_PANDOC" = "xtrue"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no, cannot generate full docs])
|
||||
@@ -291,7 +291,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
|
||||
ZIP_EXTERNAL_DEBUG_SYMBOLS=false
|
||||
elif test "x$with_native_debug_symbols" = xexternal; then
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
if test "x$OBJCOPY" = x; then
|
||||
# enabling of enable-debug-symbols and can't find objcopy
|
||||
# this is an error
|
||||
@@ -304,7 +304,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
|
||||
ZIP_EXTERNAL_DEBUG_SYMBOLS=false
|
||||
elif test "x$with_native_debug_symbols" = xzipped; then
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
if test "x$OBJCOPY" = x; then
|
||||
# enabling of enable-debug-symbols and can't find objcopy
|
||||
# this is an error
|
||||
@@ -598,3 +598,91 @@ AC_DEFUN([JDKOPT_ENABLE_DISABLE_CDS_ARCHIVE],
|
||||
])
|
||||
AC_SUBST(BUILD_CDS_ARCHIVE)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Disallow any output from containing absolute paths from the build system.
|
||||
# This setting defaults to allowed on debug builds and not allowed on release
|
||||
# builds.
|
||||
#
|
||||
AC_DEFUN([JDKOPT_ALLOW_ABSOLUTE_PATHS_IN_OUTPUT],
|
||||
[
|
||||
AC_ARG_ENABLE([absolute-paths-in-output],
|
||||
[AS_HELP_STRING([--disable-absolute-paths-in-output],
|
||||
[Set to disable to prevent any absolute paths from the build to end up in
|
||||
any of the build output. @<:@disabled in release builds, otherwise enabled@:>@])
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([if absolute paths should be allowed in the build output])
|
||||
if test "x$enable_absolute_paths_in_output" = "xno"; then
|
||||
AC_MSG_RESULT([no, forced])
|
||||
ALLOW_ABSOLUTE_PATHS_IN_OUTPUT="false"
|
||||
elif test "x$enable_absolute_paths_in_output" = "xyes"; then
|
||||
AC_MSG_RESULT([yes, forced])
|
||||
ALLOW_ABSOLUTE_PATHS_IN_OUTPUT="true"
|
||||
elif test "x$DEBUG_LEVEL" = "xrelease"; then
|
||||
AC_MSG_RESULT([no, release build])
|
||||
ALLOW_ABSOLUTE_PATHS_IN_OUTPUT="false"
|
||||
else
|
||||
AC_MSG_RESULT([yes, debug build])
|
||||
ALLOW_ABSOLUTE_PATHS_IN_OUTPUT="true"
|
||||
fi
|
||||
|
||||
AC_SUBST(ALLOW_ABSOLUTE_PATHS_IN_OUTPUT)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Check and set options related to reproducible builds.
|
||||
#
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_REPRODUCIBLE_BUILD],
|
||||
[
|
||||
AC_ARG_WITH([source-date], [AS_HELP_STRING([--with-source-date],
|
||||
[how to set SOURCE_DATE_EPOCH ('updated', 'current', 'version' a timestamp or an ISO-8601 date) @<:@updated@:>@])],
|
||||
[with_source_date_present=true], [with_source_date_present=false])
|
||||
|
||||
AC_MSG_CHECKING([what source date to use])
|
||||
|
||||
if test "x$with_source_date" = xyes; then
|
||||
AC_MSG_ERROR([--with-source-date must have a value])
|
||||
elif test "x$with_source_date" = xupdated || test "x$with_source_date" = x; then
|
||||
# Tell the makefiles to update at each build
|
||||
SOURCE_DATE=updated
|
||||
AC_MSG_RESULT([determined at build time, from 'updated'])
|
||||
elif test "x$with_source_date" = xcurrent; then
|
||||
# Set the current time
|
||||
SOURCE_DATE=$($DATE +"%s")
|
||||
AC_MSG_RESULT([$SOURCE_DATE, from 'current'])
|
||||
elif test "x$with_source_date" = xversion; then
|
||||
# Use the date from version-numbers
|
||||
UTIL_GET_EPOCH_TIMESTAMP(SOURCE_DATE, $DEFAULT_VERSION_DATE)
|
||||
if test "x$SOURCE_DATE" = x; then
|
||||
AC_MSG_RESULT([unavailable])
|
||||
AC_MSG_ERROR([Cannot convert DEFAULT_VERSION_DATE to timestamp])
|
||||
fi
|
||||
AC_MSG_RESULT([$SOURCE_DATE, from 'version'])
|
||||
else
|
||||
# It's a timestamp, an ISO-8601 date, or an invalid string
|
||||
# Additional [] needed to keep m4 from mangling shell constructs.
|
||||
if [ [[ "$with_source_date" =~ ^[0-9][0-9]*$ ]] ] ; then
|
||||
SOURCE_DATE=$with_source_date
|
||||
AC_MSG_RESULT([$SOURCE_DATE, from timestamp on command line])
|
||||
else
|
||||
UTIL_GET_EPOCH_TIMESTAMP(SOURCE_DATE, $with_source_date)
|
||||
if test "x$SOURCE_DATE" != x; then
|
||||
AC_MSG_RESULT([$SOURCE_DATE, from ISO-8601 date on command line])
|
||||
else
|
||||
AC_MSG_RESULT([unavailable])
|
||||
AC_MSG_ERROR([Cannot parse date string "$with_source_date"])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
UTIL_ARG_ENABLE(NAME: reproducible-build, DEFAULT: $with_source_date_present,
|
||||
RESULT: ENABLE_REPRODUCIBLE_BUILD,
|
||||
DESC: [enable reproducible builds (not yet fully functional)],
|
||||
DEFAULT_DESC: [enabled if --with-source-date is given])
|
||||
|
||||
AC_SUBST(SOURCE_DATE)
|
||||
AC_SUBST(ENABLE_REPRODUCIBLE_BUILD)
|
||||
])
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
AC_DEFUN([JDKVER_CHECK_AND_SET_NUMBER],
|
||||
[
|
||||
# Additional [] needed to keep m4 from mangling shell constructs.
|
||||
if [ ! [[ "$2" =~ ^0*([1-9][0-9]*)|(0)$ ]] ] ; then
|
||||
if [ ! [[ "$2" =~ ^0*([1-9][0-9]*)$|^0*(0)$ ]] ] ; then
|
||||
AC_MSG_ERROR(["$2" is not a valid numerical value for $1])
|
||||
fi
|
||||
# Extract the version number without leading zeros.
|
||||
@@ -179,7 +179,7 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
|
||||
AC_MSG_ERROR([--with-version-string must have a value])
|
||||
elif test "x$with_version_string" != x; then
|
||||
# Additional [] needed to keep m4 from mangling shell constructs.
|
||||
if [ [[ $with_version_string =~ ^([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(-([a-zA-Z]+))?((\+)([0-9]+)?(-([-a-zA-Z0-9.]+))?)?$ ]] ]; then
|
||||
if [ [[ $with_version_string =~ ^([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(-([a-zA-Z0-9]+))?(((\+)([0-9]*))?(-([-a-zA-Z0-9.]+))?)?$ ]] ]; then
|
||||
VERSION_FEATURE=${BASH_REMATCH[[1]]}
|
||||
VERSION_INTERIM=${BASH_REMATCH[[3]]}
|
||||
VERSION_UPDATE=${BASH_REMATCH[[5]]}
|
||||
@@ -188,9 +188,9 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
|
||||
VERSION_EXTRA2=${BASH_REMATCH[[11]]}
|
||||
VERSION_EXTRA3=${BASH_REMATCH[[13]]}
|
||||
VERSION_PRE=${BASH_REMATCH[[15]]}
|
||||
version_plus_separator=${BASH_REMATCH[[17]]}
|
||||
VERSION_BUILD=${BASH_REMATCH[[18]]}
|
||||
VERSION_OPT=${BASH_REMATCH[[20]]}
|
||||
version_plus_separator=${BASH_REMATCH[[18]]}
|
||||
VERSION_BUILD=${BASH_REMATCH[[19]]}
|
||||
VERSION_OPT=${BASH_REMATCH[[21]]}
|
||||
# Unspecified numerical fields are interpreted as 0.
|
||||
if test "x$VERSION_INTERIM" = x; then
|
||||
VERSION_INTERIM=0
|
||||
@@ -233,8 +233,8 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
|
||||
# Interpret --without-* as empty string instead of the literal "no"
|
||||
VERSION_PRE=
|
||||
else
|
||||
# Only [a-zA-Z] is allowed in the VERSION_PRE. Outer [ ] to quote m4.
|
||||
[ VERSION_PRE=`$ECHO "$with_version_pre" | $TR -c -d '[a-z][A-Z]'` ]
|
||||
# Only [a-zA-Z0-9] is allowed in the VERSION_PRE. Outer [ ] to quote m4.
|
||||
[ VERSION_PRE=`$ECHO "$with_version_pre" | $TR -c -d '[a-zA-Z0-9]'` ]
|
||||
if test "x$VERSION_PRE" != "x$with_version_pre"; then
|
||||
AC_MSG_WARN([--with-version-pre value has been sanitized from '$with_version_pre' to '$VERSION_PRE'])
|
||||
fi
|
||||
|
||||
@@ -320,8 +320,7 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_JFR],
|
||||
[
|
||||
JVM_FEATURES_CHECK_AVAILABILITY(jfr, [
|
||||
AC_MSG_CHECKING([if platform is supported by JFR])
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix || \
|
||||
test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-sparcv9"; then
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
AC_MSG_RESULT([no, $OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU])
|
||||
AVAILABLE=false
|
||||
else
|
||||
@@ -447,10 +446,6 @@ AC_DEFUN_ONCE([JVM_FEATURES_PREPARE_PLATFORM],
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
JVM_FEATURES_PLATFORM_FILTER="$JVM_FEATURES_PLATFORM_FILTER jfr"
|
||||
fi
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-sparcv9"; then
|
||||
JVM_FEATURES_PLATFORM_FILTER="$JVM_FEATURES_PLATFORM_FILTER jfr"
|
||||
fi
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -40,6 +40,7 @@ AC_DEFUN_ONCE([LIB_SETUP_BUNDLED_LIBS],
|
||||
LIB_SETUP_LIBPNG
|
||||
LIB_SETUP_ZLIB
|
||||
LIB_SETUP_LCMS
|
||||
LIB_SETUP_HARFBUZZ
|
||||
])
|
||||
|
||||
################################################################################
|
||||
@@ -263,3 +264,43 @@ AC_DEFUN_ONCE([LIB_SETUP_LCMS],
|
||||
AC_SUBST(LCMS_CFLAGS)
|
||||
AC_SUBST(LCMS_LIBS)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
# Setup harfbuzz
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_SETUP_HARFBUZZ],
|
||||
[
|
||||
AC_ARG_WITH(harfbuzz, [AS_HELP_STRING([--with-harfbuzz],
|
||||
[use harfbuzz from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
|
||||
|
||||
AC_MSG_CHECKING([for which harfbuzz to use])
|
||||
|
||||
DEFAULT_HARFBUZZ=bundled
|
||||
# If user didn't specify, use DEFAULT_HARFBUZZ
|
||||
if test "x${with_harfbuzz}" = "x"; then
|
||||
with_harfbuzz=${DEFAULT_HARFBUZZ}
|
||||
fi
|
||||
|
||||
if test "x${with_harfbuzz}" = "xbundled"; then
|
||||
USE_EXTERNAL_HARFBUZZ=false
|
||||
HARFBUZZ_CFLAGS=""
|
||||
HARFBUZZ_LIBS=""
|
||||
AC_MSG_RESULT([bundled])
|
||||
elif test "x${with_harfbuzz}" = "xsystem"; then
|
||||
AC_MSG_RESULT([system])
|
||||
PKG_CHECK_MODULES([HARFBUZZ], [harfbuzz], [HARFBUZZ_FOUND=yes], [HARFBUZZ_FOUND=no])
|
||||
if test "x${HARFBUZZ_FOUND}" = "xyes"; then
|
||||
# PKG_CHECK_MODULES will set HARFBUZZ_CFLAGS and HARFBUZZ_LIBS
|
||||
USE_EXTERNAL_HARFBUZZ=true
|
||||
else
|
||||
HELP_MSG_MISSING_DEPENDENCY([harfbuzz])
|
||||
AC_MSG_ERROR([--with-harfbuzz=system specified, but no harfbuzz found! $HELP_MSG])
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR([Invalid value for --with-harfbuzz: ${with_harfbuzz}, use 'system' or 'bundled'])
|
||||
fi
|
||||
|
||||
AC_SUBST(USE_EXTERNAL_HARFBUZZ)
|
||||
AC_SUBST(HARFBUZZ_CFLAGS)
|
||||
AC_SUBST(HARFBUZZ_LIBS)
|
||||
])
|
||||
|
||||
@@ -87,6 +87,20 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBFFI],
|
||||
[LIBFFI_FOUND=no]
|
||||
)
|
||||
fi
|
||||
# on macos we need a special case for system's libffi as
|
||||
# headers are located only in sdk in $SYSROOT and in ffi subfolder
|
||||
if test "x$LIBFFI_FOUND" = xno; then
|
||||
if test "x$SYSROOT" != "x"; then
|
||||
AC_CHECK_HEADER([$SYSROOT/usr/include/ffi/ffi.h],
|
||||
[
|
||||
LIBFFI_FOUND=yes
|
||||
LIBFFI_CFLAGS="-I${SYSROOT}/usr/include/ffi"
|
||||
LIBFFI_LIBS=-lffi
|
||||
],
|
||||
[LIBFFI_FOUND=no]
|
||||
)
|
||||
fi
|
||||
fi
|
||||
if test "x$LIBFFI_FOUND" = xno; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([ffi])
|
||||
AC_MSG_ERROR([Could not find libffi! $HELP_MSG])
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 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
|
||||
@@ -53,13 +53,6 @@ AC_DEFUN([LIB_CHECK_POTENTIAL_FREETYPE],
|
||||
if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then
|
||||
AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location.])
|
||||
FOUND_FREETYPE=no
|
||||
else
|
||||
if test "x$OPENJDK_TARGET_OS" = "xsolaris" \
|
||||
&& test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then
|
||||
# Found lib in isa dir, use that instead.
|
||||
POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR"
|
||||
AC_MSG_NOTICE([Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -79,7 +72,7 @@ AC_DEFUN([LIB_CHECK_POTENTIAL_FREETYPE],
|
||||
AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
|
||||
[
|
||||
AC_ARG_WITH(freetype, [AS_HELP_STRING([--with-freetype],
|
||||
[specify whether to use 'system' or 'bundled' freetype. Other values are errors.
|
||||
[specify whether to use 'system' or 'bundled' freetype.
|
||||
The selected option applies to both build time and run time.
|
||||
The default behaviour can be platform dependent.
|
||||
If using 'system' and either the include files or libraries cannot be
|
||||
@@ -90,78 +83,83 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
|
||||
AC_ARG_WITH(freetype-lib, [AS_HELP_STRING([--with-freetype-lib],
|
||||
[specify directory for the freetype library])])
|
||||
|
||||
# This setup is to verify access to system installed freetype header and libraries.
|
||||
# On Windows and MacOS this does not apply and using these options will report an error.
|
||||
# On other platforms (Linux, Solaris), they will default to using
|
||||
# the system libraries. If they are found automatically, nothing need be done.
|
||||
# If they are not found, the configure "--with-freetype-*" options may be used to fix that.
|
||||
# If the preference is to bundle on these platforms then use --with-freetype=bundled
|
||||
# This setup is to verify access to system installed freetype header and
|
||||
# libraries. On Windows and MacOS this does not apply and using these options
|
||||
# will report an error. On other platforms they will default to using the
|
||||
# system libraries. If they are found automatically, nothing need be done.
|
||||
# If they are not found, the configure "--with-freetype-*" options may be
|
||||
# used to fix that. If the preference is to bundle on these platforms then
|
||||
# use --with-freetype=bundled.
|
||||
|
||||
FREETYPE_BASE_NAME=freetype
|
||||
FREETYPE_CFLAGS=
|
||||
FREETYPE_LIBS=
|
||||
|
||||
if (test "x$with_freetype_include" = "x" && test "x$with_freetype_lib" != "x") || \
|
||||
(test "x$with_freetype_include" != "x" && test "x$with_freetype_lib" = "x"); then
|
||||
AC_MSG_ERROR(['must specify both or neither of --with-freetype-include and --with-freetype-lib])
|
||||
if (test "x$with_freetype_include" = "x" && test "x$with_freetype_lib" != "x") || \
|
||||
(test "x$with_freetype_include" != "x" && test "x$with_freetype_lib" = "x"); then
|
||||
AC_MSG_ERROR([Must specify both or neither of --with-freetype-include and --with-freetype-lib])
|
||||
fi
|
||||
|
||||
FREETYPE_TO_USE=bundled
|
||||
if (test "x$OPENJDK_TARGET_OS" != "xwindows" && test "x$OPENJDK_TARGET_OS" != "xmacosx" \
|
||||
&& test "x$OPENJDK_TARGET_OS" != "xaix"); then
|
||||
if test "x$OPENJDK_TARGET_OS" != "xwindows" && \
|
||||
test "x$OPENJDK_TARGET_OS" != "xmacosx" && \
|
||||
test "x$OPENJDK_TARGET_OS" != "xaix"; then
|
||||
FREETYPE_TO_USE=system
|
||||
fi
|
||||
if (test "x$with_freetype" != "x"); then
|
||||
if (test "x$with_freetype" = "xsystem"); then
|
||||
if test "x$with_freetype" != "x" ; then
|
||||
if test "x$with_freetype" = "xsystem" ; then
|
||||
FREETYPE_TO_USE=system
|
||||
elif (test "x$with_freetype" = "xbundled"); then
|
||||
elif test "x$with_freetype" = "xbundled" ; then
|
||||
FREETYPE_TO_USE=bundled
|
||||
if (test "x$with_freetype_include" != "x" || test "x$with_freetype_lib" != "x"); then
|
||||
if test "x$with_freetype_include" != "x" || \
|
||||
test "x$with_freetype_lib" != "x" ; then
|
||||
AC_MSG_ERROR(['bundled' cannot be specified with --with-freetype-include and --with-freetype-lib])
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR(['valid values for --with-freetype are 'system' and 'bundled'])
|
||||
AC_MSG_ERROR([Valid values for --with-freetype are 'system' and 'bundled'])
|
||||
fi
|
||||
fi
|
||||
|
||||
if (test "x$with_freetype_include" != "x" && test "x$with_freetype_lib" != "x"); then
|
||||
FREETYPE_TO_USE=system
|
||||
if test "x$with_freetype_include" != "x" && \
|
||||
test "x$with_freetype_lib" != "x" ; then
|
||||
FREETYPE_TO_USE=system
|
||||
fi
|
||||
|
||||
if (test "x$FREETYPE_TO_USE" = "xsystem") && \
|
||||
(test "x$OPENJDK_TARGET_OS" = "xwindows" || test "x$OPENJDK_TARGET_OS" = "xmacosx"); then
|
||||
AC_MSG_ERROR([Only bundled freetype can be specified on Mac and Windows])
|
||||
if test "x$FREETYPE_TO_USE" = "xsystem" && \
|
||||
(test "x$OPENJDK_TARGET_OS" = "xwindows" || \
|
||||
test "x$OPENJDK_TARGET_OS" = "xmacosx"); then
|
||||
AC_MSG_ERROR([Only bundled freetype can be specified on Mac and Windows])
|
||||
fi
|
||||
|
||||
if (test "x$with_freetype_include" != "x"); then
|
||||
if test "x$with_freetype_include" != "x" ; then
|
||||
POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype_include"
|
||||
fi
|
||||
if (test "x$with_freetype_lib" != "x"); then
|
||||
if test "x$with_freetype_lib" != "x" ; then
|
||||
POTENTIAL_FREETYPE_LIB_PATH="$with_freetype_lib"
|
||||
fi
|
||||
|
||||
if (test "x$FREETYPE_TO_USE" = "xsystem"); then
|
||||
if (test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != "x" && test "x$POTENTIAL_FREETYPE_LIB_PATH" != "x"); then
|
||||
if test "x$FREETYPE_TO_USE" = "xsystem" ; then
|
||||
if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != "x" && \
|
||||
test "x$POTENTIAL_FREETYPE_LIB_PATH" != "x" ; then
|
||||
# Okay, we got it. Check that it works.
|
||||
LIB_CHECK_POTENTIAL_FREETYPE($POTENTIAL_FREETYPE_INCLUDE_PATH, $POTENTIAL_FREETYPE_LIB_PATH, [--with-freetype])
|
||||
if (test "x$FOUND_FREETYPE" != "xyes"); then
|
||||
LIB_CHECK_POTENTIAL_FREETYPE($POTENTIAL_FREETYPE_INCLUDE_PATH,
|
||||
$POTENTIAL_FREETYPE_LIB_PATH, [--with-freetype])
|
||||
if test "x$FOUND_FREETYPE" != "xyes" ; then
|
||||
AC_MSG_ERROR([Can not find or use freetype at location given by --with-freetype-lib|include])
|
||||
fi
|
||||
else
|
||||
# User did not specify a location, but asked for system freetype. Try to locate it.
|
||||
# User did not specify a location, but asked for system freetype.
|
||||
# Try to locate it.
|
||||
|
||||
# If we have a sysroot, assume that's where we are supposed to look and skip pkg-config.
|
||||
if (test "x$SYSROOT" = "x"); then
|
||||
if (test "x$FOUND_FREETYPE" != "xyes"); then
|
||||
# Check modules using pkg-config, but only if we have it (ugly output results otherwise)
|
||||
if (test "x$PKG_CONFIG" != "x"); then
|
||||
# If we have a sysroot, assume that's where we are supposed to look and
|
||||
# skip pkg-config.
|
||||
if test "x$SYSROOT" = "x" ; then
|
||||
if test "x$FOUND_FREETYPE" != "xyes" ; then
|
||||
# Check modules using pkg-config, but only if we have it (ugly output
|
||||
# results otherwise)
|
||||
if test "x$PKG_CONFIG" != "x" ; then
|
||||
PKG_CHECK_MODULES(FREETYPE, freetype2, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no])
|
||||
if (test "x$FOUND_FREETYPE" = "xyes"); then
|
||||
# On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us.
|
||||
FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's/-lz//g'`
|
||||
# 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64
|
||||
if (test "x$OPENJDK_TARGET_OS" = "xsolaris" && test "x$OPENJDK_TARGET_CPU" = "xx86_64"); then
|
||||
FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's?/lib?/lib/amd64?g'`
|
||||
fi
|
||||
if test "x$FOUND_FREETYPE" = "xyes" ; then
|
||||
AC_MSG_CHECKING([for freetype])
|
||||
AC_MSG_RESULT([yes (using pkg-config)])
|
||||
fi
|
||||
@@ -169,59 +167,65 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
|
||||
fi
|
||||
fi
|
||||
|
||||
if (test "x$FOUND_FREETYPE" != "xyes"); then
|
||||
if test "x$FOUND_FREETYPE" != "xyes" ; then
|
||||
# Check in well-known locations
|
||||
FREETYPE_BASE_DIR="$SYSROOT/usr"
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
|
||||
|
||||
if (test "x$FOUND_FREETYPE" != "xyes"); then
|
||||
FREETYPE_BASE_DIR="$SYSROOT/usr/X11"
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
|
||||
fi
|
||||
if (test "x$FOUND_FREETYPE" != "xyes"); then
|
||||
FREETYPE_BASE_DIR="$SYSROOT/usr/local"
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
|
||||
fi
|
||||
|
||||
if (test "x$FOUND_FREETYPE" != "xyes"); then
|
||||
FREETYPE_BASE_DIR="$SYSROOT/usr"
|
||||
if (test "x$OPENJDK_TARGET_CPU_BITS" = "x64"); then
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/$OPENJDK_TARGET_CPU-linux-gnu], [well-known location])
|
||||
if (test "x$FOUND_FREETYPE" != "xyes"); then
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib64], [well-known location])
|
||||
fi
|
||||
else
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/i386-linux-gnu], [well-known location])
|
||||
if (test "x$FOUND_FREETYPE" != "xyes"); then
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib32], [well-known location])
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" ; then
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include],
|
||||
[$FREETYPE_BASE_DIR/lib/$OPENJDK_TARGET_CPU-linux-gnu], [well-known location])
|
||||
if test "x$FOUND_FREETYPE" != "xyes" ; then
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include],
|
||||
[$FREETYPE_BASE_DIR/lib64], [well-known location])
|
||||
fi
|
||||
else
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include],
|
||||
[$FREETYPE_BASE_DIR/lib/i386-linux-gnu], [well-known location])
|
||||
if test "x$FOUND_FREETYPE" != "xyes" ; then
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include],
|
||||
[$FREETYPE_BASE_DIR/lib32], [well-known location])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$FOUND_FREETYPE" != "xyes" ; then
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include],
|
||||
[$FREETYPE_BASE_DIR/lib], [well-known location])
|
||||
fi
|
||||
|
||||
if test "x$FOUND_FREETYPE" != "xyes" ; then
|
||||
FREETYPE_BASE_DIR="$SYSROOT/usr/X11"
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include],
|
||||
[$FREETYPE_BASE_DIR/lib], [well-known location])
|
||||
fi
|
||||
|
||||
if test "x$FOUND_FREETYPE" != "xyes" ; then
|
||||
FREETYPE_BASE_DIR="$SYSROOT/usr/local"
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include],
|
||||
[$FREETYPE_BASE_DIR/lib], [well-known location])
|
||||
fi
|
||||
fi # end check in well-known locations
|
||||
|
||||
if (test "x$FOUND_FREETYPE" != "xyes"); then
|
||||
if test "x$FOUND_FREETYPE" != "xyes" ; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([freetype])
|
||||
AC_MSG_ERROR([Could not find freetype! $HELP_MSG ])
|
||||
fi
|
||||
fi # end user specified settings
|
||||
|
||||
# Set FREETYPE_CFLAGS, _LIBS and _LIB_PATH from include and lib dir.
|
||||
if (test "x$FREETYPE_CFLAGS" = "x"); then
|
||||
if (test -d $FREETYPE_INCLUDE_PATH/freetype2/freetype); then
|
||||
if test "x$FREETYPE_CFLAGS" = "x" ; then
|
||||
if test -d $FREETYPE_INCLUDE_PATH/freetype2/freetype ; then
|
||||
FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH/freetype2 -I$FREETYPE_INCLUDE_PATH"
|
||||
else
|
||||
FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH"
|
||||
fi
|
||||
fi
|
||||
|
||||
if (test "x$FREETYPE_LIBS" = "x"); then
|
||||
if test "x$FREETYPE_LIBS" = "x" ; then
|
||||
FREETYPE_LIBS="-L$FREETYPE_LIB_PATH -l$FREETYPE_BASE_NAME"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
AC_MSG_RESULT([Using freetype: $FREETYPE_TO_USE])
|
||||
|
||||
AC_MSG_RESULT([Using freetype: $FREETYPE_TO_USE])
|
||||
|
||||
AC_SUBST(FREETYPE_TO_USE)
|
||||
AC_SUBST(FREETYPE_CFLAGS)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 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
|
||||
@@ -70,6 +70,7 @@ AC_DEFUN_ONCE([LIB_SETUP_STD_LIBS],
|
||||
else
|
||||
LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS"
|
||||
JVM_LDFLAGS="$JVM_LDFLAGS $STATIC_STDCXX_FLAGS"
|
||||
ADLC_LDFLAGS="$ADLC_LDFLAGS $STATIC_STDCXX_FLAGS"
|
||||
# Ideally, we should test stdc++ for the BUILD toolchain separately. For now
|
||||
# just use the same setting as for the TARGET toolchain.
|
||||
OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $STATIC_STDCXX_FLAGS"
|
||||
@@ -77,14 +78,6 @@ AC_DEFUN_ONCE([LIB_SETUP_STD_LIBS],
|
||||
fi
|
||||
fi
|
||||
|
||||
# libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so)
|
||||
if test "x$TOOLCHAIN_TYPE" = xsolstudio && test "x$LIBCXX" = x; then
|
||||
LIBCXX="${SYSROOT}/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1"
|
||||
fi
|
||||
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
LIBCXX_JVM="-lCrun"
|
||||
fi
|
||||
|
||||
AC_SUBST(LIBCXX)
|
||||
|
||||
# Setup Windows runtime dlls
|
||||
|
||||
@@ -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
|
||||
@@ -55,6 +55,40 @@ AC_DEFUN_ONCE([LIB_TESTS_SETUP_GRAALUNIT],
|
||||
AC_SUBST(GRAALUNIT_LIB)
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Setup and check for gtest framework source files
|
||||
#
|
||||
AC_DEFUN_ONCE([LIB_TESTS_SETUP_GTEST],
|
||||
[
|
||||
AC_ARG_WITH(gtest, [AS_HELP_STRING([--with-gtest],
|
||||
[specify prefix directory for the gtest framework])])
|
||||
|
||||
if test "x${with_gtest}" != x; then
|
||||
AC_MSG_CHECKING([for gtest])
|
||||
if test "x${with_gtest}" = xno; then
|
||||
AC_MSG_RESULT([no, disabled])
|
||||
elif test "x${with_gtest}" = xyes; then
|
||||
AC_MSG_RESULT([no, error])
|
||||
AC_MSG_ERROR([--with-gtest must have a value])
|
||||
else
|
||||
if ! test -s "${with_gtest}/googletest/include/gtest/gtest.h"; then
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([Can't find 'googletest/include/gtest/gtest.h' under ${with_gtest} given with the --with-gtest option.])
|
||||
elif ! test -s "${with_gtest}/googlemock/include/gmock/gmock.h"; then
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([Can't find 'googlemock/include/gmock/gmock.h' under ${with_gtest} given with the --with-gtest option.])
|
||||
else
|
||||
GTEST_FRAMEWORK_SRC=${with_gtest}
|
||||
AC_MSG_RESULT([$GTEST_FRAMEWORK_SRC])
|
||||
UTIL_FIXUP_PATH([GTEST_FRAMEWORK_SRC])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(GTEST_FRAMEWORK_SRC)
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Setup and check the Java Microbenchmark Harness
|
||||
@@ -77,6 +111,8 @@ AC_DEFUN_ONCE([LIB_TESTS_SETUP_JMH],
|
||||
AC_MSG_RESULT([no, error])
|
||||
AC_MSG_ERROR([$JMH_HOME does not exist or is not a directory])
|
||||
fi
|
||||
AC_MSG_RESULT([yes, $JMH_HOME])
|
||||
|
||||
UTIL_FIXUP_PATH([JMH_HOME])
|
||||
|
||||
jar_names="jmh-core jmh-generator-annprocess jopt-simple commons-math3"
|
||||
@@ -84,17 +120,14 @@ AC_DEFUN_ONCE([LIB_TESTS_SETUP_JMH],
|
||||
found_jar_files=$($ECHO $(ls $JMH_HOME/$jar-*.jar 2> /dev/null))
|
||||
|
||||
if test "x$found_jar_files" = x; then
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([--with-jmh does not contain $jar-*.jar])
|
||||
elif ! test -e "$found_jar_files"; then
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([--with-jmh contain multiple $jar-*.jar: $found_jar_files])
|
||||
fi
|
||||
|
||||
found_jar_var_name=found_${jar//-/_}
|
||||
eval $found_jar_var_name='"'$found_jar_files'"'
|
||||
done
|
||||
AC_MSG_RESULT([yes])
|
||||
|
||||
JMH_CORE_JAR=$found_jmh_core
|
||||
JMH_GENERATOR_JAR=$found_jmh_generator_annprocess
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 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
|
||||
@@ -88,13 +88,6 @@ AC_DEFUN_ONCE([LIB_SETUP_X11],
|
||||
AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG])
|
||||
fi
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
OPENWIN_HOME="/usr/openwin"
|
||||
X_CFLAGS="-I$SYSROOT$OPENWIN_HOME/include -I$SYSROOT$OPENWIN_HOME/include/X11/extensions"
|
||||
X_LIBS="-L$SYSROOT$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR \
|
||||
-R$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR"
|
||||
fi
|
||||
|
||||
AC_LANG_PUSH(C)
|
||||
OLD_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $SYSROOT_CFLAGS $X_CFLAGS"
|
||||
@@ -122,16 +115,6 @@ AC_DEFUN_ONCE([LIB_SETUP_X11],
|
||||
AC_MSG_ERROR([Could not find all X11 headers (shape.h Xrender.h Xrandr.h XTest.h Intrinsic.h). $HELP_MSG])
|
||||
fi
|
||||
|
||||
# If XLinearGradient isn't available in Xrender.h, signal that it needs to be
|
||||
# defined in libawt_xawt.
|
||||
AC_MSG_CHECKING([if XlinearGradient is defined in Xrender.h])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],
|
||||
[[XLinearGradient x;]])],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])
|
||||
X_CFLAGS="$X_CFLAGS -DSOLARIS10_NO_XRENDER_STRUCTS"])
|
||||
|
||||
CFLAGS="$OLD_CFLAGS"
|
||||
AC_LANG_POP(C)
|
||||
fi # NEEDS_LIB_X11
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 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
|
||||
@@ -101,14 +101,8 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
|
||||
LIB_SETUP_LIBFFI
|
||||
LIB_SETUP_BUNDLED_LIBS
|
||||
LIB_SETUP_MISC_LIBS
|
||||
LIB_SETUP_SOLARIS_STLPORT
|
||||
LIB_TESTS_SETUP_GRAALUNIT
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
GLOBAL_LIBS="-lc"
|
||||
else
|
||||
GLOBAL_LIBS=""
|
||||
fi
|
||||
LIB_TESTS_SETUP_GTEST
|
||||
|
||||
BASIC_JDKLIB_LIBS=""
|
||||
if test "x$TOOLCHAIN_TYPE" != xmicrosoft; then
|
||||
@@ -119,15 +113,13 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
|
||||
BASIC_JVM_LIBS="$LIBM"
|
||||
|
||||
# Dynamic loading library
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
BASIC_JVM_LIBS="$BASIC_JVM_LIBS $LIBDL"
|
||||
fi
|
||||
|
||||
# Threading library
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lpthread"
|
||||
elif test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lthread"
|
||||
fi
|
||||
|
||||
# perfstat lib
|
||||
@@ -135,12 +127,6 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
|
||||
BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lperfstat"
|
||||
fi
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lsocket -lsched -ldoor -ldemangle -lnsl \
|
||||
-lrt -lkstat"
|
||||
BASIC_JVM_LIBS="$BASIC_JVM_LIBS $LIBCXX_JVM"
|
||||
fi
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||
BASIC_JVM_LIBS="$BASIC_JVM_LIBS kernel32.lib user32.lib gdi32.lib winspool.lib \
|
||||
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib \
|
||||
@@ -158,7 +144,6 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
|
||||
AC_SUBST(JVM_LIBS)
|
||||
AC_SUBST(OPENJDK_BUILD_JDKLIB_LIBS)
|
||||
AC_SUBST(OPENJDK_BUILD_JVM_LIBS)
|
||||
AC_SUBST(GLOBAL_LIBS)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
@@ -189,28 +174,3 @@ AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS],
|
||||
LIBZIP_CAN_USE_MMAP=true
|
||||
AC_SUBST(LIBZIP_CAN_USE_MMAP)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
# libstlport.so.1 is needed for running gtest on Solaris. Find it to
|
||||
# redistribute it in the test image.
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_SETUP_SOLARIS_STLPORT],
|
||||
[
|
||||
if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
|
||||
# Find the root of the Solaris Studio installation from the compiler path
|
||||
SOLARIS_STUDIO_DIR="$(dirname $CC)/.."
|
||||
STLPORT_LIB="$SOLARIS_STUDIO_DIR/lib/stlport4$OPENJDK_TARGET_CPU_ISADIR/libstlport.so.1"
|
||||
AC_MSG_CHECKING([for libstlport.so.1])
|
||||
if ! test -f "$STLPORT_LIB" && test "x$OPENJDK_TARGET_CPU_ISADIR" = "x/sparcv9"; then
|
||||
# SS12u3 has libstlport under 'stlport4/v9' instead of 'stlport4/sparcv9'
|
||||
STLPORT_LIB="$SOLARIS_STUDIO_DIR/lib/stlport4/v9/libstlport.so.1"
|
||||
fi
|
||||
if test -f "$STLPORT_LIB"; then
|
||||
AC_MSG_RESULT([yes, $STLPORT_LIB])
|
||||
UTIL_FIXUP_PATH([STLPORT_LIB])
|
||||
else
|
||||
AC_MSG_RESULT([no, not found at $STLPORT_LIB, cannot build Hotspot gtests])
|
||||
fi
|
||||
AC_SUBST(STLPORT_LIB)
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -120,6 +120,12 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU],
|
||||
VAR_CPU_BITS=64
|
||||
VAR_CPU_ENDIAN=little
|
||||
;;
|
||||
riscv64)
|
||||
VAR_CPU=riscv64
|
||||
VAR_CPU_ARCH=riscv
|
||||
VAR_CPU_BITS=64
|
||||
VAR_CPU_ENDIAN=little
|
||||
;;
|
||||
s390)
|
||||
VAR_CPU=s390
|
||||
VAR_CPU_ARCH=s390
|
||||
@@ -156,6 +162,18 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU],
|
||||
VAR_CPU_BITS=64
|
||||
VAR_CPU_ENDIAN=big
|
||||
;;
|
||||
sparc)
|
||||
VAR_CPU=sparc
|
||||
VAR_CPU_ARCH=sparc
|
||||
VAR_CPU_BITS=32
|
||||
VAR_CPU_ENDIAN=big
|
||||
;;
|
||||
sparcv9|sparc64)
|
||||
VAR_CPU=sparcv9
|
||||
VAR_CPU_ARCH=sparc
|
||||
VAR_CPU_BITS=64
|
||||
VAR_CPU_ENDIAN=big
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([unsupported cpu $1])
|
||||
;;
|
||||
@@ -172,10 +190,6 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS],
|
||||
VAR_OS=linux
|
||||
VAR_OS_TYPE=unix
|
||||
;;
|
||||
*solaris*)
|
||||
VAR_OS=solaris
|
||||
VAR_OS_TYPE=unix
|
||||
;;
|
||||
*darwin*)
|
||||
VAR_OS=macosx
|
||||
VAR_OS_TYPE=unix
|
||||
@@ -375,19 +389,6 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER],
|
||||
fi
|
||||
AC_SUBST(OPENJDK_$1_CPU_LEGACY_LIB)
|
||||
|
||||
# OPENJDK_$1_CPU_ISADIR is normally empty. On 64-bit Solaris systems, it is set to
|
||||
# /amd64 or /sparcv9. This string is appended to some library paths, like this:
|
||||
# /usr/lib${OPENJDK_$1_CPU_ISADIR}/libexample.so
|
||||
OPENJDK_$1_CPU_ISADIR=""
|
||||
if test "x$OPENJDK_$1_OS" = xsolaris; then
|
||||
if test "x$OPENJDK_$1_CPU" = xx86_64; then
|
||||
OPENJDK_$1_CPU_ISADIR="/amd64"
|
||||
elif test "x$OPENJDK_$1_CPU" = xsparcv9; then
|
||||
OPENJDK_$1_CPU_ISADIR="/sparcv9"
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(OPENJDK_$1_CPU_ISADIR)
|
||||
|
||||
# Setup OPENJDK_$1_CPU_OSARCH, which is used to set the os.arch Java system property
|
||||
OPENJDK_$1_CPU_OSARCH="$OPENJDK_$1_CPU"
|
||||
if test "x$OPENJDK_$1_OS" = xlinux && test "x$OPENJDK_$1_CPU" = xx86; then
|
||||
@@ -485,6 +486,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER],
|
||||
HOTSPOT_$1_CPU_DEFINE=S390
|
||||
elif test "x$OPENJDK_$1_CPU" = xs390x; then
|
||||
HOTSPOT_$1_CPU_DEFINE=S390
|
||||
elif test "x$OPENJDK_$1_CPU" = xriscv64; then
|
||||
HOTSPOT_$1_CPU_DEFINE=RISCV
|
||||
elif test "x$OPENJDK_$1_CPU" != x; then
|
||||
HOTSPOT_$1_CPU_DEFINE=$(echo $OPENJDK_$1_CPU | tr a-z A-Z)
|
||||
fi
|
||||
@@ -502,9 +505,6 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER],
|
||||
|
||||
AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES],
|
||||
[
|
||||
if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
|
||||
RELEASE_FILE_OS_NAME=SunOS
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = "xlinux"; then
|
||||
RELEASE_FILE_OS_NAME=Linux
|
||||
fi
|
||||
@@ -558,25 +558,9 @@ AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET],
|
||||
PLATFORM_SET_MODULE_TARGET_OS_VALUES
|
||||
PLATFORM_SET_RELEASE_FILE_OS_VALUES
|
||||
PLATFORM_SETUP_LEGACY_VARS
|
||||
PLATFORM_CHECK_DEPRECATION
|
||||
])
|
||||
|
||||
AC_DEFUN([PLATFORM_CHECK_DEPRECATION],
|
||||
[
|
||||
UTIL_ARG_ENABLE(NAME: deprecated-ports, DEFAULT: false,
|
||||
RESULT: ENABLE_DEPRECATED_PORTS,
|
||||
DESC: [suppress the error when configuring for a deprecated port])
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris || \
|
||||
(test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc && \
|
||||
test "x$with_jvm_variants" != xzero); then
|
||||
if test "x$ENABLE_DEPRECATED_PORTS" = "xtrue"; then
|
||||
AC_MSG_WARN([The Solaris and SPARC ports are deprecated and may be removed in a future release.])
|
||||
else
|
||||
AC_MSG_ERROR(m4_normalize([The Solaris and SPARC ports are deprecated and may be removed in a
|
||||
future release. Use --enable-deprecated-ports=yes to suppress this error.]))
|
||||
fi
|
||||
fi
|
||||
# Deprecated in JDK 15
|
||||
UTIL_DEPRECATED_ARG_ENABLE(deprecated-ports)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION],
|
||||
|
||||
@@ -83,7 +83,6 @@ OPENJDK_TARGET_CPU_ENDIAN:=@OPENJDK_TARGET_CPU_ENDIAN@
|
||||
COMPILE_TYPE:=@COMPILE_TYPE@
|
||||
|
||||
# Legacy support
|
||||
OPENJDK_TARGET_CPU_ISADIR:=@OPENJDK_TARGET_CPU_ISADIR@
|
||||
OPENJDK_TARGET_CPU_LEGACY:=@OPENJDK_TARGET_CPU_LEGACY@
|
||||
OPENJDK_TARGET_CPU_LEGACY_LIB:=@OPENJDK_TARGET_CPU_LEGACY_LIB@
|
||||
OPENJDK_TARGET_CPU_OSARCH:=@OPENJDK_TARGET_CPU_OSARCH@
|
||||
@@ -119,6 +118,9 @@ OPENJDK_MODULE_TARGET_PLATFORM:=@OPENJDK_MODULE_TARGET_PLATFORM@
|
||||
RELEASE_FILE_OS_NAME:=@RELEASE_FILE_OS_NAME@
|
||||
RELEASE_FILE_OS_ARCH:=@RELEASE_FILE_OS_ARCH@
|
||||
|
||||
SOURCE_DATE := @SOURCE_DATE@
|
||||
ENABLE_REPRODUCIBLE_BUILD := @ENABLE_REPRODUCIBLE_BUILD@
|
||||
|
||||
LIBM:=@LIBM@
|
||||
LIBDL:=@LIBDL@
|
||||
|
||||
@@ -156,6 +158,7 @@ IMPORT_MODULES_SRC:=@IMPORT_MODULES_SRC@
|
||||
IMPORT_MODULES_MAKE:=@IMPORT_MODULES_MAKE@
|
||||
|
||||
COPYRIGHT_YEAR:=@COPYRIGHT_YEAR@
|
||||
HOTSPOT_BUILD_TIME:=@HOTSPOT_BUILD_TIME@
|
||||
|
||||
# Platform naming variables
|
||||
LAUNCHER_NAME:=@LAUNCHER_NAME@
|
||||
@@ -245,7 +248,7 @@ ifneq ($(COMPANY_NAME),)
|
||||
# Only export "VENDOR" to the build if COMPANY_NAME contains a real value.
|
||||
# Otherwise the default value for VENDOR, which is used to set the "java.vendor"
|
||||
# and "java.vm.vendor" properties is hard-coded into the source code (i.e. in
|
||||
# VersionProps.java.template in the jdk for "vm.vendor" and
|
||||
# VersionProps.java.template in the jdk for "java.vendor" and
|
||||
# vm_version.cpp in the VM for "java.vm.vendor")
|
||||
ifneq ($(COMPANY_NAME), N/A)
|
||||
VERSION_CFLAGS += -DVENDOR='"$(COMPANY_NAME)"'
|
||||
@@ -289,9 +292,6 @@ JVM_FEATURES_custom := @JVM_FEATURES_custom@
|
||||
VALID_JVM_FEATURES := @VALID_JVM_FEATURES@
|
||||
VALID_JVM_VARIANTS := @VALID_JVM_VARIANTS@
|
||||
|
||||
# Control whether Hotspot builds gtest tests
|
||||
BUILD_GTEST := @BUILD_GTEST@
|
||||
|
||||
# Allow overriding the default hotspot library path
|
||||
HOTSPOT_OVERRIDE_LIBPATH := @HOTSPOT_OVERRIDE_LIBPATH@
|
||||
|
||||
@@ -337,6 +337,8 @@ BUILD_MANPAGES := @BUILD_MANPAGES@
|
||||
|
||||
BUILD_CDS_ARCHIVE := @BUILD_CDS_ARCHIVE@
|
||||
|
||||
ALLOW_ABSOLUTE_PATHS_IN_OUTPUT := @ALLOW_ABSOLUTE_PATHS_IN_OUTPUT@
|
||||
|
||||
# The boot jdk to use. This is overridden in bootcycle-spec.gmk. Make sure to keep
|
||||
# it in sync.
|
||||
BOOT_JDK:=@BOOT_JDK@
|
||||
@@ -352,13 +354,10 @@ BOOT_JDK_SOURCETARGET:=@BOOT_JDK_SOURCETARGET@
|
||||
# Information about the build system
|
||||
NUM_CORES:=@NUM_CORES@
|
||||
MEMORY_SIZE:=@MEMORY_SIZE@
|
||||
# Enable sjavac support = use a javac server,
|
||||
# multi core javac compilation and dependency tracking.
|
||||
ENABLE_SJAVAC:=@ENABLE_SJAVAC@
|
||||
ENABLE_JAVAC_SERVER:=@ENABLE_JAVAC_SERVER@
|
||||
# Store sjavac server synchronization files here, and
|
||||
# the sjavac server log files.
|
||||
SJAVAC_SERVER_DIR=$(MAKESUPPORT_OUTPUTDIR)/javacservers
|
||||
# Store javac server synchronization files here, and
|
||||
# the javac server log files.
|
||||
JAVAC_SERVER_DIR=$(MAKESUPPORT_OUTPUTDIR)/javacservers
|
||||
|
||||
# Number of parallel jobs to use for compilation
|
||||
JOBS?=@JOBS@
|
||||
@@ -380,6 +379,7 @@ LIBFFI_CFLAGS:=@LIBFFI_CFLAGS@
|
||||
ENABLE_LIBFFI_BUNDLING:=@ENABLE_LIBFFI_BUNDLING@
|
||||
LIBFFI_LIB_FILE:=@LIBFFI_LIB_FILE@
|
||||
GRAALUNIT_LIB := @GRAALUNIT_LIB@
|
||||
FILE_MACRO_CFLAGS := @FILE_MACRO_CFLAGS@
|
||||
|
||||
STATIC_LIBS_CFLAGS := @STATIC_LIBS_CFLAGS@
|
||||
|
||||
@@ -389,6 +389,8 @@ JMH_JOPT_SIMPLE_JAR := @JMH_JOPT_SIMPLE_JAR@
|
||||
JMH_COMMONS_MATH_JAR := @JMH_COMMONS_MATH_JAR@
|
||||
JMH_VERSION := @JMH_VERSION@
|
||||
|
||||
GTEST_FRAMEWORK_SRC := @GTEST_FRAMEWORK_SRC@
|
||||
|
||||
# Source file for cacerts
|
||||
CACERTS_FILE=@CACERTS_FILE@
|
||||
|
||||
@@ -423,7 +425,7 @@ MACOSX_VERSION_MAX=@MACOSX_VERSION_MAX@
|
||||
# The macosx code signing identity to use
|
||||
MACOSX_CODESIGN_IDENTITY=@MACOSX_CODESIGN_IDENTITY@
|
||||
|
||||
# Toolchain type: gcc, clang, solstudio, lxc, microsoft...
|
||||
# Toolchain type: gcc, clang, xlc, microsoft...
|
||||
TOOLCHAIN_TYPE:=@TOOLCHAIN_TYPE@
|
||||
TOOLCHAIN_VERSION := @TOOLCHAIN_VERSION@
|
||||
CC_VERSION_NUMBER := @CC_VERSION_NUMBER@
|
||||
@@ -466,7 +468,6 @@ CXX_FLAG_DEPS:=@CXX_FLAG_DEPS@
|
||||
|
||||
DISABLE_WARNING_PREFIX := @DISABLE_WARNING_PREFIX@
|
||||
CFLAGS_WARNINGS_ARE_ERRORS:=@CFLAGS_WARNINGS_ARE_ERRORS@
|
||||
LDFLAGS_WARNINGS_ARE_ERRORS:=@LDFLAGS_WARNINGS_ARE_ERRORS@
|
||||
DISABLED_WARNINGS := @DISABLED_WARNINGS@
|
||||
DISABLED_WARNINGS_C := @DISABLED_WARNINGS_C@
|
||||
DISABLED_WARNINGS_CXX := @DISABLED_WARNINGS_CXX@
|
||||
@@ -475,7 +476,8 @@ DISABLED_WARNINGS_CXX := @DISABLED_WARNINGS_CXX@
|
||||
WARNINGS_AS_ERRORS := @WARNINGS_AS_ERRORS@
|
||||
|
||||
CFLAGS_CCACHE:=@CFLAGS_CCACHE@
|
||||
ADLC_CXXFLAG=@ADLC_CXXFLAG@
|
||||
ADLC_LANGSTD_CXXFLAGS=@ADLC_LANGSTD_CXXFLAGS@
|
||||
ADLC_LDFLAGS=@ADLC_LDFLAGS@
|
||||
|
||||
# Tools that potentially need to be cross compilation aware.
|
||||
CC:=@FIXPATH@ @CCACHE@ @ICECC@ @CC@
|
||||
@@ -488,15 +490,11 @@ CXXFLAGS_JDKLIB:=@CXXFLAGS_JDKLIB@
|
||||
CFLAGS_JDKEXE:=@CFLAGS_JDKEXE@
|
||||
CXXFLAGS_JDKEXE:=@CXXFLAGS_JDKEXE@
|
||||
|
||||
LIBJSIG_HASHSTYLE_LDFLAGS := @LIBJSIG_HASHSTYLE_LDFLAGS@
|
||||
LIBJSIG_NOEXECSTACK_LDFLAGS := @LIBJSIG_NOEXECSTACK_LDFLAGS@
|
||||
|
||||
FDLIBM_CFLAGS := @FDLIBM_CFLAGS@
|
||||
JVM_CFLAGS := @JVM_CFLAGS@
|
||||
JVM_LDFLAGS := @JVM_LDFLAGS@
|
||||
JVM_ASFLAGS := @JVM_ASFLAGS@
|
||||
JVM_LIBS := @JVM_LIBS@
|
||||
JVM_RCFLAGS := @JVM_RCFLAGS@
|
||||
|
||||
# These flags might contain variables set by a custom extension that is included later.
|
||||
EXTRA_CFLAGS = @EXTRA_CFLAGS@
|
||||
@@ -520,7 +518,6 @@ SDKROOT:=@SDKROOT@
|
||||
# LDFLAGS used to link the jdk native libraries (C-code)
|
||||
LDFLAGS_JDKLIB:=@LDFLAGS_JDKLIB@
|
||||
JDKLIB_LIBS:=@JDKLIB_LIBS@
|
||||
GLOBAL_LIBS:=@GLOBAL_LIBS@
|
||||
|
||||
# LDFLAGS used to link the jdk native launchers (C-code)
|
||||
LDFLAGS_JDKEXE:=@LDFLAGS_JDKEXE@
|
||||
@@ -565,17 +562,11 @@ CXXFILT:=@CXXFILT@
|
||||
|
||||
LIPO:=@LIPO@
|
||||
INSTALL_NAME_TOOL:=@INSTALL_NAME_TOOL@
|
||||
METAL := @METAL@
|
||||
METALLIB := @METALLIB@
|
||||
|
||||
# Options to linker to specify a mapfile.
|
||||
# (Note absence of := assignment, because we do not want to evaluate the macro body here)
|
||||
SET_SHARED_LIBRARY_MAPFILE=@SET_SHARED_LIBRARY_MAPFILE@
|
||||
|
||||
# Options for C/CXX compiler to be used if linking is performed
|
||||
# using reorder file
|
||||
C_FLAG_REORDER:=@C_FLAG_REORDER@
|
||||
|
||||
#
|
||||
# Options for generating debug symbols
|
||||
COMPILE_WITH_DEBUG_SYMBOLS := @COMPILE_WITH_DEBUG_SYMBOLS@
|
||||
@@ -618,9 +609,8 @@ STRIPFLAGS:=@STRIPFLAGS@
|
||||
JAVA_FLAGS:=@JAVA_FLAGS@
|
||||
JAVA_FLAGS_BIG:=@JAVA_FLAGS_BIG@
|
||||
JAVA_FLAGS_SMALL:=@JAVA_FLAGS_SMALL@
|
||||
JAVA_FLAGS_JAVAC:=@JAVA_FLAGS_JAVAC@
|
||||
BUILDJDK_JAVA_FLAGS_SMALL:=@BUILDJDK_JAVA_FLAGS_SMALL@
|
||||
JAVA_TOOL_FLAGS_SMALL:=@JAVA_TOOL_FLAGS_SMALL@
|
||||
SJAVAC_SERVER_JAVA_FLAGS:=@SJAVAC_SERVER_JAVA_FLAGS@
|
||||
|
||||
# The *_CMD variables are defined separately to be easily overridden in bootcycle-spec.gmk
|
||||
# for bootcycle-images build. Make sure to keep them in sync. Do not use the *_CMD
|
||||
@@ -632,27 +622,17 @@ JAR_CMD:=@JAR@
|
||||
JLINK_CMD := @JLINK@
|
||||
JMOD_CMD := @JMOD@
|
||||
JARSIGNER_CMD:=@JARSIGNER@
|
||||
SJAVAC_SERVER_JAVA_CMD:=@SJAVAC_SERVER_JAVA@
|
||||
# These variables are meant to be used. They are defined with = instead of := to make
|
||||
# it possible to override only the *_CMD variables.
|
||||
JAVA=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_BIG) $(JAVA_FLAGS)
|
||||
JAVA_SMALL=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_SMALL) $(JAVA_FLAGS)
|
||||
JAVA_JAVAC=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_JAVAC) $(JAVA_FLAGS)
|
||||
JAVA_DETACH =@FIXPATH@ @FIXPATH_DETACH_FLAG@ $(JAVA_CMD) $(JAVA_FLAGS_BIG) $(JAVA_FLAGS)
|
||||
JAVAC=@FIXPATH@ $(JAVAC_CMD)
|
||||
JAVADOC=@FIXPATH@ $(JAVADOC_CMD)
|
||||
JAR=@FIXPATH@ $(JAR_CMD)
|
||||
JLINK = @FIXPATH@ $(JLINK_CMD) $(JAVA_TOOL_FLAGS_SMALL)
|
||||
JLINK = @FIXPATH@ $(JLINK_CMD)
|
||||
JMOD = @FIXPATH@ $(JMOD_CMD) $(JAVA_TOOL_FLAGS_SMALL)
|
||||
JARSIGNER=@FIXPATH@ $(JARSIGNER_CMD)
|
||||
# A specific java binary with specific options can be used to run
|
||||
# the long running background sjavac servers and other long running tasks.
|
||||
SJAVAC_SERVER_JAVA=@FIXPATH@ @FIXPATH_DETACH_FLAG@ $(SJAVAC_SERVER_JAVA_CMD) \
|
||||
$(SJAVAC_SERVER_JAVA_FLAGS)
|
||||
|
||||
# Hotspot sets this variable before reading the SPEC when compiling sa-jdi.jar. Avoid
|
||||
# overriding that value by using ?=.
|
||||
JAVAC_FLAGS?=@JAVAC_FLAGS@
|
||||
|
||||
|
||||
BUILD_JAVA_FLAGS := @BOOTCYCLE_JVM_ARGS_BIG@
|
||||
BUILD_JAVA=@FIXPATH@ $(BUILD_JDK)/bin/java $(BUILD_JAVA_FLAGS)
|
||||
@@ -665,6 +645,7 @@ INTERIM_LANGTOOLS_ADD_EXPORTS := \
|
||||
--add-exports java.base/sun.reflect.annotation=jdk.compiler.interim \
|
||||
--add-exports java.base/jdk.internal.jmod=jdk.compiler.interim \
|
||||
--add-exports java.base/jdk.internal.misc=jdk.compiler.interim \
|
||||
--add-exports java.base/sun.invoke.util=jdk.compiler.interim \
|
||||
#
|
||||
INTERIM_LANGTOOLS_MODULES_COMMA := $(strip $(subst $(SPACE),$(COMMA),$(strip \
|
||||
$(INTERIM_LANGTOOLS_MODULES))))
|
||||
@@ -684,12 +665,7 @@ NEW_JAVADOC = $(INTERIM_LANGTOOLS_ARGS) $(JAVADOC_MAIN_CLASS)
|
||||
|
||||
JLINK_KEEP_PACKAGED_MODULES:=@JLINK_KEEP_PACKAGED_MODULES@
|
||||
|
||||
# Base flags for RC
|
||||
# Guarding this against resetting value. Legacy make files include spec multiple
|
||||
# times.
|
||||
ifndef RC_FLAGS
|
||||
RC_FLAGS:=@RC_FLAGS@
|
||||
endif
|
||||
RCFLAGS := @RCFLAGS@
|
||||
|
||||
# Tools adhering to a minimal and common standard of posix compliance.
|
||||
AWK:=@AWK@
|
||||
@@ -753,7 +729,6 @@ WSLPATH:=@WSLPATH@
|
||||
LDD:=@LDD@
|
||||
OTOOL:=@OTOOL@
|
||||
READELF:=@READELF@
|
||||
ELFEDIT:=@ELFEDIT@
|
||||
EXPR:=@EXPR@
|
||||
FILE:=@FILE@
|
||||
DOT:=@DOT@
|
||||
@@ -763,7 +738,6 @@ OBJCOPY:=@OBJCOPY@
|
||||
SETFILE:=@SETFILE@
|
||||
XATTR:=@XATTR@
|
||||
JT_HOME:=@JT_HOME@
|
||||
JTREGEXE:=@JTREGEXE@
|
||||
JIB_HOME:=@JIB_HOME@
|
||||
XCODEBUILD=@XCODEBUILD@
|
||||
DTRACE := @DTRACE@
|
||||
@@ -771,7 +745,6 @@ FIXPATH:=@FIXPATH@
|
||||
ULIMIT:=@ULIMIT@
|
||||
|
||||
TAR_TYPE:=@TAR_TYPE@
|
||||
TAR_CREATE_EXTRA_PARAM:=@TAR_CREATE_EXTRA_PARAM@
|
||||
TAR_INCLUDE_PARAM:=@TAR_INCLUDE_PARAM@
|
||||
TAR_SUPPORTS_TRANSFORM:=@TAR_SUPPORTS_TRANSFORM@
|
||||
|
||||
@@ -785,9 +758,9 @@ LIBZ_CFLAGS:=@LIBZ_CFLAGS@
|
||||
LIBZ_LIBS:=@LIBZ_LIBS@
|
||||
LIBZIP_CAN_USE_MMAP:=@LIBZIP_CAN_USE_MMAP@
|
||||
MSVCR_DLL:=@MSVCR_DLL@
|
||||
VCRUNTIME_1_DLL:=@VCRUNTIME_1_DLL@
|
||||
MSVCP_DLL:=@MSVCP_DLL@
|
||||
UCRT_DLL_DIR:=@UCRT_DLL_DIR@
|
||||
STLPORT_LIB:=@STLPORT_LIB@
|
||||
ENABLE_PANDOC:=@ENABLE_PANDOC@
|
||||
PANDOC_MARKDOWN_FLAG:=@PANDOC_MARKDOWN_FLAG@
|
||||
|
||||
@@ -851,6 +824,10 @@ USE_EXTERNAL_LCMS:=@USE_EXTERNAL_LCMS@
|
||||
LCMS_CFLAGS:=@LCMS_CFLAGS@
|
||||
LCMS_LIBS:=@LCMS_LIBS@
|
||||
|
||||
USE_EXTERNAL_HARFBUZZ:=@USE_EXTERNAL_HARFBUZZ@
|
||||
HARFBUZZ_CFLAGS:=@HARFBUZZ_CFLAGS@
|
||||
HARFBUZZ_LIBS:=@HARFBUZZ_LIBS@
|
||||
|
||||
USE_EXTERNAL_LIBPNG:=@USE_EXTERNAL_LIBPNG@
|
||||
PNG_LIBS:=@PNG_LIBS@
|
||||
PNG_CFLAGS:=@PNG_CFLAGS@
|
||||
|
||||
@@ -35,11 +35,10 @@
|
||||
m4_include([toolchain_windows.m4])
|
||||
|
||||
# All valid toolchains, regardless of platform (used by help.m4)
|
||||
VALID_TOOLCHAINS_all="gcc clang solstudio xlc microsoft"
|
||||
VALID_TOOLCHAINS_all="gcc clang xlc microsoft"
|
||||
|
||||
# These toolchains are valid on different platforms
|
||||
VALID_TOOLCHAINS_linux="gcc clang"
|
||||
VALID_TOOLCHAINS_solaris="solstudio"
|
||||
VALID_TOOLCHAINS_macosx="gcc clang"
|
||||
VALID_TOOLCHAINS_aix="xlc"
|
||||
VALID_TOOLCHAINS_windows="microsoft"
|
||||
@@ -48,14 +47,12 @@ VALID_TOOLCHAINS_windows="microsoft"
|
||||
TOOLCHAIN_DESCRIPTION_clang="clang/LLVM"
|
||||
TOOLCHAIN_DESCRIPTION_gcc="GNU Compiler Collection"
|
||||
TOOLCHAIN_DESCRIPTION_microsoft="Microsoft Visual Studio"
|
||||
TOOLCHAIN_DESCRIPTION_solstudio="Oracle Solaris Studio"
|
||||
TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"
|
||||
|
||||
# Minimum supported versions, empty means unspecified
|
||||
TOOLCHAIN_MINIMUM_VERSION_clang="3.2"
|
||||
TOOLCHAIN_MINIMUM_VERSION_clang="3.5"
|
||||
TOOLCHAIN_MINIMUM_VERSION_gcc="5.0"
|
||||
TOOLCHAIN_MINIMUM_VERSION_microsoft="16.00.30319.01" # VS2010
|
||||
TOOLCHAIN_MINIMUM_VERSION_solstudio="5.13"
|
||||
TOOLCHAIN_MINIMUM_VERSION_microsoft="19.10.0.0" # VS2017
|
||||
TOOLCHAIN_MINIMUM_VERSION_xlc=""
|
||||
|
||||
# Minimum supported linker versions, empty means unspecified
|
||||
@@ -296,13 +293,11 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE],
|
||||
TOOLCHAIN_CC_BINARY_clang="clang"
|
||||
TOOLCHAIN_CC_BINARY_gcc="gcc"
|
||||
TOOLCHAIN_CC_BINARY_microsoft="cl$EXE_SUFFIX"
|
||||
TOOLCHAIN_CC_BINARY_solstudio="cc"
|
||||
TOOLCHAIN_CC_BINARY_xlc="xlclang"
|
||||
|
||||
TOOLCHAIN_CXX_BINARY_clang="clang++"
|
||||
TOOLCHAIN_CXX_BINARY_gcc="g++"
|
||||
TOOLCHAIN_CXX_BINARY_microsoft="cl$EXE_SUFFIX"
|
||||
TOOLCHAIN_CXX_BINARY_solstudio="CC"
|
||||
TOOLCHAIN_CXX_BINARY_xlc="xlclang++"
|
||||
|
||||
# Use indirect variable referencing
|
||||
@@ -409,28 +404,7 @@ AC_DEFUN([TOOLCHAIN_EXTRACT_COMPILER_VERSION],
|
||||
COMPILER=[$]$1
|
||||
COMPILER_NAME=$2
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
# cc -V output typically looks like
|
||||
# cc: Sun C 5.12 Linux_i386 2011/11/16
|
||||
# or
|
||||
# cc: Studio 12.5 Sun C 5.14 SunOS_sparc 2016/05/31
|
||||
COMPILER_VERSION_OUTPUT=`$COMPILER -V 2>&1`
|
||||
# Check that this is likely to be the Solaris Studio cc.
|
||||
$ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "^.* Sun $COMPILER_NAME" > /dev/null
|
||||
if test $? -ne 0; then
|
||||
ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1`
|
||||
AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler.])
|
||||
AC_MSG_NOTICE([The result from running with -V was: "$COMPILER_VERSION_OUTPUT"])
|
||||
AC_MSG_NOTICE([The result from running with --version was: "$ALT_VERSION_OUTPUT"])
|
||||
AC_MSG_ERROR([A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.])
|
||||
fi
|
||||
# Remove usage instructions (if present), and
|
||||
# collapse compiler output into a single line
|
||||
COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \
|
||||
$SED -e 's/ *@<:@Uu@:>@sage:.*//'`
|
||||
COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \
|
||||
$SED -e "s/^.*@<:@ ,\t@:>@$COMPILER_NAME@<:@ ,\t@:>@\(@<:@1-9@:>@\.@<:@0-9@:>@@<:@0-9@:>@*\).*/\1/"`
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
if test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
# xlc -qversion output typically looks like
|
||||
# IBM XL C/C++ for AIX, V11.1 (5724-X13)
|
||||
# Version: 11.01.0000.0015
|
||||
@@ -615,26 +589,19 @@ AC_DEFUN([TOOLCHAIN_EXTRACT_LD_VERSION],
|
||||
LINKER=[$]$1
|
||||
LINKER_NAME="$2"
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
# cc -Wl,-V output typically looks like
|
||||
# ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.2329
|
||||
|
||||
# solstudio cc requires us to have an existing file to pass as argument,
|
||||
# but it need not be a syntactically correct C file, so just use
|
||||
# ourself. :) The intermediate 'cat' is needed to stop ld from leaving
|
||||
# a lingering a.out (!).
|
||||
LINKER_VERSION_STRING=`$LD -Wl,-V $TOPDIR/configure 2>&1 | $CAT | $HEAD -n 1 | $SED -e 's/ld: //'`
|
||||
# Extract version number
|
||||
[ LINKER_VERSION_NUMBER=`$ECHO $LINKER_VERSION_STRING | \
|
||||
$SED -e 's/.* \([0-9][0-9]*\.[0-9][0-9]*\)-\([0-9][0-9]*\.[0-9][0-9]*\)/\1.\2/'` ]
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
if test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
LINKER_VERSION_STRING="Unknown"
|
||||
LINKER_VERSION_NUMBER="0.0"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
# There is no specific version flag, but all output starts with a version string.
|
||||
# First line typically looks something like:
|
||||
# Microsoft (R) Incremental Linker Version 12.00.31101.0
|
||||
# Reset PATH since it can contain a mix of WSL/linux paths and Windows paths from VS,
|
||||
# which, in combination with WSLENV, will make the WSL layer complain
|
||||
old_path="$PATH"
|
||||
PATH=
|
||||
LINKER_VERSION_STRING=`$LD 2>&1 | $HEAD -n 1 | $TR -d '\r'`
|
||||
PATH="$old_path"
|
||||
# Extract version number
|
||||
[ LINKER_VERSION_NUMBER=`$ECHO $LINKER_VERSION_STRING | \
|
||||
$SED -e 's/.* \([0-9][0-9]*\(\.[0-9][0-9]*\)*\).*/\1/'` ]
|
||||
@@ -732,13 +699,23 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_CORE],
|
||||
UTIL_FIXUP_EXECUTABLE(LD)
|
||||
# Verify that we indeed succeeded with this trick.
|
||||
AC_MSG_CHECKING([if the found link.exe is actually the Visual Studio linker])
|
||||
|
||||
# Reset PATH since it can contain a mix of WSL/linux paths and Windows paths from VS,
|
||||
# which, in combination with WSLENV, will make the WSL layer complain
|
||||
old_path="$PATH"
|
||||
PATH=
|
||||
|
||||
"$LD" --version > /dev/null
|
||||
|
||||
if test $? -eq 0 ; then
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([This is the Cygwin link tool. Please check your PATH and rerun configure.])
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
|
||||
PATH="$old_path"
|
||||
|
||||
LDCXX="$LD"
|
||||
# jaotc being a windows program expects the linker to be supplied with exe suffix.
|
||||
LD_JAOTC="$LD$EXE_SUFFIX"
|
||||
@@ -769,16 +746,8 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_CORE],
|
||||
#
|
||||
# Setup the assembler (AS)
|
||||
#
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
UTIL_PATH_PROGS(AS, as)
|
||||
UTIL_FIXUP_EXECUTABLE(AS)
|
||||
if test "x$AS" = x; then
|
||||
AC_MSG_ERROR([Solaris assembler (as) is required. Please install via "pkg install pkg:/developer/assembler".])
|
||||
fi
|
||||
else
|
||||
# FIXME: is this correct for microsoft?
|
||||
AS="$CC -c"
|
||||
fi
|
||||
# FIXME: is this correct for microsoft?
|
||||
AS="$CC -c"
|
||||
AC_SUBST(AS)
|
||||
|
||||
#
|
||||
@@ -807,32 +776,6 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA],
|
||||
UTIL_FIXUP_EXECUTABLE(OTOOL)
|
||||
UTIL_REQUIRE_PROGS(INSTALL_NAME_TOOL, install_name_tool)
|
||||
UTIL_FIXUP_EXECUTABLE(INSTALL_NAME_TOOL)
|
||||
|
||||
UTIL_PATH_PROGS(METAL, metal)
|
||||
if test "x$METAL" = x; then
|
||||
AC_MSG_CHECKING([if metal can be run using xcrun])
|
||||
METAL="xcrun -sdk macosx metal"
|
||||
test_metal=`$METAL --version 2>&1`
|
||||
if test $? -ne 0; then
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([XCode tool 'metal' neither found in path nor with xcrun])
|
||||
else
|
||||
AC_MSG_RESULT([yes, will be using '$METAL'])
|
||||
fi
|
||||
fi
|
||||
|
||||
UTIL_PATH_PROGS(METALLIB, metallib)
|
||||
if test "x$METALLIB" = x; then
|
||||
AC_MSG_CHECKING([if metallib can be run using xcrun])
|
||||
METALLIB="xcrun -sdk macosx metallib"
|
||||
test_metallib=`$METALLIB --version 2>&1`
|
||||
if test $? -ne 0; then
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([XCode tool 'metallib' neither found in path nor with xcrun])
|
||||
else
|
||||
AC_MSG_RESULT([yes, will be using '$METALLIB'])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
@@ -853,15 +796,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA],
|
||||
AC_CHECK_PROG([MSBUILD], [msbuild$EXE_SUFFIX], [msbuild$EXE_SUFFIX],,,)
|
||||
fi
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
UTIL_PATH_PROGS(STRIP, strip)
|
||||
UTIL_FIXUP_EXECUTABLE(STRIP)
|
||||
UTIL_PATH_PROGS(NM, nm)
|
||||
UTIL_FIXUP_EXECUTABLE(NM)
|
||||
UTIL_PATH_PROGS(GNM, gnm)
|
||||
UTIL_FIXUP_EXECUTABLE(GNM)
|
||||
elif test "x$OPENJDK_TARGET_OS" != xwindows; then
|
||||
# FIXME: we should unify this with the solaris case above.
|
||||
if test "x$OPENJDK_TARGET_OS" != xwindows; then
|
||||
UTIL_CHECK_TOOLS(STRIP, strip)
|
||||
UTIL_FIXUP_EXECUTABLE(STRIP)
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
@@ -876,48 +811,11 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA],
|
||||
|
||||
# objcopy is used for moving debug symbols to separate files when
|
||||
# full debug symbols are enabled.
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
UTIL_CHECK_TOOLS(OBJCOPY, [gobjcopy objcopy])
|
||||
# Only call fixup if objcopy was found.
|
||||
if test -n "$OBJCOPY"; then
|
||||
UTIL_FIXUP_EXECUTABLE(OBJCOPY)
|
||||
if test "x$OPENJDK_BUILD_OS" = xsolaris; then
|
||||
# objcopy prior to 2.21.1 on solaris is broken and is not usable.
|
||||
# Rewrite objcopy version output to VALID_VERSION or BAD_VERSION.
|
||||
# - version number is last blank separate word on first line
|
||||
# - version number formats that have been seen:
|
||||
# - <major>.<minor>
|
||||
# - <major>.<minor>.<micro>
|
||||
OBJCOPY_VERSION=`$OBJCOPY --version | $HEAD -n 1`
|
||||
# The outer [ ] is to prevent m4 from eating the [] in the sed expression.
|
||||
[ OBJCOPY_VERSION_CHECK=`$ECHO $OBJCOPY_VERSION | $SED -n \
|
||||
-e 's/.* //' \
|
||||
-e '/^[01]\./b bad' \
|
||||
-e '/^2\./{' \
|
||||
-e ' s/^2\.//' \
|
||||
-e ' /^[0-9]$/b bad' \
|
||||
-e ' /^[0-9]\./b bad' \
|
||||
-e ' /^1[0-9]$/b bad' \
|
||||
-e ' /^1[0-9]\./b bad' \
|
||||
-e ' /^20\./b bad' \
|
||||
-e ' /^21\.0$/b bad' \
|
||||
-e ' /^21\.0\./b bad' \
|
||||
-e '}' \
|
||||
-e ':good' \
|
||||
-e 's/.*/VALID_VERSION/p' \
|
||||
-e 'q' \
|
||||
-e ':bad' \
|
||||
-e 's/.*/BAD_VERSION/p' \
|
||||
-e 'q'` ]
|
||||
if test "x$OBJCOPY_VERSION_CHECK" = xBAD_VERSION; then
|
||||
OBJCOPY=
|
||||
AC_MSG_WARN([Ignoring found objcopy since it is broken (prior to 2.21.1). No debug symbols will be generated.])
|
||||
AC_MSG_NOTICE([objcopy reports version $OBJCOPY_VERSION])
|
||||
AC_MSG_NOTICE([Note: patch 149063-01 or newer contains the correct Solaris 10 SPARC version])
|
||||
AC_MSG_NOTICE([Note: patch 149064-01 or newer contains the correct Solaris 10 X86 version])
|
||||
AC_MSG_NOTICE([Note: Solaris 11 Update 1 contains the correct version])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -929,7 +827,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA],
|
||||
fi
|
||||
|
||||
case $TOOLCHAIN_TYPE in
|
||||
gcc|clang|solstudio)
|
||||
gcc|clang)
|
||||
UTIL_CHECK_TOOLS(CXXFILT, [c++filt])
|
||||
UTIL_CHECK_NONEMPTY(CXXFILT)
|
||||
UTIL_FIXUP_EXECUTABLE(CXXFILT)
|
||||
@@ -1004,9 +902,14 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS],
|
||||
# FIXME: we should list the discovered compilers as an exclude pattern!
|
||||
# If we do that, we can do this detection before POST_DETECTION, and still
|
||||
# find the build compilers in the tools dir, if needed.
|
||||
UTIL_REQUIRE_PROGS(BUILD_CC, [cl cc gcc])
|
||||
if test "x$OPENJDK_BUILD_OS" = xmacosx; then
|
||||
UTIL_REQUIRE_PROGS(BUILD_CC, [clang cl cc gcc])
|
||||
UTIL_REQUIRE_PROGS(BUILD_CXX, [clang++ cl CC g++])
|
||||
else
|
||||
UTIL_REQUIRE_PROGS(BUILD_CC, [cl cc gcc])
|
||||
UTIL_REQUIRE_PROGS(BUILD_CXX, [cl CC g++])
|
||||
fi
|
||||
UTIL_FIXUP_EXECUTABLE(BUILD_CC)
|
||||
UTIL_REQUIRE_PROGS(BUILD_CXX, [cl CC g++])
|
||||
UTIL_FIXUP_EXECUTABLE(BUILD_CXX)
|
||||
UTIL_PATH_PROGS(BUILD_NM, nm gcc-nm)
|
||||
UTIL_FIXUP_EXECUTABLE(BUILD_NM)
|
||||
@@ -1074,12 +977,6 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS],
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
# If this is a --hash-style=gnu system, use --hash-style=both, why?
|
||||
HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'`
|
||||
# This is later checked when setting flags.
|
||||
fi
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
# Check if linker has -z noexecstack.
|
||||
HAS_NOEXECSTACK=`$CC -Wl,--help 2>/dev/null | $GREP 'z noexecstack'`
|
||||
@@ -1107,8 +1004,27 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG],
|
||||
AC_MSG_CHECKING([for jtreg test harness])
|
||||
AC_MSG_RESULT([no, disabled])
|
||||
elif test "x$with_jtreg" != xyes && test "x$with_jtreg" != x; then
|
||||
# An explicit path is specified, use it.
|
||||
JT_HOME="$with_jtreg"
|
||||
if test -d "$with_jtreg"; then
|
||||
# An explicit path is specified, use it.
|
||||
JT_HOME="$with_jtreg"
|
||||
else
|
||||
case "$with_jtreg" in
|
||||
*.zip )
|
||||
JTREG_SUPPORT_DIR=$CONFIGURESUPPORT_OUTPUTDIR/jtreg
|
||||
$RM -rf $JTREG_SUPPORT_DIR
|
||||
$MKDIR -p $JTREG_SUPPORT_DIR
|
||||
$UNZIP -qq -d $JTREG_SUPPORT_DIR $with_jtreg
|
||||
|
||||
# Try to find jtreg to determine JT_HOME path
|
||||
JTREG_PATH=`$FIND $JTREG_SUPPORT_DIR | $GREP "/bin/jtreg"`
|
||||
if test "x$JTREG_PATH" != x; then
|
||||
JT_HOME=$($DIRNAME $($DIRNAME $JTREG_PATH))
|
||||
fi
|
||||
;;
|
||||
* )
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
UTIL_FIXUP_PATH([JT_HOME])
|
||||
if test ! -d "$JT_HOME"; then
|
||||
AC_MSG_ERROR([jtreg home directory from --with-jtreg=$with_jtreg does not exist])
|
||||
@@ -1118,15 +1034,10 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG],
|
||||
AC_MSG_ERROR([jtreg home directory from --with-jtreg=$with_jtreg is not a valid jtreg home])
|
||||
fi
|
||||
|
||||
JTREGEXE="$JT_HOME/bin/jtreg"
|
||||
if test ! -x "$JTREGEXE"; then
|
||||
AC_MSG_ERROR([jtreg home directory from --with-jtreg=$with_jtreg does not contain valid jtreg executable])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for jtreg test harness])
|
||||
AC_MSG_RESULT([$JT_HOME])
|
||||
else
|
||||
# Try to locate jtreg
|
||||
# Try to locate jtreg using the JT_HOME environment variable
|
||||
if test "x$JT_HOME" != x; then
|
||||
# JT_HOME set in environment, use it
|
||||
if test ! -d "$JT_HOME"; then
|
||||
@@ -1136,11 +1047,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG],
|
||||
if test ! -e "$JT_HOME/lib/jtreg.jar"; then
|
||||
AC_MSG_WARN([Ignoring JT_HOME which is not a valid jtreg home: $JT_HOME])
|
||||
JT_HOME=
|
||||
elif test ! -x "$JT_HOME/bin/jtreg"; then
|
||||
AC_MSG_WARN([Ignoring JT_HOME which does not contain valid jtreg executable: $JT_HOME])
|
||||
JT_HOME=
|
||||
else
|
||||
JTREGEXE="$JT_HOME/bin/jtreg"
|
||||
AC_MSG_NOTICE([Located jtreg using JT_HOME from environment])
|
||||
fi
|
||||
fi
|
||||
@@ -1156,7 +1063,6 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG],
|
||||
if test ! -e "$JT_HOME/lib/jtreg.jar"; then
|
||||
AC_MSG_WARN([Ignoring jtreg from path since a valid jtreg home cannot be found])
|
||||
JT_HOME=
|
||||
JTREGEXE=
|
||||
else
|
||||
AC_MSG_NOTICE([Located jtreg using jtreg executable in path])
|
||||
fi
|
||||
@@ -1175,10 +1081,8 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG],
|
||||
fi
|
||||
fi
|
||||
|
||||
UTIL_FIXUP_EXECUTABLE(JTREGEXE)
|
||||
UTIL_FIXUP_PATH(JT_HOME)
|
||||
AC_SUBST(JT_HOME)
|
||||
AC_SUBST(JTREGEXE)
|
||||
])
|
||||
|
||||
# Setup the JIB dependency resolver
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 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
|
||||
@@ -25,55 +25,7 @@
|
||||
|
||||
################################################################################
|
||||
# The order of these defines the priority by which we try to find them.
|
||||
VALID_VS_VERSIONS="2017 2019 2013 2015 2012 2010"
|
||||
|
||||
VS_DESCRIPTION_2010="Microsoft Visual Studio 2010"
|
||||
VS_VERSION_INTERNAL_2010=100
|
||||
VS_MSVCR_2010=msvcr100.dll
|
||||
# We don't use msvcp on Visual Studio 2010
|
||||
#VS_MSVCP_2010=msvcp100.dll
|
||||
VS_ENVVAR_2010="VS100COMNTOOLS"
|
||||
VS_VS_INSTALLDIR_2010="Microsoft Visual Studio 10.0"
|
||||
VS_SDK_INSTALLDIR_2010="Microsoft SDKs/Windows/v7.1"
|
||||
VS_VS_PLATFORM_NAME_2010="v100"
|
||||
VS_SDK_PLATFORM_NAME_2010="Windows7.1SDK"
|
||||
VS_SUPPORTED_2010=false
|
||||
|
||||
VS_DESCRIPTION_2012="Microsoft Visual Studio 2012"
|
||||
VS_VERSION_INTERNAL_2012=110
|
||||
VS_MSVCR_2012=msvcr110.dll
|
||||
VS_MSVCP_2012=msvcp110.dll
|
||||
VS_ENVVAR_2012="VS110COMNTOOLS"
|
||||
VS_VS_INSTALLDIR_2012="Microsoft Visual Studio 11.0"
|
||||
VS_SDK_INSTALLDIR_2012=
|
||||
VS_VS_PLATFORM_NAME_2012="v110"
|
||||
VS_SDK_PLATFORM_NAME_2012=
|
||||
VS_SUPPORTED_2012=false
|
||||
|
||||
VS_DESCRIPTION_2013="Microsoft Visual Studio 2013"
|
||||
VS_VERSION_INTERNAL_2013=120
|
||||
VS_MSVCR_2013=msvcr120.dll
|
||||
VS_MSVCP_2013=msvcp120.dll
|
||||
VS_ENVVAR_2013="VS120COMNTOOLS"
|
||||
VS_VS_INSTALLDIR_2013="Microsoft Visual Studio 12.0"
|
||||
VS_SDK_INSTALLDIR_2013=
|
||||
VS_VS_PLATFORM_NAME_2013="v120"
|
||||
VS_SDK_PLATFORM_NAME_2013=
|
||||
VS_SUPPORTED_2013=false
|
||||
|
||||
VS_DESCRIPTION_2015="Microsoft Visual Studio 2015"
|
||||
VS_VERSION_INTERNAL_2015=140
|
||||
VS_MSVCR_2015=vcruntime140.dll
|
||||
VS_MSVCP_2015=msvcp140.dll
|
||||
VS_ENVVAR_2015="VS140COMNTOOLS"
|
||||
VS_VS_INSTALLDIR_2015="Microsoft Visual Studio 14.0"
|
||||
VS_SDK_INSTALLDIR_2015=
|
||||
VS_VS_PLATFORM_NAME_2015="v140"
|
||||
VS_SDK_PLATFORM_NAME_2015=
|
||||
# The vcvars of 2015 breaks if 2017 is also installed. Work around this by
|
||||
# explicitly specifying Windows Kit 8.1 to be used.
|
||||
VS_ENV_ARGS_2015="8.1"
|
||||
VS_SUPPORTED_2015=false
|
||||
VALID_VS_VERSIONS="2019 2017"
|
||||
|
||||
VS_DESCRIPTION_2017="Microsoft Visual Studio 2017"
|
||||
VS_VERSION_INTERNAL_2017=141
|
||||
@@ -90,8 +42,9 @@ VS_SUPPORTED_2017=true
|
||||
VS_TOOLSET_SUPPORTED_2017=true
|
||||
|
||||
VS_DESCRIPTION_2019="Microsoft Visual Studio 2019"
|
||||
VS_VERSION_INTERNAL_2019=141
|
||||
VS_VERSION_INTERNAL_2019=142
|
||||
VS_MSVCR_2019=vcruntime140.dll
|
||||
VS_VCRUNTIME_1_2019=vcruntime140_1.dll
|
||||
VS_MSVCP_2019=msvcp140.dll
|
||||
VS_ENVVAR_2019="VS160COMNTOOLS"
|
||||
VS_USE_UCRT_2019="true"
|
||||
@@ -100,8 +53,8 @@ VS_EDITIONS_2019="BuildTools Community Professional Enterprise"
|
||||
VS_SDK_INSTALLDIR_2019=
|
||||
VS_VS_PLATFORM_NAME_2019="v142"
|
||||
VS_SDK_PLATFORM_NAME_2019=
|
||||
VS_SUPPORTED_2019=false
|
||||
VS_TOOLSET_SUPPORTED_2019=false
|
||||
VS_SUPPORTED_2019=true
|
||||
VS_TOOLSET_SUPPORTED_2019=true
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -299,6 +252,7 @@ AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO],
|
||||
fi
|
||||
eval VS_VERSION_INTERNAL="\${VS_VERSION_INTERNAL_${VS_VERSION}}"
|
||||
eval MSVCR_NAME="\${VS_MSVCR_${VS_VERSION}}"
|
||||
eval VCRUNTIME_1_NAME="\${VS_VCRUNTIME_1_${VS_VERSION}}"
|
||||
eval MSVCP_NAME="\${VS_MSVCP_${VS_VERSION}}"
|
||||
eval USE_UCRT="\${VS_USE_UCRT_${VS_VERSION}}"
|
||||
eval VS_SUPPORTED="\${VS_SUPPORTED_${VS_VERSION}}"
|
||||
@@ -365,6 +319,7 @@ AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO],
|
||||
eval VS_DESCRIPTION="\${VS_DESCRIPTION_${VS_VERSION}}"
|
||||
eval VS_VERSION_INTERNAL="\${VS_VERSION_INTERNAL_${VS_VERSION}}"
|
||||
eval MSVCR_NAME="\${VS_MSVCR_${VS_VERSION}}"
|
||||
eval VCRUNTIME_1_NAME="\${VS_VCRUNTIME_1_${VS_VERSION}}"
|
||||
eval MSVCP_NAME="\${VS_MSVCP_${VS_VERSION}}"
|
||||
eval USE_UCRT="\${VS_USE_UCRT_${VS_VERSION}}"
|
||||
eval VS_SUPPORTED="\${VS_SUPPORTED_${VS_VERSION}}"
|
||||
@@ -482,10 +437,9 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV],
|
||||
fi
|
||||
|
||||
# Now execute the newly created bat file.
|
||||
# The | cat is to stop SetEnv.Cmd to mess with system colors on msys.
|
||||
# Change directory so we don't need to mess with Windows paths in redirects.
|
||||
cd $VS_ENV_TMP_DIR
|
||||
$CMD /c extract-vs-env.bat | $CAT
|
||||
$CMD /c extract-vs-env.bat > extract-vs-env.log 2>&1
|
||||
cd $CONFIGURE_START_DIR
|
||||
|
||||
if test ! -s $VS_ENV_TMP_DIR/set-vs-env.sh; then
|
||||
@@ -802,6 +756,31 @@ AC_DEFUN([TOOLCHAIN_SETUP_VS_RUNTIME_DLLS],
|
||||
AC_SUBST(MSVCP_DLL)
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(vcruntime-1-dll, [AS_HELP_STRING([--with-vcruntime-1-dll],
|
||||
[path to microsoft C++ runtime dll (vcruntime*_1.dll) (Windows only) @<:@probed@:>@])])
|
||||
|
||||
if test "x$VCRUNTIME_1_NAME" != "x"; then
|
||||
if test "x$with_vcruntime_1_dll" != x; then
|
||||
# If given explicitly by user, do not probe. If not present, fail directly.
|
||||
TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($VCRUNTIME_1_NAME, [$with_vcruntime_1_dll],
|
||||
[--with-vcruntime-1-dll])
|
||||
if test "x$MSVC_DLL" = x; then
|
||||
AC_MSG_ERROR([Could not find a proper $VCRUNTIME_1_NAME as specified by --with-vcruntime-1-dll])
|
||||
fi
|
||||
VCRUNTIME_1_DLL="$MSVC_DLL"
|
||||
elif test "x$DEVKIT_VCRUNTIME_1_DLL" != x; then
|
||||
TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($VCRUNTIME_1_NAME, [$DEVKIT_VCRUNTIME_1_DLL], [devkit])
|
||||
if test "x$MSVC_DLL" = x; then
|
||||
AC_MSG_ERROR([Could not find a proper $VCRUNTIME_1_NAME as specified by devkit])
|
||||
fi
|
||||
VCRUNTIME_1_DLL="$MSVC_DLL"
|
||||
else
|
||||
TOOLCHAIN_SETUP_MSVC_DLL([${VCRUNTIME_1_NAME}])
|
||||
VCRUNTIME_1_DLL="$MSVC_DLL"
|
||||
fi
|
||||
AC_SUBST(VCRUNTIME_1_DLL)
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(ucrt-dll-dir, [AS_HELP_STRING([--with-ucrt-dll-dir],
|
||||
[path to Microsoft Windows Kit UCRT DLL dir (Windows only) @<:@probed@:>@])])
|
||||
|
||||
|
||||
@@ -227,6 +227,29 @@ AC_DEFUN([UTIL_GET_MATCHING_VALUES],
|
||||
fi
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
# Converts an ISO-8601 date/time string to a unix epoch timestamp. If no
|
||||
# suitable conversion method was found, an empty string is returned.
|
||||
#
|
||||
# Sets the specified variable to the resulting list.
|
||||
#
|
||||
# $1: result variable name
|
||||
# $2: input date/time string
|
||||
AC_DEFUN([UTIL_GET_EPOCH_TIMESTAMP],
|
||||
[
|
||||
timestamp=$($DATE --utc --date=$2 +"%s" 2> /dev/null)
|
||||
if test "x$timestamp" = x; then
|
||||
# GNU date format did not work, try BSD date options
|
||||
timestamp=$($DATE -j -f "%F %T" "$2" "+%s" 2> /dev/null)
|
||||
if test "x$timestamp" = x; then
|
||||
# Perhaps the time was missing
|
||||
timestamp=$($DATE -j -f "%F %T" "$2 00:00:00" "+%s" 2> /dev/null)
|
||||
# If this did not work, we give up and return the empty string
|
||||
fi
|
||||
fi
|
||||
$1=$timestamp
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
# Sort a space-separated list, and remove duplicates.
|
||||
#
|
||||
@@ -320,12 +343,14 @@ AC_DEFUN([UTIL_ALIASED_ARG_ENABLE],
|
||||
# option should be available. Must set AVAILABLE to 'false' if not.
|
||||
# IF_GIVEN: An optional code block to execute if the option was given on the
|
||||
# command line (regardless of the value).
|
||||
# IF_NOT_GIVEN: An optional code block to execute if the option was not given
|
||||
# on the command line (regardless of the value).
|
||||
# IF_ENABLED: An optional code block to execute if the option is turned on.
|
||||
# IF_DISABLED: An optional code block to execute if the option is turned off.
|
||||
#
|
||||
UTIL_DEFUN_NAMED([UTIL_ARG_ENABLE],
|
||||
[*NAME RESULT DEFAULT AVAILABLE DESC DEFAULT_DESC CHECKING_MSG
|
||||
CHECK_AVAILABLE IF_GIVEN IF_ENABLED IF_DISABLED], [$@],
|
||||
CHECK_AVAILABLE IF_GIVEN IF_NOT_GIVEN IF_ENABLED IF_DISABLED], [$@],
|
||||
[
|
||||
##########################
|
||||
# Part 1: Set up m4 macros
|
||||
@@ -356,6 +381,7 @@ UTIL_DEFUN_NAMED([UTIL_ARG_ENABLE],
|
||||
# tripping up bash.
|
||||
m4_define([ARG_CHECK_AVAILABLE], m4_if(ARG_CHECK_AVAILABLE, , :, ARG_CHECK_AVAILABLE))
|
||||
m4_define([ARG_IF_GIVEN], m4_if(ARG_IF_GIVEN, , :, ARG_IF_GIVEN))
|
||||
m4_define([ARG_IF_NOT_GIVEN], m4_if(ARG_IF_NOT_GIVEN, , :, ARG_IF_NOT_GIVEN))
|
||||
m4_define([ARG_IF_ENABLED], m4_if(ARG_IF_ENABLED, , :, ARG_IF_ENABLED))
|
||||
m4_define([ARG_IF_DISABLED], m4_if(ARG_IF_DISABLED, , :, ARG_IF_DISABLED))
|
||||
|
||||
@@ -425,6 +451,8 @@ UTIL_DEFUN_NAMED([UTIL_ARG_ENABLE],
|
||||
# Execute result payloads, if present
|
||||
if test x$ARG_GIVEN = xtrue; then
|
||||
ARG_IF_GIVEN
|
||||
else
|
||||
ARG_IF_NOT_GIVEN
|
||||
fi
|
||||
|
||||
if test x$ARG_RESULT = xtrue; then
|
||||
@@ -506,7 +534,7 @@ AC_DEFUN([UTIL_SETUP_TOOL],
|
||||
# Otherwise we believe it is a complete path. Use it as it is.
|
||||
AC_MSG_NOTICE([Will use user supplied tool "$tool_command"])
|
||||
AC_MSG_CHECKING([for $tool_command])
|
||||
if test ! -x "$tool_command"; then
|
||||
if test ! -x "$tool_command" && test ! -x "$tool_command.exe"; then
|
||||
AC_MSG_RESULT([not found])
|
||||
AC_MSG_ERROR([User supplied tool $1="$tool_command" does not exist or is not executable])
|
||||
fi
|
||||
@@ -573,7 +601,7 @@ AC_DEFUN([UTIL_REQUIRE_BUILTIN_PROGS],
|
||||
UTIL_SETUP_TOOL($1, [AC_PATH_PROGS($1, $2, , $3)])
|
||||
if test "x[$]$1" = x; then
|
||||
AC_MSG_NOTICE([Required tool $2 not found in PATH, checking built-in])
|
||||
if help $2 > /dev/null 2>&1; then
|
||||
if type -p $2 > /dev/null 2>&1; then
|
||||
AC_MSG_NOTICE([Found $2 as shell built-in. Using it])
|
||||
$1="$2"
|
||||
else
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 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
|
||||
@@ -52,7 +52,15 @@ AC_DEFUN([UTIL_REWRITE_AS_WINDOWS_MIXED_PATH],
|
||||
windows_path=`cmd //c echo $unix_path`
|
||||
$1="$windows_path"
|
||||
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl"; then
|
||||
windows_path=`$WSLPATH -m "$unix_path"`
|
||||
windows_path=`$WSLPATH -m "$unix_path" 2>/dev/null`
|
||||
if test $? -ne 0; then
|
||||
dir=`dirname "$unix_path"`
|
||||
base=`basename "$unix_path"`
|
||||
windows_path=`$WSLPATH -m "$dir"`/"$base"
|
||||
if test $? -ne 0; then
|
||||
AC_MSG_ERROR([Cannot convert "$unix_path" to Windows path])
|
||||
fi
|
||||
fi
|
||||
$1="$windows_path"
|
||||
fi
|
||||
])
|
||||
@@ -127,10 +135,15 @@ AC_DEFUN([UTIL_MAKE_WINDOWS_SPACE_SAFE_WSL],
|
||||
UTIL_REWRITE_AS_WINDOWS_MIXED_PATH([TOPDIR_windows])
|
||||
# First convert to Windows path to make input valid for cmd
|
||||
UTIL_REWRITE_AS_WINDOWS_MIXED_PATH([input_path])
|
||||
# Reset PATH since it can contain a mix of WSL/linux paths and Windows paths from VS,
|
||||
# which, in combination with WSLENV, will make the WSL layer complain
|
||||
old_path="$PATH"
|
||||
PATH=
|
||||
new_path=`$CMD /c $TOPDIR_windows/make/scripts/windowsShortName.bat "$input_path" \
|
||||
| $SED -e 's|\r||g' \
|
||||
| $TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
# Rewrite back to unix style
|
||||
PATH="$old_path"
|
||||
UTIL_REWRITE_AS_UNIX_PATH([new_path])
|
||||
fi
|
||||
])
|
||||
@@ -229,7 +242,7 @@ AC_DEFUN([UTIL_FIXUP_EXECUTABLE_CYGWIN],
|
||||
new_path=`$CYGPATH -u "$path"`
|
||||
|
||||
# Now try to locate executable using which
|
||||
new_path=`$WHICH "$new_path" 2> /dev/null`
|
||||
new_path=`type -p "$new_path" 2> /dev/null`
|
||||
# bat and cmd files are not always considered executable in cygwin causing which
|
||||
# to not find them
|
||||
if test "x$new_path" = x \
|
||||
@@ -245,7 +258,7 @@ AC_DEFUN([UTIL_FIXUP_EXECUTABLE_CYGWIN],
|
||||
path="$complete"
|
||||
arguments="EOL"
|
||||
new_path=`$CYGPATH -u "$path"`
|
||||
new_path=`$WHICH "$new_path" 2> /dev/null`
|
||||
new_path=`type -p "$new_path" 2> /dev/null`
|
||||
# bat and cmd files are not always considered executable in cygwin causing which
|
||||
# to not find them
|
||||
if test "x$new_path" = x \
|
||||
@@ -311,7 +324,7 @@ AC_DEFUN([UTIL_FIXUP_EXECUTABLE_MSYS],
|
||||
UTIL_REWRITE_AS_UNIX_PATH(new_path)
|
||||
|
||||
# Now try to locate executable using which
|
||||
new_path=`$WHICH "$new_path" 2> /dev/null`
|
||||
new_path=`type -p "$new_path" 2> /dev/null`
|
||||
|
||||
if test "x$new_path" = x; then
|
||||
# Oops. Which didn't find the executable.
|
||||
@@ -323,7 +336,7 @@ AC_DEFUN([UTIL_FIXUP_EXECUTABLE_MSYS],
|
||||
new_path="$path"
|
||||
UTIL_REWRITE_AS_UNIX_PATH(new_path)
|
||||
|
||||
new_path=`$WHICH "$new_path" 2> /dev/null`
|
||||
new_path=`type -p "$new_path" 2> /dev/null`
|
||||
# bat and cmd files are not always considered executable in MSYS causing which
|
||||
# to not find them
|
||||
if test "x$new_path" = x \
|
||||
@@ -379,7 +392,7 @@ AC_DEFUN([UTIL_FIXUP_EXECUTABLE_WSL],
|
||||
|
||||
# Now try to locate executable using which
|
||||
new_path_bak="$new_path"
|
||||
new_path=`$WHICH "$new_path" 2> /dev/null`
|
||||
new_path=`type -p "$new_path" 2> /dev/null`
|
||||
# bat and cmd files are not considered executable in WSL
|
||||
if test "x$new_path" = x \
|
||||
&& test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
|
||||
@@ -396,7 +409,7 @@ AC_DEFUN([UTIL_FIXUP_EXECUTABLE_WSL],
|
||||
new_path="$path"
|
||||
UTIL_REWRITE_AS_UNIX_PATH([new_path])
|
||||
new_path_bak="$new_path"
|
||||
new_path=`$WHICH "$new_path" 2> /dev/null`
|
||||
new_path=`type -p "$new_path" 2> /dev/null`
|
||||
# bat and cmd files are not considered executable in WSL
|
||||
if test "x$new_path" = x \
|
||||
&& test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 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
|
||||
@@ -26,18 +26,18 @@
|
||||
# Default version, product, and vendor information to use,
|
||||
# unless overridden by configure
|
||||
|
||||
DEFAULT_VERSION_FEATURE=15
|
||||
DEFAULT_VERSION_FEATURE=16
|
||||
DEFAULT_VERSION_INTERIM=0
|
||||
DEFAULT_VERSION_UPDATE=0
|
||||
DEFAULT_VERSION_PATCH=0
|
||||
DEFAULT_VERSION_EXTRA1=0
|
||||
DEFAULT_VERSION_EXTRA2=0
|
||||
DEFAULT_VERSION_EXTRA3=0
|
||||
DEFAULT_VERSION_DATE=2020-09-15
|
||||
DEFAULT_VERSION_CLASSFILE_MAJOR=59 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
|
||||
DEFAULT_VERSION_DATE=2021-03-16
|
||||
DEFAULT_VERSION_CLASSFILE_MAJOR=60 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
|
||||
DEFAULT_VERSION_CLASSFILE_MINOR=0
|
||||
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="13 14 15"
|
||||
DEFAULT_JDK_SOURCE_TARGET_VERSION=15
|
||||
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="14 15 16"
|
||||
DEFAULT_JDK_SOURCE_TARGET_VERSION=16
|
||||
DEFAULT_PROMOTED_VERSION_PRE=ea
|
||||
|
||||
LAUNCHER_NAME=openjdk
|
||||
|
||||
@@ -43,7 +43,7 @@ $(eval $(call IncludeCustomExtension, common/FindTests.gmk))
|
||||
TEST_BASEDIRS += $(TOPDIR)/test $(TOPDIR)
|
||||
|
||||
# JTREG_TESTROOTS might have been set by a custom extension
|
||||
JTREG_TESTROOTS += $(addprefix $(TOPDIR)/test/, hotspot/jtreg jdk langtools nashorn jaxp)
|
||||
JTREG_TESTROOTS += $(addprefix $(TOPDIR)/test/, hotspot/jtreg jdk langtools jaxp lib-test)
|
||||
|
||||
# Extract the names of the Jtreg group files from the TEST.ROOT files. The
|
||||
# TEST.ROOT files being properties files can be interpreted as makefiles so
|
||||
|
||||
@@ -23,10 +23,6 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
# When you read this source. Remember that $(sort ...) has the side effect
|
||||
# of removing duplicates. It is actually this side effect that is
|
||||
# desired whenever sort is used below!
|
||||
|
||||
ifndef _JAVA_COMPILATION_GMK
|
||||
_JAVA_COMPILATION_GMK := 1
|
||||
|
||||
@@ -39,30 +35,22 @@ endif
|
||||
include JarArchive.gmk
|
||||
include ZipArchive.gmk
|
||||
|
||||
# Setup make rules for defining a Java compiler, which is needed to compile
|
||||
# Java code. This rule generates no output.
|
||||
#
|
||||
# Parameter 1 is the name of the compiler definition. This name needs to be
|
||||
# passed to SetupJavaCompilation. This name is used as variable prefix.
|
||||
#
|
||||
# Remaining parameters are named arguments. These include:
|
||||
# JVM:=The jvm used to run the javac command
|
||||
# JAVAC:=The javac jar and bootstrap classpath changes, or just bin/javac if JVM is left out
|
||||
# FLAGS:=Flags to be supplied to javac
|
||||
# SERVER_DIR:=Use a javac server (-XDserver) and store the server related files here
|
||||
# SERVER_JVM:=Use this JVM for the server. Defaults to the JVM above.
|
||||
# DISABLE_SJAVAC:=Set to true if this setup does not support sjavac
|
||||
SetupJavaCompiler = $(NamedParamsMacroTemplate)
|
||||
define SetupJavaCompilerBody
|
||||
# The port file contains the tcp/ip on which the server listens
|
||||
# and the cookie necessary to talk to the server.
|
||||
$1_SJAVAC_PORTFILE:=$$($1_SERVER_DIR)/server.port
|
||||
# You can use a different JVM to run the background javac server.
|
||||
ifeq ($$($1_SERVER_JVM),)
|
||||
# It defaults to the same JVM that is used to start the javac command.
|
||||
$1_SERVER_JVM:=$$($1_JVM)
|
||||
endif
|
||||
endef
|
||||
###
|
||||
### Definitions for common release targets
|
||||
###
|
||||
|
||||
# Create classes that can run on the bootjdk
|
||||
TARGET_RELEASE_BOOTJDK := $(BOOT_JDK_SOURCETARGET)
|
||||
|
||||
# Create classes that can be used in (or be a part of) the new jdk we're building
|
||||
TARGET_RELEASE_NEWJDK := -source $(JDK_SOURCE_TARGET_VERSION) -target $(JDK_SOURCE_TARGET_VERSION)
|
||||
|
||||
# Create classes that can be used in JDK 8, for legacy support
|
||||
TARGET_RELEASE_JDK8 := --release 8
|
||||
|
||||
# Create classes for the new jdk, relying only on the modules of the new jdk
|
||||
TARGET_RELEASE_NEWJDK_UPGRADED := $(TARGET_RELEASE_NEWJDK) \
|
||||
--upgrade-module-path $(JDK_OUTPUTDIR)/modules --system none
|
||||
|
||||
define add_file_to_copy
|
||||
# param 1 = BUILD_MYPACKAGE
|
||||
@@ -76,7 +64,7 @@ define add_file_to_copy
|
||||
$1_COPY_$$($2_TARGET) := 1
|
||||
# Now we can setup the dependency that will trigger the copying.
|
||||
$$($1_BIN)$$($1_MODULE_SUBDIR)$$($2_TARGET) : $2
|
||||
$$(call LogInfo, Copying $$(patsubst $(OUTPUTDIR)/%,%, $$@))
|
||||
$$(call LogInfo, Copying $$(patsubst $$(OUTPUTDIR)/%,%, $$@))
|
||||
$$(install-file)
|
||||
$(CHMOD) -f ug+w $$@
|
||||
|
||||
@@ -86,10 +74,7 @@ define add_file_to_copy
|
||||
endef
|
||||
|
||||
# This macro is used only for properties files that are to be
|
||||
# copied over to the classes directory in cleaned form:
|
||||
# Previously this was inconsistently done in different repositories.
|
||||
# This is the new clean standard. Though it is to be superseded by
|
||||
# a standard annotation processor from with sjavac.
|
||||
# copied over to the classes directory in cleaned form.
|
||||
#
|
||||
# An empty echo ensures that the input to sed always ends with a newline.
|
||||
# Certain implementations (e.g. Solaris) will skip the last line without
|
||||
@@ -120,12 +105,12 @@ define add_file_to_clean
|
||||
ifneq ($$($1_CLEAN_$$($2_TARGET)), 1)
|
||||
$1_CLEAN_$$($2_TARGET) := 1
|
||||
$$($1_BIN)$$($1_MODULE_SUBDIR)$$($2_TARGET) : $2
|
||||
$$(call LogInfo, Cleaning $$(patsubst $(OUTPUTDIR)/%,%, $$@))
|
||||
$$(call LogInfo, Cleaning $$(patsubst $$(OUTPUTDIR)/%,%, $$@))
|
||||
$$(call MakeTargetDir)
|
||||
( $(CAT) $$< && $(ECHO) "" ) \
|
||||
| $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' \
|
||||
-e 's/\([^\\]\)!/\1\\!/g' -e 's/^[ ]*#.*/#/g' \
|
||||
| $(SED) -f "$(TOPDIR)/make/common/support/unicode2x.sed" \
|
||||
| $(SED) -f "$$(TOPDIR)/make/common/support/unicode2x.sed" \
|
||||
| $(SED) -e '/^#/d' -e '/^$$$$/d' \
|
||||
-e :a -e '/\\$$$$/N; s/\\\n//; ta' \
|
||||
-e 's/^[ ]*//;s/[ ]*$$$$//' \
|
||||
@@ -151,9 +136,12 @@ endef
|
||||
# The target for public API digest is returned in $1_API_TARGET.
|
||||
#
|
||||
# Remaining parameters are named arguments. These include:
|
||||
# SETUP:=must point to a previously setup java compiler, for example: SETUP:=BOOTJAVAC
|
||||
# JVM:=path to ..bin/java
|
||||
# ADD_JAVAC_FLAGS:=javac flags to append to the default ones.
|
||||
# SMALL_JAVA:=set to false to run javac as a "big" java app
|
||||
# COMPILER:=bootjdk or interim, the latter is default
|
||||
# TARGET_RELEASE:=javac flags to set the targeted jdk release (-source/-target or --release)
|
||||
# Defaults to $(TARGET_RELEASE_NEWJDK).
|
||||
# JAVAC_FLAGS:=javac flags to append to the default ones.
|
||||
# JAVA_FLAGS:=flags to be appended to the java launching the compiler
|
||||
# DISABLED_WARNINGS:=list of Xlint warnings that should be disabled
|
||||
# SRC:=one or more directories to search for sources. The order of the source roots
|
||||
# is significant. The first found file of a certain name has priority.
|
||||
@@ -174,14 +162,12 @@ endef
|
||||
# specify files that need to be generated by other rules first.
|
||||
# HEADERS:=path to directory where all generated c-headers are written.
|
||||
# DEPENDS:=Extra dependecy
|
||||
# DISABLE_SJAVAC:=Explicitly disable the use of sjavac for this compilation unit.
|
||||
# KEEP_DUPS:=Do not remove duplicate file names from different source roots.
|
||||
# FAIL_NO_SRC:=Set to false to not fail the build if no source files are found,
|
||||
# default is true.
|
||||
# DEBUG_SYMBOLS:=Set to false to disable generation of debug symbols.
|
||||
# CREATE_API_DIGEST:=Set to true to use a javac plugin to generate a public API
|
||||
# hash which can be used for down stream dependencies to only rebuild
|
||||
# when the API changes. Implicitly used in sjavac.
|
||||
# when the API changes.
|
||||
# KEEP_ALL_TRANSLATIONS:=Set to true to skip translation filtering
|
||||
SetupJavaCompilation = $(NamedParamsMacroTemplate)
|
||||
define SetupJavaCompilationBody
|
||||
@@ -191,14 +177,76 @@ define SetupJavaCompilationBody
|
||||
$$(error Must specify BIN (in $1))
|
||||
endif
|
||||
|
||||
# Extract the info from the java compiler setup.
|
||||
$1_JVM := $$($$($1_SETUP)_JVM)
|
||||
$1_JAVAC := $$($$($1_SETUP)_JAVAC)
|
||||
$1_FLAGS :=
|
||||
ifneq ($$($1_DEBUG_SYMBOLS), false)
|
||||
$1_FLAGS := -g
|
||||
ifeq ($$($1_SMALL_JAVA), )
|
||||
# If unspecified, default to true
|
||||
$1_SMALL_JAVA := true
|
||||
endif
|
||||
$1_FLAGS += $$($$($1_SETUP)_FLAGS) $$($1_ADD_JAVAC_FLAGS) $(JAVAC_FLAGS)
|
||||
|
||||
ifeq ($$($1_COMPILER), )
|
||||
# If unspecified, default to interim compiler
|
||||
$1_COMPILER := interim
|
||||
endif
|
||||
|
||||
ifeq ($$($1_COMPILER), bootjdk)
|
||||
# Javac server is not available when using the bootjdk compiler.
|
||||
$1_JAVAC_CMD := $$(JAVAC)
|
||||
|
||||
ifeq ($$($1_SMALL_JAVA), true)
|
||||
$1_FLAGS += $$(addprefix -J, $$(JAVA_FLAGS_SMALL))
|
||||
endif
|
||||
ifeq ($$($1_JAVA_FLAGS), true)
|
||||
$1_FLAGS += $$(addprefix -J, $$($1_JAVA_FLAGS))
|
||||
endif
|
||||
|
||||
ifeq ($$($1_TARGET_RELEASE), )
|
||||
# If unspecified, default to the new jdk we're building
|
||||
$1_TARGET_RELEASE := $$(TARGET_RELEASE_BOOTJDK)
|
||||
endif
|
||||
else ifeq ($$($1_COMPILER), interim)
|
||||
# Use java server if it is enabled, and the user does not want a specialized
|
||||
# class path.
|
||||
ifeq ($$(ENABLE_JAVAC_SERVER)+$$($1_CLASSPATH), true+)
|
||||
$1_JAVAC := $$(INTERIM_LANGTOOLS_ARGS) -m jdk.compiler.interim/com.sun.tools.sjavac.Main
|
||||
|
||||
# How to launch the server. This must use JAVA_DETACH, which is the "big" java
|
||||
# with an ability to detach from fixpath (on Windows)
|
||||
# This will be executed by the client, if needed.
|
||||
$1_JAVAC_SERVER_CMD := $$(JAVA_DETACH) $$($1_JAVA_FLAGS) $$($1_JAVAC)
|
||||
$1_ESCAPED_CMD := $$(subst $$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_JAVAC_SERVER_CMD))))
|
||||
|
||||
# The port file contains the tcp/ip on which the server listens
|
||||
# and the cookie necessary to talk to the server.
|
||||
$1_JAVA_SERVER_FLAGS := --server:portfile=$$(JAVAC_SERVER_DIR)/server.port,sjavac=$$($1_ESCAPED_CMD)
|
||||
|
||||
# Always use small to launch client
|
||||
$1_JAVAC_CMD := $$(JAVA_SMALL) $$($1_JAVA_FLAGS) $$($1_JAVAC) $$($1_JAVA_SERVER_FLAGS)
|
||||
else
|
||||
# No javac server
|
||||
$1_JAVAC := $$(INTERIM_LANGTOOLS_ARGS) -m jdk.compiler.interim/com.sun.tools.javac.Main
|
||||
|
||||
ifeq ($$($1_SMALL_JAVA), true)
|
||||
$1_JAVAC_CMD := $$(JAVA_SMALL) $$($1_JAVA_FLAGS) $$($1_JAVAC)
|
||||
else
|
||||
$1_JAVAC_CMD := $$(JAVA) $$($1_JAVA_FLAGS) $$($1_JAVAC)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($$($1_TARGET_RELEASE), )
|
||||
# If unspecified, default to the new jdk we're building
|
||||
$1_TARGET_RELEASE := $$(TARGET_RELEASE_NEWJDK)
|
||||
endif
|
||||
else
|
||||
$$(error Invalid value for COMPILER in SetupJavaCompilation for $1: '$$($1_COMPILER)')
|
||||
endif
|
||||
|
||||
# Allow overriding on the command line
|
||||
JAVA_WARNINGS_ARE_ERRORS ?= -Werror
|
||||
|
||||
# Tell javac to do exactly as told and no more
|
||||
PARANOIA_FLAGS := -implicit:none -Xprefer:source -XDignore.symbol.file=true -encoding ascii
|
||||
|
||||
$1_FLAGS += -g -Xlint:all --doclint-format html5 $$($1_TARGET_RELEASE) $$(PARANOIA_FLAGS) $$(JAVA_WARNINGS_ARE_ERRORS)
|
||||
$1_FLAGS += $$($1_JAVAC_FLAGS)
|
||||
|
||||
ifneq ($$($1_DISABLED_WARNINGS), )
|
||||
$1_FLAGS += -Xlint:$$(call CommaList, $$(addprefix -, $$($1_DISABLED_WARNINGS)))
|
||||
@@ -208,13 +256,6 @@ define SetupJavaCompilationBody
|
||||
$1_FLAGS += -cp $$(call PathList, $$($1_CLASSPATH))
|
||||
endif
|
||||
|
||||
ifeq ($$($1_JAVAC),)
|
||||
$$(error The Java compilation $1 refers to a non-existant java compiler setup $$($1_SETUP))
|
||||
endif
|
||||
$1_SJAVAC_PORTFILE := $$($$($1_SETUP)_SJAVAC_PORTFILE)
|
||||
$1_SERVER_JVM := $$($$($1_SETUP)_SERVER_JVM)
|
||||
$1_DISABLE_SJAVAC := $$($$($1_SETUP)_DISABLE_SJAVAC)
|
||||
|
||||
ifneq ($$($1_MODULE), )
|
||||
$1_MODULE_SUBDIR := /$$($1_MODULE)
|
||||
endif
|
||||
@@ -264,13 +305,10 @@ define SetupJavaCompilationBody
|
||||
# Remove duplicate source files by keeping the first found of each duplicate.
|
||||
# This allows for automatic overrides with custom or platform specific versions
|
||||
# source files.
|
||||
#
|
||||
# For the smart javac wrapper case, add each removed file to an extra exclude
|
||||
# file list to prevent sjavac from finding duplicate sources.
|
||||
$1_SRCS := $$(strip $$(foreach s, $$($1_SRCS), \
|
||||
$$(eval relative_src := $$(call remove-prefixes, $$($1_SRC), $$(s))) \
|
||||
$$(if $$($1_$$(relative_src)), \
|
||||
$$(eval $1_SJAVAC_EXCLUDE_FILES += $$(s)), \
|
||||
, \
|
||||
$$(eval $1_$$(relative_src) := 1) $$(s))))
|
||||
endif
|
||||
|
||||
@@ -343,92 +381,17 @@ define SetupJavaCompilationBody
|
||||
# and remove .java at the end.
|
||||
$1_REWRITE_INTO_CLASSES:=$$(foreach i,$$($1_SRC),-e 's|$$i/||g') -e 's|/|.|g' -e 's|.java$$$$||g'
|
||||
|
||||
# Create SJAVAC variable from JAVAC variable. Expects $1_JAVAC to be
|
||||
# "bootclasspathprepend -cp .../javac.jar com.sun.tools.javac.Main"
|
||||
# and javac is simply replaced with sjavac.
|
||||
$1_SJAVAC:=$$(subst com.sun.tools.javac.Main,com.sun.tools.sjavac.Main,$$($1_JAVAC))
|
||||
|
||||
# Set the $1_REMOTE to spawn a background javac server.
|
||||
$1_REMOTE:=--server:portfile=$$($1_SJAVAC_PORTFILE),id=$1,sjavac=$$(subst \
|
||||
$$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_SERVER_JVM) $$($1_SJAVAC))))
|
||||
|
||||
$1_COMPILE_TARGET := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_batch
|
||||
$1_FILELIST := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_batch.filelist
|
||||
|
||||
$1_API_TARGET := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi
|
||||
|
||||
ifeq ($$($1_DISABLE_SJAVAC)x$$(ENABLE_SJAVAC),xyes)
|
||||
# Using sjavac to compile.
|
||||
# Put headers in a temp dir to filter out those that actually
|
||||
# changed before copying them to the real header dir.
|
||||
ifneq (,$$($1_HEADERS))
|
||||
$1_HEADERS_ARG := -h $$($1_HEADERS).$1.tmp
|
||||
|
||||
# Create the sjavac wrapper command line. Sjavac doesn't handle patterns that
|
||||
# match the absolute path, only the part inside each src dir. Instead -i and
|
||||
# -x flags apply only to the next -src arg on the command line.
|
||||
$1_EXCLUDE_FILES_ABS := $$(filter /%, $$($1_EXCLUDE_FILES)) $$($1_SJAVAC_EXCLUDE_FILES)
|
||||
$1_EXCLUDE_FILES_REL := $$(filter-out /%, $$($1_EXCLUDE_FILES))
|
||||
$1_SJAVAC_ARGS_STRING := $$(foreach s, $$(patsubst %/, %, $$($1_SRC)), \
|
||||
$$(addprefix -x ,$$(addsuffix /**,$$($1_EXCLUDES))) \
|
||||
$$(addprefix -i ,$$(addsuffix /**,$$($1_INCLUDES))) \
|
||||
$$(addprefix -x **,$$(strip $$($1_EXCLUDE_FILES_REL))) \
|
||||
$$(addprefix -i **,$$(strip $$($1_INCLUDE_FILES))) \
|
||||
$$(addprefix -x , $$(strip $$(patsubst $$(s)/%, %, $$(filter $$(s)/%, $$($1_EXCLUDE_FILES_ABS))))) \
|
||||
-src $$(s))
|
||||
|
||||
ifneq ($$(word 20, $$($1_SJAVAC_ARGS_STRING)), )
|
||||
$1_SJAVAC_ARGS_FILE := $$($1_BIN)/_the.$1_args
|
||||
$1_SJAVAC_ARGS := @$$($1_SJAVAC_ARGS_FILE)
|
||||
else
|
||||
$1_SJAVAC_ARGS := $$($1_SJAVAC_ARGS_STRING)
|
||||
endif
|
||||
|
||||
|
||||
ifneq (,$$($1_HEADERS))
|
||||
$1_HEADERS_ARG := -h $$($1_HEADERS)
|
||||
endif
|
||||
|
||||
$1_VARDEPS := $$($1_JVM) $$($1_SJAVAC) $$($1_SJAVAC_ARGS_STRING) $$($1_FLAGS) \
|
||||
$$($1_HEADERS_ARG) $$($1_BIN) $$($1_EXCLUDES) $$($1_INCLUDES) \
|
||||
$$($1_EXCLUDE_FILES) $$($1_INCLUDE_FILES)
|
||||
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
|
||||
$$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1.vardeps)
|
||||
|
||||
$$($1_COMPILE_TARGET): $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE)
|
||||
$$(call MakeDir, $$(@D) $$(dir $$($1_SJAVAC_PORTFILE)))
|
||||
$$(eval $$(call ListPathsSafely,$1_SRCS, $$@.tmp))
|
||||
ifneq ($$($1_SJAVAC_ARGS_FILE), )
|
||||
$$(eval $$(call ListPathsSafely,$1_SJAVAC_ARGS_STRING, $$($1_SJAVAC_ARGS_FILE)))
|
||||
endif
|
||||
$$(call LogWarn, Compiling $1)
|
||||
$$(call ExecuteWithLog, $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$$($1_SAFE_NAME)_batch, \
|
||||
$$($1_JVM) $$($1_SJAVAC) \
|
||||
$$($1_REMOTE) \
|
||||
-j 1 \
|
||||
--permit-unidentified-artifacts \
|
||||
--permit-sources-without-package \
|
||||
--compare-found-sources $$@.tmp \
|
||||
--log=$(LOG_LEVEL) \
|
||||
--state-dir=$$($1_BIN)$$($1_MODULE_SUBDIR) \
|
||||
$$($1_SJAVAC_ARGS) \
|
||||
$$($1_FLAGS) \
|
||||
$$($1_HEADERS_ARG) \
|
||||
-d $$($1_BIN)) && \
|
||||
$(MV) $$@.tmp $$@
|
||||
# Create a pubapi file that only changes when the pubapi changes. Dependent
|
||||
# compilations can use this file to only get recompiled when pubapi has changed.
|
||||
# Grep returns 1 if no matching lines are found. Do not fail for this.
|
||||
$(GREP) -e "^I" $$($1_BIN)$$($1_MODULE_SUBDIR)/javac_state \
|
||||
> $$($1_API_TARGET).tmp || test "$$$$?" = "1"
|
||||
if [ ! -f $$($1_API_TARGET) ] \
|
||||
|| [ "`$(DIFF) $$($1_API_TARGET) $$($1_API_TARGET).tmp`" != "" ]; then \
|
||||
$(MV) $$($1_API_TARGET).tmp $$($1_API_TARGET); \
|
||||
fi
|
||||
|
||||
else
|
||||
# Using plain javac to batch compile everything.
|
||||
|
||||
# When building in batch, put headers in a temp dir to filter out those that actually
|
||||
# changed before copying them to the real header dir.
|
||||
ifneq (,$$($1_HEADERS))
|
||||
$1_HEADERS_ARG := -h $$($1_HEADERS).$1.tmp
|
||||
|
||||
$$($1_HEADERS)/_the.$1_headers: $$($1_COMPILE_TARGET)
|
||||
$$($1_HEADERS)/_the.$1_headers: $$($1_COMPILE_TARGET)
|
||||
$$(call MakeTargetDir)
|
||||
if [ -d "$$($1_HEADERS).$1.tmp" ]; then \
|
||||
for f in `$(CD) $$($1_HEADERS).$1.tmp && $(FIND) . -type f`; do \
|
||||
@@ -442,44 +405,42 @@ define SetupJavaCompilationBody
|
||||
$(RM) -r $$($1_HEADERS).$1.tmp
|
||||
$(TOUCH) $$@
|
||||
|
||||
$1_HEADER_TARGETS := $$($1_HEADERS)/_the.$1_headers
|
||||
endif
|
||||
|
||||
$1_VARDEPS := $$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) $$($1_BIN) \
|
||||
$$($1_HEADERS_ARG) $$($1_EXCLUDES) $$($1_INCLUDES) \
|
||||
$$($1_EXCLUDE_FILES) $$($1_INCLUDE_FILES)
|
||||
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
|
||||
$$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1.vardeps)
|
||||
|
||||
ifeq ($$($1_DISABLE_SJAVAC)x$(ENABLE_JAVAC_SERVER), xyes)
|
||||
$1_JAVAC_CMD := $$($1_SJAVAC) $$($1_REMOTE)
|
||||
else
|
||||
$1_JAVAC_CMD := $$($1_JAVAC)
|
||||
endif
|
||||
|
||||
ifeq ($$($1_CREATE_API_DIGEST), true)
|
||||
$1_API_DIGEST_FLAGS := \
|
||||
-classpath $(BUILDTOOLS_OUTPUTDIR)/depend \
|
||||
-Xplugin:"depend $$($1_API_TARGET)" \
|
||||
#
|
||||
|
||||
$1_EXTRA_DEPS := $(BUILDTOOLS_OUTPUTDIR)/depend/_the.COMPILE_DEPEND_batch
|
||||
endif
|
||||
|
||||
# When not using sjavac, pass along all sources to javac using an @file.
|
||||
$$($1_COMPILE_TARGET): $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE) \
|
||||
$$($1_EXTRA_DEPS)
|
||||
$$(call MakeDir, $$(@D))
|
||||
$$(eval $$(call ListPathsSafely,$1_SRCS, $$@.tmp))
|
||||
$$(call LogWarn, Compiling $$(words $$($1_SRCS)) files for $1)
|
||||
$$(call ExecuteWithLog, $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$$($1_SAFE_NAME)_batch, \
|
||||
$$($1_JVM) $$($1_JAVAC_CMD) $$($1_FLAGS) \
|
||||
-implicit:none \
|
||||
$$($1_API_DIGEST_FLAGS) \
|
||||
-d $$($1_BIN) $$($1_HEADERS_ARG) @$$@.tmp) && \
|
||||
$(MV) $$@.tmp $$@
|
||||
$1_HEADER_TARGETS := $$($1_HEADERS)/_the.$1_headers
|
||||
endif
|
||||
|
||||
$1_VARDEPS := $$($1_JAVAC_CMD) $$($1_FLAGS) $$($1_BIN) \
|
||||
$$($1_HEADERS_ARG) $$($1_EXCLUDES) $$($1_INCLUDES) \
|
||||
$$($1_EXCLUDE_FILES) $$($1_INCLUDE_FILES)
|
||||
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
|
||||
$$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1.vardeps)
|
||||
|
||||
ifeq ($$($1_CREATE_API_DIGEST), true)
|
||||
$1_API_DIGEST_FLAGS := \
|
||||
-classpath $$(BUILDTOOLS_OUTPUTDIR)/depend \
|
||||
-Xplugin:"depend $$($1_API_TARGET)" \
|
||||
#
|
||||
|
||||
$1_EXTRA_DEPS := $$(BUILDTOOLS_OUTPUTDIR)/depend/_the.COMPILE_DEPEND_batch
|
||||
endif
|
||||
|
||||
# Create a file with all sources, to pass to javac in an @file.
|
||||
# $$($1_VARDEPS_FILE) is used as dependency to track changes in set of
|
||||
# list of files.
|
||||
$$($1_FILELIST): $$($1_SRCS) $$($1_VARDEPS_FILE)
|
||||
$$(call MakeDir, $$(@D))
|
||||
$$(call LogWarn, Compiling $$(words $$($1_SRCS)) files for $1)
|
||||
$$(eval $$(call ListPathsSafely, $1_SRCS, $$($1_FILELIST)))
|
||||
|
||||
# Do the actual compilation
|
||||
$$($1_COMPILE_TARGET): $$($1_SRCS) $$($1_FILELIST) $$($1_DEPENDS) \
|
||||
$$($1_VARDEPS_FILE) $$($1_EXTRA_DEPS)
|
||||
$$(call MakeDir, $$(@D))
|
||||
$$(call ExecuteWithLog, $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$$($1_SAFE_NAME)_batch, \
|
||||
$$($1_JAVAC_CMD) $$($1_FLAGS) \
|
||||
$$($1_API_DIGEST_FLAGS) \
|
||||
-d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_FILELIST)) && \
|
||||
$(TOUCH) $$@
|
||||
|
||||
# Add all targets to main variable
|
||||
$1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_COMPILE_TARGET) \
|
||||
$$($1_HEADER_TARGETS)
|
||||
@@ -506,7 +467,6 @@ define SetupJavaCompilationBody
|
||||
EXTRA_MANIFEST_ATTR:=$$($1_EXTRA_MANIFEST_ATTR), \
|
||||
JARINDEX:=$$($1_JARINDEX), \
|
||||
HEADERS:=$$($1_HEADERS), \
|
||||
SETUP:=$$($1_SETUP), \
|
||||
))
|
||||
|
||||
# Add jar to target list
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user