mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-08 18:39:40 +01:00
Compare commits
947 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
706b421cca | ||
|
|
fe0227e978 | ||
|
|
064628471b | ||
|
|
4895a15a77 | ||
|
|
fd331ff173 | ||
|
|
9fd78022b1 | ||
|
|
192ec387bc | ||
|
|
03e84178eb | ||
|
|
ff3e76fd0c | ||
|
|
811aadd9e7 | ||
|
|
5841cb3b51 | ||
|
|
89129e3f67 | ||
|
|
9445047d05 | ||
|
|
d2f9a1eb97 | ||
|
|
e4021adb28 | ||
|
|
3ccbc6d4d0 | ||
|
|
7744b0046a | ||
|
|
9d63fee49c | ||
|
|
01bda278d6 | ||
|
|
2fe2f3aff8 | ||
|
|
cd4c3aac63 | ||
|
|
e57a322d70 | ||
|
|
c8702ede97 | ||
|
|
f6f038a678 | ||
|
|
fb4cf1cc3c | ||
|
|
d1c6cd104e | ||
|
|
76cbe4883b | ||
|
|
f7c84137b5 | ||
|
|
941bee197f | ||
|
|
2ede14335a | ||
|
|
90df3b7fbb | ||
|
|
f11a496de6 | ||
|
|
bfff02eef6 | ||
|
|
e073d5b374 | ||
|
|
6e77d918e6 | ||
|
|
61fa4d45b6 | ||
|
|
56ff87a096 | ||
|
|
8a5b86c529 | ||
|
|
58911ccc2c | ||
|
|
97c180892b | ||
|
|
def257727d | ||
|
|
2f11afdae9 | ||
|
|
33d7127555 | ||
|
|
8de2f6f883 | ||
|
|
0203c7e612 | ||
|
|
2885469c4b | ||
|
|
31a1f9c493 | ||
|
|
274c805c51 | ||
|
|
140f56718b | ||
|
|
a293bdff91 | ||
|
|
da75e015b5 | ||
|
|
ddc3921cf9 | ||
|
|
273df6286a | ||
|
|
a3fecdb2f4 | ||
|
|
60d88b7ae2 | ||
|
|
3f1d9c441e | ||
|
|
5404b4eafc | ||
|
|
d22d560871 | ||
|
|
bc1a1a5861 | ||
|
|
b486709b06 | ||
|
|
1abb826210 | ||
|
|
c1c99a669b | ||
|
|
b9ef9f667e | ||
|
|
28b2019559 | ||
|
|
68f86dccce | ||
|
|
397d948310 | ||
|
|
f7069494f4 | ||
|
|
0f78d017af | ||
|
|
b8f675f45b | ||
|
|
3e9c381166 | ||
|
|
77a217df60 | ||
|
|
717a07b932 | ||
|
|
aebfd53e9d | ||
|
|
006a516aa0 | ||
|
|
c7fcd62302 | ||
|
|
2c8b432b89 | ||
|
|
2c45eca159 | ||
|
|
bde3fc0c03 | ||
|
|
e45fea5a80 | ||
|
|
ece7d4349a | ||
|
|
0db42906e3 | ||
|
|
5808f30b89 | ||
|
|
31ee5108e0 | ||
|
|
0656f08092 | ||
|
|
16061874ff | ||
|
|
2e3682a7f2 | ||
|
|
63684cd183 | ||
|
|
ecc603ca9b | ||
|
|
ff5c9a4dde | ||
|
|
9acce7a6f3 | ||
|
|
f0cd866a37 | ||
|
|
8817ba450c | ||
|
|
f778642613 | ||
|
|
7df492627b | ||
|
|
2ceeb6c001 | ||
|
|
b04b3047ff | ||
|
|
d9c84e763a | ||
|
|
5e544f1510 | ||
|
|
643dd48a2a | ||
|
|
70944ca54a | ||
|
|
279ed0ddd5 | ||
|
|
9731b1c8b0 | ||
|
|
c5150c7b81 | ||
|
|
86cb76728d | ||
|
|
b49ba426a7 | ||
|
|
dd6e4533eb | ||
|
|
e0fd6c4c9e | ||
|
|
51ed69a586 | ||
|
|
bea9acc55a | ||
|
|
d037a597a9 | ||
|
|
bab70193dd | ||
|
|
47df14590c | ||
|
|
b81b86da98 | ||
|
|
6276789fb5 | ||
|
|
316361b95c | ||
|
|
b80ba08518 | ||
|
|
4bba445d83 | ||
|
|
6736792b9a | ||
|
|
1e02a13a7f | ||
|
|
23d161de29 | ||
|
|
2e925f263d | ||
|
|
e75e1cb02c | ||
|
|
f9bc2db9a9 | ||
|
|
a8fbeec9e9 | ||
|
|
3b6629cec7 | ||
|
|
5fb5e6c8f0 | ||
|
|
2fcb816858 | ||
|
|
635cb3c976 | ||
|
|
5c9f03686d | ||
|
|
492b954f81 | ||
|
|
87131fb2f7 | ||
|
|
5ea21c3a61 | ||
|
|
a48289ac30 | ||
|
|
8907eda779 | ||
|
|
b9331cd25c | ||
|
|
71c5bbcec7 | ||
|
|
58e39c1932 | ||
|
|
19a99d023e | ||
|
|
b4ddddeff1 | ||
|
|
dfaf11a3d8 | ||
|
|
fbc1e6661e | ||
|
|
a887fd2144 | ||
|
|
e702646545 | ||
|
|
7e5ef79f95 | ||
|
|
94677200fb | ||
|
|
a4dd2e9532 | ||
|
|
212a253697 | ||
|
|
dd930c573b | ||
|
|
115f4193eb | ||
|
|
9ac3b77d0d | ||
|
|
747582484c | ||
|
|
6439375bb9 | ||
|
|
3ebf8c9359 | ||
|
|
be45de1f93 | ||
|
|
8648890f86 | ||
|
|
fc18201bbd | ||
|
|
7c66465763 | ||
|
|
6f087cbcd5 | ||
|
|
d1aad71209 | ||
|
|
51b0abc874 | ||
|
|
3a3b77dd4f | ||
|
|
d771ec6296 | ||
|
|
49d8e63833 | ||
|
|
3d50eaa6ed | ||
|
|
862e615696 | ||
|
|
040c93565c | ||
|
|
4a11db8b60 | ||
|
|
46d3d7b967 | ||
|
|
29992e1fca | ||
|
|
27353ad367 | ||
|
|
18c925cd33 | ||
|
|
3f4b167c97 | ||
|
|
8bc1867da7 | ||
|
|
8efe569b8d | ||
|
|
71d48bcc3d | ||
|
|
b71acc704a | ||
|
|
1131bb77ec | ||
|
|
6bc6392d2b | ||
|
|
9da5170a0e | ||
|
|
c1cfb43d8d | ||
|
|
5860a48c71 | ||
|
|
0b01144ece | ||
|
|
34f7974a40 | ||
|
|
27cfcef99f | ||
|
|
e1183ac044 | ||
|
|
12ad09a966 | ||
|
|
d80d478182 | ||
|
|
83eba863fe | ||
|
|
28216aa971 | ||
|
|
4276d5c004 | ||
|
|
6382a1290f | ||
|
|
d90e5b5b9f | ||
|
|
f3db2796b8 | ||
|
|
21867c929a | ||
|
|
b9da14012d | ||
|
|
a169c06361 | ||
|
|
8efd7aa6c1 | ||
|
|
f26e430899 | ||
|
|
e5e21a8a6e | ||
|
|
f762637be2 | ||
|
|
2931458711 | ||
|
|
41966885b9 | ||
|
|
802018306f | ||
|
|
8267d6565d | ||
|
|
16576b87b7 | ||
|
|
375bfac8e7 | ||
|
|
233619b3fb | ||
|
|
023f7f176b | ||
|
|
8dc43aa0fe | ||
|
|
1c691938e9 | ||
|
|
ee09801afd | ||
|
|
bea493bcb8 | ||
|
|
80c54b484f | ||
|
|
d954f3bd0c | ||
|
|
bdd9438b45 | ||
|
|
e3e6c2a899 | ||
|
|
16b842af8e | ||
|
|
92f5c0be8e | ||
|
|
866e7b6b77 | ||
|
|
f88f31dcbf | ||
|
|
021ed6aea9 | ||
|
|
3057dded48 | ||
|
|
db159149c1 | ||
|
|
925d82931c | ||
|
|
dd5d7d0770 | ||
|
|
6ae1cf12ce | ||
|
|
7eb78e3320 | ||
|
|
5ac067f6d6 | ||
|
|
5ae849d66f | ||
|
|
ed821cbe85 | ||
|
|
5cf457b743 | ||
|
|
8b934aab14 | ||
|
|
3b582dff84 | ||
|
|
816638e3be | ||
|
|
3d2283800a | ||
|
|
5cddc2de49 | ||
|
|
6b1b0e9d45 | ||
|
|
bc546c21a5 | ||
|
|
af7c6af0cc | ||
|
|
d3fc8df8af | ||
|
|
a85c8493ae | ||
|
|
70c8ff1c9a | ||
|
|
ecd2b7112a | ||
|
|
c2979c150b | ||
|
|
5698f7ad29 | ||
|
|
4a14cba2f1 | ||
|
|
9f5464ee95 | ||
|
|
3f5b75a5ef | ||
|
|
1e76e1fdfa | ||
|
|
9d052e9331 | ||
|
|
f2e5808b46 | ||
|
|
37c2279148 | ||
|
|
20cb6e786f | ||
|
|
d1b51e39c9 | ||
|
|
8a0ef811ed | ||
|
|
5b05f8e0c4 | ||
|
|
59c2aff1ed | ||
|
|
418deaf5a1 | ||
|
|
245514da51 | ||
|
|
df01cc528d | ||
|
|
bf93e77e72 | ||
|
|
991e04e7d7 | ||
|
|
4eefda9102 | ||
|
|
341dd57fa1 | ||
|
|
7ac2f914aa | ||
|
|
85cb4a9942 | ||
|
|
aa595dbda4 | ||
|
|
2af0312c95 | ||
|
|
7c7b961e73 | ||
|
|
2b79c22c43 | ||
|
|
47f33a59ea | ||
|
|
d580bcf956 | ||
|
|
4fa77a2ad4 | ||
|
|
3eb1d05d85 | ||
|
|
0cb0b5db2a | ||
|
|
e3588bba04 | ||
|
|
cc5b9c63cb | ||
|
|
892b8bb6d1 | ||
|
|
05854fd704 | ||
|
|
614db2ea9e | ||
|
|
d292aabf05 | ||
|
|
d0a265039a | ||
|
|
37a5a08378 | ||
|
|
788d2bc40c | ||
|
|
4dfcc6df17 | ||
|
|
9e566d76d1 | ||
|
|
8fc9097b37 | ||
|
|
2725405ac9 | ||
|
|
db01fcd6d8 | ||
|
|
89e0889ab3 | ||
|
|
153410f480 | ||
|
|
da8a095a19 | ||
|
|
472fcb6e6e | ||
|
|
cc1800fa4d | ||
|
|
b9c76dedf4 | ||
|
|
7b1f2c801f | ||
|
|
9d441e3e56 | ||
|
|
44549b605a | ||
|
|
5d19d15517 | ||
|
|
5f7432f7b1 | ||
|
|
7560dbb925 | ||
|
|
4047a3623a | ||
|
|
27ac39a2bc | ||
|
|
fb8f2a0a92 | ||
|
|
447436e18c | ||
|
|
c7cf602078 | ||
|
|
78d1b90468 | ||
|
|
907e30ff00 | ||
|
|
70a15c7363 | ||
|
|
a1fbbffb5e | ||
|
|
26b2ec4847 | ||
|
|
af15c68f3c | ||
|
|
142c311e3b | ||
|
|
cb2a671359 | ||
|
|
0c1b254be9 | ||
|
|
29ba4b7d1e | ||
|
|
f67ec19e23 | ||
|
|
93579c29e3 | ||
|
|
b235682a18 | ||
|
|
19a0151a52 | ||
|
|
cf9b5a71bd | ||
|
|
acc4a82818 | ||
|
|
9f920b9bbf | ||
|
|
c7b9dc463a | ||
|
|
bc73963974 | ||
|
|
476421efe5 | ||
|
|
c013fa1811 | ||
|
|
f33a8445eb | ||
|
|
4324e3be9e | ||
|
|
c7bbf84929 | ||
|
|
23ebd9c3c6 | ||
|
|
4d932d615c | ||
|
|
ce7ebaa606 | ||
|
|
b7a51dd0e8 | ||
|
|
739957ca1e | ||
|
|
13cf0707f9 | ||
|
|
709410d8a4 | ||
|
|
f207aa94f9 | ||
|
|
e80619a032 | ||
|
|
638708cad8 | ||
|
|
e06b568c3c | ||
|
|
528efe206d | ||
|
|
d379afbc11 | ||
|
|
cd534f8197 | ||
|
|
38e3cda442 | ||
|
|
b334a8e5fc | ||
|
|
e669d14d47 | ||
|
|
940d1965f8 | ||
|
|
d44aaa37f9 | ||
|
|
9bc741d04f | ||
|
|
256d48b196 | ||
|
|
177b8a241c | ||
|
|
da009214f1 | ||
|
|
4d36c4adcc | ||
|
|
0efd9dc09b | ||
|
|
46809b396c | ||
|
|
f7f291c5d4 | ||
|
|
771f6a2f8e | ||
|
|
4210e507a0 | ||
|
|
ab183e437c | ||
|
|
ab28045d77 | ||
|
|
ba05c6d0b6 | ||
|
|
fa823bd21c | ||
|
|
e81374e050 | ||
|
|
cc5cda5587 | ||
|
|
ef2bd57213 | ||
|
|
e66788c165 | ||
|
|
1496b5de90 | ||
|
|
16ed191329 | ||
|
|
581b1e29ae | ||
|
|
75195aab49 | ||
|
|
725d87bbc2 | ||
|
|
e41bc42deb | ||
|
|
43080173e8 | ||
|
|
700d2b91de | ||
|
|
bb3e84bd1f | ||
|
|
ac2f8e5af8 | ||
|
|
c434b79cff | ||
|
|
700679011e | ||
|
|
68170ae222 | ||
|
|
9f5ad43358 | ||
|
|
684678f9e8 | ||
|
|
93d1700f23 | ||
|
|
a5a2eca155 | ||
|
|
65d9f119c4 | ||
|
|
481473efce | ||
|
|
dea94f4445 | ||
|
|
d32746ef4a | ||
|
|
000f4d8d15 | ||
|
|
fbeac98c84 | ||
|
|
96530bcc07 | ||
|
|
a112fc8bac | ||
|
|
4e83f4cfc7 | ||
|
|
d3f3011d56 | ||
|
|
e5e7cd20ec | ||
|
|
1b68c731f2 | ||
|
|
e0373e01fe | ||
|
|
03c25b15eb | ||
|
|
eebcc2181f | ||
|
|
a68f5d7331 | ||
|
|
269163d509 | ||
|
|
7231fd78aa | ||
|
|
4f8f48654e | ||
|
|
9ca4ae3d3b | ||
|
|
9214a62f26 | ||
|
|
132921683b | ||
|
|
3b305d502b | ||
|
|
f140eb4c3a | ||
|
|
5f2a92d954 | ||
|
|
2094ff3c7a | ||
|
|
db4842c9d9 | ||
|
|
c01095c0c9 | ||
|
|
f1c69ccadb | ||
|
|
5b6b514441 | ||
|
|
c59c41aa6e | ||
|
|
6eea5d6755 | ||
|
|
053ff76e14 | ||
|
|
e1b0af29e4 | ||
|
|
c0fc9563a7 | ||
|
|
4ef591f71f | ||
|
|
ac5b6cb2d4 | ||
|
|
652fb3aa48 | ||
|
|
9059727df1 | ||
|
|
2dd5fba3bd | ||
|
|
3f2e849c54 | ||
|
|
c901da48e3 | ||
|
|
9e32db266e | ||
|
|
fc0472baf9 | ||
|
|
85fc47c81a | ||
|
|
569b05addf | ||
|
|
dec68d7e36 | ||
|
|
7734466c46 | ||
|
|
9e98118f28 | ||
|
|
f3af91815a | ||
|
|
fb390d202c | ||
|
|
86f1744736 | ||
|
|
7baec66222 | ||
|
|
c342188fd9 | ||
|
|
3c70f26b2f | ||
|
|
48717d63cc | ||
|
|
ece4124f25 | ||
|
|
d32ce65781 | ||
|
|
07194195ce | ||
|
|
0204aacb03 | ||
|
|
9bc1b065db | ||
|
|
65a84c2642 | ||
|
|
044f4ed55d | ||
|
|
71f9c4e7fd | ||
|
|
bfba4894e1 | ||
|
|
42aec8c5e7 | ||
|
|
90ab52e598 | ||
|
|
bf990c8b32 | ||
|
|
80b98c86b8 | ||
|
|
dde519dc21 | ||
|
|
80ccc989a8 | ||
|
|
5249cc0a79 | ||
|
|
c05f8c7223 | ||
|
|
b8dfeafdfd | ||
|
|
d57bdd85ab | ||
|
|
128e60a29f | ||
|
|
06f4b7f54d | ||
|
|
605800e5ab | ||
|
|
09439374ed | ||
|
|
f6390e5f80 | ||
|
|
e8d1ba33b4 | ||
|
|
be1dd275a4 | ||
|
|
fab0edc9e6 | ||
|
|
7c6fd337d0 | ||
|
|
89fb0f837b | ||
|
|
df909e2f9c | ||
|
|
87bd6caca0 | ||
|
|
2482a505e5 | ||
|
|
e6a8fdd82c | ||
|
|
7cc1965a25 | ||
|
|
d4ec783108 | ||
|
|
debd59732d | ||
|
|
acfefc6c7a | ||
|
|
0c3998d2c6 | ||
|
|
d25c452f0c | ||
|
|
759cc67591 | ||
|
|
51381bb13c | ||
|
|
792fc9d114 | ||
|
|
a232e8fb4e | ||
|
|
c879627dbd | ||
|
|
954c50ed88 | ||
|
|
6f8b0a33fa | ||
|
|
1d34b74a64 | ||
|
|
3b9255eb66 | ||
|
|
ad0f329493 | ||
|
|
a43c3cc347 | ||
|
|
11a3673d42 | ||
|
|
1281e18f14 | ||
|
|
49ce85fae9 | ||
|
|
481c866df8 | ||
|
|
44aef38623 | ||
|
|
fcf746dede | ||
|
|
fadc4b197e | ||
|
|
cff0747d7f | ||
|
|
6f2676dc5f | ||
|
|
7502dc99bf | ||
|
|
357c912be5 | ||
|
|
98e4b753e8 | ||
|
|
628e770274 | ||
|
|
092a7343a4 | ||
|
|
7858138ad2 | ||
|
|
2edf4081af | ||
|
|
1ad3ebcf11 | ||
|
|
7f6b7ebbcc | ||
|
|
8f9899b23e | ||
|
|
eb45d5bd64 | ||
|
|
5cae7d20ad | ||
|
|
35b00e640b | ||
|
|
be344e442b | ||
|
|
0db6231198 | ||
|
|
035324503f | ||
|
|
4d64467444 | ||
|
|
7e05a70301 | ||
|
|
7d8561d56b | ||
|
|
a4a5196351 | ||
|
|
da4dd7c008 | ||
|
|
49d8008947 | ||
|
|
0ae4fa71e4 | ||
|
|
107cb536e7 | ||
|
|
07acc0bbad | ||
|
|
cc9a8aba67 | ||
|
|
3b18c5dc5d | ||
|
|
5d4bfad12b | ||
|
|
f3d0c45cbb | ||
|
|
d5b95a0ed3 | ||
|
|
966a42f9b3 | ||
|
|
22f10e045b | ||
|
|
7283c8b075 | ||
|
|
30249c4cca | ||
|
|
94b4ed5766 | ||
|
|
b9c3dc3b47 | ||
|
|
5b41466275 | ||
|
|
313e814bc9 | ||
|
|
8a3bdd5c4d | ||
|
|
201042fd96 | ||
|
|
379ad1fbb4 | ||
|
|
782206bc97 | ||
|
|
0776fff0e3 | ||
|
|
cfd9209e03 | ||
|
|
2cf35246e6 | ||
|
|
5056902e76 | ||
|
|
78beb031c7 | ||
|
|
1f43fa0f8b | ||
|
|
013aff87ce | ||
|
|
b92440f9b1 | ||
|
|
139681a7eb | ||
|
|
9f7aff4e4c | ||
|
|
251347bd7e | ||
|
|
e21da4caac | ||
|
|
4d6235ed11 | ||
|
|
586396cbb5 | ||
|
|
41450e9405 | ||
|
|
0a6e64e2f5 | ||
|
|
c65d308973 | ||
|
|
b9bc31f720 | ||
|
|
18de9321ce | ||
|
|
d74b907d20 | ||
|
|
ffd43c922e | ||
|
|
680ac2cebe | ||
|
|
570ad67204 | ||
|
|
63dd6d1ac5 | ||
|
|
f2b5ffdb8e | ||
|
|
ca5ca85d24 | ||
|
|
d451f818cf | ||
|
|
243cb098d4 | ||
|
|
2d4c757e2e | ||
|
|
761ed250ec | ||
|
|
53628f2ea9 | ||
|
|
2627470946 | ||
|
|
a6dc4bc2b8 | ||
|
|
33aa4b26b1 | ||
|
|
87b40c6ad2 | ||
|
|
6efdaf8ddf | ||
|
|
c4845f01d2 | ||
|
|
585a958441 | ||
|
|
06f7bb5a32 | ||
|
|
1877a48795 | ||
|
|
997e615c69 | ||
|
|
27a03e0dc3 | ||
|
|
d0d4912c3b | ||
|
|
c65da92a80 | ||
|
|
f9d479fe1e | ||
|
|
bdd1aebea3 | ||
|
|
fb4610e6b7 | ||
|
|
de428daf9a | ||
|
|
8dbd4b391f | ||
|
|
7c5e6e74c8 | ||
|
|
972e81d1ad | ||
|
|
5aae80304c | ||
|
|
784f11c35d | ||
|
|
d7273ac8b1 | ||
|
|
53c4714aab | ||
|
|
1261740521 | ||
|
|
f54e598354 | ||
|
|
401834122d | ||
|
|
1bd4abf98e | ||
|
|
ddcd6dece9 | ||
|
|
3d37b28642 | ||
|
|
989fc3e6ea | ||
|
|
13c74535de | ||
|
|
4f336085d1 | ||
|
|
e92ecd9703 | ||
|
|
9f7094079b | ||
|
|
08b03a329f | ||
|
|
ae5e3fdd59 | ||
|
|
326c91e1a2 | ||
|
|
a7461de231 | ||
|
|
2bdd38716c | ||
|
|
992104d477 | ||
|
|
fbb422ece7 | ||
|
|
7d53559d2f | ||
|
|
bee50cd330 | ||
|
|
96bfe613c3 | ||
|
|
fcf48ab3d3 | ||
|
|
b665fe3ac1 | ||
|
|
a7280d1b96 | ||
|
|
721bfee53a | ||
|
|
809995b526 | ||
|
|
c6641c7d2d | ||
|
|
3d106cb091 | ||
|
|
c00c939f99 | ||
|
|
98f0b86641 | ||
|
|
2372aba6a2 | ||
|
|
c653e67c0f | ||
|
|
a089ed2b92 | ||
|
|
560cf59626 | ||
|
|
fec51d4c46 | ||
|
|
e9adcebaf2 | ||
|
|
d6f2a174fc | ||
|
|
0b959098be | ||
|
|
c589555845 | ||
|
|
b7540df6a4 | ||
|
|
e1b661f8c1 | ||
|
|
045eea1130 | ||
|
|
f615ac4bdf | ||
|
|
6f8d351e86 | ||
|
|
8cfacebd06 | ||
|
|
59529a92ca | ||
|
|
43c6f0b588 | ||
|
|
b5cd7efceb | ||
|
|
0583f73574 | ||
|
|
b69d1b51c7 | ||
|
|
e889b460c0 | ||
|
|
7c71f188a3 | ||
|
|
97dc0edde0 | ||
|
|
f3b15abcb7 | ||
|
|
31ac8714e0 | ||
|
|
37e01efb78 | ||
|
|
a3d51d2027 | ||
|
|
f62f2adbc3 | ||
|
|
f68a4b9fc4 | ||
|
|
a9c17a22ca | ||
|
|
7f02f07f75 | ||
|
|
8f0fb27dec | ||
|
|
b38a6c5780 | ||
|
|
acc0a7436f | ||
|
|
012411ad8d | ||
|
|
98434d6105 | ||
|
|
c02e7f4bb5 | ||
|
|
b972997af7 | ||
|
|
437cf354e2 | ||
|
|
e85265abc2 | ||
|
|
5b75199769 | ||
|
|
a065eba56d | ||
|
|
0899b3b5e5 | ||
|
|
12404a5efb | ||
|
|
0d35450362 | ||
|
|
8d6f7849ff | ||
|
|
43af12039f | ||
|
|
742c776a92 | ||
|
|
d29cefb6eb | ||
|
|
b8fc4186d5 | ||
|
|
d9aa1deac8 | ||
|
|
bbfda6599a | ||
|
|
db0e2b8faf | ||
|
|
8f6edd8dc8 | ||
|
|
430290066c | ||
|
|
e772e78179 | ||
|
|
d9ef16dbb6 | ||
|
|
998d0baab0 | ||
|
|
0735c8ab26 | ||
|
|
5fa2bdc6c7 | ||
|
|
be2b92bd8b | ||
|
|
38ad514589 | ||
|
|
b938a5c9ed | ||
|
|
a93605f7fb | ||
|
|
41242cbe5d | ||
|
|
5db50aca69 | ||
|
|
eb4b6fa621 | ||
|
|
e7e8083139 | ||
|
|
e6b3bda2c3 | ||
|
|
1ab6bd434f | ||
|
|
3b90ddfefe | ||
|
|
9b1f1e5294 | ||
|
|
6cad07c23b | ||
|
|
4dd6c44cbd | ||
|
|
33f2382767 | ||
|
|
419191c653 | ||
|
|
349df0a0e5 | ||
|
|
552411f832 | ||
|
|
9f0e7da64e | ||
|
|
81b065a95d | ||
|
|
4fcae1aef5 | ||
|
|
c5c866aafe | ||
|
|
ac3ce2aa15 | ||
|
|
bceaed6d4d | ||
|
|
16d917a85f | ||
|
|
60cbf29250 | ||
|
|
da14aa463b | ||
|
|
d482c1af28 | ||
|
|
e85355ada4 | ||
|
|
5d3d40d962 | ||
|
|
7583419d88 | ||
|
|
c5f1dcccfc | ||
|
|
4d82ea102a | ||
|
|
a48f5966be | ||
|
|
5daf63b717 | ||
|
|
97aca09e58 | ||
|
|
ec9437dbcc | ||
|
|
0901dedefe | ||
|
|
d22d890cac | ||
|
|
93feda3d9a | ||
|
|
fc67c2b4f1 | ||
|
|
b87d9cf2c9 | ||
|
|
0963a4e9a1 | ||
|
|
bf13a4e281 | ||
|
|
f62b5789ad | ||
|
|
9a9cfbe0ba | ||
|
|
3780ad3133 | ||
|
|
2d3c9c5e67 | ||
|
|
20c71ceacd | ||
|
|
c042f08632 | ||
|
|
bb6b04897b | ||
|
|
490825fb91 | ||
|
|
3a00fc732a | ||
|
|
f32f574004 | ||
|
|
09f755a64d | ||
|
|
1799ffeaa9 | ||
|
|
d10f277bd3 | ||
|
|
63f6a563a3 | ||
|
|
27574b384c | ||
|
|
c26c5833cc | ||
|
|
09a78b5da9 | ||
|
|
ef2d5c40c0 | ||
|
|
11fdca0634 | ||
|
|
5d414da504 | ||
|
|
93a2e773a5 | ||
|
|
336bbbe389 | ||
|
|
cb809f8e04 | ||
|
|
c4409eafc4 | ||
|
|
54f09d7345 | ||
|
|
00ffc42cef | ||
|
|
d695af89f6 | ||
|
|
9f9a732c38 | ||
|
|
864cf22241 | ||
|
|
8e5c0ee402 | ||
|
|
724a2a2c4a | ||
|
|
f365d807e5 | ||
|
|
4406915ebc | ||
|
|
cc1e216eb9 | ||
|
|
10eafdc62e | ||
|
|
0f4cd8f1c0 | ||
|
|
8b30503387 | ||
|
|
8e5f6ddb68 | ||
|
|
0bcece9958 | ||
|
|
64f7972a3d | ||
|
|
f0f4d63fa9 | ||
|
|
51e2dde018 | ||
|
|
c022431a00 | ||
|
|
33834b7d14 | ||
|
|
23522682d4 | ||
|
|
492e8bf563 | ||
|
|
5f16f342d9 | ||
|
|
921507c510 | ||
|
|
68eb5a1df5 | ||
|
|
04d43c435d | ||
|
|
d5f3d5c8cc | ||
|
|
d31fd78d96 | ||
|
|
27003b53bb | ||
|
|
36246c975b | ||
|
|
14f9aba921 | ||
|
|
1bd91cdebe | ||
|
|
4d50ee63d6 | ||
|
|
221fbfb436 | ||
|
|
d2590c69b4 | ||
|
|
aa792eabab | ||
|
|
a2d027eaa0 | ||
|
|
b419e95173 | ||
|
|
9538f5d317 | ||
|
|
4957d6a61e | ||
|
|
d60331a21c | ||
|
|
beed4145ec | ||
|
|
56073cd1ea | ||
|
|
bb675afae6 | ||
|
|
5bf859c8e9 | ||
|
|
0d285312a9 | ||
|
|
69a11c7f7e | ||
|
|
9fbcc008cb | ||
|
|
7d32a1a829 | ||
|
|
a3d7f9f242 | ||
|
|
20a25f60ea | ||
|
|
5c5a282f91 | ||
|
|
8668198c26 | ||
|
|
a19314b087 | ||
|
|
f6d7e30b84 | ||
|
|
82609b1ebc | ||
|
|
a776104e21 | ||
|
|
56c50841ee | ||
|
|
aeb6d8c459 | ||
|
|
dc17c268e8 | ||
|
|
b366492761 | ||
|
|
9451677daa | ||
|
|
d422811bb7 | ||
|
|
3742bc626e | ||
|
|
099b744235 | ||
|
|
39627bc429 | ||
|
|
7004c2724d | ||
|
|
c2d9fa26ce | ||
|
|
f50df10591 | ||
|
|
cf13086efe | ||
|
|
3b76372254 | ||
|
|
b5df2f4314 | ||
|
|
267780bf0a | ||
|
|
f3073db42a | ||
|
|
4c7b313e0d | ||
|
|
53102502c3 | ||
|
|
7a76252007 | ||
|
|
00b5c70750 | ||
|
|
4388095cde | ||
|
|
244573e719 | ||
|
|
80b63b6729 | ||
|
|
9f4ec21f47 | ||
|
|
0aaec97527 | ||
|
|
4018b2b196 | ||
|
|
2705ed0a71 | ||
|
|
3d851033e9 | ||
|
|
ba8db1f6d7 | ||
|
|
18cea823a1 | ||
|
|
9029bf644e | ||
|
|
99c9ae127c | ||
|
|
0fdfdf71f2 | ||
|
|
3b1062d45d | ||
|
|
5a988a5087 | ||
|
|
a231706a06 | ||
|
|
2564f0f998 | ||
|
|
9a1b843ff6 | ||
|
|
a0e5e16afb | ||
|
|
0d51b76947 | ||
|
|
2b1a840002 | ||
|
|
b718ae35a8 | ||
|
|
0e2fdc95ae | ||
|
|
8cb9b479c5 | ||
|
|
1aae980c54 | ||
|
|
810daf8206 | ||
|
|
22e81810dd | ||
|
|
b823fa4450 | ||
|
|
09d4936657 | ||
|
|
f6e285103a | ||
|
|
53878eef13 | ||
|
|
130f429c6f | ||
|
|
9c852df6aa | ||
|
|
737b4c515e | ||
|
|
61f249335d | ||
|
|
8dc59763eb | ||
|
|
84965ea1a8 | ||
|
|
0c2def0e3e | ||
|
|
d0039960c4 | ||
|
|
ea98de63f7 | ||
|
|
7f6bb71eb3 | ||
|
|
ea4193222f | ||
|
|
8765b176f9 | ||
|
|
628cd8a489 | ||
|
|
842b895f09 | ||
|
|
243fb46157 | ||
|
|
74b90aa87e | ||
|
|
6dfa7f3941 | ||
|
|
6b7c9718d6 | ||
|
|
13d9e8ff38 | ||
|
|
57b04e1b5d | ||
|
|
7cd25ed605 | ||
|
|
7ec2badd21 | ||
|
|
71ff2d7177 | ||
|
|
c3c1cdd1b0 | ||
|
|
f8d8eecf80 | ||
|
|
088e54f560 | ||
|
|
c266800a3a | ||
|
|
ec20b0aa2e | ||
|
|
618af397b4 | ||
|
|
5dbf13730e | ||
|
|
4513da9496 | ||
|
|
62a4be03cf | ||
|
|
b356fee5d8 | ||
|
|
2ed889b7f2 | ||
|
|
7c6971239d | ||
|
|
482c100646 | ||
|
|
b3e0587ea0 | ||
|
|
d70156d2e2 | ||
|
|
4628763001 | ||
|
|
1e4b701749 | ||
|
|
16b3be0a76 | ||
|
|
1358850aa6 | ||
|
|
6a12362660 | ||
|
|
e5cb78cc88 | ||
|
|
efa071dd06 | ||
|
|
2546afe2aa | ||
|
|
af7eeffddb | ||
|
|
232d136885 | ||
|
|
71d2dbd0b6 | ||
|
|
6c7029ffd4 | ||
|
|
e33d8a2198 | ||
|
|
6303c0e713 | ||
|
|
3ebe6c192a | ||
|
|
d39b7bab27 | ||
|
|
ac4607ed81 | ||
|
|
b42b8886aa | ||
|
|
6944537c3e | ||
|
|
4368437475 | ||
|
|
4a3a38d1b7 | ||
|
|
40708baf7a | ||
|
|
29d89d48cb | ||
|
|
8ef918d667 | ||
|
|
69b2674c68 | ||
|
|
52d497619e | ||
|
|
8b70b8d85a | ||
|
|
5daf622aea | ||
|
|
d165d124b1 | ||
|
|
71b46c38a8 | ||
|
|
e3dc6a7a28 | ||
|
|
cc276ff0df | ||
|
|
8d9ad97c29 | ||
|
|
b797652209 | ||
|
|
9936aeea32 | ||
|
|
d91fb17a80 | ||
|
|
10beb3184e | ||
|
|
0ea75b28d4 | ||
|
|
ab5e94777c | ||
|
|
3c91b59ef9 | ||
|
|
e8ceb7189b | ||
|
|
3d3a8f0ebf | ||
|
|
b58d73b915 | ||
|
|
917838e0a5 | ||
|
|
43089bf006 | ||
|
|
d1099033ac |
8
.github/actions/get-jtreg/action.yml
vendored
8
.github/actions/get-jtreg/action.yml
vendored
@@ -56,8 +56,14 @@ runs:
|
||||
|
||||
- name: 'Build JTReg'
|
||||
run: |
|
||||
# If runner architecture is x64 set JAVA_HOME_17_X64 otherwise set to JAVA_HOME_17_arm64
|
||||
if [[ '${{ runner.arch }}' == 'X64' ]]; then
|
||||
JDK="$JAVA_HOME_17_X64"
|
||||
else
|
||||
JDK="$JAVA_HOME_17_arm64"
|
||||
fi
|
||||
# Build JTReg and move files to the proper locations
|
||||
bash make/build.sh --jdk "$(realpath bootjdk/jdk)"
|
||||
bash make/build.sh --jdk "$JDK"
|
||||
mkdir ../installed
|
||||
mv build/images/jtreg/* ../installed
|
||||
working-directory: jtreg/src
|
||||
|
||||
24
.github/workflows/build-cross-compile.yml
vendored
24
.github/workflows/build-cross-compile.yml
vendored
@@ -61,27 +61,32 @@ jobs:
|
||||
debian-arch: arm64
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: bullseye
|
||||
tolerate-sysroot-errors: false
|
||||
- target-cpu: arm
|
||||
gnu-arch: arm
|
||||
debian-arch: armhf
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: bullseye
|
||||
tolerate-sysroot-errors: false
|
||||
gnu-abi: eabihf
|
||||
- target-cpu: s390x
|
||||
gnu-arch: s390x
|
||||
debian-arch: s390x
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: bullseye
|
||||
tolerate-sysroot-errors: false
|
||||
- target-cpu: ppc64le
|
||||
gnu-arch: powerpc64le
|
||||
debian-arch: ppc64el
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: bullseye
|
||||
tolerate-sysroot-errors: false
|
||||
- target-cpu: riscv64
|
||||
gnu-arch: riscv64
|
||||
debian-arch: riscv64
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: sid
|
||||
tolerate-sysroot-errors: true
|
||||
|
||||
steps:
|
||||
- name: 'Checkout the JDK source'
|
||||
@@ -93,13 +98,6 @@ jobs:
|
||||
with:
|
||||
platform: linux-x64
|
||||
|
||||
# Use linux-x64 JDK bundle as build JDK
|
||||
- name: 'Get build JDK'
|
||||
id: buildjdk
|
||||
uses: ./.github/actions/get-bundles
|
||||
with:
|
||||
platform: linux-x64
|
||||
|
||||
- name: 'Get GTest'
|
||||
id: gtest
|
||||
uses: ./.github/actions/get-gtest
|
||||
@@ -130,6 +128,7 @@ jobs:
|
||||
if: steps.get-cached-sysroot.outputs.cache-hit != 'true'
|
||||
|
||||
- name: 'Create sysroot'
|
||||
id: create-sysroot
|
||||
run: >
|
||||
sudo debootstrap
|
||||
--arch=${{ matrix.debian-arch }}
|
||||
@@ -140,6 +139,7 @@ jobs:
|
||||
${{ matrix.debian-version }}
|
||||
sysroot
|
||||
${{ matrix.debian-repository }}
|
||||
continue-on-error: ${{ matrix.tolerate-sysroot-errors }}
|
||||
if: steps.get-cached-sysroot.outputs.cache-hit != 'true'
|
||||
|
||||
- name: 'Prepare sysroot'
|
||||
@@ -151,7 +151,12 @@ jobs:
|
||||
rm -rf sysroot/usr/{sbin,bin,share}
|
||||
rm -rf sysroot/usr/lib/{apt,gcc,udev,systemd}
|
||||
rm -rf sysroot/usr/libexec/gcc
|
||||
if: steps.get-cached-sysroot.outputs.cache-hit != 'true'
|
||||
if: steps.create-sysroot.outcome == 'success' && steps.get-cached-sysroot.outputs.cache-hit != 'true'
|
||||
|
||||
- name: 'Remove broken sysroot'
|
||||
run: |
|
||||
sudo rm -rf sysroot/
|
||||
if: steps.create-sysroot.outcome != 'success' && steps.get-cached-sysroot.outputs.cache-hit != 'true'
|
||||
|
||||
- name: 'Configure'
|
||||
run: >
|
||||
@@ -165,7 +170,6 @@ jobs:
|
||||
--disable-precompiled-headers
|
||||
--openjdk-target=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}
|
||||
--with-sysroot=sysroot
|
||||
--with-build-jdk=${{ steps.buildjdk.outputs.jdk-path }}
|
||||
--with-jmod-compress=zip-1
|
||||
CC=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-gcc-${{ inputs.gcc-major-version }}
|
||||
CXX=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-g++-${{ inputs.gcc-major-version }}
|
||||
@@ -173,6 +177,7 @@ jobs:
|
||||
echo "Dumping config.log:" &&
|
||||
cat config.log &&
|
||||
exit 1)
|
||||
if: steps.create-sysroot.outcome == 'success' || steps.get-cached-sysroot.outputs.cache-hit == 'true'
|
||||
|
||||
- name: 'Build'
|
||||
id: build
|
||||
@@ -180,3 +185,4 @@ jobs:
|
||||
with:
|
||||
make-target: 'hotspot ${{ inputs.make-arguments }}'
|
||||
platform: linux-${{ matrix.target-cpu }}
|
||||
if: steps.create-sysroot.outcome == 'success' || steps.get-cached-sysroot.outputs.cache-hit == 'true'
|
||||
|
||||
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
@@ -133,8 +133,7 @@ jobs:
|
||||
gcc-major-version: '10'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
# The linux-x64 jdk bundle is used as buildjdk for the cross-compile job
|
||||
if: needs.select.outputs.linux-x64 == 'true' || needs.select.outputs.linux-cross-compile == 'true'
|
||||
if: needs.select.outputs.linux-x64 == 'true'
|
||||
|
||||
build-linux-x86:
|
||||
name: linux-x86
|
||||
@@ -214,7 +213,6 @@ jobs:
|
||||
name: linux-cross-compile
|
||||
needs:
|
||||
- select
|
||||
- build-linux-x64
|
||||
uses: ./.github/workflows/build-cross-compile.yml
|
||||
with:
|
||||
gcc-major-version: '10'
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -18,8 +18,5 @@ NashornProfile.txt
|
||||
/src/utils/LogCompilation/target/
|
||||
/.project/
|
||||
/.settings/
|
||||
/.project
|
||||
/.classpath
|
||||
/.cproject
|
||||
/compile_commands.json
|
||||
/.cache
|
||||
|
||||
@@ -15,7 +15,7 @@ version=0
|
||||
domain=openjdk.org
|
||||
|
||||
[checks "whitespace"]
|
||||
files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java|.*\.cc|.*\.hh|.*\.m|.*\.mm|.*\.md|.*\.gmk|.*\.m4|.*\.ac|Makefile
|
||||
files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java|.*\.cc|.*\.hh|.*\.m|.*\.mm|.*\.S|.*\.md|.*\.properties|.*\.gmk|.*\.m4|.*\.ac|Makefile
|
||||
ignore-tabs=.*\.gmk|Makefile
|
||||
|
||||
[checks "merge"]
|
||||
|
||||
@@ -68,7 +68,8 @@ id="toc-native-compiler-toolchain-requirements">Native Compiler
|
||||
<li><a href="#apple-xcode" id="toc-apple-xcode">Apple Xcode</a></li>
|
||||
<li><a href="#microsoft-visual-studio"
|
||||
id="toc-microsoft-visual-studio">Microsoft Visual Studio</a></li>
|
||||
<li><a href="#ibm-xl-cc" id="toc-ibm-xl-cc">IBM XL C/C++</a></li>
|
||||
<li><a href="#ibm-open-xl-cc" id="toc-ibm-open-xl-cc">IBM Open XL
|
||||
C/C++</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#boot-jdk-requirements" id="toc-boot-jdk-requirements">Boot
|
||||
JDK Requirements</a>
|
||||
@@ -92,6 +93,8 @@ id="toc-build-tools-requirements">Build Tools Requirements</a>
|
||||
<li><a href="#autoconf" id="toc-autoconf">Autoconf</a></li>
|
||||
<li><a href="#gnu-make" id="toc-gnu-make">GNU Make</a></li>
|
||||
<li><a href="#gnu-bash" id="toc-gnu-bash">GNU Bash</a></li>
|
||||
<li><a href="#graphviz-and-pandoc" id="toc-graphviz-and-pandoc">Graphviz
|
||||
and Pandoc</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#running-configure" id="toc-running-configure">Running
|
||||
Configure</a>
|
||||
@@ -524,7 +527,7 @@ header files as provided by your distribution.</p>
|
||||
<p>The basic tooling is provided as part of the core operating system,
|
||||
but you will most likely need to install developer packages.</p>
|
||||
<p>For apt-based distributions (Debian, Ubuntu, etc), try this:</p>
|
||||
<pre><code>sudo apt-get install build-essential</code></pre>
|
||||
<pre><code>sudo apt-get install build-essential autoconf</code></pre>
|
||||
<p>For rpm-based distributions (Fedora, Red Hat, etc), try this:</p>
|
||||
<pre><code>sudo yum groupinstall "Development Tools"</code></pre>
|
||||
<p>For Alpine Linux, aside from basic tooling, install the GNU versions
|
||||
@@ -560,7 +563,7 @@ system and toolchain.</p>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td>AIX</td>
|
||||
<td>IBM XL C/C++</td>
|
||||
<td>IBM Open XL C/C++</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>Windows</td>
|
||||
@@ -599,18 +602,18 @@ to compile successfully without issues.</p>
|
||||
<p>All compilers are expected to be able to handle the C11 language
|
||||
standard for C, and C++14 for C++.</p>
|
||||
<h3 id="gcc">gcc</h3>
|
||||
<p>The minimum accepted version of gcc is 6.0. Older versions will not
|
||||
<p>The minimum accepted version of gcc is 10.0. Older versions will not
|
||||
be accepted by <code>configure</code>.</p>
|
||||
<p>The JDK is currently known to compile successfully with gcc version
|
||||
13.2 or newer.</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.5. Older versions will not
|
||||
<p>The minimum accepted version of clang is 13. 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>
|
||||
<p>The oldest supported version of Xcode is 13.0.</p>
|
||||
<p>You will need the Xcode command line developer tools to be able to
|
||||
build the JDK. (Actually, <em>only</em> the command line tools are
|
||||
needed, not the IDE.) The simplest way to install these is to run:</p>
|
||||
@@ -671,11 +674,10 @@ the following line: (note that the " characters are essential)</p>
|
||||
version number accordingly. If you have not installed the
|
||||
<code>BuildTools</code>, but e.g. <code>Professional</code>, adjust the
|
||||
product ID accordingly.</p>
|
||||
<h3 id="ibm-xl-cc">IBM XL C/C++</h3>
|
||||
<p>Please consult the AIX section of the <a
|
||||
href="https://wiki.openjdk.org/display/Build/Supported+Build+Platforms">Supported
|
||||
Build Platforms</a> OpenJDK Build Wiki page for details about which
|
||||
versions of XLC are supported.</p>
|
||||
<h3 id="ibm-open-xl-cc">IBM Open XL C/C++</h3>
|
||||
<p>The minimum accepted version of Open XL is 17.1.1.4. This is in
|
||||
essence clang 15, and will be treated as such by the OpenJDK build
|
||||
system.</p>
|
||||
<h2 id="boot-jdk-requirements">Boot JDK Requirements</h2>
|
||||
<p>Paradoxically, building the JDK requires a pre-existing JDK. This is
|
||||
called the "boot JDK". The boot JDK does not, however, have to be a JDK
|
||||
@@ -862,6 +864,13 @@ e.g. <code>configure MAKE=/opt/gnu/make</code>.</p>
|
||||
href="https://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>
|
||||
<h3 id="graphviz-and-pandoc">Graphviz and Pandoc</h3>
|
||||
<p>In order to build the full docs (see the
|
||||
<code>--enable-full-docs</code> configure option) <a
|
||||
href="https://www.graphviz.org">Graphviz</a> and <a
|
||||
href="https://pandoc.org">Pandoc</a> are required. Any recent versions
|
||||
should work. For reference, and subject to change, Oracle builds use
|
||||
Graphviz 9.0.0 and Pandoc 2.19.2.</p>
|
||||
<h2 id="running-configure">Running Configure</h2>
|
||||
<p>To build the JDK, you need a "configuration", which consists of a
|
||||
directory where to store the build output, coupled with information
|
||||
@@ -2157,15 +2166,26 @@ you can create a directory under <code>build</code> and run
|
||||
<code>configure</code> from there, e.g.
|
||||
<code>mkdir build/<name> && cd build/<name> && bash ../../configure</code>.</p>
|
||||
<p>Then you can build that configuration using
|
||||
<code>make CONF_NAME=<name></code> or
|
||||
<code>make CONF=<pattern></code>, where
|
||||
<code><pattern></code> is a substring matching one or several
|
||||
configurations, e.g. <code>CONF=debug</code>. The special empty pattern
|
||||
(<code>CONF=</code>) will match <em>all</em> available configuration, so
|
||||
<code>make CONF= hotspot</code> will build the <code>hotspot</code>
|
||||
target for all configurations. Alternatively, you can execute
|
||||
<code>make</code> in the configuration directory, e.g.
|
||||
<code>cd build/<name> && make</code>.</p>
|
||||
<code>make CONF=<selector></code>, where
|
||||
<code><selector></code> is interpreted as follows:</p>
|
||||
<ul>
|
||||
<li>If <code><selector></code> exacly matches the name of a
|
||||
configuration, this and only this configuration will be selected.</li>
|
||||
<li>If <code><selector></code> matches (i.e. is a substring of)
|
||||
the names of several configurations, then all these configurations will
|
||||
be selected.</li>
|
||||
<li>If <code><selector></code> is empty (i.e. <code>CONF=</code>),
|
||||
then all configurations will be selected.</li>
|
||||
<li>If <code><selector></code> begins with <code>!</code>, then
|
||||
all configurations <strong>not</strong> matching the string following
|
||||
<code>!</code> will be selected.</li>
|
||||
</ul>
|
||||
<p>A more specialized version, <code>CONF_NAME=<name></code> also
|
||||
exists, which will only match if the given <code><name></code>
|
||||
exactly matches a single configuration.</p>
|
||||
<p>Alternatively, you can execute <code>make</code> in the configuration
|
||||
directory, e.g. <code>cd build/<name> && make</code>.</p>
|
||||
<p><code>make CONF_NAME=<name></code> or</p>
|
||||
<h3 id="handling-reconfigurations">Handling Reconfigurations</h3>
|
||||
<p>If you update the repository and part of the configure script has
|
||||
changed, the build system will force you to re-run
|
||||
|
||||
@@ -349,7 +349,7 @@ will most likely need to install developer packages.
|
||||
For apt-based distributions (Debian, Ubuntu, etc), try this:
|
||||
|
||||
```
|
||||
sudo apt-get install build-essential
|
||||
sudo apt-get install build-essential autoconf
|
||||
```
|
||||
|
||||
For rpm-based distributions (Fedora, Red Hat, etc), try this:
|
||||
@@ -382,7 +382,7 @@ one-to-one correlation between target operating system and toolchain.
|
||||
| ------------------ | ------------------------- |
|
||||
| Linux | gcc, clang |
|
||||
| macOS | Apple Xcode (using clang) |
|
||||
| AIX | IBM XL C/C++ |
|
||||
| AIX | IBM Open XL C/C++ |
|
||||
| Windows | Microsoft Visual Studio |
|
||||
|
||||
Please see the individual sections on the toolchains for version
|
||||
@@ -403,7 +403,7 @@ C, and C++14 for C++.
|
||||
|
||||
### gcc
|
||||
|
||||
The minimum accepted version of gcc is 6.0. Older versions will not be accepted
|
||||
The minimum accepted version of gcc is 10.0. Older versions will not be accepted
|
||||
by `configure`.
|
||||
|
||||
The JDK is currently known to compile successfully with gcc version 13.2 or
|
||||
@@ -413,14 +413,14 @@ In general, any version between these two should be usable.
|
||||
|
||||
### clang
|
||||
|
||||
The minimum accepted version of clang is 3.5. Older versions will not be
|
||||
The minimum accepted version of clang is 13. Older versions will not be
|
||||
accepted by `configure`.
|
||||
|
||||
To use clang instead of gcc on Linux, use `--with-toolchain-type=clang`.
|
||||
|
||||
### Apple Xcode
|
||||
|
||||
The oldest supported version of Xcode is 8.
|
||||
The oldest supported version of Xcode is 13.0.
|
||||
|
||||
You will need the Xcode command line developer tools to be able to build the
|
||||
JDK. (Actually, *only* the command line tools are needed, not the IDE.) The
|
||||
@@ -487,11 +487,10 @@ that the " characters are essential)
|
||||
accordingly. If you have not installed the `BuildTools`, but e.g.
|
||||
`Professional`, adjust the product ID accordingly.
|
||||
|
||||
### IBM XL C/C++
|
||||
### IBM Open XL C/C++
|
||||
|
||||
Please consult the AIX section of the [Supported Build Platforms](
|
||||
https://wiki.openjdk.org/display/Build/Supported+Build+Platforms) OpenJDK Build
|
||||
Wiki page for details about which versions of XLC are supported.
|
||||
The minimum accepted version of Open XL is 17.1.1.4. This is in essence clang
|
||||
15, and will be treated as such by the OpenJDK build system.
|
||||
|
||||
## Boot JDK Requirements
|
||||
|
||||
@@ -685,6 +684,14 @@ shells are supported.
|
||||
|
||||
At least version 3.2 of GNU Bash must be used.
|
||||
|
||||
### Graphviz and Pandoc
|
||||
|
||||
In order to build the full docs (see the `--enable-full-docs`
|
||||
configure option) [Graphviz](https://www.graphviz.org) and
|
||||
[Pandoc](https://pandoc.org) are required. Any recent versions should
|
||||
work. For reference, and subject to change, Oracle builds use Graphviz
|
||||
9.0.0 and Pandoc 2.19.2.
|
||||
|
||||
## Running Configure
|
||||
|
||||
To build the JDK, you need a "configuration", which consists of a directory
|
||||
@@ -1944,12 +1951,25 @@ configuration with the name `<name>`. Alternatively, you can create a directory
|
||||
under `build` and run `configure` from there, e.g. `mkdir build/<name> && cd
|
||||
build/<name> && bash ../../configure`.
|
||||
|
||||
Then you can build that configuration using `make CONF_NAME=<name>` or `make
|
||||
CONF=<pattern>`, where `<pattern>` is a substring matching one or several
|
||||
configurations, e.g. `CONF=debug`. The special empty pattern (`CONF=`) will
|
||||
match *all* available configuration, so `make CONF= hotspot` will build the
|
||||
`hotspot` target for all configurations. Alternatively, you can execute `make`
|
||||
in the configuration directory, e.g. `cd build/<name> && make`.
|
||||
Then you can build that configuration using `make CONF=<selector>`, where
|
||||
`<selector>` is interpreted as follows:
|
||||
|
||||
* If `<selector>` exacly matches the name of a configuration, this and only
|
||||
this configuration will be selected.
|
||||
* If `<selector>` matches (i.e. is a substring of) the names of several
|
||||
configurations, then all these configurations will be selected.
|
||||
* If `<selector>` is empty (i.e. `CONF=`), then all configurations will be
|
||||
selected.
|
||||
* If `<selector>` begins with `!`, then all configurations **not** matching the
|
||||
string following `!` will be selected.
|
||||
|
||||
A more specialized version, `CONF_NAME=<name>` also exists, which will only
|
||||
match if the given `<name>` exactly matches a single configuration.
|
||||
|
||||
Alternatively, you can execute `make` in the configuration directory, e.g. `cd
|
||||
build/<name> && make`.
|
||||
|
||||
`make CONF_NAME=<name>` or
|
||||
|
||||
### Handling Reconfigurations
|
||||
|
||||
|
||||
@@ -748,12 +748,15 @@ cases where dynamic initialization or destruction are essential. See <a
|
||||
href="https://bugs.openjdk.org/browse/JDK-8282469">JDK-8282469</a> for
|
||||
further discussion.</p>
|
||||
<h3 id="nullptr">nullptr</h3>
|
||||
<p>Prefer <code>nullptr</code> (<a
|
||||
<p>Use <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>
|
||||
rather than <code>NULL</code>. See the paper for reasons to avoid
|
||||
<code>NULL</code>.</p>
|
||||
<p>Don't use (constant expression or literal) 0 for pointers. Note that
|
||||
C++14 removed non-literal 0 constants from <em>null pointer
|
||||
constants</em>, though some compilers continue to treat them as such.
|
||||
For historical reasons there may be lingering uses of 0 as a
|
||||
pointer.</p>
|
||||
<h3 id="atomic"><atomic></h3>
|
||||
<p>Do not use facilities provided by the <code><atomic></code>
|
||||
header (<a
|
||||
|
||||
@@ -725,12 +725,14 @@ for further discussion.
|
||||
|
||||
### nullptr
|
||||
|
||||
Prefer `nullptr`
|
||||
Use `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.
|
||||
rather than `NULL`. See the paper for reasons to avoid `NULL`.
|
||||
|
||||
For historical reasons there are widespread uses of both `NULL` and of
|
||||
integer 0 as a pointer value.
|
||||
Don't use (constant expression or literal) 0 for pointers. Note that C++14
|
||||
removed non-literal 0 constants from _null pointer constants_, though some
|
||||
compilers continue to treat them as such. For historical reasons there may be
|
||||
lingering uses of 0 as a pointer.
|
||||
|
||||
### <atomic>
|
||||
|
||||
|
||||
@@ -110,10 +110,6 @@ Java and C/C++ natures during development by running:</p>
|
||||
<pre><code>make eclipse-mixed-env</code></pre>
|
||||
<p>Do note that this generates all features that come with both Java and
|
||||
C/C++ natures.</p>
|
||||
<p>By default, the Eclipse Workspace is located in the ide subdirectory
|
||||
in the build output. To share the JDK's source directory with the
|
||||
Eclipse Workspace, you can instead run:</p>
|
||||
<pre><code>make eclipse-shared-<ENV>-env</code></pre>
|
||||
<p>Eclipse support in the JDK is relatively new, so do keep in mind that
|
||||
not everything may work at the moment. As such, the resulting Workspace
|
||||
also has compilation database parsing support enabled, so you can pass
|
||||
@@ -160,9 +156,6 @@ to import the newly created Java Workspace.</p>
|
||||
<p>If doing so results in an error, you can also import the JDK via
|
||||
<code>File -> Import -> Existing Projects into Workspace</code> as
|
||||
a last resort.</p>
|
||||
<p>Alternatively, if you want a Java Workspace inside the JDK's source
|
||||
directory, you can instead run:</p>
|
||||
<pre><code>make eclipse-shared-java-env</code></pre>
|
||||
<p>As mentioned above for Eclipse CDT, you can create a combined Java
|
||||
and C/C++ Workspace which can conveniently switch between Java and C/C++
|
||||
natures during development by running:</p>
|
||||
|
||||
15
doc/ide.md
15
doc/ide.md
@@ -100,14 +100,6 @@ make eclipse-mixed-env
|
||||
Do note that this generates all features that come with both Java and C/C++
|
||||
natures.
|
||||
|
||||
By default, the Eclipse Workspace is located in the ide subdirectory in the
|
||||
build output. To share the JDK's source directory with the Eclipse Workspace,
|
||||
you can instead run:
|
||||
|
||||
```
|
||||
make eclipse-shared-<ENV>-env
|
||||
```
|
||||
|
||||
Eclipse support in the JDK is relatively new, so do keep in mind that not
|
||||
everything may work at the moment. As such, the resulting Workspace also
|
||||
has compilation database parsing support enabled, so you can pass Eclipse
|
||||
@@ -176,13 +168,6 @@ If doing so results in an error, you can also import the JDK via
|
||||
`File -> Import -> Existing Projects into Workspace`
|
||||
as a last resort.
|
||||
|
||||
Alternatively, if you want a Java Workspace inside the JDK's source directory,
|
||||
you can instead run:
|
||||
|
||||
```
|
||||
make eclipse-shared-java-env
|
||||
```
|
||||
|
||||
As mentioned above for Eclipse CDT, you can create a combined Java and C/C++
|
||||
Workspace which can conveniently switch between Java and C/C++ natures during
|
||||
development by running:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2016, 2024, 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
|
||||
@@ -28,6 +28,9 @@ default: all
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include MakeIO.gmk
|
||||
|
||||
PRODUCT_TARGETS :=
|
||||
LEGACY_TARGETS :=
|
||||
TEST_TARGETS :=
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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,8 +31,9 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include JavaCompilation.gmk
|
||||
include NativeCompilation.gmk
|
||||
include TextFileProcessing.gmk
|
||||
include ZipArchive.gmk
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 2024, 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
|
||||
@@ -28,6 +28,8 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include JavaCompilation.gmk
|
||||
include Modules.gmk
|
||||
|
||||
@@ -105,7 +107,7 @@ define SetupInterimModule
|
||||
Standard.java, \
|
||||
EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java \
|
||||
$($1.interim_EXTRA_FILES), \
|
||||
COPY := .gif .png .xml .css .svg .js .js.template .txt javax.tools.JavaCompilerTool, \
|
||||
COPY := .gif .png .xml .css .svg .js .js.template .txt .woff .woff2 javax.tools.JavaCompilerTool, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules/$1.interim, \
|
||||
DISABLED_WARNINGS := module options, \
|
||||
JAVAC_FLAGS := \
|
||||
|
||||
@@ -53,7 +53,7 @@ $(eval $(call SetupJavaCompilation, BUILD_JIGSAW_TOOLS, \
|
||||
build/tools/jigsaw, \
|
||||
COPY := .properties .html, \
|
||||
BIN := $(TOOLS_CLASSES_DIR), \
|
||||
DISABLED_WARNINGS := fallthrough this-escape, \
|
||||
DISABLED_WARNINGS := fallthrough, \
|
||||
JAVAC_FLAGS := \
|
||||
--add-modules jdk.jdeps \
|
||||
--add-exports java.base/jdk.internal.module=ALL-UNNAMED \
|
||||
|
||||
@@ -27,6 +27,8 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include JavaCompilation.gmk
|
||||
include TextFileProcessing.gmk
|
||||
|
||||
|
||||
@@ -31,6 +31,8 @@ default: all
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
|
||||
LIBS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_LIBS)))
|
||||
CMDS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CMDS)))
|
||||
CONF_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CONF)))
|
||||
|
||||
@@ -28,6 +28,8 @@ default: all
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
|
||||
##########################################################################################
|
||||
|
||||
### TZDB tool needs files from java.time.zone package
|
||||
|
||||
@@ -27,6 +27,8 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include Execute.gmk
|
||||
include Modules.gmk
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include Execute.gmk
|
||||
include Modules.gmk
|
||||
include ModuleTools.gmk
|
||||
|
||||
@@ -31,6 +31,8 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include JavaCompilation.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -87,10 +87,9 @@ help:
|
||||
$(info $(_) # (gensrc, java, copy, libs, launchers, gendata))
|
||||
$(info )
|
||||
$(info Make control variables)
|
||||
$(info $(_) CONF= # Build all configurations (note, assignment is empty))
|
||||
$(info $(_) CONF=<substring> # Build the configuration(s) with a name matching)
|
||||
$(info $(_) # <substring>)
|
||||
$(info $(_) CONF_NAME=<string> # Build the configuration with exactly the <string>)
|
||||
$(info $(_) CONF=<selector> # Select which configuration(s) to build)
|
||||
$(info $(_) CONF= # Select all configurations (note, assignment is empty))
|
||||
$(info $(_) CONF_NAME=<string> # Select the configuration with the name <string>)
|
||||
$(info $(_) SPEC=<spec file> # Build the configuration given by the spec file)
|
||||
$(info $(_) LOG=<loglevel> # Change the log level from warn to <loglevel>)
|
||||
$(info $(_) # Available log levels are:)
|
||||
@@ -103,9 +102,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, 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 $(_) JTREG="OPT1=x;OPT2=y" # Control the JTREG test harness, use 'make test-only JTREG=help' to list)
|
||||
$(info $(_) GTEST="OPT1=x;OPT2=y" # Control the GTEST test harness, use 'make test-only GTEST=help' to list)
|
||||
$(info $(_) MICRO="OPT1=x;OPT2=y" # Control the MICRO test harness, use 'make test-only MICRO=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 )
|
||||
|
||||
@@ -31,6 +31,8 @@ default: all
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
TARGETS :=
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2020, 2024, 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
|
||||
@@ -38,9 +38,7 @@ HSDIS_OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/hsdis
|
||||
REAL_HSDIS_NAME := hsdis-$(OPENJDK_TARGET_CPU_LEGACY_LIB)$(SHARED_LIBRARY_SUFFIX)
|
||||
BUILT_HSDIS_LIB := $(HSDIS_OUTPUT_DIR)/$(REAL_HSDIS_NAME)
|
||||
|
||||
HSDIS_TOOLCHAIN := TOOLCHAIN_DEFAULT
|
||||
HSDIS_TOOLCHAIN_CFLAGS := $(CFLAGS_JDKLIB)
|
||||
HSDIS_TOOLCHAIN_LDFLAGS := $(LDFLAGS_JDKLIB)
|
||||
HSDIS_LINK_TYPE := C
|
||||
|
||||
ifeq ($(HSDIS_BACKEND), capstone)
|
||||
ifeq ($(call isTargetCpuArch, x86), true)
|
||||
@@ -59,8 +57,7 @@ endif
|
||||
|
||||
ifeq ($(HSDIS_BACKEND), llvm)
|
||||
# Use C++ instead of C
|
||||
HSDIS_TOOLCHAIN_CFLAGS := $(CXXFLAGS_JDKLIB)
|
||||
HSDIS_TOOLCHAIN := TOOLCHAIN_LINK_CXX
|
||||
HSDIS_LINK_TYPE := C++
|
||||
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
LLVM_OS := pc-linux-gnu
|
||||
@@ -91,14 +88,11 @@ ifeq ($(HSDIS_BACKEND), binutils)
|
||||
endif
|
||||
endif
|
||||
|
||||
$(eval $(call DefineNativeToolchain, TOOLCHAIN_MINGW, \
|
||||
CC := $(MINGW_BASE)-gcc, \
|
||||
LD := $(MINGW_BASE)-ld, \
|
||||
OBJCOPY := $(MINGW_BASE)-objcopy, \
|
||||
RC := $(RC), \
|
||||
SYSROOT_CFLAGS := --sysroot=$(MINGW_SYSROOT), \
|
||||
SYSROOT_LDFLAGS := --sysroot=$(MINGW_SYSROOT), \
|
||||
))
|
||||
BUILD_HSDIS_CC := $(MINGW_BASE)-gcc
|
||||
BUILD_HSDIS_LD := $(MINGW_BASE)-ld
|
||||
BUILD_HSDIS_OBJCOPY := $(MINGW_BASE)-objcopy
|
||||
BUILD_HSDIS_SYSROOT_CFLAGS := --sysroot=$(MINGW_SYSROOT)
|
||||
BUILD_HSDIS_SYSROOT_LDFLAGS := --sysroot=$(MINGW_SYSROOT)
|
||||
|
||||
MINGW_SYSROOT_LIB_PATH := $(MINGW_SYSROOT)/mingw/lib
|
||||
ifeq ($(wildcard $(MINGW_SYSROOT_LIB_PATH)), )
|
||||
@@ -122,8 +116,8 @@ ifeq ($(HSDIS_BACKEND), binutils)
|
||||
|
||||
TOOLCHAIN_TYPE := gcc
|
||||
OPENJDK_TARGET_OS := linux
|
||||
OPENJDK_TARGET_OS_TYPE := unix
|
||||
CC_OUT_OPTION := -o$(SPACE)
|
||||
LD_OUT_OPTION := -o$(SPACE)
|
||||
GENDEPS_FLAGS := -MMD -MF
|
||||
CFLAGS_DEBUG_SYMBOLS := -g
|
||||
DISABLED_WARNINGS :=
|
||||
@@ -131,9 +125,9 @@ ifeq ($(HSDIS_BACKEND), binutils)
|
||||
CFLAGS_WARNINGS_ARE_ERRORS := -Werror
|
||||
SHARED_LIBRARY_FLAGS := -shared
|
||||
|
||||
HSDIS_TOOLCHAIN := TOOLCHAIN_MINGW
|
||||
HSDIS_TOOLCHAIN_CFLAGS :=
|
||||
HSDIS_TOOLCHAIN_LDFLAGS := -L$(MINGW_GCC_LIB_PATH) -L$(MINGW_SYSROOT_LIB_PATH)
|
||||
HSDIS_TOOLCHAIN_DEFAULT_CFLAGS := false
|
||||
HSDIS_TOOLCHAIN_DEFAULT_LDFLAGS := false
|
||||
HSDIS_LDFLAGS += -L$(MINGW_GCC_LIB_PATH) -L$(MINGW_SYSROOT_LIB_PATH)
|
||||
MINGW_DLLCRT := $(MINGW_SYSROOT_LIB_PATH)/dllcrt2.o
|
||||
HSDIS_TOOLCHAIN_LIBS := $(MINGW_DLLCRT) -lmingw32 -lgcc -lgcc_eh -lmoldname \
|
||||
-lmingwex -lmsvcrt -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32
|
||||
@@ -142,17 +136,27 @@ ifeq ($(HSDIS_BACKEND), binutils)
|
||||
endif
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
## Build libhsdis
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_HSDIS, \
|
||||
NAME := hsdis, \
|
||||
LINK_TYPE := $(HSDIS_LINK_TYPE), \
|
||||
SRC := $(TOPDIR)/src/utils/hsdis/$(HSDIS_BACKEND), \
|
||||
EXTRA_HEADER_DIRS := $(TOPDIR)/src/utils/hsdis, \
|
||||
TOOLCHAIN := $(HSDIS_TOOLCHAIN), \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
java.base:include \
|
||||
$(TOPDIR)/src/utils/hsdis, \
|
||||
OUTPUT_DIR := $(HSDIS_OUTPUT_DIR), \
|
||||
OBJECT_DIR := $(HSDIS_OUTPUT_DIR), \
|
||||
DISABLED_WARNINGS_gcc := undef format-nonliteral sign-compare, \
|
||||
DISABLED_WARNINGS_clang := undef format-nonliteral, \
|
||||
CFLAGS := $(HSDIS_TOOLCHAIN_CFLAGS) $(HSDIS_CFLAGS), \
|
||||
LDFLAGS := $(HSDIS_TOOLCHAIN_LDFLAGS) $(HSDIS_LDFLAGS) $(SHARED_LIBRARY_FLAGS), \
|
||||
DEFAULT_CFLAGS := $(HSDIS_TOOLCHAIN_DEFAULT_CFLAGS), \
|
||||
CFLAGS := $(HSDIS_CFLAGS), \
|
||||
CXXFLAGS := $(HSDIS_CFLAGS), \
|
||||
LD_SET_ORIGIN := false, \
|
||||
DEFAULT_LDFLAGS := $(HSDIS_TOOLCHAIN_DEFAULT_LDFLAGS), \
|
||||
LDFLAGS := $(HSDIS_LDFLAGS) $(SHARED_LIBRARY_FLAGS), \
|
||||
LIBS := $(HSDIS_LIBS) $(HSDIS_TOOLCHAIN_LIBS), \
|
||||
))
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 2024, 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,6 +27,8 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include Execute.gmk
|
||||
include Modules.gmk
|
||||
include Utils.gmk
|
||||
@@ -144,6 +146,14 @@ define CreateCDSArchive
|
||||
$1_$2_CDS_ARCHIVE := lib/$1/classes$2.jsa
|
||||
endif
|
||||
|
||||
ifneq ($(COMPARE_BUILD), )
|
||||
DEBUG_CDS_ARCHIVE := true
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG_CDS_ARCHIVE), true)
|
||||
$1_$2_CDS_DUMP_FLAGS += -Xlog:cds+map*=trace:file=$$(JDK_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE).cdsmap:none:filesize=0
|
||||
endif
|
||||
|
||||
$$(eval $$(call SetupExecute, $1_$2_gen_cds_archive_jdk, \
|
||||
WARN := Creating CDS$$($1_$2_DUMP_TYPE) archive for jdk image for $1, \
|
||||
INFO := Using CDS flags for $1: $$($1_$2_CDS_DUMP_FLAGS), \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -202,8 +202,14 @@ ifeq ($(HAS_SPEC),)
|
||||
matching_confs := $$(strip $$(all_confs))
|
||||
else
|
||||
# Otherwise select those that contain the given CONF string
|
||||
matching_confs := $$(strip $$(foreach var, $$(all_confs), \
|
||||
$$(if $$(findstring $$(CONF), $$(var)), $$(var))))
|
||||
ifeq ($$(patsubst !%,,$$(CONF)),)
|
||||
# A CONF starting with ! means we should negate the search term
|
||||
matching_confs := $$(strip $$(foreach var, $$(all_confs), \
|
||||
$$(if $$(findstring $$(subst !,,$$(CONF)), $$(var)), ,$$(var))))
|
||||
else
|
||||
matching_confs := $$(strip $$(foreach var, $$(all_confs), \
|
||||
$$(if $$(findstring $$(CONF), $$(var)), $$(var))))
|
||||
endif
|
||||
ifneq ($$(filter $$(CONF), $$(matching_confs)), )
|
||||
# If we found an exact match, use that
|
||||
matching_confs := $$(CONF)
|
||||
@@ -421,8 +427,9 @@ else # $(HAS_SPEC)=true
|
||||
|
||||
# Cleanup after a compare build
|
||||
define CleanupCompareBuild
|
||||
# If running with a COMPARE_BUILD patch, reverse-apply it
|
||||
$(if $(COMPARE_BUILD_PATCH), cd $(topdir) && $(PATCH) -R -p1 < $(COMPARE_BUILD_PATCH))
|
||||
# If running with a COMPARE_BUILD patch, reverse-apply it, but continue
|
||||
# even if that fails (can happen with removed files).
|
||||
$(if $(COMPARE_BUILD_PATCH), cd $(topdir) && $(PATCH) -R -p1 < $(COMPARE_BUILD_PATCH) || true)
|
||||
# Move this build away and restore the original build
|
||||
$(MKDIR) -p $(topdir)/build/compare-build
|
||||
$(MV) $(OUTPUTDIR) $(COMPARE_BUILD_OUTPUTDIR)
|
||||
@@ -435,10 +442,10 @@ else # $(HAS_SPEC)=true
|
||||
# Compare first and second build. Ignore any error code from compare.sh.
|
||||
$(ECHO) "Comparing between comparison rebuild (this/new) and baseline (other/old)"
|
||||
$(if $(COMPARE_BUILD_COMP_DIR), \
|
||||
+(cd $(COMPARE_BUILD_OUTPUTDIR) && ./compare.sh -vv $(COMPARE_BUILD_COMP_OPTS) \
|
||||
+(cd $(COMPARE_BUILD_OUTPUTDIR) && ./compare.sh --diffs $(COMPARE_BUILD_COMP_OPTS) \
|
||||
-2dirs $(COMPARE_BUILD_OUTPUTDIR)/$(COMPARE_BUILD_COMP_DIR) \
|
||||
$(OUTPUTDIR)/$(COMPARE_BUILD_COMP_DIR) $(COMPARE_BUILD_IGNORE_RESULT)), \
|
||||
+(cd $(COMPARE_BUILD_OUTPUTDIR) && ./compare.sh -vv $(COMPARE_BUILD_COMP_OPTS) \
|
||||
+(cd $(COMPARE_BUILD_OUTPUTDIR) && ./compare.sh --diffs $(COMPARE_BUILD_COMP_OPTS) \
|
||||
-o $(OUTPUTDIR) $(COMPARE_BUILD_IGNORE_RESULT)) \
|
||||
)
|
||||
endef
|
||||
@@ -529,6 +536,31 @@ else # $(HAS_SPEC)=true
|
||||
endef
|
||||
endif
|
||||
|
||||
##############################################################################
|
||||
# Functions for timers
|
||||
##############################################################################
|
||||
|
||||
# Store the build times in this directory.
|
||||
BUILDTIMESDIR=$(OUTPUTDIR)/make-support/build-times
|
||||
|
||||
# Record starting time for build of a sub repository.
|
||||
define RecordStartTime
|
||||
$(DATE) '+%Y %m %d %H %M %S' | $(AWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$(strip $1) && \
|
||||
$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_start_$(strip $1)_human_readable
|
||||
endef
|
||||
|
||||
# Record ending time and calculate the difference and store it in a
|
||||
# easy to read format. Handles builds that cross midnight. Expects
|
||||
# that a build will never take 24 hours or more.
|
||||
define RecordEndTime
|
||||
$(DATE) '+%Y %m %d %H %M %S' | $(AWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_end_$(strip $1)
|
||||
$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_end_$(strip $1)_human_readable
|
||||
$(ECHO) `$(CAT) $(BUILDTIMESDIR)/build_time_start_$(strip $1)` `$(CAT) $(BUILDTIMESDIR)/build_time_end_$(strip $1)` $1 | \
|
||||
$(AWK) '{ F=$$7; T=$$14; if (F > T) { T+=3600*24 }; D=T-F; H=int(D/3600); \
|
||||
M=int((D-H*3600)/60); S=D-H*3600-M*60; printf("%02d:%02d:%02d %s\n",H,M,S,$$15); }' \
|
||||
> $(BUILDTIMESDIR)/build_time_diff_$(strip $1)
|
||||
endef
|
||||
|
||||
define StartGlobalTimer
|
||||
$(RM) -r $(BUILDTIMESDIR) 2> /dev/null && \
|
||||
$(MKDIR) -p $(BUILDTIMESDIR) && \
|
||||
|
||||
@@ -27,6 +27,8 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include JavaCompilation.gmk
|
||||
include JarArchive.gmk
|
||||
include TextFileProcessing.gmk
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include TextFileProcessing.gmk
|
||||
|
||||
default: bundles
|
||||
|
||||
@@ -268,42 +268,22 @@ $(eval $(call SetupTarget, hotspot-ide-project, \
|
||||
|
||||
$(eval $(call SetupTarget, eclipse-java-env, \
|
||||
MAKEFILE := ide/eclipse/CreateWorkspace, \
|
||||
ARGS := --always-make WORKSPACE=java SHARED=false, \
|
||||
ARGS := --always-make WORKSPACE=java, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, eclipse-hotspot-env, \
|
||||
MAKEFILE := ide/eclipse/CreateWorkspace, \
|
||||
ARGS := --always-make WORKSPACE=hotspot SHARED=false, \
|
||||
ARGS := --always-make WORKSPACE=hotspot, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, eclipse-native-env, \
|
||||
MAKEFILE := ide/eclipse/CreateWorkspace, \
|
||||
ARGS := --always-make WORKSPACE=native SHARED=false, \
|
||||
ARGS := --always-make WORKSPACE=native, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, eclipse-mixed-env, \
|
||||
MAKEFILE := ide/eclipse/CreateWorkspace, \
|
||||
ARGS := --always-make SHARED=false, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, eclipse-shared-java-env, \
|
||||
MAKEFILE := ide/eclipse/CreateWorkspace, \
|
||||
ARGS := --always-make WORKSPACE=java SHARED=true, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, eclipse-shared-hotspot-env, \
|
||||
MAKEFILE := ide/eclipse/CreateWorkspace, \
|
||||
ARGS := --always-make WORKSPACE=hotspot SHARED=true, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, eclipse-shared-native-env, \
|
||||
MAKEFILE := ide/eclipse/CreateWorkspace, \
|
||||
ARGS := --always-make WORKSPACE=native SHARED=true, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, eclipse-shared-mixed-env, \
|
||||
MAKEFILE := ide/eclipse/CreateWorkspace, \
|
||||
ARGS := --always-make SHARED=true, \
|
||||
ARGS := --always-make, \
|
||||
))
|
||||
|
||||
ALL_TARGETS += $(HOTSPOT_VARIANT_TARGETS) $(HOTSPOT_VARIANT_GENSRC_TARGETS) \
|
||||
@@ -951,6 +931,11 @@ else
|
||||
java.base-copy: build-hsdis
|
||||
endif
|
||||
|
||||
# On Windows, we need to copy tzmappings generated by gensrc
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
java.base-copy: java.base-gensrc
|
||||
endif
|
||||
|
||||
# jdk.accessibility depends on java.desktop
|
||||
jdk.accessibility-libs: java.desktop-libs
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@ default: all
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
|
||||
MODULE_SRC := $(TOPDIR)/src/$(MODULE)
|
||||
|
||||
# All makefiles should add the targets to be built to this variable.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2017, 2024, 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
|
||||
@@ -176,7 +176,3 @@ ULIMIT := ulimit
|
||||
ifeq ($(OPENJDK_BUILD_OS), windows)
|
||||
PATHTOOL := cygpath
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Simple macros from spec.gmk.in
|
||||
SHARED_LIBRARY=$(LIBRARY_PREFIX)$1$(SHARED_LIBRARY_SUFFIX)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2016, 2024, 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
|
||||
@@ -41,6 +41,16 @@ $(eval $(call IncludeCustomExtension, SourceRevision-pre.gmk))
|
||||
|
||||
STORED_SOURCE_REVISION := $(TOPDIR)/.src-rev
|
||||
|
||||
# Locate all sourcecode repositories included in the forest, as absolute paths
|
||||
FindAllReposAbs = \
|
||||
$(strip $(sort $(dir $(filter-out $(TOPDIR)/build/%, $(wildcard \
|
||||
$(addprefix $(TOPDIR)/, .git */.git */*/.git */*/*/.git */*/*/*/.git) \
|
||||
)))))
|
||||
|
||||
# Locate all sourcecode repositories included in the forest, as relative paths
|
||||
FindAllReposRel = \
|
||||
$(strip $(subst $(TOPDIR)/,.,$(patsubst $(TOPDIR)/%/, %, $(FindAllReposAbs))))
|
||||
|
||||
USE_SCM := false
|
||||
ifneq ($(and $(GIT), $(wildcard $(TOPDIR)/.git)), )
|
||||
USE_SCM := true
|
||||
|
||||
@@ -30,6 +30,8 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include Modules.gmk
|
||||
|
||||
ALL_MODULES = $(call FindAllModules)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012, 2024, 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,7 +30,7 @@ default: all
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include Execute.gmk
|
||||
include NativeCompilation.gmk
|
||||
include JdkNativeCompilation.gmk
|
||||
include ToolsJdk.gmk
|
||||
|
||||
################################################################################
|
||||
@@ -47,14 +47,14 @@ ifeq ($(COMPILE_TYPE), cross)
|
||||
$(error It is not possible to update the x11wrappers when cross-compiling)
|
||||
endif
|
||||
|
||||
BITS := $(OPENJDK_TARGET_CPU_BITS)
|
||||
|
||||
X11WRAPPERS_OUTPUT := $(SUPPORT_OUTPUTDIR)/x11wrappers
|
||||
GENERATOR_SOURCE_FILE := $(X11WRAPPERS_OUTPUT)/src/data_generator.c
|
||||
|
||||
GENSRC_X11WRAPPERS_DATADIR := $(TOPDIR)/src/java.desktop/unix/data/x11wrappergen
|
||||
WRAPPER_OUTPUT_FILE := $(GENSRC_X11WRAPPERS_DATADIR)/sizes-$(BITS).txt
|
||||
|
||||
BITS := $(OPENJDK_TARGET_CPU_BITS)
|
||||
|
||||
# Generate the C code for the program that will output the offset file.
|
||||
$(eval $(call SetupExecute, gensrc_generator, \
|
||||
INFO := Generating X11 wrapper data generator source code, \
|
||||
@@ -76,14 +76,17 @@ DATA_GENERATOR_INCLUDES := \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
|
||||
#
|
||||
|
||||
################################################################################
|
||||
## Build data_generator
|
||||
################################################################################
|
||||
|
||||
# Compile the generated C code into an executable.
|
||||
$(eval $(call SetupNativeCompilation, BUILD_DATA_GENERATOR, \
|
||||
PROGRAM := data_generator, \
|
||||
OUTPUT_DIR := $(X11WRAPPERS_OUTPUT)/bin, \
|
||||
$(eval $(call SetupJdkExecutable, BUILD_DATA_GENERATOR, \
|
||||
NAME := data_generator, \
|
||||
EXTRA_FILES := $(GENERATOR_SOURCE_FILE), \
|
||||
CFLAGS := $(X_CFLAGS) $(DATA_GENERATOR_INCLUDES) $(CFLAGS_JDKEXE), \
|
||||
LDFLAGS := $(LDFLAGS_JDKEXE), \
|
||||
CFLAGS := $(X_CFLAGS) $(DATA_GENERATOR_INCLUDES), \
|
||||
LIBS := $(X_LIBS), \
|
||||
OUTPUT_DIR := $(X11WRAPPERS_OUTPUT)/bin, \
|
||||
OBJECT_DIR := $(X11WRAPPERS_OUTPUT)/objs, \
|
||||
))
|
||||
|
||||
@@ -92,6 +95,7 @@ $(eval $(call SetupExecute, run_wrappergen, \
|
||||
INFO := Generating X11 wrapper data files, \
|
||||
DEPS := $(BUILD_DATA_GENERATOR), \
|
||||
OUTPUT_FILE := $(WRAPPER_OUTPUT_FILE), \
|
||||
SUPPORT_DIR := $(X11WRAPPERS_OUTPUT)/run-wrapper, \
|
||||
COMMAND := $(BUILD_DATA_GENERATOR_TARGET) | $(SORT) > $(WRAPPER_OUTPUT_FILE), \
|
||||
))
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012, 2024, 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,11 +25,11 @@
|
||||
#
|
||||
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright 1992-2022 Free Software Foundation, Inc.
|
||||
# Copyright 1992-2024 Free Software Foundation, Inc.
|
||||
|
||||
# shellcheck disable=SC2006,SC2268 # see below for rationale
|
||||
|
||||
timestamp='2022-09-17'
|
||||
timestamp='2024-01-01'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@@ -72,7 +72,7 @@ me=`echo "$0" | sed -e 's,.*/,,'`
|
||||
usage="\
|
||||
Usage: $0 [OPTION]
|
||||
|
||||
Output the configuration name of the system \`$me' is run on.
|
||||
Output the configuration name of the system '$me' is run on.
|
||||
|
||||
Options:
|
||||
-h, --help print this help, then exit
|
||||
@@ -85,13 +85,13 @@ version="\
|
||||
GNU config.guess ($timestamp)
|
||||
|
||||
Originally written by Per Bothner.
|
||||
Copyright 1992-2022 Free Software Foundation, Inc.
|
||||
Copyright 1992-2024 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
|
||||
help="
|
||||
Try \`$me --help' for more information."
|
||||
Try '$me --help' for more information."
|
||||
|
||||
# Parse command line
|
||||
while test $# -gt 0 ; do
|
||||
@@ -127,8 +127,8 @@ GUESS=
|
||||
# temporary files to be created and, as you can see below, it is a
|
||||
# headache to deal with in a portable fashion.
|
||||
|
||||
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
|
||||
# use `HOST_CC' if defined, but it is deprecated.
|
||||
# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still
|
||||
# use 'HOST_CC' if defined, but it is deprecated.
|
||||
|
||||
# Portable tmp directory creation inspired by the Autoconf team.
|
||||
|
||||
@@ -180,6 +180,9 @@ Linux|GNU|GNU/*)
|
||||
|
||||
set_cc_for_build
|
||||
cat <<-EOF > "$dummy.c"
|
||||
#if defined(__ANDROID__)
|
||||
LIBC=android
|
||||
#else
|
||||
#include <features.h>
|
||||
#if defined(__UCLIBC__)
|
||||
LIBC=uclibc
|
||||
@@ -187,6 +190,8 @@ Linux|GNU|GNU/*)
|
||||
LIBC=dietlibc
|
||||
#elif defined(__GLIBC__)
|
||||
LIBC=gnu
|
||||
#elif defined(__LLVM_LIBC__)
|
||||
LIBC=llvm
|
||||
#else
|
||||
#include <stdarg.h>
|
||||
/* First heuristic to detect musl libc. */
|
||||
@@ -194,6 +199,7 @@ Linux|GNU|GNU/*)
|
||||
LIBC=musl
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
|
||||
eval "$cc_set_libc"
|
||||
@@ -484,7 +490,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
|
||||
UNAME_RELEASE=`uname -v`
|
||||
;;
|
||||
esac
|
||||
# Japanese Language versions have a version number like `4.1.3-JL'.
|
||||
# Japanese Language versions have a version number like '4.1.3-JL'.
|
||||
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
|
||||
GUESS=sparc-sun-sunos$SUN_REL
|
||||
;;
|
||||
@@ -929,7 +935,7 @@ EOF
|
||||
fi
|
||||
;;
|
||||
*:FreeBSD:*:*)
|
||||
UNAME_PROCESSOR=`/usr/bin/uname -p`
|
||||
UNAME_PROCESSOR=`uname -p`
|
||||
case $UNAME_PROCESSOR in
|
||||
amd64)
|
||||
UNAME_PROCESSOR=x86_64 ;;
|
||||
@@ -1001,7 +1007,27 @@ EOF
|
||||
GUESS=$UNAME_MACHINE-unknown-minix
|
||||
;;
|
||||
aarch64:Linux:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
||||
set_cc_for_build
|
||||
CPU=$UNAME_MACHINE
|
||||
LIBCABI=$LIBC
|
||||
if test "$CC_FOR_BUILD" != no_compiler_found; then
|
||||
ABI=64
|
||||
sed 's/^ //' << EOF > "$dummy.c"
|
||||
#ifdef __ARM_EABI__
|
||||
#ifdef __ARM_PCS_VFP
|
||||
ABI=eabihf
|
||||
#else
|
||||
ABI=eabi
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
|
||||
eval "$cc_set_abi"
|
||||
case $ABI in
|
||||
eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
|
||||
esac
|
||||
fi
|
||||
GUESS=$CPU-unknown-linux-$LIBCABI
|
||||
;;
|
||||
aarch64_be:Linux:*:*)
|
||||
UNAME_MACHINE=aarch64_be
|
||||
@@ -1067,6 +1093,15 @@ EOF
|
||||
k1om:Linux:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
||||
;;
|
||||
kvx:Linux:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
||||
;;
|
||||
kvx:cos:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-cos
|
||||
;;
|
||||
kvx:mbr:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-mbr
|
||||
;;
|
||||
loongarch32:Linux:*:* | loongarch64:Linux:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
||||
;;
|
||||
@@ -1222,7 +1257,7 @@ EOF
|
||||
GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
|
||||
;;
|
||||
i*86:OS/2:*:*)
|
||||
# If we were able to find `uname', then EMX Unix compatibility
|
||||
# If we were able to find 'uname', then EMX Unix compatibility
|
||||
# is probably installed.
|
||||
GUESS=$UNAME_MACHINE-pc-os2-emx
|
||||
;;
|
||||
@@ -1363,7 +1398,7 @@ EOF
|
||||
GUESS=ns32k-sni-sysv
|
||||
fi
|
||||
;;
|
||||
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
|
||||
PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort
|
||||
# says <Richard.M.Bartel@ccMail.Census.GOV>
|
||||
GUESS=i586-unisys-sysv4
|
||||
;;
|
||||
@@ -1585,6 +1620,9 @@ EOF
|
||||
*:Unleashed:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
|
||||
;;
|
||||
*:Ironclad:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-ironclad
|
||||
;;
|
||||
esac
|
||||
|
||||
# Do we have a guess based on uname results?
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#! /bin/sh
|
||||
|
||||
#
|
||||
# Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012, 2024, 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,11 +26,11 @@
|
||||
#
|
||||
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright 1992-2022 Free Software Foundation, Inc.
|
||||
# Copyright 1992-2024 Free Software Foundation, Inc.
|
||||
|
||||
# shellcheck disable=SC2006,SC2268 # see below for rationale
|
||||
|
||||
timestamp='2022-09-17'
|
||||
timestamp='2024-01-01'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@@ -102,13 +102,13 @@ Report bugs and patches to <config-patches@gnu.org>."
|
||||
version="\
|
||||
GNU config.sub ($timestamp)
|
||||
|
||||
Copyright 1992-2022 Free Software Foundation, Inc.
|
||||
Copyright 1992-2024 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
|
||||
help="
|
||||
Try \`$me --help' for more information."
|
||||
Try '$me --help' for more information."
|
||||
|
||||
# Parse command line
|
||||
while test $# -gt 0 ; do
|
||||
@@ -156,7 +156,7 @@ IFS=$saved_IFS
|
||||
# Separate into logical components for further validation
|
||||
case $1 in
|
||||
*-*-*-*-*)
|
||||
echo Invalid configuration \`"$1"\': more than four components >&2
|
||||
echo "Invalid configuration '$1': more than four components" >&2
|
||||
exit 1
|
||||
;;
|
||||
*-*-*-*)
|
||||
@@ -171,7 +171,8 @@ case $1 in
|
||||
nto-qnx* | linux-* | uclinux-uclibc* \
|
||||
| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
|
||||
| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
|
||||
| storm-chaos* | os2-emx* | rtmk-nova* | managarm-*)
|
||||
| storm-chaos* | os2-emx* | rtmk-nova* | managarm-* \
|
||||
| windows-* )
|
||||
basic_machine=$field1
|
||||
basic_os=$maybe_os
|
||||
;;
|
||||
@@ -969,7 +970,7 @@ $basic_machine
|
||||
EOF
|
||||
IFS=$saved_IFS
|
||||
;;
|
||||
# We use `pc' rather than `unknown'
|
||||
# We use 'pc' rather than 'unknown'
|
||||
# because (1) that's what they normally are, and
|
||||
# (2) the word "unknown" tends to confuse beginning users.
|
||||
i*86 | x86_64)
|
||||
@@ -1101,7 +1102,7 @@ case $cpu-$vendor in
|
||||
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
|
||||
cpu=i586
|
||||
;;
|
||||
pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
|
||||
pentiumpro-* | p6-* | 6x86-* | athlon-* | athlon_*-*)
|
||||
cpu=i686
|
||||
;;
|
||||
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
|
||||
@@ -1206,7 +1207,7 @@ case $cpu-$vendor in
|
||||
case $cpu in
|
||||
1750a | 580 \
|
||||
| a29k \
|
||||
| aarch64 | aarch64_be \
|
||||
| aarch64 | aarch64_be | aarch64c | arm64ec \
|
||||
| abacus \
|
||||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
|
||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
|
||||
@@ -1225,12 +1226,14 @@ case $cpu-$vendor in
|
||||
| d10v | d30v | dlx | dsp16xx \
|
||||
| e2k | elxsi | epiphany \
|
||||
| f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
|
||||
| javascript \
|
||||
| h8300 | h8500 \
|
||||
| hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
| hexagon \
|
||||
| i370 | i*86 | i860 | i960 | ia16 | ia64 \
|
||||
| ip2k | iq2000 \
|
||||
| k1om \
|
||||
| kvx \
|
||||
| le32 | le64 \
|
||||
| lm32 \
|
||||
| loongarch32 | loongarch64 \
|
||||
@@ -1239,36 +1242,13 @@ case $cpu-$vendor in
|
||||
| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
|
||||
| m88110 | m88k | maxq | mb | mcore | mep | metag \
|
||||
| microblaze | microblazeel \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64eb | mips64el \
|
||||
| mips64octeon | mips64octeonel \
|
||||
| mips64orion | mips64orionel \
|
||||
| mips64r5900 | mips64r5900el \
|
||||
| mips64vr | mips64vrel \
|
||||
| mips64vr4100 | mips64vr4100el \
|
||||
| mips64vr4300 | mips64vr4300el \
|
||||
| mips64vr5000 | mips64vr5000el \
|
||||
| mips64vr5900 | mips64vr5900el \
|
||||
| mipsisa32 | mipsisa32el \
|
||||
| mipsisa32r2 | mipsisa32r2el \
|
||||
| mipsisa32r3 | mipsisa32r3el \
|
||||
| mipsisa32r5 | mipsisa32r5el \
|
||||
| mipsisa32r6 | mipsisa32r6el \
|
||||
| mipsisa64 | mipsisa64el \
|
||||
| mipsisa64r2 | mipsisa64r2el \
|
||||
| mipsisa64r3 | mipsisa64r3el \
|
||||
| mipsisa64r5 | mipsisa64r5el \
|
||||
| mipsisa64r6 | mipsisa64r6el \
|
||||
| mipsisa64sb1 | mipsisa64sb1el \
|
||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
||||
| mipsr5900 | mipsr5900el \
|
||||
| mipstx39 | mipstx39el \
|
||||
| mips* \
|
||||
| mmix \
|
||||
| mn10200 | mn10300 \
|
||||
| moxie \
|
||||
| mt \
|
||||
| msp430 \
|
||||
| nanomips* \
|
||||
| nds32 | nds32le | nds32be \
|
||||
| nfp \
|
||||
| nios | nios2 | nios2eb | nios2el \
|
||||
@@ -1300,6 +1280,7 @@ case $cpu-$vendor in
|
||||
| ubicom32 \
|
||||
| v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
|
||||
| vax \
|
||||
| vc4 \
|
||||
| visium \
|
||||
| w65 \
|
||||
| wasm32 | wasm64 \
|
||||
@@ -1311,7 +1292,7 @@ case $cpu-$vendor in
|
||||
;;
|
||||
|
||||
*)
|
||||
echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
|
||||
echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -1332,11 +1313,12 @@ esac
|
||||
|
||||
# Decode manufacturer-specific aliases for certain operating systems.
|
||||
|
||||
if test x$basic_os != x
|
||||
if test x"$basic_os" != x
|
||||
then
|
||||
|
||||
# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
|
||||
# set os.
|
||||
obj=
|
||||
case $basic_os in
|
||||
gnu/linux*)
|
||||
kernel=linux
|
||||
@@ -1536,10 +1518,16 @@ case $os in
|
||||
os=eabi
|
||||
;;
|
||||
*)
|
||||
os=elf
|
||||
os=
|
||||
obj=elf
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
aout* | coff* | elf* | pe*)
|
||||
# These are machine code file formats, not OSes
|
||||
obj=$os
|
||||
os=
|
||||
;;
|
||||
*)
|
||||
# No normalization, but not necessarily accepted, that comes below.
|
||||
;;
|
||||
@@ -1558,12 +1546,15 @@ else
|
||||
# system, and we'll never get to this point.
|
||||
|
||||
kernel=
|
||||
obj=
|
||||
case $cpu-$vendor in
|
||||
score-*)
|
||||
os=elf
|
||||
os=
|
||||
obj=elf
|
||||
;;
|
||||
spu-*)
|
||||
os=elf
|
||||
os=
|
||||
obj=elf
|
||||
;;
|
||||
*-acorn)
|
||||
os=riscix1.2
|
||||
@@ -1573,28 +1564,35 @@ case $cpu-$vendor in
|
||||
os=gnu
|
||||
;;
|
||||
arm*-semi)
|
||||
os=aout
|
||||
os=
|
||||
obj=aout
|
||||
;;
|
||||
c4x-* | tic4x-*)
|
||||
os=coff
|
||||
os=
|
||||
obj=coff
|
||||
;;
|
||||
c8051-*)
|
||||
os=elf
|
||||
os=
|
||||
obj=elf
|
||||
;;
|
||||
clipper-intergraph)
|
||||
os=clix
|
||||
;;
|
||||
hexagon-*)
|
||||
os=elf
|
||||
os=
|
||||
obj=elf
|
||||
;;
|
||||
tic54x-*)
|
||||
os=coff
|
||||
os=
|
||||
obj=coff
|
||||
;;
|
||||
tic55x-*)
|
||||
os=coff
|
||||
os=
|
||||
obj=coff
|
||||
;;
|
||||
tic6x-*)
|
||||
os=coff
|
||||
os=
|
||||
obj=coff
|
||||
;;
|
||||
# This must come before the *-dec entry.
|
||||
pdp10-*)
|
||||
@@ -1616,19 +1614,24 @@ case $cpu-$vendor in
|
||||
os=sunos3
|
||||
;;
|
||||
m68*-cisco)
|
||||
os=aout
|
||||
os=
|
||||
obj=aout
|
||||
;;
|
||||
mep-*)
|
||||
os=elf
|
||||
os=
|
||||
obj=elf
|
||||
;;
|
||||
mips*-cisco)
|
||||
os=elf
|
||||
os=
|
||||
obj=elf
|
||||
;;
|
||||
mips*-*)
|
||||
os=elf
|
||||
mips*-*|nanomips*-*)
|
||||
os=
|
||||
obj=elf
|
||||
;;
|
||||
or32-*)
|
||||
os=coff
|
||||
os=
|
||||
obj=coff
|
||||
;;
|
||||
*-tti) # must be before sparc entry or we get the wrong os.
|
||||
os=sysv3
|
||||
@@ -1637,7 +1640,8 @@ case $cpu-$vendor in
|
||||
os=sunos4.1.1
|
||||
;;
|
||||
pru-*)
|
||||
os=elf
|
||||
os=
|
||||
obj=elf
|
||||
;;
|
||||
*-be)
|
||||
os=beos
|
||||
@@ -1718,10 +1722,12 @@ case $cpu-$vendor in
|
||||
os=uxpv
|
||||
;;
|
||||
*-rom68k)
|
||||
os=coff
|
||||
os=
|
||||
obj=coff
|
||||
;;
|
||||
*-*bug)
|
||||
os=coff
|
||||
os=
|
||||
obj=coff
|
||||
;;
|
||||
*-apple)
|
||||
os=macos
|
||||
@@ -1739,10 +1745,11 @@ esac
|
||||
|
||||
fi
|
||||
|
||||
# Now, validate our (potentially fixed-up) OS.
|
||||
# Now, validate our (potentially fixed-up) individual pieces (OS, OBJ).
|
||||
|
||||
case $os in
|
||||
# Sometimes we do "kernel-libc", so those need to count as OSes.
|
||||
musl* | newlib* | relibc* | uclibc*)
|
||||
llvm* | musl* | newlib* | relibc* | uclibc*)
|
||||
;;
|
||||
# Likewise for "kernel-abi"
|
||||
eabi* | gnueabi*)
|
||||
@@ -1750,6 +1757,9 @@ case $os in
|
||||
# VxWorks passes extra cpu info in the 4th filed.
|
||||
simlinux | simwindows | spe)
|
||||
;;
|
||||
# See `case $cpu-$os` validation below
|
||||
ghcjs)
|
||||
;;
|
||||
# Now accept the basic system types.
|
||||
# The portable systems comes first.
|
||||
# Each alternative MUST end in a * to match a version number.
|
||||
@@ -1758,7 +1768,7 @@ case $os in
|
||||
| hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
|
||||
| sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
|
||||
| hiux* | abug | nacl* | netware* | windows* \
|
||||
| os9* | macos* | osx* | ios* \
|
||||
| os9* | macos* | osx* | ios* | tvos* | watchos* \
|
||||
| mpw* | magic* | mmixware* | mon960* | lnews* \
|
||||
| amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
|
||||
| aos* | aros* | cloudabi* | sortix* | twizzler* \
|
||||
@@ -1767,11 +1777,11 @@ case $os in
|
||||
| mirbsd* | netbsd* | dicos* | openedition* | ose* \
|
||||
| bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
|
||||
| ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
|
||||
| bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
|
||||
| ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
|
||||
| bosx* | nextstep* | cxux* | oabi* \
|
||||
| ptx* | ecoff* | winnt* | domain* | vsta* \
|
||||
| udi* | lites* | ieee* | go32* | aux* | hcos* \
|
||||
| chorusrdb* | cegcc* | glidix* | serenity* \
|
||||
| cygwin* | msys* | pe* | moss* | proelf* | rtems* \
|
||||
| cygwin* | msys* | moss* | proelf* | rtems* \
|
||||
| midipix* | mingw32* | mingw64* | mint* \
|
||||
| uxpv* | beos* | mpeix* | udk* | moxiebox* \
|
||||
| interix* | uwin* | mks* | rhapsody* | darwin* \
|
||||
@@ -1784,62 +1794,116 @@ case $os in
|
||||
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
|
||||
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
|
||||
| nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
|
||||
| fiwix* | mlibc* )
|
||||
| fiwix* | mlibc* | cos* | mbr* | ironclad* )
|
||||
;;
|
||||
# This one is extra strict with allowed versions
|
||||
sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
|
||||
# Don't forget version if it is 3.2v4 or newer.
|
||||
;;
|
||||
# This refers to builds using the UEFI calling convention
|
||||
# (which depends on the architecture) and PE file format.
|
||||
# Note that this is both a different calling convention and
|
||||
# different file format than that of GNU-EFI
|
||||
# (x86_64-w64-mingw32).
|
||||
uefi)
|
||||
;;
|
||||
none)
|
||||
;;
|
||||
kernel* )
|
||||
kernel* | msvc* )
|
||||
# Restricted further below
|
||||
;;
|
||||
'')
|
||||
if test x"$obj" = x
|
||||
then
|
||||
echo "Invalid configuration '$1': Blank OS only allowed with explicit machine code file format" 1>&2
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
|
||||
echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
case $obj in
|
||||
aout* | coff* | elf* | pe*)
|
||||
;;
|
||||
'')
|
||||
# empty is fine
|
||||
;;
|
||||
*)
|
||||
echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Here we handle the constraint that a (synthetic) cpu and os are
|
||||
# valid only in combination with each other and nowhere else.
|
||||
case $cpu-$os in
|
||||
# The "javascript-unknown-ghcjs" triple is used by GHC; we
|
||||
# accept it here in order to tolerate that, but reject any
|
||||
# variations.
|
||||
javascript-ghcjs)
|
||||
;;
|
||||
javascript-* | *-ghcjs)
|
||||
echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# As a final step for OS-related things, validate the OS-kernel combination
|
||||
# (given a valid OS), if there is a kernel.
|
||||
case $kernel-$os in
|
||||
linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
|
||||
| linux-musl* | linux-relibc* | linux-uclibc* )
|
||||
case $kernel-$os-$obj in
|
||||
linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \
|
||||
| linux-mlibc*- | linux-musl*- | linux-newlib*- \
|
||||
| linux-relibc*- | linux-uclibc*- )
|
||||
;;
|
||||
uclinux-uclibc* )
|
||||
uclinux-uclibc*- )
|
||||
;;
|
||||
managarm-mlibc* | managarm-kernel* )
|
||||
managarm-mlibc*- | managarm-kernel*- )
|
||||
;;
|
||||
-dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* )
|
||||
windows*-msvc*-)
|
||||
;;
|
||||
-dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \
|
||||
| -uclibc*- )
|
||||
# These are just libc implementations, not actual OSes, and thus
|
||||
# require a kernel.
|
||||
echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
|
||||
echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2
|
||||
exit 1
|
||||
;;
|
||||
-kernel* )
|
||||
echo "Invalid configuration \`$1': \`$os' needs explicit kernel." 1>&2
|
||||
-kernel*- )
|
||||
echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2
|
||||
exit 1
|
||||
;;
|
||||
*-kernel* )
|
||||
echo "Invalid configuration \`$1': \`$kernel' does not support \`$os'." 1>&2
|
||||
*-kernel*- )
|
||||
echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2
|
||||
exit 1
|
||||
;;
|
||||
kfreebsd*-gnu* | kopensolaris*-gnu*)
|
||||
*-msvc*- )
|
||||
echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2
|
||||
exit 1
|
||||
;;
|
||||
vxworks-simlinux | vxworks-simwindows | vxworks-spe)
|
||||
kfreebsd*-gnu*- | kopensolaris*-gnu*-)
|
||||
;;
|
||||
nto-qnx*)
|
||||
vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-)
|
||||
;;
|
||||
os2-emx)
|
||||
nto-qnx*-)
|
||||
;;
|
||||
*-eabi* | *-gnueabi*)
|
||||
os2-emx-)
|
||||
;;
|
||||
-*)
|
||||
*-eabi*- | *-gnueabi*-)
|
||||
;;
|
||||
none--*)
|
||||
# None (no kernel, i.e. freestanding / bare metal),
|
||||
# can be paired with an machine code file format
|
||||
;;
|
||||
-*-)
|
||||
# Blank kernel with real OS is always fine.
|
||||
;;
|
||||
*-*)
|
||||
echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
|
||||
--*)
|
||||
# Blank kernel and OS with real machine code file format is always fine.
|
||||
;;
|
||||
*-*-*)
|
||||
echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -1922,7 +1986,7 @@ case $vendor in
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "$cpu-$vendor-${kernel:+$kernel-}$os"
|
||||
echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}"
|
||||
exit
|
||||
|
||||
# Local variables:
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
#
|
||||
#
|
||||
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@@ -54,18 +54,18 @@ AC_DEFUN([PKG_PROG_PKG_CONFIG],
|
||||
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
|
||||
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
|
||||
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
|
||||
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
|
||||
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
|
||||
fi
|
||||
if test -n "$PKG_CONFIG"; then
|
||||
_pkg_min_version=m4_default([$1], [0.9.0])
|
||||
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
PKG_CONFIG=""
|
||||
fi
|
||||
|
||||
_pkg_min_version=m4_default([$1], [0.9.0])
|
||||
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
PKG_CONFIG=""
|
||||
fi
|
||||
|
||||
fi[]dnl
|
||||
])# PKG_PROG_PKG_CONFIG
|
||||
|
||||
@@ -97,7 +97,7 @@ m4_define([_PKG_CONFIG],
|
||||
elif test -n "$PKG_CONFIG"; then
|
||||
PKG_CHECK_EXISTS([$3],
|
||||
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
|
||||
[pkg_failed=yes])
|
||||
[pkg_failed=yes])
|
||||
else
|
||||
pkg_failed=untried
|
||||
fi[]dnl
|
||||
@@ -143,14 +143,14 @@ See the pkg-config man page for more details.])
|
||||
if test $pkg_failed = yes; then
|
||||
_PKG_SHORT_ERRORS_SUPPORTED
|
||||
if test $_pkg_short_errors_supported = yes; then
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
|
||||
else
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
|
||||
else
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
|
||||
fi
|
||||
# Put the nasty error message in config.log where it belongs
|
||||
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
|
||||
# Put the nasty error message in config.log where it belongs
|
||||
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
|
||||
|
||||
ifelse([$4], , [AC_MSG_ERROR(dnl
|
||||
ifelse([$4], , [AC_MSG_ERROR(dnl
|
||||
[Package requirements ($2) were not met:
|
||||
|
||||
$$1_PKG_ERRORS
|
||||
@@ -160,10 +160,10 @@ installed software in a non-standard prefix.
|
||||
|
||||
_PKG_TEXT
|
||||
])],
|
||||
[AC_MSG_RESULT([no])
|
||||
[AC_MSG_RESULT([no])
|
||||
$4])
|
||||
elif test $pkg_failed = untried; then
|
||||
ifelse([$4], , [AC_MSG_FAILURE(dnl
|
||||
ifelse([$4], , [AC_MSG_FAILURE(dnl
|
||||
[The pkg-config script could not be found or is too old. Make sure it
|
||||
is in your PATH or set the PKG_CONFIG environment variable to the full
|
||||
path to pkg-config.
|
||||
@@ -171,11 +171,11 @@ path to pkg-config.
|
||||
_PKG_TEXT
|
||||
|
||||
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
|
||||
[$4])
|
||||
[$4])
|
||||
else
|
||||
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
|
||||
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
|
||||
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
|
||||
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
|
||||
AC_MSG_RESULT([yes])
|
||||
ifelse([$3], , :, [$3])
|
||||
ifelse([$3], , :, [$3])
|
||||
fi[]dnl
|
||||
])# PKG_CHECK_MODULES
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -359,9 +359,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" = xxlc; then
|
||||
AC_MSG_RESULT([no, does not work with xlc])
|
||||
PRECOMPILED_HEADERS_AVAILABLE=false
|
||||
elif test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
# Check that the compiler actually supports precomp headers.
|
||||
echo "int alfa();" > conftest.h
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2015, 2024, 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
|
||||
@@ -40,6 +40,7 @@ LDCXX := @BUILD_LDCXX@
|
||||
AS := @BUILD_AS@
|
||||
NM := @BUILD_NM@
|
||||
AR := @BUILD_AR@
|
||||
LIB := @BUILD_LIB@
|
||||
OBJCOPY := @BUILD_OBJCOPY@
|
||||
STRIP := @BUILD_STRIP@
|
||||
SYSROOT_CFLAGS := @BUILD_SYSROOT_CFLAGS@
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012, 2024, 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,11 +45,13 @@ export CP="@CP@"
|
||||
export CUT="@CUT@"
|
||||
export DIFF="@DIFF@"
|
||||
export DUMPBIN="@DUMPBIN@"
|
||||
export ECHO="@ECHO@"
|
||||
export EXPR="@EXPR@"
|
||||
export FILE="@FILE@"
|
||||
export FIND="@FIND@"
|
||||
export GREP="@GREP@"
|
||||
export GUNZIP="@GUNZIP@"
|
||||
export HEAD="@HEAD@"
|
||||
export LDD="@LDD@"
|
||||
export LN="@LN@"
|
||||
export MKDIR="@MKDIR@"
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
# Setup flags for C/C++ compiler
|
||||
#
|
||||
|
||||
###############################################################################
|
||||
################################################################################
|
||||
#
|
||||
# How to compile shared libraries.
|
||||
#
|
||||
@@ -37,10 +37,12 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
# Default works for linux, might work on other platforms as well.
|
||||
SHARED_LIBRARY_FLAGS='-shared'
|
||||
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1'
|
||||
# --disable-new-dtags forces use of RPATH instead of RUNPATH for rpaths.
|
||||
# This protects internal library dependencies within the JDK from being
|
||||
# overridden using LD_LIBRARY_PATH. See JDK-8326891 for more information.
|
||||
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1 -Wl,--disable-new-dtags'
|
||||
SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN"
|
||||
SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1'
|
||||
SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1'
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
@@ -49,7 +51,6 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
|
||||
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path$(or [$]1,/.)'
|
||||
SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
|
||||
SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1'
|
||||
SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1'
|
||||
|
||||
elif test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
# Linking is different on aix
|
||||
@@ -57,14 +58,15 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
|
||||
SET_EXECUTABLE_ORIGIN=""
|
||||
SET_SHARED_LIBRARY_ORIGIN=''
|
||||
SET_SHARED_LIBRARY_NAME=''
|
||||
SET_SHARED_LIBRARY_MAPFILE=''
|
||||
|
||||
else
|
||||
# Default works for linux, might work on other platforms as well.
|
||||
SHARED_LIBRARY_FLAGS='-shared'
|
||||
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1'
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
SET_EXECUTABLE_ORIGIN="$SET_EXECUTABLE_ORIGIN -Wl,--disable-new-dtags"
|
||||
fi
|
||||
SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1'
|
||||
SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1'
|
||||
|
||||
# arm specific settings
|
||||
if test "x$OPENJDK_TARGET_CPU" = "xarm"; then
|
||||
@@ -75,25 +77,16 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
|
||||
fi
|
||||
fi
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
SHARED_LIBRARY_FLAGS="-qmkshrobj -bM:SRE -bnoentry"
|
||||
SET_EXECUTABLE_ORIGIN=""
|
||||
SET_SHARED_LIBRARY_ORIGIN=''
|
||||
SET_SHARED_LIBRARY_NAME=''
|
||||
SET_SHARED_LIBRARY_MAPFILE=''
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
SHARED_LIBRARY_FLAGS="-dll"
|
||||
SET_EXECUTABLE_ORIGIN=''
|
||||
SET_SHARED_LIBRARY_ORIGIN=''
|
||||
SET_SHARED_LIBRARY_NAME=''
|
||||
SET_SHARED_LIBRARY_MAPFILE='-def:[$]1'
|
||||
fi
|
||||
|
||||
AC_SUBST(SET_EXECUTABLE_ORIGIN)
|
||||
AC_SUBST(SET_SHARED_LIBRARY_ORIGIN)
|
||||
AC_SUBST(SET_SHARED_LIBRARY_NAME)
|
||||
AC_SUBST(SET_SHARED_LIBRARY_MAPFILE)
|
||||
AC_SUBST(SHARED_LIBRARY_FLAGS)
|
||||
])
|
||||
|
||||
@@ -122,6 +115,11 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
|
||||
# Add debug prefix map gcc system include paths, as they cause
|
||||
# non-deterministic debug paths depending on gcc path location.
|
||||
DEBUG_PREFIX_MAP_GCC_INCLUDE_PATHS
|
||||
|
||||
# Add debug prefix map for OUTPUTDIR to handle the scenario when
|
||||
# it is not located within WORKSPACE_ROOT
|
||||
outputdir_slash="${OUTPUTDIR%/}/"
|
||||
DEBUG_PREFIX_CFLAGS="$DEBUG_PREFIX_CFLAGS -fdebug-prefix-map=${outputdir_slash}="
|
||||
]
|
||||
)
|
||||
fi
|
||||
@@ -148,8 +146,6 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
|
||||
|
||||
CFLAGS_DEBUG_SYMBOLS="-g ${GDWARF_FLAGS}"
|
||||
ASFLAGS_DEBUG_SYMBOLS="-g"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
CFLAGS_DEBUG_SYMBOLS="-g1"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
CFLAGS_DEBUG_SYMBOLS="-Z7"
|
||||
fi
|
||||
@@ -215,11 +211,7 @@ AC_DEFUN([DEBUG_PREFIX_MAP_GCC_INCLUDE_PATHS],
|
||||
AC_DEFUN([FLAGS_SETUP_WARNINGS],
|
||||
[
|
||||
# Set default value.
|
||||
if test "x$TOOLCHAIN_TYPE" != xxlc; then
|
||||
WARNINGS_AS_ERRORS_DEFAULT=true
|
||||
else
|
||||
WARNINGS_AS_ERRORS_DEFAULT=false
|
||||
fi
|
||||
WARNINGS_AS_ERRORS_DEFAULT=true
|
||||
|
||||
UTIL_ARG_ENABLE(NAME: warnings-as-errors, DEFAULT: $WARNINGS_AS_ERRORS_DEFAULT,
|
||||
RESULT: WARNINGS_AS_ERRORS,
|
||||
@@ -269,15 +261,6 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
|
||||
|
||||
DISABLED_WARNINGS="unknown-warning-option unused-parameter unused"
|
||||
;;
|
||||
|
||||
xlc)
|
||||
DISABLE_WARNING_PREFIX="-Wno-"
|
||||
CFLAGS_WARNINGS_ARE_ERRORS="-qhalt=w"
|
||||
|
||||
# Possibly a better subset than "all" is "lan:trx:ret:zea:cmp:ret"
|
||||
WARNINGS_ENABLE_ALL="-qinfo=all -qformat=all"
|
||||
DISABLED_WARNINGS=""
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(DISABLE_WARNING_PREFIX)
|
||||
AC_SUBST(BUILD_CC_DISABLE_WARNING_PREFIX)
|
||||
@@ -359,15 +342,6 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
|
||||
C_O_FLAG_SIZE="-Os"
|
||||
C_O_FLAG_DEBUG="-O0"
|
||||
C_O_FLAG_NONE="-O0"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
C_O_FLAG_HIGHEST_JVM="-O3 -qhot=level=1 -qinline -qinlglue"
|
||||
C_O_FLAG_HIGHEST="-O3 -qhot=level=1 -qinline -qinlglue"
|
||||
C_O_FLAG_HI="-O3 -qinline -qinlglue"
|
||||
C_O_FLAG_NORM="-O2"
|
||||
C_O_FLAG_DEBUG="-qnoopt"
|
||||
# FIXME: Value below not verified.
|
||||
C_O_FLAG_DEBUG_JVM=""
|
||||
C_O_FLAG_NONE="-qnoopt"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
C_O_FLAG_HIGHEST_JVM="-O2 -Oy-"
|
||||
C_O_FLAG_HIGHEST="-O2"
|
||||
@@ -480,12 +454,13 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
#### OS DEFINES, these should be independent on toolchain
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
CFLAGS_OS_DEF_JVM="-DLINUX -D_FILE_OFFSET_BITS=64"
|
||||
CFLAGS_OS_DEF_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
|
||||
CFLAGS_OS_DEF_JDK="-D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64"
|
||||
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"
|
||||
elif test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
CFLAGS_OS_DEF_JVM="-DAIX -D_LARGE_FILES"
|
||||
CFLAGS_OS_DEF_JVM="-DAIX -Dalloca'(size)'=__builtin_alloca'(size)' -D_LARGE_FILES"
|
||||
CFLAGS_OS_DEF_JDK="-D_LARGE_FILES"
|
||||
elif test "x$OPENJDK_TARGET_OS" = xbsd; then
|
||||
CFLAGS_OS_DEF_JDK="-D_ALLBSD_SOURCE"
|
||||
elif test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||
@@ -501,15 +476,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
# Always enable optional macros for VM.
|
||||
ALWAYS_CFLAGS_JVM="-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS"
|
||||
|
||||
# Setup some hard coded includes
|
||||
ALWAYS_CFLAGS_JDK=" \
|
||||
-I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base \
|
||||
-I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base/\$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \
|
||||
-I${TOPDIR}/src/java.base/share/native/libjava \
|
||||
-I${TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_TYPE/native/libjava \
|
||||
-I${TOPDIR}/src/hotspot/share/include \
|
||||
-I${TOPDIR}/src/hotspot/os/${HOTSPOT_TARGET_OS_TYPE}/include"
|
||||
|
||||
###############################################################################
|
||||
|
||||
# Adjust flags according to debug level.
|
||||
@@ -519,12 +485,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
else
|
||||
DEBUG_CFLAGS_JDK="-DDEBUG"
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
# We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows.
|
||||
# Hotspot now overflows its 64K TOC (currently only for debug),
|
||||
# so for debug we build with '-qpic=large -bbigtoc'.
|
||||
DEBUG_CFLAGS_JVM="-qpic=large"
|
||||
fi
|
||||
if test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
DEBUG_CFLAGS_JVM="-fpic -mcmodel=large"
|
||||
fi
|
||||
@@ -541,9 +501,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" = xxlc; then
|
||||
ALWAYS_DEFINES_JVM="-D_REENTRANT"
|
||||
ALWAYS_DEFINES_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
# Access APIs for Windows 8 and above
|
||||
# see https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=msvc-170
|
||||
@@ -571,7 +528,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -fstack-protector"
|
||||
TOOLCHAIN_CFLAGS_JDK="-pipe -fstack-protector"
|
||||
TOOLCHAIN_CFLAGS_JDK="-fvisibility=hidden -pipe -fstack-protector"
|
||||
# reduce lib size on linux in link step, this needs also special compile flags
|
||||
# do this on s390x also for libjvm (where serviceability agent is not supported)
|
||||
if test "x$ENABLE_LINKTIME_GC" = xtrue; then
|
||||
@@ -606,22 +563,17 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
TOOLCHAIN_CFLAGS_JDK="-pipe"
|
||||
TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing" # technically NOT for CXX
|
||||
fi
|
||||
TOOLCHAIN_CFLAGS_JDK="$TOOLCHAIN_CFLAGS_JDK -fvisibility=hidden"
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
# Suggested additions: -qsrcmsg to get improved error reporting
|
||||
# set -qtbtable=full for a better traceback table/better stacks in hs_err when xlc16 is used
|
||||
TOOLCHAIN_CFLAGS_JDK="-qtbtable=full -qchars=signed -qfullpath -qsaveopt -qstackprotect" # add on both CFLAGS
|
||||
TOOLCHAIN_CFLAGS_JVM="-qtbtable=full -qtune=balanced -fno-exceptions \
|
||||
-qalias=noansi -qstrict -qtls=default -qnortti -qnoeh -qignerrno -qstackprotect"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
# The -utf-8 option sets source and execution character sets to UTF-8 to enable correct
|
||||
# compilation of all source files regardless of the active code page on Windows.
|
||||
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:strictStrings -Zc:inline -permissive- -utf-8 -MP"
|
||||
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:preprocessor -Zc:strictStrings -Zc:inline -utf-8 -Zc:wchar_t-"
|
||||
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:inline -permissive- -utf-8 -MP"
|
||||
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:preprocessor -Zc:inline -permissive- -utf-8 -Zc:wchar_t-"
|
||||
fi
|
||||
|
||||
# CFLAGS C language level for JDK sources (hotspot only uses C++)
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang || test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
LANGSTD_CFLAGS="-std=c11"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
LANGSTD_CFLAGS="-std:c11"
|
||||
@@ -629,12 +581,12 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
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
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; 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])
|
||||
AC_MSG_ERROR([Cannot 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"
|
||||
@@ -653,8 +605,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
WARNING_CFLAGS="$WARNINGS_ENABLE_ALL"
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
WARNING_CFLAGS="" # currently left empty
|
||||
fi
|
||||
|
||||
# Set some additional per-OS defines.
|
||||
@@ -679,31 +629,16 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
PICFLAG="-fPIC"
|
||||
PIEFLAG="-fPIE"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
JVM_PICFLAG="-fpic -mcmodel=large -Wl,-bbigtoc
|
||||
JDK_PICFLAG="-fpic
|
||||
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
|
||||
# will have to patch this single instruction with a call to some out-of-order code which
|
||||
# does the load from the TOC. This is of course slower, and we also would have
|
||||
# to use '-bbigtoc' for linking anyway so we could also change the PICFLAG to 'qpic=large'.
|
||||
# With 'qpic=large' the compiler will by default generate a two-instruction sequence which
|
||||
# can be patched directly by the linker and does not require a jump to out-of-order code.
|
||||
#
|
||||
# Since large TOC causes perf. overhead, only pay it where we must. Currently this is
|
||||
# for all libjvm variants (both gtest and normal) but no other binaries. So, build
|
||||
# libjvm with -qpic=large and link with -bbigtoc.
|
||||
JVM_PICFLAG="-qpic=large"
|
||||
JDK_PICFLAG="-qpic"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
PICFLAG=""
|
||||
fi
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" != xxlc; then
|
||||
if test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
JVM_PICFLAG="-fpic -mcmodel=large"
|
||||
else
|
||||
JVM_PICFLAG="$PICFLAG"
|
||||
JDK_PICFLAG="$PICFLAG"
|
||||
fi
|
||||
JDK_PICFLAG="$PICFLAG"
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
# Linking is different on MacOSX
|
||||
@@ -753,8 +688,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -DARCH='\"$FLAGS_CPU_LEGACY\"' \
|
||||
-D$FLAGS_CPU_LEGACY"
|
||||
|
||||
if test "x$FLAGS_CPU_BITS" = x64 && test "x$FLAGS_OS" != xaix; then
|
||||
# xlc on AIX defines _LP64=1 by default and issues a warning if we redefine it.
|
||||
if test "x$FLAGS_CPU_BITS" = x64; then
|
||||
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_LP64=1"
|
||||
$1_DEFINES_CPU_JVM="${$1_DEFINES_CPU_JVM} -D_LP64=1"
|
||||
fi
|
||||
@@ -831,11 +765,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
$1_CFLAGS_CPU="-mcpu=pwr8"
|
||||
fi
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
if test "x$FLAGS_CPU" = xppc64; then
|
||||
$1_CFLAGS_CPU_JVM="-qarch=ppc64"
|
||||
fi
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
if test "x$FLAGS_CPU" = xx86; then
|
||||
$1_CFLAGS_CPU_JVM="-arch:IA32"
|
||||
@@ -933,7 +862,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
$WARNING_CFLAGS $WARNING_CFLAGS_JVM $JVM_PICFLAG $FILE_MACRO_CFLAGS \
|
||||
$REPRODUCIBLE_CFLAGS $BRANCH_PROTECTION_CFLAGS"
|
||||
|
||||
CFLAGS_JDK_COMMON="$ALWAYS_CFLAGS_JDK $ALWAYS_DEFINES_JDK $TOOLCHAIN_CFLAGS_JDK \
|
||||
CFLAGS_JDK_COMMON="$ALWAYS_DEFINES_JDK $TOOLCHAIN_CFLAGS_JDK \
|
||||
$OS_CFLAGS $CFLAGS_OS_DEF_JDK $DEBUG_CFLAGS_JDK $DEBUG_OPTIONS_FLAGS_JDK \
|
||||
$WARNING_CFLAGS $WARNING_CFLAGS_JDK $DEBUG_SYMBOLS_CFLAGS_JDK \
|
||||
$FILE_MACRO_CFLAGS $REPRODUCIBLE_CFLAGS $BRANCH_PROTECTION_CFLAGS"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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,22 +31,11 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS],
|
||||
FLAGS_SETUP_LDFLAGS_HELPER
|
||||
|
||||
# Setup the target toolchain
|
||||
|
||||
# The target dir matches the name of VM variant
|
||||
TARGET_JVM_VARIANT_PATH=$JVM_VARIANT_MAIN
|
||||
|
||||
# On some platforms (mac) the linker warns about non existing -L dirs.
|
||||
FLAGS_SETUP_LDFLAGS_CPU_DEP([TARGET])
|
||||
|
||||
# Setup the build toolchain
|
||||
|
||||
# When building a buildjdk, it's always only the server variant
|
||||
BUILD_JVM_VARIANT_PATH=server
|
||||
|
||||
FLAGS_SETUP_LDFLAGS_CPU_DEP([BUILD], [OPENJDK_BUILD_])
|
||||
|
||||
LDFLAGS_TESTEXE="${TARGET_LDFLAGS_JDK_LIBPATH}"
|
||||
AC_SUBST(LDFLAGS_TESTEXE)
|
||||
AC_SUBST(ADLC_LDFLAGS)
|
||||
])
|
||||
|
||||
@@ -61,7 +50,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
|
||||
# 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)
|
||||
# add --no-as-needed to disable default --as-needed link flag on some GCC toolchains
|
||||
BASIC_LDFLAGS="-Wl,-z,defs -Wl,-z,relro -Wl,-z,now -Wl,--no-as-needed"
|
||||
BASIC_LDFLAGS="-Wl,-z,defs -Wl,-z,relro -Wl,-z,now -Wl,--no-as-needed -Wl,--exclude-libs,ALL"
|
||||
# Linux : remove unused code+data in link step
|
||||
if test "x$ENABLE_LINKTIME_GC" = xtrue; then
|
||||
if test "x$OPENJDK_TARGET_CPU" = xs390x; then
|
||||
@@ -81,19 +70,17 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
|
||||
|
||||
LDFLAGS_CXX_PARTIAL_LINKING="$MACHINE_FLAG -r"
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
BASIC_LDFLAGS="-Wl,--exclude-libs,ALL"
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
BASIC_LDFLAGS="-Wl,-b64 -Wl,-brtl -Wl,-bnorwexec -Wl,-bnolibpath -Wl,-bnoexpall \
|
||||
-Wl,-bernotok -Wl,-bdatapsize:64k -Wl,-btextpsize:64k -Wl,-bstackpsize:64k"
|
||||
BASIC_LDFLAGS_JVM_ONLY="$BASIC_LDFLAGS_JVM_ONLY -Wl,-lC_r -Wl,-bbigtoc"
|
||||
fi
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
BASIC_LDFLAGS="-b64 -brtl -bnorwexec -bnolibpath -bnoexpall -bernotok -btextpsize:64K \
|
||||
-bdatapsize:64K -bstackpsize:64K"
|
||||
# libjvm.so has gotten too large for normal TOC size; compile with qpic=large and link with bigtoc
|
||||
BASIC_LDFLAGS_JVM_ONLY="-Wl,-lC_r -bbigtoc"
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
BASIC_LDFLAGS="-nologo -opt:ref"
|
||||
BASIC_LDFLAGS="-opt:ref"
|
||||
BASIC_LDFLAGS_JDK_ONLY="-incremental:no"
|
||||
BASIC_LDFLAGS_JVM_ONLY="-opt:icf,8 -subsystem:windows"
|
||||
fi
|
||||
@@ -120,14 +107,6 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
|
||||
fi
|
||||
fi
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
# We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows.
|
||||
# Hotspot now overflows its 64K TOC (currently only for debug),
|
||||
# so we build with '-qpic=large -bbigtoc'.
|
||||
if test "x$DEBUG_LEVEL" != xrelease; then
|
||||
DEBUGLEVEL_LDFLAGS_JVM_ONLY="$DEBUGLEVEL_LDFLAGS_JVM_ONLY -bbigtoc"
|
||||
fi
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
# We need '-fpic' or '-fpic -mcmodel=large -Wl,-bbigtoc' if the TOC overflows.
|
||||
# Hotspot now overflows its 64K TOC (currently only for debug),
|
||||
@@ -165,7 +144,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
|
||||
fi
|
||||
|
||||
# Export some intermediate variables for compatibility
|
||||
LDFLAGS_CXX_JDK="$BASIC_LDFLAGS_ONLYCXX $BASIC_LDFLAGS_ONLYCXX_JDK_ONLY $DEBUGLEVEL_LDFLAGS_JDK_ONLY"
|
||||
LDFLAGS_CXX_JDK="$DEBUGLEVEL_LDFLAGS_JDK_ONLY"
|
||||
AC_SUBST(LDFLAGS_CXX_JDK)
|
||||
AC_SUBST(LDFLAGS_CXX_PARTIAL_LINKING)
|
||||
])
|
||||
@@ -207,20 +186,11 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_CPU_DEP],
|
||||
fi
|
||||
fi
|
||||
|
||||
# JVM_VARIANT_PATH depends on if this is build or target...
|
||||
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
$1_LDFLAGS_JDK_LIBPATH="-libpath:\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base"
|
||||
else
|
||||
$1_LDFLAGS_JDK_LIBPATH="-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base \
|
||||
-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/${$1_JVM_VARIANT_PATH}"
|
||||
fi
|
||||
|
||||
# Export variables according to old definitions, prefix with $2 if present.
|
||||
LDFLAGS_JDK_COMMON="$BASIC_LDFLAGS $BASIC_LDFLAGS_JDK_ONLY \
|
||||
$OS_LDFLAGS $DEBUGLEVEL_LDFLAGS_JDK_ONLY ${$2EXTRA_LDFLAGS}"
|
||||
$2LDFLAGS_JDKLIB="$LDFLAGS_JDK_COMMON $BASIC_LDFLAGS_JDK_LIB_ONLY \
|
||||
${$1_LDFLAGS_JDK_LIBPATH} $SHARED_LIBRARY_FLAGS \
|
||||
$REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS"
|
||||
$SHARED_LIBRARY_FLAGS $REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS"
|
||||
$2LDFLAGS_JDKEXE="$LDFLAGS_JDK_COMMON $EXECUTABLE_LDFLAGS \
|
||||
${$1_CPU_EXECUTABLE_LDFLAGS} $REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -33,9 +33,6 @@ AC_DEFUN([FLAGS_SETUP_ARFLAGS],
|
||||
# FIXME: figure out if we should select AR flags depending on OS or toolchain.
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
ARFLAGS="-X64"
|
||||
elif test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||
# lib.exe is used as AR to create static libraries.
|
||||
ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT"
|
||||
else
|
||||
ARFLAGS=""
|
||||
fi
|
||||
@@ -43,6 +40,18 @@ AC_DEFUN([FLAGS_SETUP_ARFLAGS],
|
||||
AC_SUBST(ARFLAGS)
|
||||
])
|
||||
|
||||
AC_DEFUN([FLAGS_SETUP_LIBFLAGS],
|
||||
[
|
||||
# LIB is used to create static libraries on Windows
|
||||
if test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||
LIBFLAGS="-nodefaultlib:msvcrt"
|
||||
else
|
||||
LIBFLAGS=""
|
||||
fi
|
||||
|
||||
AC_SUBST(LIBFLAGS)
|
||||
])
|
||||
|
||||
AC_DEFUN([FLAGS_SETUP_STRIPFLAGS],
|
||||
[
|
||||
## Setup strip.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -261,12 +261,9 @@ 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 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 and ppc).
|
||||
if test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
MACHINE_FLAG="-q${OPENJDK_TARGET_CPU_BITS}"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
if 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" = xppc; then
|
||||
@@ -321,75 +318,20 @@ AC_DEFUN_ONCE([FLAGS_PRE_TOOLCHAIN],
|
||||
|
||||
AC_DEFUN([FLAGS_SETUP_TOOLCHAIN_CONTROL],
|
||||
[
|
||||
# COMPILER_TARGET_BITS_FLAG : option for selecting 32- or 64-bit output
|
||||
# COMPILER_COMMAND_FILE_FLAG : option for passing a command file to the compiler
|
||||
# COMPILER_BINDCMD_FILE_FLAG : option for specifying a file which saves the binder
|
||||
# commands produced by the link step (currently AIX only)
|
||||
if test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
COMPILER_TARGET_BITS_FLAG="-q"
|
||||
COMPILER_COMMAND_FILE_FLAG="-f"
|
||||
COMPILER_BINDCMD_FILE_FLAG="-bloadmap:"
|
||||
else
|
||||
COMPILER_TARGET_BITS_FLAG="-m"
|
||||
COMPILER_COMMAND_FILE_FLAG="@"
|
||||
COMPILER_BINDCMD_FILE_FLAG=""
|
||||
|
||||
# Check if @file is supported by gcc
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
AC_MSG_CHECKING([if @file is supported by gcc])
|
||||
# Extra empty "" to prevent ECHO from interpreting '--version' as argument
|
||||
$ECHO "" "--version" > command.file
|
||||
# Redirect stderr and stdout to config.log (AS_MESSAGE_LOG_FD) via merge
|
||||
if $CXX @command.file 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD; then
|
||||
AC_MSG_RESULT(yes)
|
||||
COMPILER_COMMAND_FILE_FLAG="@"
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
COMPILER_COMMAND_FILE_FLAG=
|
||||
fi
|
||||
$RM command.file
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(COMPILER_TARGET_BITS_FLAG)
|
||||
AC_SUBST(COMPILER_COMMAND_FILE_FLAG)
|
||||
AC_SUBST(COMPILER_BINDCMD_FILE_FLAG)
|
||||
|
||||
# Check that the compiler supports -mX (or -qX on AIX) flags
|
||||
# Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does
|
||||
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}],
|
||||
IF_TRUE: [COMPILER_SUPPORTS_TARGET_BITS_FLAG=true],
|
||||
IF_FALSE: [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false])
|
||||
AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG)
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
CC_OUT_OPTION=-Fo
|
||||
LD_OUT_OPTION=-out:
|
||||
AR_OUT_OPTION=-out:
|
||||
else
|
||||
# The option used to specify the target .o,.a or .so file.
|
||||
# When compiling, how to specify the to be created object file.
|
||||
CC_OUT_OPTION='-o$(SPACE)'
|
||||
# When linking, how to specify the output
|
||||
LD_OUT_OPTION='-o$(SPACE)'
|
||||
# When archiving, how to specify the destination static archive.
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
AR_OUT_OPTION='-r -cs$(SPACE)'
|
||||
else
|
||||
AR_OUT_OPTION='-rcs$(SPACE)'
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(CC_OUT_OPTION)
|
||||
AC_SUBST(LD_OUT_OPTION)
|
||||
AC_SUBST(AR_OUT_OPTION)
|
||||
|
||||
# Generate make dependency files
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
GENDEPS_FLAGS="-MMD -MF"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
GENDEPS_FLAGS="-MMD -MF"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
GENDEPS_FLAGS="-qmakedep=gcc -MF"
|
||||
fi
|
||||
AC_SUBST(GENDEPS_FLAGS)
|
||||
])
|
||||
@@ -423,6 +365,7 @@ AC_DEFUN([FLAGS_SETUP_FLAGS],
|
||||
FLAGS_SETUP_LDFLAGS
|
||||
|
||||
FLAGS_SETUP_ARFLAGS
|
||||
FLAGS_SETUP_LIBFLAGS
|
||||
FLAGS_SETUP_STRIPFLAGS
|
||||
FLAGS_SETUP_RCFLAGS
|
||||
FLAGS_SETUP_NMFLAGS
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -849,7 +849,7 @@ AC_DEFUN([JDKOPT_CHECK_CODESIGN_DEBUG],
|
||||
|
||||
AC_DEFUN([JDKOPT_SETUP_MACOSX_SIGNING],
|
||||
[
|
||||
ENABLE_CODESIGN=false
|
||||
MACOSX_CODESIGN_MODE=disabled
|
||||
if test "x$OPENJDK_TARGET_OS" = "xmacosx" && test "x$CODESIGN" != "x"; then
|
||||
|
||||
UTIL_ARG_WITH(NAME: macosx-codesign, TYPE: literal, OPTIONAL: true,
|
||||
@@ -859,7 +859,6 @@ AC_DEFUN([JDKOPT_SETUP_MACOSX_SIGNING],
|
||||
DESC: [set the macosx code signing mode (hardened, debug, auto)]
|
||||
)
|
||||
|
||||
MACOSX_CODESIGN_MODE=disabled
|
||||
if test "x$MACOSX_CODESIGN_ENABLED" = "xtrue"; then
|
||||
|
||||
# Check for user provided code signing identity.
|
||||
@@ -902,9 +901,9 @@ AC_DEFUN([JDKOPT_SETUP_MACOSX_SIGNING],
|
||||
AC_MSG_ERROR([unknown value for --with-macosx-codesign: $MACOSX_CODESIGN])
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(MACOSX_CODESIGN_IDENTITY)
|
||||
AC_SUBST(MACOSX_CODESIGN_MODE)
|
||||
fi
|
||||
AC_SUBST(MACOSX_CODESIGN_IDENTITY)
|
||||
AC_SUBST(MACOSX_CODESIGN_MODE)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -69,11 +69,13 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBJPEG],
|
||||
[ AC_MSG_ERROR([--with-libjpeg=system specified, but no libjpeg found])])
|
||||
|
||||
USE_EXTERNAL_LIBJPEG=true
|
||||
LIBJPEG_LIBS="-ljpeg"
|
||||
else
|
||||
AC_MSG_ERROR([Invalid use of --with-libjpeg: ${with_libjpeg}, use 'system' or 'bundled'])
|
||||
fi
|
||||
|
||||
AC_SUBST(USE_EXTERNAL_LIBJPEG)
|
||||
AC_SUBST(LIBJPEG_LIBS)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
@@ -102,11 +104,13 @@ AC_DEFUN_ONCE([LIB_SETUP_GIFLIB],
|
||||
[ AC_MSG_ERROR([--with-giflib=system specified, but no giflib found!])])
|
||||
|
||||
USE_EXTERNAL_LIBGIF=true
|
||||
GIFLIB_LIBS=-lgif
|
||||
else
|
||||
AC_MSG_ERROR([Invalid value of --with-giflib: ${with_giflib}, use 'system' or 'bundled'])
|
||||
fi
|
||||
|
||||
AC_SUBST(USE_EXTERNAL_LIBGIF)
|
||||
AC_SUBST(GIFLIB_LIBS)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -129,12 +129,6 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
|
||||
|
||||
LIB_TESTS_SETUP_GTEST
|
||||
|
||||
BASIC_JDKLIB_LIBS=""
|
||||
BASIC_JDKLIB_LIBS_TARGET=""
|
||||
if test "x$TOOLCHAIN_TYPE" != xmicrosoft; then
|
||||
BASIC_JDKLIB_LIBS="-ljava -ljvm"
|
||||
fi
|
||||
|
||||
# Math library
|
||||
BASIC_JVM_LIBS="$LIBM"
|
||||
|
||||
@@ -170,14 +164,10 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
|
||||
LIB_SETUP_JVM_LIBS(BUILD)
|
||||
LIB_SETUP_JVM_LIBS(TARGET)
|
||||
|
||||
JDKLIB_LIBS="$BASIC_JDKLIB_LIBS"
|
||||
JDKEXE_LIBS=""
|
||||
JVM_LIBS="$BASIC_JVM_LIBS $BASIC_JVM_LIBS_TARGET"
|
||||
OPENJDK_BUILD_JDKLIB_LIBS="$BASIC_JDKLIB_LIBS"
|
||||
OPENJDK_BUILD_JDKLIB_LIBS=""
|
||||
OPENJDK_BUILD_JVM_LIBS="$BASIC_JVM_LIBS $BASIC_JVM_LIBS_BUILD"
|
||||
|
||||
AC_SUBST(JDKLIB_LIBS)
|
||||
AC_SUBST(JDKEXE_LIBS)
|
||||
AC_SUBST(JVM_LIBS)
|
||||
AC_SUBST(OPENJDK_BUILD_JDKLIB_LIBS)
|
||||
AC_SUBST(OPENJDK_BUILD_JVM_LIBS)
|
||||
|
||||
@@ -477,7 +477,7 @@ MACOSX_VERSION_MAX := @MACOSX_VERSION_MAX@
|
||||
MACOSX_CODESIGN_MODE := @MACOSX_CODESIGN_MODE@
|
||||
MACOSX_CODESIGN_IDENTITY := @MACOSX_CODESIGN_IDENTITY@
|
||||
|
||||
# Toolchain type: gcc, clang, xlc, microsoft...
|
||||
# Toolchain type: gcc, clang, microsoft...
|
||||
TOOLCHAIN_TYPE := @TOOLCHAIN_TYPE@
|
||||
TOOLCHAIN_VERSION := @TOOLCHAIN_VERSION@
|
||||
CC_VERSION_NUMBER := @CC_VERSION_NUMBER@
|
||||
@@ -486,20 +486,7 @@ CXX_VERSION_NUMBER := @CXX_VERSION_NUMBER@
|
||||
# Legacy support
|
||||
HOTSPOT_TOOLCHAIN_TYPE := @HOTSPOT_TOOLCHAIN_TYPE@
|
||||
|
||||
# Option used to tell the compiler whether to create 32- or 64-bit executables
|
||||
COMPILER_TARGET_BITS_FLAG := @COMPILER_TARGET_BITS_FLAG@
|
||||
COMPILER_SUPPORTS_TARGET_BITS_FLAG := @COMPILER_SUPPORTS_TARGET_BITS_FLAG@
|
||||
|
||||
# Option used to pass a command file to the compiler
|
||||
COMPILER_COMMAND_FILE_FLAG := @COMPILER_COMMAND_FILE_FLAG@
|
||||
|
||||
# Option for specifying a file which saves the binder commands
|
||||
# produced by the link step (for debugging, currently AIX only)
|
||||
COMPILER_BINDCMD_FILE_FLAG := @COMPILER_BINDCMD_FILE_FLAG@
|
||||
|
||||
CC_OUT_OPTION := @CC_OUT_OPTION@
|
||||
LD_OUT_OPTION := @LD_OUT_OPTION@
|
||||
AR_OUT_OPTION := @AR_OUT_OPTION@
|
||||
|
||||
# Flags used for overriding the default opt setting for a C/C++ source file.
|
||||
C_O_FLAG_HIGHEST_JVM := @C_O_FLAG_HIGHEST_JVM@
|
||||
@@ -568,11 +555,9 @@ SYSROOT := @SYSROOT@
|
||||
|
||||
# LDFLAGS used to link the jdk native libraries (C-code)
|
||||
LDFLAGS_JDKLIB := @LDFLAGS_JDKLIB@
|
||||
JDKLIB_LIBS := @JDKLIB_LIBS@
|
||||
|
||||
# LDFLAGS used to link the jdk native launchers (C-code)
|
||||
LDFLAGS_JDKEXE := @LDFLAGS_JDKEXE@
|
||||
JDKEXE_LIBS := @JDKEXE_LIBS@
|
||||
|
||||
# LDFLAGS specific to C++ linking.
|
||||
LDFLAGS_CXX_JDK := @LDFLAGS_CXX_JDK@
|
||||
@@ -585,9 +570,6 @@ LDCXX := @LDCXX@
|
||||
# The flags for linking libstdc++ linker.
|
||||
LIBCXX := @LIBCXX@
|
||||
|
||||
# Compiler and linker flags used when building native tests
|
||||
LDFLAGS_TESTEXE := @LDFLAGS_TESTEXE@
|
||||
|
||||
# BUILD_CC/BUILD_LD is a compiler/linker that generates code that is runnable on the
|
||||
# build platform.
|
||||
BUILD_CC := @BUILD_ICECC@ @BUILD_CC@
|
||||
@@ -604,10 +586,10 @@ BUILD_SYSROOT_LDFLAGS := @BUILD_SYSROOT_LDFLAGS@
|
||||
|
||||
AS := @AS@
|
||||
|
||||
# AR is used to create a static library (is ar in unix, lib.exe in windows)
|
||||
AR := @AR@
|
||||
ARFLAGS := @ARFLAGS@
|
||||
|
||||
LIB := @LIB@
|
||||
LIBFLAGS := @LIBFLAGS@
|
||||
NM := @NM@
|
||||
NMFLAGS := @NMFLAGS@
|
||||
STRIP := @STRIP@
|
||||
@@ -619,10 +601,6 @@ 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 generating debug symbols
|
||||
COMPILE_WITH_DEBUG_SYMBOLS := @COMPILE_WITH_DEBUG_SYMBOLS@
|
||||
@@ -647,13 +625,6 @@ SHARED_LIBRARY_FLAGS := @SHARED_LIBRARY_FLAGS@
|
||||
SET_SHARED_LIBRARY_ORIGIN = @SET_SHARED_LIBRARY_ORIGIN@
|
||||
SET_EXECUTABLE_ORIGIN = @SET_EXECUTABLE_ORIGIN@
|
||||
|
||||
# Different OS:es have different ways of naming shared libraries.
|
||||
# The SHARED_LIBRARY and STATIC_LIBRARY macros takes "verify" as and argument and returns:
|
||||
# "libverify.so" or "libverify.dylib" or "verify.dll" depending on platform.
|
||||
# (Note absence of := assignment, because we do not want to evaluate the macro body here)
|
||||
SHARED_LIBRARY = @SHARED_LIBRARY@
|
||||
STATIC_LIBRARY = @STATIC_LIBRARY@
|
||||
|
||||
LIBRARY_PREFIX := @LIBRARY_PREFIX@
|
||||
SHARED_LIBRARY_SUFFIX := @SHARED_LIBRARY_SUFFIX@
|
||||
STATIC_LIBRARY_SUFFIX := @STATIC_LIBRARY_SUFFIX@
|
||||
@@ -699,6 +670,10 @@ BUILD_JAR = @FIXPATH@ $(BUILD_JDK)/bin/jar
|
||||
|
||||
DOCS_REFERENCE_JAVADOC := @DOCS_REFERENCE_JAVADOC@
|
||||
|
||||
# A file containing a way to uniquely identify the source code revision that
|
||||
# the build was created from
|
||||
SOURCE_REVISION_TRACKER := $(SUPPORT_OUTPUTDIR)/src-rev/source-revision-tracker
|
||||
|
||||
# Interim langtools modules and arguments
|
||||
INTERIM_LANGTOOLS_BASE_MODULES := java.compiler jdk.compiler jdk.javadoc
|
||||
INTERIM_LANGTOOLS_MODULES := $(addsuffix .interim, $(INTERIM_LANGTOOLS_BASE_MODULES))
|
||||
@@ -813,7 +788,9 @@ TAR_SUPPORTS_TRANSFORM := @TAR_SUPPORTS_TRANSFORM@
|
||||
|
||||
# Build setup
|
||||
USE_EXTERNAL_LIBJPEG := @USE_EXTERNAL_LIBJPEG@
|
||||
LIBJPEG_LIBS := @LIBJPEG_LIBS@
|
||||
USE_EXTERNAL_LIBGIF := @USE_EXTERNAL_LIBGIF@
|
||||
GIFLIB_LIBS := @GIFLIB_LIBS@
|
||||
USE_EXTERNAL_LIBZ := @USE_EXTERNAL_LIBZ@
|
||||
LIBZ_CFLAGS := @LIBZ_CFLAGS@
|
||||
LIBZ_LIBS := @LIBZ_LIBS@
|
||||
|
||||
@@ -35,25 +35,23 @@
|
||||
m4_include([toolchain_microsoft.m4])
|
||||
|
||||
# All valid toolchains, regardless of platform (used by help.m4)
|
||||
VALID_TOOLCHAINS_all="gcc clang xlc microsoft"
|
||||
VALID_TOOLCHAINS_all="gcc clang microsoft"
|
||||
|
||||
# These toolchains are valid on different platforms
|
||||
VALID_TOOLCHAINS_linux="gcc clang"
|
||||
VALID_TOOLCHAINS_macosx="clang"
|
||||
VALID_TOOLCHAINS_aix="xlc clang"
|
||||
VALID_TOOLCHAINS_aix="clang"
|
||||
VALID_TOOLCHAINS_windows="microsoft"
|
||||
|
||||
# Toolchain descriptions
|
||||
TOOLCHAIN_DESCRIPTION_clang="clang/LLVM"
|
||||
TOOLCHAIN_DESCRIPTION_gcc="GNU Compiler Collection"
|
||||
TOOLCHAIN_DESCRIPTION_microsoft="Microsoft Visual Studio"
|
||||
TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"
|
||||
|
||||
# Minimum supported versions, empty means unspecified
|
||||
TOOLCHAIN_MINIMUM_VERSION_clang="3.5"
|
||||
TOOLCHAIN_MINIMUM_VERSION_gcc="6.0"
|
||||
TOOLCHAIN_MINIMUM_VERSION_clang="13.0"
|
||||
TOOLCHAIN_MINIMUM_VERSION_gcc="10.0"
|
||||
TOOLCHAIN_MINIMUM_VERSION_microsoft="19.28.0.0" # VS2019 16.8, aka MSVC 14.28
|
||||
TOOLCHAIN_MINIMUM_VERSION_xlc="16.1.0.0011"
|
||||
|
||||
# Minimum supported linker versions, empty means unspecified
|
||||
TOOLCHAIN_MINIMUM_LD_VERSION_gcc="2.18"
|
||||
@@ -176,30 +174,24 @@ AC_DEFUN([TOOLCHAIN_SETUP_FILENAME_PATTERNS],
|
||||
LIBRARY_PREFIX=
|
||||
SHARED_LIBRARY_SUFFIX='.dll'
|
||||
STATIC_LIBRARY_SUFFIX='.lib'
|
||||
SHARED_LIBRARY='[$]1.dll'
|
||||
STATIC_LIBRARY='[$]1.lib'
|
||||
OBJ_SUFFIX='.obj'
|
||||
EXECUTABLE_SUFFIX='.exe'
|
||||
else
|
||||
LIBRARY_PREFIX=lib
|
||||
SHARED_LIBRARY_SUFFIX='.so'
|
||||
STATIC_LIBRARY_SUFFIX='.a'
|
||||
SHARED_LIBRARY='lib[$]1.so'
|
||||
STATIC_LIBRARY='lib[$]1.a'
|
||||
OBJ_SUFFIX='.o'
|
||||
EXECUTABLE_SUFFIX=''
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
# For full static builds, we're overloading the SHARED_LIBRARY
|
||||
# variables in order to limit the amount of changes required.
|
||||
# For full static builds, we're overloading the shared library suffix
|
||||
# in order to limit the amount of changes required.
|
||||
# It would be better to remove SHARED and just use LIBRARY and
|
||||
# LIBRARY_SUFFIX for libraries that can be built either
|
||||
# shared or static and use STATIC_* for libraries that are
|
||||
# always built statically.
|
||||
if test "x$STATIC_BUILD" = xtrue; then
|
||||
SHARED_LIBRARY='lib[$]1.a'
|
||||
SHARED_LIBRARY_SUFFIX='.a'
|
||||
else
|
||||
SHARED_LIBRARY='lib[$]1.dylib'
|
||||
SHARED_LIBRARY_SUFFIX='.dylib'
|
||||
fi
|
||||
fi
|
||||
@@ -208,8 +200,6 @@ AC_DEFUN([TOOLCHAIN_SETUP_FILENAME_PATTERNS],
|
||||
AC_SUBST(LIBRARY_PREFIX)
|
||||
AC_SUBST(SHARED_LIBRARY_SUFFIX)
|
||||
AC_SUBST(STATIC_LIBRARY_SUFFIX)
|
||||
AC_SUBST(SHARED_LIBRARY)
|
||||
AC_SUBST(STATIC_LIBRARY)
|
||||
AC_SUBST(OBJ_SUFFIX)
|
||||
AC_SUBST(EXECUTABLE_SUFFIX)
|
||||
])
|
||||
@@ -234,25 +224,6 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE],
|
||||
# First toolchain type in the list is the default
|
||||
DEFAULT_TOOLCHAIN=${VALID_TOOLCHAINS%% *}
|
||||
|
||||
# On AIX the default toolchain depends on the installed (found) compiler
|
||||
# xlclang++ -> xlc toolchain
|
||||
# ibm-clang++_r -> clang toolchain
|
||||
# The compiler is searched on the PATH and TOOLCHAIN_PATH
|
||||
# xlclang++ has precedence over ibm-clang++_r if both are installed
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
DEFAULT_TOOLCHAIN="clang"
|
||||
if test "x$TOOLCHAIN_PATH" != x; then
|
||||
if test -e ${TOOLCHAIN_PATH}/xlclang++; then
|
||||
DEFAULT_TOOLCHAIN="xlc"
|
||||
fi
|
||||
else
|
||||
UTIL_LOOKUP_PROGS(XLCLANG_TEST_PATH, xlclang++)
|
||||
if test "x$XLCLANG_TEST_PATH" != x; then
|
||||
DEFAULT_TOOLCHAIN="xlc"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$with_toolchain_type" = xlist; then
|
||||
# List all toolchains
|
||||
AC_MSG_NOTICE([The following toolchains are valid on this platform:])
|
||||
@@ -277,48 +248,13 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE],
|
||||
fi
|
||||
AC_SUBST(TOOLCHAIN_TYPE)
|
||||
|
||||
# on AIX, check for xlclang++ on the PATH and TOOLCHAIN_PATH and use it if it is available
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
if test "x$TOOLCHAIN_PATH" != x; then
|
||||
XLC_TEST_PATH=${TOOLCHAIN_PATH}/
|
||||
fi
|
||||
if test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
TOOLCHAIN_DESCRIPTION_clang="IBM Open XL C/C++"
|
||||
XLCLANG_VERSION_OUTPUT=`${XLC_TEST_PATH}ibm-clang++_r --version 2>&1 | $HEAD -n 1`
|
||||
$ECHO "$XLCLANG_VERSION_OUTPUT" | $GREP "IBM Open XL C/C++ for AIX" > /dev/null
|
||||
if test $? -eq 0; then
|
||||
AC_MSG_NOTICE([ibm-clang++_r output: $XLCLANG_VERSION_OUTPUT])
|
||||
else
|
||||
AC_MSG_ERROR([ibm-clang++_r version output check failed, output: $XLCLANG_VERSION_OUTPUT])
|
||||
fi
|
||||
else
|
||||
XLCLANG_VERSION_OUTPUT=`${XLC_TEST_PATH}xlclang++ -qversion 2>&1 | $HEAD -n 1`
|
||||
$ECHO "$XLCLANG_VERSION_OUTPUT" | $GREP "IBM XL C/C++ for AIX" > /dev/null
|
||||
if test $? -eq 0; then
|
||||
AC_MSG_NOTICE([xlclang++ output: $XLCLANG_VERSION_OUTPUT])
|
||||
else
|
||||
AC_MSG_ERROR([xlclang++ version output check failed, output: $XLCLANG_VERSION_OUTPUT])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
TOOLCHAIN_CC_BINARY_clang="ibm-clang_r"
|
||||
else
|
||||
TOOLCHAIN_CC_BINARY_clang="clang"
|
||||
fi
|
||||
TOOLCHAIN_CC_BINARY_clang="ibm-clang_r clang"
|
||||
TOOLCHAIN_CC_BINARY_gcc="gcc"
|
||||
TOOLCHAIN_CC_BINARY_microsoft="cl"
|
||||
TOOLCHAIN_CC_BINARY_xlc="xlclang"
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
TOOLCHAIN_CXX_BINARY_clang="ibm-clang++_r"
|
||||
else
|
||||
TOOLCHAIN_CXX_BINARY_clang="clang++"
|
||||
fi
|
||||
TOOLCHAIN_CXX_BINARY_clang="ibm-clang++_r clang++"
|
||||
TOOLCHAIN_CXX_BINARY_gcc="g++"
|
||||
TOOLCHAIN_CXX_BINARY_microsoft="cl"
|
||||
TOOLCHAIN_CXX_BINARY_xlc="xlclang++"
|
||||
|
||||
# Use indirect variable referencing
|
||||
toolchain_var_name=TOOLCHAIN_DESCRIPTION_$TOOLCHAIN_TYPE
|
||||
@@ -408,25 +344,7 @@ AC_DEFUN([TOOLCHAIN_EXTRACT_COMPILER_VERSION],
|
||||
COMPILER=[$]$1
|
||||
COMPILER_NAME=$2
|
||||
|
||||
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
|
||||
COMPILER_VERSION_OUTPUT=`$COMPILER -qversion 2>&1`
|
||||
# Check that this is likely to be the IBM XL C compiler.
|
||||
$ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "IBM XL C" > /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 -qversion 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
|
||||
# Collapse compiler output into a single line
|
||||
COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT`
|
||||
COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \
|
||||
$SED -e 's/^.*Version: \(@<:@1-9@:>@@<:@0-9.@:>@*\).*$/\1/'`
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
if 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) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
|
||||
@@ -465,12 +383,22 @@ AC_DEFUN([TOOLCHAIN_EXTRACT_COMPILER_VERSION],
|
||||
$SED -e 's/^.* \(@<:@1-9@:>@<:@0-9@:>@*\.@<:@0-9.@:>@*\)@<:@^0-9.@:>@.*$/\1/'`
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
# clang --version output typically looks like
|
||||
# Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
|
||||
# clang version 3.3 (tags/RELEASE_33/final)
|
||||
# Apple clang version 15.0.0 (clang-1500.3.9.4)
|
||||
# Target: arm64-apple-darwin23.2.0
|
||||
# Thread model: posix
|
||||
# InstalledDir: /Library/Developer/CommandLineTools/usr/bin
|
||||
# or
|
||||
# Debian clang version 3.2-7ubuntu1 (tags/RELEASE_32/final) (based on LLVM 3.2)
|
||||
# clang version 10.0.0-4ubuntu1
|
||||
# Target: x86_64-pc-linux-gnu
|
||||
# Thread model: posix
|
||||
# InstalledDir: /usr/bin
|
||||
# Target: x86_64-pc-linux-gnu
|
||||
# Thread model: posix
|
||||
# or
|
||||
# IBM Open XL C/C++ for AIX 17.1.0 (5725-C72, 5765-J18), clang version 13.0.0
|
||||
# Target: powerpc-ibm-aix7.2.0.0
|
||||
# Thread model: posix
|
||||
# InstalledDir: /opt/IBM/openxlC/17.1.0/bin
|
||||
COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1`
|
||||
# Check that this is likely to be clang
|
||||
$ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "clang" > /dev/null
|
||||
@@ -479,10 +407,12 @@ AC_DEFUN([TOOLCHAIN_EXTRACT_COMPILER_VERSION],
|
||||
AC_MSG_NOTICE([The result from running with --version was: "$COMPILER_VERSION_OUTPUT"])
|
||||
AC_MSG_ERROR([A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.])
|
||||
fi
|
||||
# Collapse compiler output into a single line
|
||||
COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT`
|
||||
# Remove "Thread model:" and further details from the version string, and
|
||||
# collapse into a single line
|
||||
COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \
|
||||
$SED -e 's/ *Thread model: .*//'`
|
||||
COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \
|
||||
$SED -e 's/^.* version \(@<:@1-9@:>@@<:@0-9.@:>@*\).*$/\1/'`
|
||||
$SED -e 's/^.*clang version \(@<:@1-9@:>@@<:@0-9.@:>@*\).*$/\1/'`
|
||||
else
|
||||
AC_MSG_ERROR([Unknown toolchain type $TOOLCHAIN_TYPE.])
|
||||
fi
|
||||
@@ -575,10 +505,7 @@ AC_DEFUN([TOOLCHAIN_EXTRACT_LD_VERSION],
|
||||
LINKER=[$]$1
|
||||
LINKER_NAME="$2"
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
LINKER_VERSION_STRING="Unknown"
|
||||
LINKER_VERSION_NUMBER="0.0"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
if 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
|
||||
@@ -732,11 +659,10 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_CORE],
|
||||
AC_SUBST(AS)
|
||||
|
||||
#
|
||||
# Setup the archiver (AR)
|
||||
# Setup tools for creating static libraries (AR/LIB)
|
||||
#
|
||||
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
# The corresponding ar tool is lib.exe (used to create static libraries)
|
||||
UTIL_LOOKUP_TOOLCHAIN_PROGS(AR, lib)
|
||||
UTIL_LOOKUP_TOOLCHAIN_PROGS(LIB, lib)
|
||||
elif test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
UTIL_LOOKUP_TOOLCHAIN_PROGS(AR, ar gcc-ar)
|
||||
else
|
||||
@@ -1001,6 +927,14 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS],
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
# Make sure we have the Open XL version of clang on AIX
|
||||
|
||||
$ECHO "$CC_VERSION_STRING" | $GREP "IBM Open XL C/C++ for AIX" > /dev/null
|
||||
if test $? -ne 0; then
|
||||
AC_MSG_ERROR([ibm-clang_r version output check failed, output: $CC_VERSION_OUTPUT])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
# Check if linker has -z noexecstack.
|
||||
@@ -1011,11 +945,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS],
|
||||
# Setup hotspot lecagy names for toolchains
|
||||
HOTSPOT_TOOLCHAIN_TYPE=$TOOLCHAIN_TYPE
|
||||
if test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
HOTSPOT_TOOLCHAIN_TYPE=xlc
|
||||
else
|
||||
HOTSPOT_TOOLCHAIN_TYPE=gcc
|
||||
fi
|
||||
HOTSPOT_TOOLCHAIN_TYPE=gcc
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
HOTSPOT_TOOLCHAIN_TYPE=visCPP
|
||||
fi
|
||||
|
||||
303
make/common/FileUtils.gmk
Normal file
303
make/common/FileUtils.gmk
Normal file
@@ -0,0 +1,303 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, 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.
|
||||
#
|
||||
|
||||
ifeq (,$(_MAKEBASE_GMK))
|
||||
$(error You must include MakeBase.gmk prior to including FileUtils.gmk)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Common file utility functions
|
||||
#
|
||||
################################################################################
|
||||
|
||||
################################################################################
|
||||
# Replace question marks with space in string. This macro needs to be called on
|
||||
# files from FindFiles in case any of them contains space in their file name,
|
||||
# since FindFiles replaces space with ?.
|
||||
# Param 1 - String to replace in
|
||||
DecodeSpace = \
|
||||
$(subst ?,$(SPACE),$(strip $1))
|
||||
|
||||
EncodeSpace = \
|
||||
$(subst $(SPACE),?,$(strip $1))
|
||||
|
||||
################################################################################
|
||||
# Take two paths and return the path of the last common directory.
|
||||
# Ex: /foo/bar/baz, /foo/bar/banan -> /foo/bar
|
||||
# foo/bar/baz, /foo/bar -> <empty>
|
||||
#
|
||||
# The x prefix is used to preserve the presence of the initial slash
|
||||
# On Windows paths are treated as case-insensitive
|
||||
#
|
||||
# $1 - Path to compare
|
||||
# $2 - Other path to compare
|
||||
FindCommonPathPrefix = \
|
||||
$(call DecodeSpace,$(patsubst x%,%,$(subst $(SPACE),/,$(strip \
|
||||
$(call FindCommonPathPrefixHelper1, \
|
||||
$(subst /,$(SPACE),x$(call EncodeSpace,$(strip $1))), \
|
||||
$(subst /,$(SPACE),x$(call EncodeSpace,$(strip $2)))) \
|
||||
))))
|
||||
|
||||
FindCommonPathPrefixHelper1 = \
|
||||
$(if $(filter $(OPENJDK_TARGET_OS), windows), \
|
||||
$(call FindCommonPathPrefixHelper2,$(call uppercase,$1),$(call uppercase,$2),$1), \
|
||||
$(call FindCommonPathPrefixHelper2,$1,$2,$1))
|
||||
|
||||
FindCommonPathPrefixHelper2 = \
|
||||
$(if $(call equals, $(firstword $1), $(firstword $2)), \
|
||||
$(if $(call equals, $(firstword $1),),, \
|
||||
$(firstword $3) \
|
||||
$(call FindCommonPathPrefixHelper2, \
|
||||
$(wordlist 2, $(words $1), $1), \
|
||||
$(wordlist 2, $(words $2), $2), \
|
||||
$(wordlist 2, $(words $3), $3) \
|
||||
) \
|
||||
) \
|
||||
)
|
||||
|
||||
# Computes the relative path from a directory to a file
|
||||
# $1 - File to compute the relative path to
|
||||
# $2 - Directory to compute the relative path from
|
||||
RelativePath = \
|
||||
$(call DecodeSpace,$(strip $(call RelativePathHelper,$(call EncodeSpace \
|
||||
,$(strip $1)),$(call EncodeSpace \
|
||||
,$(strip $2)),$(call EncodeSpace \
|
||||
,$(call FindCommonPathPrefix,$1,$2)))))
|
||||
|
||||
RelativePathHelper = \
|
||||
$(eval $3_prefix_length := $(words $(subst /,$(SPACE),$3))) \
|
||||
$(eval $1_words := $(subst /,$(SPACE),$1)) \
|
||||
$(eval $2_words := $(subst /,$(SPACE),$2)) \
|
||||
$(if $(call equals,$($3_prefix_length),0),, \
|
||||
$(eval $1_words := $(wordlist 2,$(words $($1_words)),$(wordlist \
|
||||
$($3_prefix_length),$(words $($1_words)),$($1_words)))) \
|
||||
$(eval $2_words := $(wordlist 2,$(words $($2_words)),$(wordlist \
|
||||
$($3_prefix_length),$(words $($2_words)),$($2_words)))) \
|
||||
) \
|
||||
$(eval $1_suffix := $(subst $(SPACE),/,$($1_words))) \
|
||||
$(eval $2_dotdots := $(subst $(SPACE),/,$(foreach d,$($2_words),..))) \
|
||||
$(if $($1_suffix), \
|
||||
$(if $($2_dotdots), $($2_dotdots)/$($1_suffix), $($1_suffix)), \
|
||||
$(if $($2_dotdots), $($2_dotdots), .))
|
||||
|
||||
# Make directory for target file. Should handle spaces in filenames. Just
|
||||
# calling $(call MakeDir $(@D)) will not work if the directory contains a space
|
||||
# and the target file already exists. In that case, the target file will have
|
||||
# its wildcard ? resolved and the $(@D) will evaluate each space separated dir
|
||||
# part on its own.
|
||||
MakeTargetDir = \
|
||||
$(call MakeDir, $(dir $(call EncodeSpace, $@)))
|
||||
|
||||
################################################################################
|
||||
# All install-file and related macros automatically call DecodeSpace when needed.
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
# On mac, extended attributes sometimes creep into the source files, which may later
|
||||
# cause the creation of ._* files which confuses testing. Clear these with xattr if
|
||||
# set. Some files get their write permissions removed after being copied to the
|
||||
# output dir. When these are copied again to images, xattr would fail. By only clearing
|
||||
# attributes when they are present, failing on this is avoided.
|
||||
#
|
||||
# If copying a soft link to a directory, need to delete the target first to avoid
|
||||
# weird errors.
|
||||
define install-file
|
||||
$(call MakeTargetDir)
|
||||
$(RM) '$(call DecodeSpace, $@)'
|
||||
# Work around a weirdness with cp on Macosx. When copying a symlink, if
|
||||
# the target of the link is write protected (e.g. 444), cp will add
|
||||
# write permission for the user on the target file (644). Avoid this by
|
||||
# using ln to create a new link instead.
|
||||
if [ -h '$(call DecodeSpace, $<)' ]; then \
|
||||
$(LN) -s "`$(READLINK) '$(call DecodeSpace, $<)'`" '$(call DecodeSpace, $@)'; \
|
||||
else \
|
||||
$(CP) -fRP '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'; \
|
||||
fi
|
||||
if [ -n "`$(XATTR) -ls '$(call DecodeSpace, $@)'`" ]; then \
|
||||
$(XATTR) -cs '$(call DecodeSpace, $@)'; \
|
||||
fi
|
||||
endef
|
||||
else
|
||||
define install-file
|
||||
$(call MakeTargetDir)
|
||||
$(CP) -fP '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
|
||||
endef
|
||||
endif
|
||||
|
||||
# Variant of install file that does not preserve symlinks
|
||||
define install-file-nolink
|
||||
$(call MakeTargetDir)
|
||||
$(CP) -f '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
# link-file-* works similarly to install-file but creates a symlink instead.
|
||||
# There are two versions, either creating a relative or an absolute link. Be
|
||||
# careful when using this on Windows since the symlink created is only valid in
|
||||
# the unix emulation environment.
|
||||
# In msys2 we use mklink /J because its ln would perform a deep copy of the target.
|
||||
# This inhibits performance and can lead to issues with long paths. With mklink /J
|
||||
# relative linking does not work, so we handle the link as absolute path.
|
||||
ifeq ($(OPENJDK_BUILD_OS_ENV), windows.msys2)
|
||||
define link-file-relative
|
||||
$(call MakeTargetDir)
|
||||
$(RM) '$(call DecodeSpace, $@)'
|
||||
cmd //c "mklink /J $(call FixPath, $(call DecodeSpace, $@)) $(call FixPath, $(call DecodeSpace, $<))"
|
||||
endef
|
||||
else
|
||||
define link-file-relative
|
||||
$(call MakeTargetDir)
|
||||
$(RM) '$(call DecodeSpace, $@)'
|
||||
$(LN) -s '$(call DecodeSpace, $(call RelativePath, $<, $(@D)))' '$(call DecodeSpace, $@)'
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(OPENJDK_BUILD_OS_ENV), windows.msys2)
|
||||
define link-file-absolute
|
||||
$(call MakeTargetDir)
|
||||
$(RM) '$(call DecodeSpace, $@)'
|
||||
cmd //c "mklink /J $(call FixPath, $(call DecodeSpace, $@)) $(call FixPath, $(call DecodeSpace, $<))"
|
||||
endef
|
||||
else
|
||||
define link-file-absolute
|
||||
$(call MakeTargetDir)
|
||||
$(RM) '$(call DecodeSpace, $@)'
|
||||
$(LN) -s '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
|
||||
endef
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
# Recursive wildcard function. Walks down directories recursively and matches
|
||||
# files with the search patterns. Patterns use standard file wildcards (* and
|
||||
# ?).
|
||||
#
|
||||
# $1 - Directories to start search in
|
||||
# $2 - Search patterns
|
||||
rwildcard = \
|
||||
$(strip \
|
||||
$(foreach d, \
|
||||
$(patsubst %/,%,$(sort $(dir $(wildcard $(addsuffix /*/*, $(strip $1)))))), \
|
||||
$(call rwildcard,$d,$2) \
|
||||
) \
|
||||
$(call DoubleDollar, $(wildcard $(foreach p, $2, $(addsuffix /$(strip $p), $(strip $1))))) \
|
||||
)
|
||||
|
||||
# Find non directories using recursive wildcard function. This function may
|
||||
# be used directly when a small amount of directories is expected to be
|
||||
# searched and caching is not expected to be of use.
|
||||
#
|
||||
# $1 - Directory to start search in
|
||||
# $2 - Optional search patterns, defaults to '*'.
|
||||
WildcardFindFiles = \
|
||||
$(sort $(strip \
|
||||
$(eval WildcardFindFiles_result := $(call rwildcard,$(patsubst %/,%,$1),$(if $(strip $2),$2,*))) \
|
||||
$(filter-out $(patsubst %/,%,$(sort $(dir $(WildcardFindFiles_result)))), \
|
||||
$(WildcardFindFiles_result) \
|
||||
) \
|
||||
))
|
||||
|
||||
# Find non directories using the find utility in the shell. Safe to call for
|
||||
# non existing directories, or directories containing wildcards.
|
||||
#
|
||||
# Files containing space will get spaces replaced with ? because GNU Make
|
||||
# cannot handle lists of files with space in them. By using ?, make will match
|
||||
# the wildcard to space in many situations so we don't need to replace back
|
||||
# to space on every use. While not a complete solution it does allow some uses
|
||||
# of FindFiles to function with spaces in file names, including for
|
||||
# SetupCopyFiles. Unfortunately this does not work for WildcardFindFiles so
|
||||
# if files with spaces are anticipated, use ShellFindFiles directly.
|
||||
#
|
||||
# $1 - Directories to start search in.
|
||||
# $2 - Optional search patterns, empty means find everything. Patterns use
|
||||
# standard file wildcards (* and ?) and should not be quoted.
|
||||
# $3 - Optional options to find.
|
||||
ShellFindFiles = \
|
||||
$(if $(wildcard $1), \
|
||||
$(sort \
|
||||
$(shell $(FIND) $3 $(patsubst %/,%,$(wildcard $1)) \( -type f -o -type l \) \
|
||||
$(if $(strip $2), -a \( -name "$(firstword $2)" \
|
||||
$(foreach p, $(filter-out $(firstword $2), $2), -o -name "$(p)") \)) \
|
||||
| $(TR) ' ' '?' \
|
||||
) \
|
||||
) \
|
||||
)
|
||||
|
||||
# Find non directories using the method most likely to work best for the
|
||||
# current build host
|
||||
#
|
||||
# $1 - Directory to start search in
|
||||
# $2 - Optional search patterns, defaults to '*'.
|
||||
ifeq ($(OPENJDK_BUILD_OS)-$(RWILDCARD_WORKS), windows-true)
|
||||
DirectFindFiles = $(WildcardFindFiles)
|
||||
else
|
||||
DirectFindFiles = $(ShellFindFiles)
|
||||
endif
|
||||
|
||||
# Finds files using a cache that is populated by FillFindCache below. If any of
|
||||
# the directories given have not been cached, DirectFindFiles is used for
|
||||
# everything. Caching is especially useful in Cygwin, where file finds are very
|
||||
# costly.
|
||||
#
|
||||
# $1 - Directories to start search in.
|
||||
# $2 - Optional search patterns. If used, no caching is done.
|
||||
CacheFindFiles_CACHED_DIRS :=
|
||||
CacheFindFiles_CACHED_FILES :=
|
||||
CacheFindFiles = \
|
||||
$(if $2, \
|
||||
$(call DirectFindFiles, $1, $2) \
|
||||
, \
|
||||
$(if $(filter-out $(addsuffix /%, $(CacheFindFiles_CACHED_DIRS)) \
|
||||
$(CacheFindFiles_CACHED_DIRS), $1), \
|
||||
$(call DirectFindFiles, $1) \
|
||||
, \
|
||||
$(filter $(addsuffix /%,$(patsubst %/,%,$1)) $1,$(CacheFindFiles_CACHED_FILES)) \
|
||||
) \
|
||||
)
|
||||
|
||||
# Explicitly adds files to the find cache used by CacheFindFiles.
|
||||
#
|
||||
# $1 - Directories to start search in
|
||||
FillFindCache = \
|
||||
$(eval CacheFindFiles_NEW_DIRS := $$(filter-out $$(addsuffix /%,\
|
||||
$$(CacheFindFiles_CACHED_DIRS)) $$(CacheFindFiles_CACHED_DIRS), $1)) \
|
||||
$(if $(CacheFindFiles_NEW_DIRS), \
|
||||
$(eval CacheFindFiles_CACHED_DIRS += $$(patsubst %/,%,$$(CacheFindFiles_NEW_DIRS))) \
|
||||
$(eval CacheFindFiles_CACHED_FILES := $$(sort $$(CacheFindFiles_CACHED_FILES) \
|
||||
$$(call DirectFindFiles, $$(CacheFindFiles_NEW_DIRS)))) \
|
||||
)
|
||||
|
||||
# Findfiles is the default macro that should be used to find files in the file
|
||||
# system. This function does not always support files with spaces in the names.
|
||||
# If files with spaces are anticipated, use ShellFindFiles directly.
|
||||
#
|
||||
# $1 - Directories to start search in.
|
||||
# $2 - Optional search patterns, empty means find everything. Patterns use
|
||||
# standard file wildcards (* and ?) and should not be quoted.
|
||||
ifeq ($(DISABLE_CACHE_FIND), true)
|
||||
FindFiles = $(DirectFindFiles)
|
||||
else
|
||||
FindFiles = $(CacheFindFiles)
|
||||
endif
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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,8 @@ ifeq (,$(_MAKEBASE_GMK))
|
||||
$(error You must include MakeBase.gmk prior to including JarArchive.gmk)
|
||||
endif
|
||||
|
||||
include MakeIO.gmk
|
||||
|
||||
FALSE_FIND_PATTERN:=-name FILE_NAME_THAT_DOESNT_EXIST
|
||||
|
||||
# Setup make rules for creating a jar archive.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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,8 @@ ifeq (,$(_MAKEBASE_GMK))
|
||||
$(error You must include MakeBase.gmk prior to including JavaCompilation.gmk)
|
||||
endif
|
||||
|
||||
include MakeIO.gmk
|
||||
|
||||
# Java compilation needs SetupJarArchive and/or SetupZipArchive, if we're
|
||||
# generating a jar file or a source zip.
|
||||
include JarArchive.gmk
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2018, 2024, 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,6 @@ include NativeCompilation.gmk
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, common/JdkNativeCompilation.gmk))
|
||||
|
||||
FindSrcDirsForLib += \
|
||||
$(call uniq, $(wildcard \
|
||||
$(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/lib$(strip $2) \
|
||||
$(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS_TYPE)/native/lib$(strip $2) \
|
||||
$(TOPDIR)/src/$(strip $1)/share/native/lib$(strip $2)))
|
||||
|
||||
FindSrcDirsForComponent += \
|
||||
$(call uniq, $(wildcard \
|
||||
$(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/$(strip $2) \
|
||||
@@ -82,18 +76,163 @@ endif
|
||||
GetJavaHeaderDir = \
|
||||
$(if $(strip $1),$(wildcard $(SUPPORT_OUTPUTDIR)/headers/$(strip $1)))
|
||||
|
||||
# Process a dir description such as "java.base:headers" into a set of proper absolute paths.
|
||||
ProcessDir = \
|
||||
HOTSPOT_INCLUDE_DIR := $(TOPDIR)/src/hotspot/share/include \
|
||||
$(TOPDIR)/src/hotspot/os/$(HOTSPOT_TARGET_OS_TYPE)/include
|
||||
|
||||
# Preprocess a source dir destination. Pass on absolute paths unchanged. Expand
|
||||
# description such as "java.base:headers" into a set of proper absolute paths,
|
||||
# by looking in $MODULE/[shared|$OS|$OSTYPE]/native.
|
||||
# Treat *:libjvm as a special case, and replace it with the proper hotspot
|
||||
# include directories.
|
||||
ProcessSrcDir = \
|
||||
$(if $(findstring :, $1), \
|
||||
$(call FindSrcDirsForComponent, $(firstword $(subst :, , $1)), $(lastword $(subst :, , $1))) \
|
||||
$(if $(filter %:libjvm, $1), \
|
||||
$(HOTSPOT_INCLUDE_DIR) \
|
||||
, \
|
||||
$(call FindSrcDirsForComponent, $(firstword $(subst :, , $1)), \
|
||||
$(lastword $(subst :, , $1))) \
|
||||
) \
|
||||
, \
|
||||
$(if $(filter /%, $1), \
|
||||
$1 \
|
||||
, \
|
||||
$(call FindSrcDirsForComponent, $(MODULE), $1) \
|
||||
$(if $(filter libjvm, $1), \
|
||||
$(HOTSPOT_INCLUDE_DIR) \
|
||||
, \
|
||||
$(call FindSrcDirsForComponent, $(MODULE), $1) \
|
||||
) \
|
||||
) \
|
||||
)
|
||||
|
||||
# Create a proper LIBPATH for the given library. Sets result in $1_$2_LIBPATH.
|
||||
# $1: The name of the rule (namespace)
|
||||
# $2: The safe namespace of the library
|
||||
define ResolveLibPath
|
||||
# Determine proper LIBPATH. This is quite messy due to historical reasons,
|
||||
# and because we need to have special treatment for "gtest:" and ":jvm".
|
||||
ifneq ($$($1_$2_MODULE), gtest)
|
||||
ifneq ($$($1_$2_NAME), jvm)
|
||||
# This is the common case
|
||||
ifeq ($$(call isTargetOs, windows), true)
|
||||
$1_$2_LIBPATH := $$(SUPPORT_OUTPUTDIR)/native/$$($1_$2_MODULE)/lib$$($1_$2_NAME)
|
||||
else
|
||||
ifeq ($(STATIC_LIBS), true)
|
||||
$1_$2_LIBPATH := $$(SUPPORT_OUTPUTDIR)/native/$$($1_$2_MODULE)/lib$$($1_$2_NAME)/static
|
||||
else ifeq ($$($1_$2_STATIC_LIBRARY), true)
|
||||
$1_$2_LIBPATH := $$(SUPPORT_OUTPUTDIR)/native/$$($1_$2_MODULE)
|
||||
else
|
||||
$1_$2_LIBPATH := $$(SUPPORT_OUTPUTDIR)/modules_libs/$$($1_$2_MODULE)
|
||||
endif
|
||||
endif
|
||||
else
|
||||
# Special treatment for hotspot
|
||||
ifeq ($(CREATING_BUILDJDK), true)
|
||||
# When building a buildjdk, it's always only the server variant
|
||||
$1_$2_JVM_VARIANT_PATH := server
|
||||
else
|
||||
$1_$2_JVM_VARIANT_PATH := $(JVM_VARIANT_MAIN)
|
||||
endif
|
||||
ifeq ($$(call isTargetOs, windows), true)
|
||||
ifeq ($(STATIC_LIBS), true)
|
||||
$1_$2_LIBPATH := $$(HOTSPOT_OUTPUTDIR)/variant-$$($1_$2_JVM_VARIANT_PATH)/libjvm/objs/static
|
||||
else
|
||||
$1_$2_LIBPATH := $$(SUPPORT_OUTPUTDIR)/modules_libs/$$($1_$2_MODULE)
|
||||
endif
|
||||
else
|
||||
ifeq ($(STATIC_LIBS), true)
|
||||
$1_$2_LIBPATH := $$(HOTSPOT_OUTPUTDIR)/variant-$$($1_$2_JVM_VARIANT_PATH)/libjvm/objs/static
|
||||
else
|
||||
$1_$2_LIBPATH := $$(SUPPORT_OUTPUTDIR)/modules_libs/$$($1_$2_MODULE)/$$($1_$2_JVM_VARIANT_PATH)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
else
|
||||
# Special treatment for virtual module "gtest"
|
||||
ifeq ($$($1_$2_NAME), jvm)
|
||||
ifeq ($$(call isTargetOs, windows), true)
|
||||
ifeq ($(STATIC_LIBS), true)
|
||||
$1_$2_LIBPATH := $$(JVM_OUTPUTDIR)/gtest/objs/static
|
||||
else
|
||||
$1_$2_LIBPATH := $$(JVM_OUTPUTDIR)/gtest/objs
|
||||
endif
|
||||
else
|
||||
ifeq ($(STATIC_LIBS), true)
|
||||
$1_$2_LIBPATH := $$(JVM_OUTPUTDIR)/gtest/objs/static
|
||||
else
|
||||
$1_$2_LIBPATH := $$(JVM_OUTPUTDIR)/gtest
|
||||
endif
|
||||
endif
|
||||
else ifeq ($$($1_$2_NAME), gtest)
|
||||
$1_$2_LIBPATH := $$(JVM_OUTPUTDIR)/libgtest
|
||||
ifeq ($(STATIC_LIBS), true)
|
||||
$1_$2_LIBPATH := $$(JVM_OUTPUTDIR)/libgtest/objs/static
|
||||
else
|
||||
$1_$2_LIBPATH := $$(JVM_OUTPUTDIR)/libgtest
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
# Process a JDK library designation such as "java.desktop:jawt" into the needed
|
||||
# additions to EXTRA_LINK_DEPS, LDFLAGS, LIBS and EXTRA_HEADER_DIRS.
|
||||
# $1: The name of the rule (namespace)
|
||||
# $2: The safe namespace of the library
|
||||
# $3: The actual string given to represent the library
|
||||
define AddJdkLibrary
|
||||
$1_$2_NAME := $$(strip $$(lastword $$(subst :, , $3)))
|
||||
$1_$2_MODULE := $$(strip $$(patsubst %$$($1_$2_NAME), %, $3))
|
||||
|
||||
ifeq ($$(filter lib%, $$($1_$2_NAME)),)
|
||||
$$(error Library name $$($1_$2_NAME) missing lib prefix in $1)
|
||||
endif
|
||||
$1_$2_NAME := $$(strip $$(patsubst lib%, %, $$($1_$2_NAME)))
|
||||
|
||||
ifeq ($$($1_$2_MODULE),)
|
||||
$1_$2_MODULE := $$(MODULE)
|
||||
else
|
||||
$1_$2_MODULE := $$(strip $$(patsubst %:, %, $$($1_$2_MODULE)))
|
||||
endif
|
||||
|
||||
# Determine if the library in question is static.
|
||||
ifeq ($(STATIC_BUILD), true)
|
||||
$1_$2_STATIC_LIBRARY := true
|
||||
endif
|
||||
# Ideally, we should not hardcode these
|
||||
ifeq ($(call isTargetOs, aix)+$$($1_$2_MODULE):$$($1_$2_NAME), true+java.base:jli)
|
||||
$1_$2_STATIC_LIBRARY := true
|
||||
endif
|
||||
ifeq ($$($1_$2_MODULE):$$($1_$2_NAME), gtest:gtest)
|
||||
$1_$2_STATIC_LIBRARY := true
|
||||
endif
|
||||
|
||||
# Setup $1_$2_LIBPATH.
|
||||
$$(eval $$(call ResolveLibPath,$1,$2))
|
||||
|
||||
$1_EXTRA_HEADER_DIRS += $$($1_$2_MODULE):lib$$($1_$2_NAME)
|
||||
|
||||
ifneq ($(STATIC_LIBS), true)
|
||||
ifeq ($$(call isTargetOs, windows), true)
|
||||
ifeq ($$(filter -libpath:$$($1_$2_LIBPATH), $$($1_LDFLAGS)), )
|
||||
$1_LDFLAGS += -libpath:$$($1_$2_LIBPATH)
|
||||
endif
|
||||
$1_LIBS += $$($1_$2_NAME)$(STATIC_LIBRARY_SUFFIX)
|
||||
$1_$2_LIBFILE := $(LIBRARY_PREFIX)$$($1_$2_NAME)$(STATIC_LIBRARY_SUFFIX)
|
||||
else
|
||||
ifeq ($$(filter -L$$($1_$2_LIBPATH), $$($1_LDFLAGS)), )
|
||||
$1_LDFLAGS += -L$$($1_$2_LIBPATH)
|
||||
endif
|
||||
$1_LIBS += -l$$($1_$2_NAME)
|
||||
ifeq ($$($1_$2_STATIC_LIBRARY), true)
|
||||
$1_$2_LIBFILE := $(LIBRARY_PREFIX)$$($1_$2_NAME)$(STATIC_LIBRARY_SUFFIX)
|
||||
else
|
||||
$1_$2_LIBFILE := $(LIBRARY_PREFIX)$$($1_$2_NAME)$(SHARED_LIBRARY_SUFFIX)
|
||||
endif
|
||||
endif
|
||||
|
||||
$1_EXTRA_LINK_DEPS += $$($1_$2_LIBPATH)/$$($1_$2_LIBFILE)
|
||||
endif
|
||||
endef
|
||||
|
||||
GLOBAL_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/common/version.rc
|
||||
|
||||
JDK_RCFLAGS=$(RCFLAGS) \
|
||||
@@ -104,29 +243,76 @@ JDK_RCFLAGS=$(RCFLAGS) \
|
||||
-D"JDK_NAME=$(JDK_RC_NAME) $(VERSION_SHORT)" \
|
||||
-D"JDK_FVER=$(subst .,$(COMMA),$(VERSION_NUMBER_FOUR_POSITIONS))"
|
||||
|
||||
# Setup make rules for creating a native shared library with suitable defaults
|
||||
# for the OpenJDK project.
|
||||
# Setup make rules for creating a native binary with suitable defaults
|
||||
# for the OpenJDK project. This macro is mostly considered to be an internal
|
||||
# support version. Please use SetupJdkLibrary or SetupJdkExecutable instead.
|
||||
#
|
||||
# Parameter 1 is the name of the rule. This name is used as variable prefix,
|
||||
# and the targets generated are listed in a variable by that name.
|
||||
#
|
||||
# Remaining parameters are named arguments. These are all passed on to
|
||||
# SetupNativeCompilation, except for
|
||||
# EXTRA_RCFLAGS -- additional RCFLAGS to append.
|
||||
# EXTRA_HEADER_DIRS -- additional directories to look for headers in
|
||||
# EXTRA_SRC -- additional directories to look for source in
|
||||
# SetupNativeCompilation. This macro also adds the following additional
|
||||
# arguments:
|
||||
#
|
||||
# SRC -- this is passed on after preprocessing. The preprocessing will pass on
|
||||
# absolute paths unchanged, but relative paths will be expanded to include
|
||||
# all directories with this name in $MODULE/[shared|$OS|$OSTYPE]/native.
|
||||
# EXTRA_SRC -- additional directories to look for source in. This is processed
|
||||
# like SRC.
|
||||
# EXCLUDE_SRC_PATTERNS -- exclude source dirs matching these patterns from
|
||||
# appearing in SRC.
|
||||
# EXTRA_HEADER_DIRS -- additional directories to look for headers in. This can
|
||||
# be specified either as an absolute path, or relative directory names which
|
||||
# are preprocessed like SRC, or in the format <module>:<directory>, which
|
||||
# will be processed like SRC but for the given module. The names
|
||||
# "java.base:libjvm" and "gtest:libjvm" symbolise virtual libraries that
|
||||
# will be replaced with proper values for hotspot.
|
||||
# HEADERS_FROM_SRC -- if false, does not add source dirs automatically as
|
||||
# header include dirs. (Defaults to true.)
|
||||
# SRC -- this is passed on, but preprocessed to accept source dir designations
|
||||
# JDK_LIBS -- libraries generated by the JDK build system to link against.
|
||||
# These take the form <module>:<basename>. For the current module, the
|
||||
# module name and colon can be omitted. The basename should be specified
|
||||
# as the source directory, e.g. "libjava". The gtest module is a virtual
|
||||
# module that will be replaced with correct values for gtest. When
|
||||
# specifying JDK_LIBS, suitable values for EXTRA_LINK_DEPS, LDFLAGS, LIBS
|
||||
# and EXTRA_HEADER_DIRS will be added.
|
||||
# JDK_LIBS_<os> or JDK_LIBS_<osType> -- additional JDK_LIBS for the given OS
|
||||
# or OS type only
|
||||
# EXTRA_RCFLAGS -- additional RCFLAGS to append.
|
||||
# RC_FILEDESC -- override the default FILEDESC for Windows version.rc
|
||||
# such as "java.base:headers".
|
||||
SetupJdkLibrary = $(NamedParamsMacroTemplate)
|
||||
define SetupJdkLibraryBody
|
||||
# DEFAULT_LIBCXX -- if false, do not add LIBCXX to LIBS for C++ compilations
|
||||
# DEFAULT_CFLAGS -- if false, do not add default CFLAGS and CXXFLAGS
|
||||
# DEFAULT_LDFLAGS -- if false, do not add default LDFLAGS
|
||||
# CFLAGS_FILTER_OUT -- flags to filter out from default CFLAGS
|
||||
# CXXFLAGS_FILTER_OUT -- flags to filter out from default CXXFLAGS
|
||||
# LDFLAGS_FILTER_OUT -- flags to filter out from default LDFLAGS
|
||||
# LD_SET_ORIGIN -- if false, do not add SET_*_ORIGIN flags to LDFLAGS
|
||||
# APPEND_LDFLAGS -- a quirk to have additional LDFLAGS that will be set after
|
||||
# the origin flags
|
||||
# DEFAULT_VERSIONINFO_RESOURCE -- if false, do not set the default
|
||||
# VERSIONINFO_RESOURCE
|
||||
#
|
||||
SetupJdkNativeCompilation = $(NamedParamsMacroTemplate)
|
||||
define SetupJdkNativeCompilationBody
|
||||
ifeq ($$($1_TYPE), EXECUTABLE)
|
||||
$1_NATIVE_DIR_PREFIX :=
|
||||
$1_MODULES_PATH := modules_cmds
|
||||
$1_RC_EXT := exe
|
||||
$1_RC_FTYPE := 0x1L
|
||||
else
|
||||
$1_NATIVE_DIR_PREFIX := lib
|
||||
$1_MODULES_PATH := modules_libs
|
||||
$1_RC_EXT := dll
|
||||
$1_RC_FTYPE := 0x2L
|
||||
endif
|
||||
|
||||
ifeq ($$($1_OUTPUT_DIR), )
|
||||
ifneq ($$(MODULE), )
|
||||
$1_OUTPUT_DIR := $$(call FindLibDirForModule, $$(MODULE))
|
||||
ifeq ($$($1_TYPE), STATIC_LIBRARY)
|
||||
$1_OUTPUT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)
|
||||
else
|
||||
$1_OUTPUT_DIR := $$(SUPPORT_OUTPUTDIR)/$$($1_MODULES_PATH)/$$(strip $$(MODULE))
|
||||
endif
|
||||
else
|
||||
$$(error Must specify OUTPUT_DIR in a MODULE free context)
|
||||
endif
|
||||
@@ -134,23 +320,31 @@ define SetupJdkLibraryBody
|
||||
|
||||
ifeq ($$($1_OBJECT_DIR), )
|
||||
ifneq ($$(MODULE), )
|
||||
$1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/lib$$($1_NAME)
|
||||
$1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/$$($1_NATIVE_DIR_PREFIX)$$($1_NAME)
|
||||
else
|
||||
$$(error Must specify OBJECT_DIR in a MODULE free context)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($$($1_DEFAULT_LIBCXX), false)
|
||||
ifeq ($$($1_LINK_TYPE), C++)
|
||||
$1_LIBS += $(LIBCXX)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($$($1_SRC), )
|
||||
ifneq ($$(MODULE), )
|
||||
$1_SRC := $$(call FindSrcDirsForLib, $$(MODULE), $$($1_NAME))
|
||||
$1_SRC := $$(call FindSrcDirsForComponent, $$(MODULE), $$($1_NATIVE_DIR_PREFIX)$$($1_NAME))
|
||||
else
|
||||
$$(error Must specify SRC in a MODULE free context)
|
||||
ifeq ($$($1_EXTRA_FILES), )
|
||||
$$(error Must specify SRC or EXTRA_FILES in a MODULE free context)
|
||||
endif
|
||||
endif
|
||||
else
|
||||
$1_SRC := $$(foreach dir, $$($1_SRC), $$(call ProcessDir, $$(dir)))
|
||||
$1_SRC := $$(foreach dir, $$($1_SRC), $$(call ProcessSrcDir, $$(dir)))
|
||||
endif
|
||||
ifneq ($$($1_EXTRA_SRC), )
|
||||
$1_SRC += $$(foreach dir, $$($1_EXTRA_SRC), $$(call ProcessDir, $$(dir)))
|
||||
$1_SRC += $$(foreach dir, $$($1_EXTRA_SRC), $$(call ProcessSrcDir, $$(dir)))
|
||||
endif
|
||||
|
||||
ifneq ($$($1_EXCLUDE_SRC_PATTERNS), )
|
||||
@@ -160,19 +354,20 @@ define SetupJdkLibraryBody
|
||||
$1_SRC := $$(filter-out $$($1_EXCLUDE_SRC), $$($1_SRC))
|
||||
endif
|
||||
|
||||
ifeq ($$($1_VERSIONINFO_RESOURCE), )
|
||||
$1_VERSIONINFO_RESOURCE := $$(GLOBAL_VERSION_INFO_RESOURCE)
|
||||
ifneq ($$($1_DEFAULT_VERSIONINFO_RESOURCE), false)
|
||||
ifeq ($$($1_VERSIONINFO_RESOURCE), )
|
||||
$1_VERSIONINFO_RESOURCE := $$(GLOBAL_VERSION_INFO_RESOURCE)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($$($1_RC_FILEDESC), )
|
||||
$1_RC_FILEDESC := $(JDK_RC_NAME) binary
|
||||
endif
|
||||
|
||||
$1_RCFLAGS := $(JDK_RCFLAGS) \
|
||||
-D"JDK_FILEDESC=$$(strip $$($1_RC_FILEDESC))" \
|
||||
-D"JDK_FNAME=$$($1_NAME).dll" \
|
||||
-D"JDK_FILEDESC=$$($1_RC_FILEDESC)" \
|
||||
-D"JDK_FNAME=$$($1_NAME).$$($1_RC_EXT)" \
|
||||
-D"JDK_INTERNAL_NAME=$$($1_NAME)" \
|
||||
-D"JDK_FTYPE=0x2L" \
|
||||
-D"JDK_FTYPE=$$($1_RC_FTYPE)" \
|
||||
-I$(TOPDIR)/src/java.base/windows/native/common \
|
||||
$$($1_EXTRA_RCFLAGS)
|
||||
|
||||
@@ -181,12 +376,40 @@ define SetupJdkLibraryBody
|
||||
endif
|
||||
|
||||
# Add the module specific java header dir
|
||||
$1_SRC_HEADER_FLAGS += $$(addprefix -I, $$(call GetJavaHeaderDir, $$(MODULE)))
|
||||
ifneq ($$(MODULE), )
|
||||
$1_SRC_HEADER_FLAGS += $$(addprefix -I, $$(call GetJavaHeaderDir, $$(MODULE)))
|
||||
endif
|
||||
|
||||
ifneq ($$($1_EXTRA_HEADER_DIRS), )
|
||||
$1_PROCESSED_EXTRA_HEADER_DIRS := $$(foreach dir, $$($1_EXTRA_HEADER_DIRS), \
|
||||
$$(call ProcessDir, $$(dir)))
|
||||
$1_EXTRA_HEADER_FLAGS := $$(addprefix -I, $$($1_PROCESSED_EXTRA_HEADER_DIRS))
|
||||
$1_JDK_LIBS += $$($1_JDK_LIBS_$$(OPENJDK_TARGET_OS))
|
||||
$1_JDK_LIBS += $$($1_JDK_LIBS_$$(OPENJDK_TARGET_OS_TYPE))
|
||||
$$(foreach lib, $$($1_JDK_LIBS), \
|
||||
$$(eval $$(call AddJdkLibrary,$1,$$(subst :,_,$$(lib)),$$(lib))) \
|
||||
)
|
||||
|
||||
# Add the include path for jni.h to all native compilations
|
||||
$1_EXTRA_HEADER_DIRS += \
|
||||
$(SUPPORT_OUTPUTDIR)/modules_include/java.base \
|
||||
java.base:include \
|
||||
#
|
||||
|
||||
$1_PROCESSED_EXTRA_HEADER_DIRS := $$(foreach dir, $$($1_EXTRA_HEADER_DIRS), \
|
||||
$$(call ProcessSrcDir, $$(dir)))
|
||||
$1_EXTRA_HEADER_FLAGS := $$(addprefix -I, $$($1_PROCESSED_EXTRA_HEADER_DIRS))
|
||||
|
||||
ifneq ($$($1_DEFAULT_CFLAGS), false)
|
||||
ifeq ($$($1_TYPE), EXECUTABLE)
|
||||
# Set the default flags first to be able to override
|
||||
$1_CFLAGS := $$(filter-out $$($1_CFLAGS_FILTER_OUT), $$(CFLAGS_JDKEXE)) $$($1_CFLAGS)
|
||||
|
||||
# Set the default flags first to be able to override
|
||||
$1_CXXFLAGS := $$(filter-out $$($1_CXXFLAGS_FILTER_OUT), $$(CXXFLAGS_JDKEXE)) $$($1_CXXFLAGS)
|
||||
else
|
||||
# Set the default flags first to be able to override
|
||||
$1_CFLAGS := $$(filter-out $$($1_CFLAGS_FILTER_OUT), $$(CFLAGS_JDKLIB)) $$($1_CFLAGS)
|
||||
|
||||
# Set the default flags first to be able to override
|
||||
$1_CXXFLAGS := $$(filter-out $$($1_CXXFLAGS_FILTER_OUT), $$(CXXFLAGS_JDKLIB)) $$($1_CXXFLAGS)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($$($1_CFLAGS), )
|
||||
@@ -199,55 +422,68 @@ define SetupJdkLibraryBody
|
||||
$1_CFLAGS += $$($1_SRC_HEADER_FLAGS) $$($1_EXTRA_HEADER_FLAGS)
|
||||
endif
|
||||
|
||||
# Since we reuse the rule name ($1), all our arguments will pass through.
|
||||
# We lose in transparency, but gain in brevity in this call...
|
||||
$$(eval $$(call SetupNativeCompilation, $1, ))
|
||||
endef
|
||||
|
||||
# Setup make rules for creating a native executable with suitable defaults for
|
||||
# the OpenJDK project.
|
||||
#
|
||||
# Parameter 1 is the name of the rule. This name is used as variable prefix,
|
||||
# and the targets generated are listed in a variable by that name.
|
||||
#
|
||||
# Remaining parameters are named arguments. These are all passed on to
|
||||
# SetupNativeCompilation, except for
|
||||
# EXTRA_RCFLAGS -- additional RCFLAGS to append.
|
||||
SetupJdkExecutable = $(NamedParamsMacroTemplate)
|
||||
define SetupJdkExecutableBody
|
||||
$1_TYPE := EXECUTABLE
|
||||
|
||||
ifeq ($$($1_OUTPUT_DIR), )
|
||||
ifneq ($$(MODULE), )
|
||||
$1_OUTPUT_DIR := $$(call FindExecutableDirForModule, $$(MODULE))
|
||||
ifneq ($$($1_DEFAULT_LDFLAGS), false)
|
||||
ifeq ($$($1_TYPE), EXECUTABLE)
|
||||
# Set the default flags first to be able to override
|
||||
$1_LDFLAGS := $$(filter-out $$($1_LDFLAGS_FILTER_OUT), $$(LDFLAGS_JDKEXE)) $$($1_LDFLAGS)
|
||||
else
|
||||
$$(error Must specify OUTPUT_DIR in a MODULE free context)
|
||||
# Set the default flags first to be able to override
|
||||
$1_LDFLAGS := $$(filter-out $$($1_LDFLAGS_FILTER_OUT), $$(LDFLAGS_JDKLIB)) $$($1_LDFLAGS)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($$($1_OBJECT_DIR), )
|
||||
ifneq ($$(MODULE), )
|
||||
$1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/$$($1_NAME)
|
||||
ifneq ($$($1_LD_SET_ORIGIN), false)
|
||||
ifeq ($$($1_TYPE), EXECUTABLE)
|
||||
$1_LDFLAGS += $$(call SET_EXECUTABLE_ORIGIN)
|
||||
else
|
||||
$$(error Must specify OBJECT_DIR in a MODULE free context)
|
||||
$1_LDFLAGS += $$(call SET_SHARED_LIBRARY_ORIGIN)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($$($1_VERSIONINFO_RESOURCE), )
|
||||
$1_VERSIONINFO_RESOURCE := $$(GLOBAL_VERSION_INFO_RESOURCE)
|
||||
endif
|
||||
|
||||
$1_RCFLAGS := $(JDK_RCFLAGS) \
|
||||
-D"JDK_FILEDESC=$(JDK_RC_NAME) binary" \
|
||||
-D"JDK_FNAME=$$($1_NAME).exe" \
|
||||
-D"JDK_INTERNAL_NAME=$$($1_NAME)" \
|
||||
-D"JDK_FTYPE=0x1L" \
|
||||
-I$(TOPDIR)/src/java.base/windows/native/common \
|
||||
$$($1_EXTRA_RCFLAGS)
|
||||
# APPEND_LDFLAGS, if it exists, must be set after the origin flags
|
||||
# This is a workaround to keep existing behavior
|
||||
$1_LDFLAGS += $$($1_APPEND_LDFLAGS)
|
||||
|
||||
# Since we reuse the rule name ($1), all our arguments will pass through.
|
||||
# We lose in transparency, but gain in brevity in this call...
|
||||
$$(eval $$(call SetupNativeCompilation, $1))
|
||||
endef
|
||||
|
||||
# Setup make rules for creating a native library with suitable defaults
|
||||
# for the OpenJDK project. The default is to create a shared library,
|
||||
# but by passing TYPE := STATIC_LIBARY, a static library can be created.
|
||||
#
|
||||
# Parameter 1 is the name of the rule. This name is used as variable prefix,
|
||||
# and the targets generated are listed in a variable by that name.
|
||||
#
|
||||
# Remaining parameters are named arguments. These are all passed on to
|
||||
# SetupJdkNativeCompilation. Please see that macro for details.
|
||||
SetupJdkLibrary = $(NamedParamsMacroTemplate)
|
||||
define SetupJdkLibraryBody
|
||||
# If type is unspecified, default to LIBRARY
|
||||
ifeq ($$($1_TYPE), )
|
||||
$1_TYPE := LIBRARY
|
||||
endif
|
||||
|
||||
# Since we reuse the rule name ($1), all our arguments will pass through.
|
||||
# We lose in transparency, but gain in brevity in this call...
|
||||
$$(eval $$(call SetupJdkNativeCompilation, $1))
|
||||
endef
|
||||
|
||||
# Setup make rules for creating a native executable with suitable defaults
|
||||
# for the OpenJDK project.
|
||||
#
|
||||
# Parameter 1 is the name of the rule. This name is used as variable prefix,
|
||||
# and the targets generated are listed in a variable by that name.
|
||||
#
|
||||
# Remaining parameters are named arguments. These are all passed on to
|
||||
# SetupJdkNativeCompilation. Please see that macro for details.
|
||||
SetupJdkExecutable = $(NamedParamsMacroTemplate)
|
||||
define SetupJdkExecutableBody
|
||||
$1_TYPE := EXECUTABLE
|
||||
|
||||
# Since we reuse the rule name ($1), all our arguments will pass through.
|
||||
# We lose in transparency, but gain in brevity in this call...
|
||||
$$(eval $$(call SetupJdkNativeCompilation, $1))
|
||||
endef
|
||||
|
||||
endif # _JDK_NATIVE_COMPILATION_GMK
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -24,9 +24,10 @@
|
||||
#
|
||||
|
||||
################################################################
|
||||
#
|
||||
# Setup common utility functions.
|
||||
#
|
||||
# MakeBase provides the core functionality needed and used by all makefiles. It
|
||||
# should be included by all makefiles. MakeBase provides essential
|
||||
# functionality for named parameter functions, variable dependency, tool
|
||||
# execution, logging and fixpath functionality.
|
||||
################################################################
|
||||
|
||||
ifndef _MAKEBASE_GMK
|
||||
@@ -64,9 +65,6 @@ define NEWLINE
|
||||
|
||||
endef
|
||||
|
||||
# Make sure we have a value (could be overridden on command line by caller)
|
||||
CREATING_BUILDJDK ?= false
|
||||
|
||||
# Certain features only work in newer version of GNU Make. The build will still
|
||||
# function in 3.81, but will be less performant.
|
||||
ifeq (4.0, $(firstword $(sort 4.0 $(MAKE_VERSION))))
|
||||
@@ -75,67 +73,16 @@ ifeq (4.0, $(firstword $(sort 4.0 $(MAKE_VERSION))))
|
||||
RWILDCARD_WORKS := true
|
||||
endif
|
||||
|
||||
|
||||
# For convenience, MakeBase.gmk continues to include these separate files, at
|
||||
# least for now.
|
||||
|
||||
# Utils.gmk must be included before FileUtils.gmk, since it uses some of the
|
||||
# basic utility functions there.
|
||||
include $(TOPDIR)/make/common/Utils.gmk
|
||||
include $(TOPDIR)/make/common/MakeIO.gmk
|
||||
include $(TOPDIR)/make/common/CopyFiles.gmk
|
||||
include $(TOPDIR)/make/common/FileUtils.gmk
|
||||
|
||||
################################################################################
|
||||
# Functions for timers
|
||||
################################################################################
|
||||
|
||||
# Store the build times in this directory.
|
||||
BUILDTIMESDIR=$(OUTPUTDIR)/make-support/build-times
|
||||
|
||||
# Record starting time for build of a sub repository.
|
||||
define RecordStartTime
|
||||
$(DATE) '+%Y %m %d %H %M %S' | $(AWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$(strip $1) && \
|
||||
$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_start_$(strip $1)_human_readable
|
||||
endef
|
||||
|
||||
# Record ending time and calculate the difference and store it in a
|
||||
# easy to read format. Handles builds that cross midnight. Expects
|
||||
# that a build will never take 24 hours or more.
|
||||
define RecordEndTime
|
||||
$(DATE) '+%Y %m %d %H %M %S' | $(AWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_end_$(strip $1)
|
||||
$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_end_$(strip $1)_human_readable
|
||||
$(ECHO) `$(CAT) $(BUILDTIMESDIR)/build_time_start_$(strip $1)` `$(CAT) $(BUILDTIMESDIR)/build_time_end_$(strip $1)` $1 | \
|
||||
$(AWK) '{ F=$$7; T=$$14; if (F > T) { T+=3600*24 }; D=T-F; H=int(D/3600); \
|
||||
M=int((D-H*3600)/60); S=D-H*3600-M*60; printf("%02d:%02d:%02d %s\n",H,M,S,$$15); }' \
|
||||
> $(BUILDTIMESDIR)/build_time_diff_$(strip $1)
|
||||
endef
|
||||
|
||||
# Hook to be called when starting to execute a top-level target
|
||||
define TargetEnter
|
||||
$(PRINTF) "## Starting $(patsubst %-only,%,$@)\n"
|
||||
$(call RecordStartTime,$(patsubst %-only,%,$@))
|
||||
endef
|
||||
|
||||
# Hook to be called when finish executing a top-level target
|
||||
define TargetExit
|
||||
$(call RecordEndTime,$(patsubst %-only,%,$@))
|
||||
$(PRINTF) "## Finished $(patsubst %-only,%,$@) (build time %s)\n\n" \
|
||||
"`$(CAT) $(BUILDTIMESDIR)/build_time_diff_$(patsubst %-only,%,$@) | $(CUT) -f 1 -d ' '`"
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
|
||||
# A file containing a way to uniquely identify the source code revision that
|
||||
# the build was created from
|
||||
SOURCE_REVISION_TRACKER := $(SUPPORT_OUTPUTDIR)/src-rev/source-revision-tracker
|
||||
|
||||
# Locate all sourcecode repositories included in the forest, as absolute paths
|
||||
FindAllReposAbs = \
|
||||
$(strip $(sort $(dir $(filter-out $(TOPDIR)/build/%, $(wildcard \
|
||||
$(addprefix $(TOPDIR)/, .git */.git */*/.git */*/*/.git */*/*/*/.git) \
|
||||
)))))
|
||||
|
||||
# Locate all sourcecode repositories included in the forest, as relative paths
|
||||
FindAllReposRel = \
|
||||
$(strip $(subst $(TOPDIR)/,.,$(patsubst $(TOPDIR)/%/, %, $(FindAllReposAbs))))
|
||||
# Make sure we have a value (could be overridden on command line by caller)
|
||||
CREATING_BUILDJDK ?= false
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -152,6 +99,10 @@ define SetupLogging
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($$(findstring $$(LOG_LEVEL), debug trace),)
|
||||
SHELL := $$(SHELL) -x
|
||||
endif
|
||||
|
||||
ifeq ($$(LOG_LEVEL), trace)
|
||||
SHELL_NO_RECURSE := $$(SHELL)
|
||||
# Shell redefinition trick inspired by http://www.cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make
|
||||
@@ -233,224 +184,6 @@ define NamedParamsMacroTemplate
|
||||
$(call $(0)Body,$(strip $1))
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
# Make directory without forking mkdir if not needed.
|
||||
#
|
||||
# If a directory with an encoded space is provided, the wildcard function
|
||||
# sometimes returns false answers (typically if the dir existed when the
|
||||
# makefile was parsed, but was deleted by a previous rule). In that case, always
|
||||
# call mkdir regardless of what wildcard says.
|
||||
#
|
||||
# 1: List of directories to create
|
||||
MakeDir = \
|
||||
$(strip \
|
||||
$(eval MakeDir_dirs_to_make := $(strip $(foreach d, $1, \
|
||||
$(if $(findstring ?, $d), '$(call DecodeSpace, $d)', \
|
||||
$(if $(wildcard $d), , $d) \
|
||||
) \
|
||||
))) \
|
||||
$(if $(MakeDir_dirs_to_make), $(shell $(MKDIR) -p $(MakeDir_dirs_to_make))) \
|
||||
)
|
||||
|
||||
# Make directory for target file. Should handle spaces in filenames. Just
|
||||
# calling $(call MakeDir $(@D)) will not work if the directory contains a space
|
||||
# and the target file already exists. In that case, the target file will have
|
||||
# its wildcard ? resolved and the $(@D) will evaluate each space separated dir
|
||||
# part on its own.
|
||||
MakeTargetDir = \
|
||||
$(call MakeDir, $(dir $(call EncodeSpace, $@)))
|
||||
|
||||
################################################################################
|
||||
# All install-file and related macros automatically call DecodeSpace when needed.
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
# On mac, extended attributes sometimes creep into the source files, which may later
|
||||
# cause the creation of ._* files which confuses testing. Clear these with xattr if
|
||||
# set. Some files get their write permissions removed after being copied to the
|
||||
# output dir. When these are copied again to images, xattr would fail. By only clearing
|
||||
# attributes when they are present, failing on this is avoided.
|
||||
#
|
||||
# If copying a soft link to a directory, need to delete the target first to avoid
|
||||
# weird errors.
|
||||
define install-file
|
||||
$(call MakeTargetDir)
|
||||
$(RM) '$(call DecodeSpace, $@)'
|
||||
# Work around a weirdness with cp on Macosx. When copying a symlink, if
|
||||
# the target of the link is write protected (e.g. 444), cp will add
|
||||
# write permission for the user on the target file (644). Avoid this by
|
||||
# using ln to create a new link instead.
|
||||
if [ -h '$(call DecodeSpace, $<)' ]; then \
|
||||
$(LN) -s "`$(READLINK) '$(call DecodeSpace, $<)'`" '$(call DecodeSpace, $@)'; \
|
||||
else \
|
||||
$(CP) -fRP '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'; \
|
||||
fi
|
||||
if [ -n "`$(XATTR) -ls '$(call DecodeSpace, $@)'`" ]; then \
|
||||
$(XATTR) -cs '$(call DecodeSpace, $@)'; \
|
||||
fi
|
||||
endef
|
||||
else
|
||||
define install-file
|
||||
$(call MakeTargetDir)
|
||||
$(CP) -fP '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
|
||||
endef
|
||||
endif
|
||||
|
||||
# Variant of install file that does not preserve symlinks
|
||||
define install-file-nolink
|
||||
$(call MakeTargetDir)
|
||||
$(CP) -f '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
# link-file-* works similarly to install-file but creates a symlink instead.
|
||||
# There are two versions, either creating a relative or an absolute link. Be
|
||||
# careful when using this on Windows since the symlink created is only valid in
|
||||
# the unix emulation environment.
|
||||
# In msys2 we use mklink /J because its ln would perform a deep copy of the target.
|
||||
# This inhibits performance and can lead to issues with long paths. With mklink /J
|
||||
# relative linking does not work, so we handle the link as absolute path.
|
||||
ifeq ($(OPENJDK_BUILD_OS_ENV), windows.msys2)
|
||||
define link-file-relative
|
||||
$(call MakeTargetDir)
|
||||
$(RM) '$(call DecodeSpace, $@)'
|
||||
cmd //c "mklink /J $(call FixPath, $(call DecodeSpace, $@)) $(call FixPath, $(call DecodeSpace, $<))"
|
||||
endef
|
||||
else
|
||||
define link-file-relative
|
||||
$(call MakeTargetDir)
|
||||
$(RM) '$(call DecodeSpace, $@)'
|
||||
$(LN) -s '$(call DecodeSpace, $(call RelativePath, $<, $(@D)))' '$(call DecodeSpace, $@)'
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(OPENJDK_BUILD_OS_ENV), windows.msys2)
|
||||
define link-file-absolute
|
||||
$(call MakeTargetDir)
|
||||
$(RM) '$(call DecodeSpace, $@)'
|
||||
cmd //c "mklink /J $(call FixPath, $(call DecodeSpace, $@)) $(call FixPath, $(call DecodeSpace, $<))"
|
||||
endef
|
||||
else
|
||||
define link-file-absolute
|
||||
$(call MakeTargetDir)
|
||||
$(RM) '$(call DecodeSpace, $@)'
|
||||
$(LN) -s '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
|
||||
endef
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
# Recursive wildcard function. Walks down directories recursively and matches
|
||||
# files with the search patterns. Patterns use standard file wildcards (* and
|
||||
# ?).
|
||||
#
|
||||
# $1 - Directories to start search in
|
||||
# $2 - Search patterns
|
||||
rwildcard = \
|
||||
$(strip \
|
||||
$(foreach d, \
|
||||
$(patsubst %/,%,$(sort $(dir $(wildcard $(addsuffix /*/*, $(strip $1)))))), \
|
||||
$(call rwildcard,$d,$2) \
|
||||
) \
|
||||
$(call DoubleDollar, $(wildcard $(foreach p, $2, $(addsuffix /$(strip $p), $(strip $1))))) \
|
||||
)
|
||||
|
||||
# Find non directories using recursive wildcard function. This function may
|
||||
# be used directly when a small amount of directories is expected to be
|
||||
# searched and caching is not expected to be of use.
|
||||
#
|
||||
# $1 - Directory to start search in
|
||||
# $2 - Optional search patterns, defaults to '*'.
|
||||
WildcardFindFiles = \
|
||||
$(sort $(strip \
|
||||
$(eval WildcardFindFiles_result := $(call rwildcard,$(patsubst %/,%,$1),$(if $(strip $2),$2,*))) \
|
||||
$(filter-out $(patsubst %/,%,$(sort $(dir $(WildcardFindFiles_result)))), \
|
||||
$(WildcardFindFiles_result) \
|
||||
) \
|
||||
))
|
||||
|
||||
# Find non directories using the find utility in the shell. Safe to call for
|
||||
# non existing directories, or directories containing wildcards.
|
||||
#
|
||||
# Files containing space will get spaces replaced with ? because GNU Make
|
||||
# cannot handle lists of files with space in them. By using ?, make will match
|
||||
# the wildcard to space in many situations so we don't need to replace back
|
||||
# to space on every use. While not a complete solution it does allow some uses
|
||||
# of FindFiles to function with spaces in file names, including for
|
||||
# SetupCopyFiles. Unfortunately this does not work for WildcardFindFiles so
|
||||
# if files with spaces are anticipated, use ShellFindFiles directly.
|
||||
#
|
||||
# $1 - Directories to start search in.
|
||||
# $2 - Optional search patterns, empty means find everything. Patterns use
|
||||
# standard file wildcards (* and ?) and should not be quoted.
|
||||
# $3 - Optional options to find.
|
||||
ShellFindFiles = \
|
||||
$(if $(wildcard $1), \
|
||||
$(sort \
|
||||
$(shell $(FIND) $3 $(patsubst %/,%,$(wildcard $1)) \( -type f -o -type l \) \
|
||||
$(if $(strip $2), -a \( -name "$(firstword $2)" \
|
||||
$(foreach p, $(filter-out $(firstword $2), $2), -o -name "$(p)") \)) \
|
||||
| $(TR) ' ' '?' \
|
||||
) \
|
||||
) \
|
||||
)
|
||||
|
||||
# Find non directories using the method most likely to work best for the
|
||||
# current build host
|
||||
#
|
||||
# $1 - Directory to start search in
|
||||
# $2 - Optional search patterns, defaults to '*'.
|
||||
ifeq ($(OPENJDK_BUILD_OS)-$(RWILDCARD_WORKS), windows-true)
|
||||
DirectFindFiles = $(WildcardFindFiles)
|
||||
else
|
||||
DirectFindFiles = $(ShellFindFiles)
|
||||
endif
|
||||
|
||||
# Finds files using a cache that is populated by FillFindCache below. If any of
|
||||
# the directories given have not been cached, DirectFindFiles is used for
|
||||
# everything. Caching is especially useful in Cygwin, where file finds are very
|
||||
# costly.
|
||||
#
|
||||
# $1 - Directories to start search in.
|
||||
# $2 - Optional search patterns. If used, no caching is done.
|
||||
CacheFindFiles_CACHED_DIRS :=
|
||||
CacheFindFiles_CACHED_FILES :=
|
||||
CacheFindFiles = \
|
||||
$(if $2, \
|
||||
$(call DirectFindFiles, $1, $2) \
|
||||
, \
|
||||
$(if $(filter-out $(addsuffix /%, $(CacheFindFiles_CACHED_DIRS)) \
|
||||
$(CacheFindFiles_CACHED_DIRS), $1), \
|
||||
$(call DirectFindFiles, $1) \
|
||||
, \
|
||||
$(filter $(addsuffix /%,$(patsubst %/,%,$1)) $1,$(CacheFindFiles_CACHED_FILES)) \
|
||||
) \
|
||||
)
|
||||
|
||||
# Explicitly adds files to the find cache used by CacheFindFiles.
|
||||
#
|
||||
# $1 - Directories to start search in
|
||||
FillFindCache = \
|
||||
$(eval CacheFindFiles_NEW_DIRS := $$(filter-out $$(addsuffix /%,\
|
||||
$$(CacheFindFiles_CACHED_DIRS)) $$(CacheFindFiles_CACHED_DIRS), $1)) \
|
||||
$(if $(CacheFindFiles_NEW_DIRS), \
|
||||
$(eval CacheFindFiles_CACHED_DIRS += $$(patsubst %/,%,$$(CacheFindFiles_NEW_DIRS))) \
|
||||
$(eval CacheFindFiles_CACHED_FILES := $$(sort $$(CacheFindFiles_CACHED_FILES) \
|
||||
$$(call DirectFindFiles, $$(CacheFindFiles_NEW_DIRS)))) \
|
||||
)
|
||||
|
||||
# Findfiles is the default macro that should be used to find files in the file
|
||||
# system. This function does not always support files with spaces in the names.
|
||||
# If files with spaces are anticipated, use ShellFindFiles directly.
|
||||
#
|
||||
# $1 - Directories to start search in.
|
||||
# $2 - Optional search patterns, empty means find everything. Patterns use
|
||||
# standard file wildcards (* and ?) and should not be quoted.
|
||||
ifeq ($(DISABLE_CACHE_FIND), true)
|
||||
FindFiles = $(DirectFindFiles)
|
||||
else
|
||||
FindFiles = $(CacheFindFiles)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# FixPath
|
||||
#
|
||||
|
||||
@@ -241,32 +241,3 @@ else # HAS_FILE_FUNCTION = false
|
||||
$$(call ListPathsSafely_IfPrintf,$1,$2,29751,30000)
|
||||
endef
|
||||
endif # HAS_FILE_FUNCTION
|
||||
|
||||
################################################################################
|
||||
# Write to and read from file
|
||||
|
||||
# Param 1 - File to read
|
||||
ReadFile = \
|
||||
$(shell $(CAT) $1)
|
||||
|
||||
# Param 1 - Text to write
|
||||
# Param 2 - File to write to
|
||||
ifeq ($(HAS_FILE_FUNCTION), true)
|
||||
WriteFile = \
|
||||
$(file >$2,$(strip $1))
|
||||
else
|
||||
# Use printf to get consistent behavior on all platforms.
|
||||
WriteFile = \
|
||||
$(shell $(PRINTF) "%s\n" $(strip $(call ShellQuote, $1)) > $2)
|
||||
endif
|
||||
|
||||
# Param 1 - Text to write
|
||||
# Param 2 - File to write to
|
||||
ifeq ($(HAS_FILE_FUNCTION), true)
|
||||
AppendFile = \
|
||||
$(file >>$2,$(strip $1))
|
||||
else
|
||||
# Use printf to get consistent behavior on all platforms.
|
||||
AppendFile = \
|
||||
$(shell $(PRINTF) "%s\n" $(strip $(call ShellQuote, $1)) >> $2)
|
||||
endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2015, 2024, 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,7 +31,7 @@ ifeq (,$(_MAKEBASE_GMK))
|
||||
endif
|
||||
|
||||
|
||||
include NativeCompilation.gmk
|
||||
include JdkNativeCompilation.gmk
|
||||
|
||||
# Setup make rules for creating a set of native test files (libraries or
|
||||
# executables). This will locate native files matching a certain pattern,
|
||||
@@ -61,19 +61,14 @@ define SetupTestFilesCompilationBody
|
||||
ifeq ($$($1_TYPE), LIBRARY)
|
||||
$1_PREFIX = lib
|
||||
$1_OUTPUT_SUBDIR := lib
|
||||
$1_BASE_CFLAGS := $(CFLAGS_JDKLIB)
|
||||
$1_BASE_CXXFLAGS := $(CXXFLAGS_JDKLIB)
|
||||
$1_LDFLAGS := $(LDFLAGS_JDKLIB) $$(call SET_SHARED_LIBRARY_ORIGIN)
|
||||
$1_COMPILATION_TYPE := LIBRARY
|
||||
$1_LOG_TYPE := library
|
||||
else ifeq ($$($1_TYPE), PROGRAM)
|
||||
$1_PREFIX = exe
|
||||
$1_OUTPUT_SUBDIR := bin
|
||||
$1_BASE_CFLAGS := $(CFLAGS_JDKEXE)
|
||||
$1_BASE_CXXFLAGS := $(CXXFLAGS_JDKEXE)
|
||||
$1_LDFLAGS := $(LDFLAGS_JDKEXE) $(LDFLAGS_TESTEXE)
|
||||
$1_COMPILATION_TYPE := EXECUTABLE
|
||||
$1_LOG_TYPE := executable
|
||||
$1_LD_SET_ORIGIN := false
|
||||
else
|
||||
$$(error Unknown type: $$($1_TYPE))
|
||||
endif
|
||||
@@ -96,24 +91,34 @@ define SetupTestFilesCompilationBody
|
||||
$1_COPY_DEBUG_SYMBOLS := true
|
||||
endif
|
||||
|
||||
# Always include common test functionality
|
||||
TEST_CFLAGS := -I$(TOPDIR)/test/lib/native
|
||||
|
||||
# Setup a compilation for each and every one of them
|
||||
$$(foreach file, $$($1_FILTERED_FILE_LIST),\
|
||||
$$(eval name := $$(strip $$(basename $$(notdir $$(file))))) \
|
||||
$$(eval unprefixed_name := $$(patsubst $$($1_PREFIX)%, %, $$(name))) \
|
||||
$$(eval $$(call SetupNativeCompilation, BUILD_TEST_$$(name), \
|
||||
$$(eval $$(call SetupJdkNativeCompilation, BUILD_TEST_$$(name), \
|
||||
NAME := $$(unprefixed_name), \
|
||||
TYPE := $$($1_COMPILATION_TYPE), \
|
||||
LINK_TYPE := $(if $$(filter %.cpp, $$(file)), C++, C), \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
java.base:libjava \
|
||||
java.base:libjvm, \
|
||||
EXTRA_FILES := $$(file) $$($1_EXTRA_FILES), \
|
||||
OBJECT_DIR := $$($1_OUTPUT_DIR)/support/$$(name), \
|
||||
OUTPUT_DIR := $$($1_OUTPUT_DIR)/$$($1_OUTPUT_SUBDIR), \
|
||||
CFLAGS := $$($1_BASE_CFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \
|
||||
CXXFLAGS := $$($1_BASE_CXXFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \
|
||||
LDFLAGS := $$($1_LDFLAGS) $$($1_LDFLAGS_$$(name)), \
|
||||
CFLAGS := $$(TEST_CFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \
|
||||
CXXFLAGS := $$(TEST_CFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \
|
||||
LD_SET_ORIGIN := $$($1_LD_SET_ORIGIN), \
|
||||
LDFLAGS := $$($1_LDFLAGS_$$(name)), \
|
||||
DISABLED_WARNINGS_gcc := format undef unused-function unused-value, \
|
||||
DISABLED_WARNINGS_clang := undef format-nonliteral \
|
||||
missing-field-initializers sometimes-uninitialized, \
|
||||
DEFAULT_LIBCXX := false, \
|
||||
JDK_LIBS := $$($1_JDK_LIBS_$$(name)), \
|
||||
LIBS := $$($1_LIBS_$$(name)), \
|
||||
TOOLCHAIN := $(if $$(filter %.cpp, $$(file)), TOOLCHAIN_LINK_CXX, TOOLCHAIN_DEFAULT), \
|
||||
DEFAULT_VERSIONINFO_RESOURCE := false, \
|
||||
OPTIMIZATION := $$(if $$($1_OPTIMIZATION_$$(name)),$$($1_OPTIMIZATION_$$(name)),LOW), \
|
||||
COPY_DEBUG_SYMBOLS := $$($1_COPY_DEBUG_SYMBOLS), \
|
||||
STRIP_SYMBOLS := $$(if $$($1_STRIP_SYMBOLS_$$(name)),$$($1_STRIP_SYMBOLS_$$(name)),false), \
|
||||
@@ -126,7 +131,7 @@ define SetupTestFilesCompilationBody
|
||||
|
||||
# Setup rule for printing a summary of all the tests being compiled. On Warn
|
||||
# log level, this replaces the individual build info logging done by
|
||||
# SetupNativeCompilation.
|
||||
# SetupJdkNativeCompilation.
|
||||
$$($1_BUILD_INFO): $$($1_BUILD_INFO_DEPS)
|
||||
$$(call LogWarn, $$(strip Creating $$(words $$(filter-out %.vardeps, $$?)) \
|
||||
test $$($1_LOG_TYPE) file(s) for $1))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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,29 +29,34 @@ endif
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Common utility functions
|
||||
# Basic utility functions available to MakeBase.gmk itself
|
||||
#
|
||||
################################################################################
|
||||
|
||||
### Debug functions
|
||||
# String equals
|
||||
equals = \
|
||||
$(if $(strip $1)$(strip $2),$(strip \
|
||||
$(and $(findstring $(strip $1),$(strip $2)),\
|
||||
$(findstring $(strip $2),$(strip $1)))), \
|
||||
true \
|
||||
)
|
||||
|
||||
# Prints the name and value of a variable
|
||||
PrintVar = \
|
||||
$(info $(strip $1) >$($(strip $1))<)
|
||||
# Convert the string given to upper case, without any $(shell)
|
||||
# Inspired by http://lists.gnu.org/archive/html/help-make/2013-09/msg00009.html
|
||||
uppercase_table := a,A b,B c,C d,D e,E f,F g,G h,H i,I j,J k,K l,L m,M n,N o,O \
|
||||
p,P q,Q r,R s,S t,T u,U v,V w,W x,X y,Y z,Z
|
||||
|
||||
################################################################################
|
||||
# This macro translates $ into \$ to protect the $ from expansion in the shell.
|
||||
# To make this macro resilient against already escaped strings, first remove
|
||||
# any present escapes before escaping so that no double escapes are added.
|
||||
EscapeDollar = $(subst $$,\$$,$(subst \$$,$$,$(strip $1)))
|
||||
uppercase_internal = \
|
||||
$(if $(strip $1), $$(subst $(firstword $1), $(call uppercase_internal, \
|
||||
$(wordlist 2, $(words $1), $1), $2)), $2)
|
||||
|
||||
################################################################################
|
||||
# This macro works just like EscapeDollar above, but for #.
|
||||
EscapeHash = $(subst \#,\\\#,$(subst \\\#,\#,$(strip $1)))
|
||||
|
||||
################################################################################
|
||||
# This macro translates $ into $$ to protect the string from make itself.
|
||||
DoubleDollar = $(subst $$,$$$$,$(strip $1))
|
||||
# Convert a string to upper case. Works only on a-z.
|
||||
# $1 - The string to convert
|
||||
uppercase = \
|
||||
$(strip \
|
||||
$(eval uppercase_result := $(call uppercase_internal, $(uppercase_table), $1)) \
|
||||
$(uppercase_result) \
|
||||
)
|
||||
|
||||
################################################################################
|
||||
# Creates a sequence of increasing numbers (inclusive).
|
||||
@@ -68,23 +73,142 @@ _sequence-do = \
|
||||
$(words $(SEQUENCE_COUNT)) \
|
||||
$(call _sequence-do,$1))
|
||||
|
||||
################################################################################
|
||||
# This macro translates $ into \$ to protect the $ from expansion in the shell.
|
||||
# To make this macro resilient against already escaped strings, first remove
|
||||
# any present escapes before escaping so that no double escapes are added.
|
||||
EscapeDollar = $(subst $$,\$$,$(subst \$$,$$,$(strip $1)))
|
||||
|
||||
################################################################################
|
||||
# This macro works just like EscapeDollar above, but for #.
|
||||
EscapeHash = $(subst \#,\\\#,$(subst \\\#,\#,$(strip $1)))
|
||||
|
||||
################################################################################
|
||||
# This macro translates $ into $$ to protect the string from make itself.
|
||||
DoubleDollar = $(subst $$,$$$$,$(strip $1))
|
||||
|
||||
################################################################################
|
||||
# ShellQuote
|
||||
#
|
||||
# Quotes a string with single quotes and replaces single quotes with '\'' so
|
||||
# that the contents survives being given to the shell.
|
||||
ShellQuote = \
|
||||
$(SQUOTE)$(subst $(SQUOTE),$(SQUOTE)\$(SQUOTE)$(SQUOTE),$(strip $1))$(SQUOTE)
|
||||
|
||||
################################################################################
|
||||
# Write to and read from file
|
||||
|
||||
# Param 1 - File to read
|
||||
ReadFile = \
|
||||
$(shell $(CAT) $1)
|
||||
|
||||
# Param 1 - Text to write
|
||||
# Param 2 - File to write to
|
||||
ifeq ($(HAS_FILE_FUNCTION), true)
|
||||
WriteFile = \
|
||||
$(file >$2,$(strip $1))
|
||||
else
|
||||
# Use printf to get consistent behavior on all platforms.
|
||||
WriteFile = \
|
||||
$(shell $(PRINTF) "%s\n" $(strip $(call ShellQuote, $1)) > $2)
|
||||
endif
|
||||
|
||||
# Param 1 - Text to write
|
||||
# Param 2 - File to write to
|
||||
ifeq ($(HAS_FILE_FUNCTION), true)
|
||||
AppendFile = \
|
||||
$(file >>$2,$(strip $1))
|
||||
else
|
||||
# Use printf to get consistent behavior on all platforms.
|
||||
AppendFile = \
|
||||
$(shell $(PRINTF) "%s\n" $(strip $(call ShellQuote, $1)) >> $2)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Make directory without forking mkdir if not needed.
|
||||
#
|
||||
# If a directory with an encoded space is provided, the wildcard function
|
||||
# sometimes returns false answers (typically if the dir existed when the
|
||||
# makefile was parsed, but was deleted by a previous rule). In that case, always
|
||||
# call mkdir regardless of what wildcard says.
|
||||
#
|
||||
# 1: List of directories to create
|
||||
MakeDir = \
|
||||
$(strip \
|
||||
$(eval MakeDir_dirs_to_make := $(strip $(foreach d, $1, \
|
||||
$(if $(findstring ?, $d), '$(call DecodeSpace, $d)', \
|
||||
$(if $(wildcard $d), , $d) \
|
||||
) \
|
||||
))) \
|
||||
$(if $(MakeDir_dirs_to_make), $(shell $(MKDIR) -p $(MakeDir_dirs_to_make))) \
|
||||
)
|
||||
|
||||
################################################################################
|
||||
# Check if our build or target conforms to certain restrictions. This set of
|
||||
# functions all work in similar ways, testing the property that the name
|
||||
# implies, so e.g. isTargetCpu test the CPU of the target system.
|
||||
#
|
||||
# $1 - A property, or a space separated list of properties to test for.
|
||||
#
|
||||
# Returns true if the actual property matches one of the properties in the list,
|
||||
# and false otherwise.
|
||||
#
|
||||
# Examples: $(call isTargetOs, linux windows) will return true when executed
|
||||
# on either linux or windows, and false otherwise.
|
||||
# $(call isBuildCpuArch, x86) will return true iff the build CPU Arch is x86.
|
||||
|
||||
isTargetOs = \
|
||||
$(strip $(if $(filter $(OPENJDK_TARGET_OS), $1), true, false))
|
||||
|
||||
isTargetOsType = \
|
||||
$(strip $(if $(filter $(OPENJDK_TARGET_OS_TYPE), $1), true, false))
|
||||
|
||||
isTargetCpu = \
|
||||
$(strip $(if $(filter $(OPENJDK_TARGET_CPU), $1), true, false))
|
||||
|
||||
isTargetCpuArch = \
|
||||
$(strip $(if $(filter $(OPENJDK_TARGET_CPU_ARCH), $1), true, false))
|
||||
|
||||
isTargetCpuBits = \
|
||||
$(strip $(if $(filter $(OPENJDK_TARGET_CPU_BITS), $1), true, false))
|
||||
|
||||
isBuildOs = \
|
||||
$(strip $(if $(filter $(OPENJDK_BUILD_OS), $1), true, false))
|
||||
|
||||
isBuildOsType = \
|
||||
$(strip $(if $(filter $(OPENJDK_BUILD_OS_TYPE), $1), true, false))
|
||||
|
||||
isBuildOsEnv = \
|
||||
$(strip $(if $(filter $(OPENJDK_BUILD_OS_ENV), $1), true, false))
|
||||
|
||||
isBuildCpu = \
|
||||
$(strip $(if $(filter $(OPENJDK_BUILD_CPU), $1), true, false))
|
||||
|
||||
isBuildCpuArch = \
|
||||
$(strip $(if $(filter $(OPENJDK_BUILD_CPU_ARCH), $1), true, false))
|
||||
|
||||
isCompiler = \
|
||||
$(strip $(if $(filter $(TOOLCHAIN_TYPE), $1), true, false))
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Common utility functions
|
||||
#
|
||||
################################################################################
|
||||
|
||||
### Debug functions
|
||||
|
||||
# Prints the name and value of a variable
|
||||
PrintVar = \
|
||||
$(info $(strip $1) >$($(strip $1))<)
|
||||
|
||||
|
||||
################################################################################
|
||||
# Strip both arguments. Append the first argument to the second argument. If the
|
||||
# first argument is empty, return the empty string.
|
||||
IfAppend = \
|
||||
$(if $(strip $1),$(strip $1)$(strip $2),)
|
||||
|
||||
################################################################################
|
||||
# Replace question marks with space in string. This macro needs to be called on
|
||||
# files from FindFiles in case any of them contains space in their file name,
|
||||
# since FindFiles replaces space with ?.
|
||||
# Param 1 - String to replace in
|
||||
DecodeSpace = \
|
||||
$(subst ?,$(SPACE),$(strip $1))
|
||||
|
||||
EncodeSpace = \
|
||||
$(subst $(SPACE),?,$(strip $1))
|
||||
|
||||
################################################################################
|
||||
# Assign a variable only if it is empty
|
||||
# Param 1 - Variable to assign
|
||||
@@ -92,65 +216,6 @@ EncodeSpace = \
|
||||
SetIfEmpty = \
|
||||
$(if $($(strip $1)),,$(eval $(strip $1) := $2))
|
||||
|
||||
################################################################################
|
||||
# Take two paths and return the path of the last common directory.
|
||||
# Ex: /foo/bar/baz, /foo/bar/banan -> /foo/bar
|
||||
# foo/bar/baz, /foo/bar -> <empty>
|
||||
#
|
||||
# The x prefix is used to preserve the presence of the initial slash
|
||||
# On Windows paths are treated as case-insensitive
|
||||
#
|
||||
# $1 - Path to compare
|
||||
# $2 - Other path to compare
|
||||
FindCommonPathPrefix = \
|
||||
$(call DecodeSpace,$(patsubst x%,%,$(subst $(SPACE),/,$(strip \
|
||||
$(call FindCommonPathPrefixHelper1, \
|
||||
$(subst /,$(SPACE),x$(call EncodeSpace,$(strip $1))), \
|
||||
$(subst /,$(SPACE),x$(call EncodeSpace,$(strip $2)))) \
|
||||
))))
|
||||
|
||||
FindCommonPathPrefixHelper1 = \
|
||||
$(if $(filter $(OPENJDK_TARGET_OS), windows), \
|
||||
$(call FindCommonPathPrefixHelper2,$(call uppercase,$1),$(call uppercase,$2),$1), \
|
||||
$(call FindCommonPathPrefixHelper2,$1,$2,$1))
|
||||
|
||||
FindCommonPathPrefixHelper2 = \
|
||||
$(if $(call equals, $(firstword $1), $(firstword $2)), \
|
||||
$(if $(call equals, $(firstword $1),),, \
|
||||
$(firstword $3) \
|
||||
$(call FindCommonPathPrefixHelper2, \
|
||||
$(wordlist 2, $(words $1), $1), \
|
||||
$(wordlist 2, $(words $2), $2), \
|
||||
$(wordlist 2, $(words $3), $3) \
|
||||
) \
|
||||
) \
|
||||
)
|
||||
|
||||
# Computes the relative path from a directory to a file
|
||||
# $1 - File to compute the relative path to
|
||||
# $2 - Directory to compute the relative path from
|
||||
RelativePath = \
|
||||
$(call DecodeSpace,$(strip $(call RelativePathHelper,$(call EncodeSpace \
|
||||
,$(strip $1)),$(call EncodeSpace \
|
||||
,$(strip $2)),$(call EncodeSpace \
|
||||
,$(call FindCommonPathPrefix,$1,$2)))))
|
||||
|
||||
RelativePathHelper = \
|
||||
$(eval $3_prefix_length := $(words $(subst /,$(SPACE),$3))) \
|
||||
$(eval $1_words := $(subst /,$(SPACE),$1)) \
|
||||
$(eval $2_words := $(subst /,$(SPACE),$2)) \
|
||||
$(if $(call equals,$($3_prefix_length),0),, \
|
||||
$(eval $1_words := $(wordlist 2,$(words $($1_words)),$(wordlist \
|
||||
$($3_prefix_length),$(words $($1_words)),$($1_words)))) \
|
||||
$(eval $2_words := $(wordlist 2,$(words $($2_words)),$(wordlist \
|
||||
$($3_prefix_length),$(words $($2_words)),$($2_words)))) \
|
||||
) \
|
||||
$(eval $1_suffix := $(subst $(SPACE),/,$($1_words))) \
|
||||
$(eval $2_dotdots := $(subst $(SPACE),/,$(foreach d,$($2_words),..))) \
|
||||
$(if $($1_suffix), \
|
||||
$(if $($2_dotdots), $($2_dotdots)/$($1_suffix), $($1_suffix)), \
|
||||
$(if $($2_dotdots), $($2_dotdots), .))
|
||||
|
||||
################################################################################
|
||||
# Filter out duplicate sub strings while preserving order. Keeps the first occurrence.
|
||||
uniq = \
|
||||
@@ -173,14 +238,6 @@ dups = \
|
||||
$(strip $(foreach v, $(sort $1), $(if $(filter-out 1, \
|
||||
$(words $(filter $v, $1))), $v)))
|
||||
|
||||
# String equals
|
||||
equals = \
|
||||
$(if $(strip $1)$(strip $2),$(strip \
|
||||
$(and $(findstring $(strip $1),$(strip $2)),\
|
||||
$(findstring $(strip $2),$(strip $1)))), \
|
||||
true \
|
||||
)
|
||||
|
||||
# Remove a whole list of prefixes
|
||||
# $1 - List of prefixes
|
||||
# $2 - List of elements to process
|
||||
@@ -188,23 +245,6 @@ remove-prefixes = \
|
||||
$(strip $(if $1,$(patsubst $(firstword $1)%,%,\
|
||||
$(call remove-prefixes,$(filter-out $(firstword $1),$1),$2)),$2))
|
||||
|
||||
# Convert the string given to upper case, without any $(shell)
|
||||
# Inspired by http://lists.gnu.org/archive/html/help-make/2013-09/msg00009.html
|
||||
uppercase_table := a,A b,B c,C d,D e,E f,F g,G h,H i,I j,J k,K l,L m,M n,N o,O \
|
||||
p,P q,Q r,R s,S t,T u,U v,V w,W x,X y,Y z,Z
|
||||
|
||||
uppercase_internal = \
|
||||
$(if $(strip $1), $$(subst $(firstword $1), $(call uppercase_internal, \
|
||||
$(wordlist 2, $(words $1), $1), $2)), $2)
|
||||
|
||||
# Convert a string to upper case. Works only on a-z.
|
||||
# $1 - The string to convert
|
||||
uppercase = \
|
||||
$(strip \
|
||||
$(eval uppercase_result := $(call uppercase_internal, $(uppercase_table), $1)) \
|
||||
$(uppercase_result) \
|
||||
)
|
||||
|
||||
################################################################################
|
||||
# Boolean operators.
|
||||
|
||||
@@ -290,14 +330,6 @@ define ParseKeywordVariableBody
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
# ShellQuote
|
||||
#
|
||||
# Quotes a string with single quotes and replaces single quotes with '\'' so
|
||||
# that the contents survives being given to the shell.
|
||||
ShellQuote = \
|
||||
$(SQUOTE)$(subst $(SQUOTE),$(SQUOTE)\$(SQUOTE)$(SQUOTE),$(strip $1))$(SQUOTE)
|
||||
|
||||
################################################################################
|
||||
# Find lib dir for module
|
||||
# Param 1 - module name
|
||||
@@ -329,53 +361,6 @@ check-jvm-variant = \
|
||||
$(error Internal error: Invalid variant tested: $1)) \
|
||||
$(if $(filter $1, $(JVM_VARIANTS)), true, false))
|
||||
|
||||
################################################################################
|
||||
# Check if our build or target conforms to certain restrictions. This set of
|
||||
# functions all work in similar ways, testing the property that the name
|
||||
# implies, so e.g. isTargetCpu test the CPU of the target system.
|
||||
#
|
||||
# $1 - A property, or a space separated list of properties to test for.
|
||||
#
|
||||
# Returns true if the actual property matches one of the properties in the list,
|
||||
# and false otherwise.
|
||||
#
|
||||
# Examples: $(call isTargetOs, linux windows) will return true when executed
|
||||
# on either linux or windows, and false otherwise.
|
||||
# $(call isBuildCpuArch, x86) will return true iff the build CPU Arch is x86.
|
||||
|
||||
isTargetOs = \
|
||||
$(strip $(if $(filter $(OPENJDK_TARGET_OS), $1), true, false))
|
||||
|
||||
isTargetOsType = \
|
||||
$(strip $(if $(filter $(OPENJDK_TARGET_OS_TYPE), $1), true, false))
|
||||
|
||||
isTargetCpu = \
|
||||
$(strip $(if $(filter $(OPENJDK_TARGET_CPU), $1), true, false))
|
||||
|
||||
isTargetCpuArch = \
|
||||
$(strip $(if $(filter $(OPENJDK_TARGET_CPU_ARCH), $1), true, false))
|
||||
|
||||
isTargetCpuBits = \
|
||||
$(strip $(if $(filter $(OPENJDK_TARGET_CPU_BITS), $1), true, false))
|
||||
|
||||
isBuildOs = \
|
||||
$(strip $(if $(filter $(OPENJDK_BUILD_OS), $1), true, false))
|
||||
|
||||
isBuildOsType = \
|
||||
$(strip $(if $(filter $(OPENJDK_BUILD_OS_TYPE), $1), true, false))
|
||||
|
||||
isBuildOsEnv = \
|
||||
$(strip $(if $(filter $(OPENJDK_BUILD_OS_ENV), $1), true, false))
|
||||
|
||||
isBuildCpu = \
|
||||
$(strip $(if $(filter $(OPENJDK_BUILD_CPU), $1), true, false))
|
||||
|
||||
isBuildCpuArch = \
|
||||
$(strip $(if $(filter $(OPENJDK_BUILD_CPU_ARCH), $1), true, false))
|
||||
|
||||
isCompiler = \
|
||||
$(strip $(if $(filter $(TOOLCHAIN_TYPE), $1), true, false))
|
||||
|
||||
################################################################################
|
||||
# Converts a space separated list to a comma separated list.
|
||||
#
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
include CopyFiles.gmk
|
||||
|
||||
LIB_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)
|
||||
CONF_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_conf/$(MODULE)
|
||||
LEGAL_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_legal/$(MODULE)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -23,26 +23,12 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
include CopyFiles.gmk
|
||||
include JdkNativeCompilation.gmk
|
||||
include Modules.gmk
|
||||
include ProcessMarkdown.gmk
|
||||
include ToolsJdk.gmk
|
||||
|
||||
# Tell the compiler not to export any functions unless declared so in
|
||||
# the source code. On Windows, this is the default and cannot be changed.
|
||||
# On Mac, we have always exported all symbols, probably due to oversight
|
||||
# and/or misunderstanding. To emulate this, don't hide any symbols
|
||||
# by default.
|
||||
# Also provide an override for non-conformant libraries.
|
||||
ifeq ($(TOOLCHAIN_TYPE), gcc)
|
||||
LAUNCHER_CFLAGS += -fvisibility=hidden
|
||||
LDFLAGS_JDKEXE += -Wl,--exclude-libs,ALL
|
||||
else ifeq ($(TOOLCHAIN_TYPE), clang)
|
||||
LAUNCHER_CFLAGS += -fvisibility=hidden
|
||||
else ifeq ($(TOOLCHAIN_TYPE), xlc)
|
||||
LAUNCHER_CFLAGS += -qvisibility=hidden
|
||||
endif
|
||||
|
||||
LAUNCHER_SRC := $(TOPDIR)/src/java.base/share/native/launcher
|
||||
LAUNCHER_CFLAGS += -I$(TOPDIR)/src/java.base/share/native/launcher \
|
||||
-I$(TOPDIR)/src/java.base/share/native/libjli \
|
||||
@@ -137,12 +123,6 @@ define SetupBuildLauncherBody
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBZ), true)
|
||||
$1_LIBS += -lz
|
||||
endif
|
||||
|
||||
$1_WINDOWS_JLI_LIB := $(call FindStaticLib, java.base, jli, /libjli)
|
||||
|
||||
$1_EXTRA_FILES := $(LAUNCHER_SRC)/main.c
|
||||
|
||||
ifeq ($(ASAN_ENABLED), true)
|
||||
@@ -153,33 +133,34 @@ define SetupBuildLauncherBody
|
||||
$1_EXTRA_FILES += $(TOPDIR)/make/data/lsan/lsan_default_options.c
|
||||
endif
|
||||
|
||||
##############################################################################
|
||||
## Build launcher "$1"
|
||||
##############################################################################
|
||||
|
||||
$$(eval $$(call SetupJdkExecutable, BUILD_LAUNCHER_$1, \
|
||||
NAME := $1, \
|
||||
EXTRA_FILES := $$($1_EXTRA_FILES), \
|
||||
OPTIMIZATION := $$($1_OPTIMIZATION), \
|
||||
CFLAGS := $$(CFLAGS_JDKEXE) \
|
||||
$$(LAUNCHER_CFLAGS) \
|
||||
CFLAGS := $$(LAUNCHER_CFLAGS) \
|
||||
$$(VERSION_CFLAGS) \
|
||||
-DLAUNCHER_NAME='"$$(LAUNCHER_NAME)"' \
|
||||
-DPROGNAME='"$1"' \
|
||||
$$($1_CFLAGS), \
|
||||
CFLAGS_windows := $$($1_CFLAGS_windows), \
|
||||
EXTRA_HEADER_DIRS := java.base:libjvm, \
|
||||
DISABLED_WARNINGS_gcc := unused-function, \
|
||||
LDFLAGS := $$(LDFLAGS_JDKEXE) \
|
||||
$$(call SET_EXECUTABLE_ORIGIN) \
|
||||
$$($1_LDFLAGS), \
|
||||
LDFLAGS_linux := $$(call SET_EXECUTABLE_ORIGIN,/../lib) \
|
||||
-L$(call FindLibDirForModule, java.base), \
|
||||
LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN,/../lib) \
|
||||
-L$(call FindLibDirForModule, java.base), \
|
||||
LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \
|
||||
LIBS := $(JDKEXE_LIBS) $$($1_LIBS), \
|
||||
LIBS_linux := -ljli -lpthread $(LIBDL), \
|
||||
LIBS_macosx := -ljli -framework Cocoa -framework Security \
|
||||
-framework ApplicationServices, \
|
||||
LIBS_aix := -ljli_static, \
|
||||
LIBS_windows := $$($1_WINDOWS_JLI_LIB) \
|
||||
$(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib, \
|
||||
LDFLAGS := $$($1_LDFLAGS), \
|
||||
LDFLAGS_linux := $$(call SET_EXECUTABLE_ORIGIN,/../lib), \
|
||||
LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN,/../lib), \
|
||||
JDK_LIBS := java.base:libjli, \
|
||||
JDK_LIBS_windows := java.base:libjava, \
|
||||
LIBS := $$($1_LIBS), \
|
||||
LIBS_unix := $(LIBZ_LIBS), \
|
||||
LIBS_linux := $(LIBDL) -lpthread, \
|
||||
LIBS_macosx := \
|
||||
-framework ApplicationServices \
|
||||
-framework Cocoa \
|
||||
-framework Security, \
|
||||
OUTPUT_DIR := $$($1_OUTPUT_DIR), \
|
||||
VERSIONINFO_RESOURCE := $$($1_VERSION_INFO_RESOURCE), \
|
||||
EXTRA_RCFLAGS := $$($1_EXTRA_RCFLAGS), \
|
||||
@@ -192,15 +173,6 @@ define SetupBuildLauncherBody
|
||||
|
||||
$$(BUILD_LAUNCHER_$1): $$(BUILD_PLIST_$1)
|
||||
|
||||
ifeq ($(call isTargetOs, aix), true)
|
||||
$$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, jli_static)
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
$$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, java, /libjava) \
|
||||
$$($1_WINDOWS_JLI_LIB)
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
$$(BUILD_LAUNCHER_$1): $$($1_PLIST_FILE)
|
||||
endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -24,32 +24,3 @@
|
||||
#
|
||||
|
||||
include JdkNativeCompilation.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
# Absolute paths to lib files on windows for use in LIBS. Should figure out a more
|
||||
# elegant solution to this.
|
||||
WIN_JAVA_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib
|
||||
|
||||
# Tell the compiler not to export any functions unless declared so in
|
||||
# the source code. On Windows, this is the default and cannot be changed.
|
||||
# On Mac, we have always exported all symbols, probably due to oversight
|
||||
# and/or misunderstanding. To emulate this, don't hide any symbols
|
||||
# by default.
|
||||
# Also provide an override for non-conformant libraries.
|
||||
ifeq ($(TOOLCHAIN_TYPE), gcc)
|
||||
CFLAGS_JDKLIB += -fvisibility=hidden
|
||||
CXXFLAGS_JDKLIB += -fvisibility=hidden
|
||||
LDFLAGS_JDKLIB += -Wl,--exclude-libs,ALL
|
||||
else ifeq ($(TOOLCHAIN_TYPE), clang)
|
||||
CFLAGS_JDKLIB += -fvisibility=hidden
|
||||
CXXFLAGS_JDKLIB += -fvisibility=hidden
|
||||
else ifeq ($(TOOLCHAIN_TYPE), xlc)
|
||||
CFLAGS_JDKLIB += -qvisibility=hidden
|
||||
CXXFLAGS_JDKLIB += -qvisibility=hidden
|
||||
endif
|
||||
|
||||
# Put the libraries here.
|
||||
INSTALL_LIBRARIES_HERE := $(call FindLibDirForModule, $(MODULE))
|
||||
|
||||
################################################################################
|
||||
|
||||
351
make/common/native/CompileFile.gmk
Normal file
351
make/common/native/CompileFile.gmk
Normal file
@@ -0,0 +1,351 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, 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.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# This file contains functionality related to compiling a single native source
|
||||
# file (C, C++ or Objective-C) into an object file. It also harbours related
|
||||
# functionality for generating PCH (precompiled headers) and Windows resource
|
||||
# files.
|
||||
|
||||
################################################################################
|
||||
# Creates a recipe that creates a compile_commands.json fragment. Remove any
|
||||
# occurrences of FIXPATH programs from the command to show the actual invocation.
|
||||
#
|
||||
# Param 1: Name of file to create
|
||||
# Param 2: Working directory
|
||||
# Param 3: Source file
|
||||
# Param 4: Compile command
|
||||
################################################################################
|
||||
define WriteCompileCommandsFragment
|
||||
$(call LogInfo, Creating compile commands fragment for $(notdir $3))
|
||||
$(call MakeDir, $(dir $1))
|
||||
$(call WriteFile,{ \
|
||||
"directory": "$(strip $(call FixPath, $2))"$(COMMA) \
|
||||
"file": "$(strip $(call FixPath, $3))"$(COMMA) \
|
||||
"command": "$(strip $(subst $(DQUOTE),\$(DQUOTE),$(subst \,\\,\
|
||||
$(subst $(FIXPATH),,$(call FixPath, $4)))))" \
|
||||
}$(COMMA), \
|
||||
$1)
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
# Extensions of files handled by this macro.
|
||||
NATIVE_SOURCE_EXTENSIONS := %.S %.c %.cpp %.cc %.m %.mm
|
||||
|
||||
# Replaces native source extensions with the object file extension in a string.
|
||||
# Param 1: the string containing source file names with extensions
|
||||
# The surrounding strip is needed to keep additional whitespace out
|
||||
define replace_with_obj_extension
|
||||
$(strip \
|
||||
$(foreach extension, $(NATIVE_SOURCE_EXTENSIONS), \
|
||||
$(patsubst $(extension),%$(OBJ_SUFFIX), $(filter $(extension), $1))) \
|
||||
)
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
# This pattern is used to transform the output of the microsoft CL compiler
|
||||
# into a make syntax dependency file (.d)
|
||||
WINDOWS_SHOWINCLUDE_SED_PATTERN := \
|
||||
-e '/^Note: including file:/!d' \
|
||||
-e 's|Note: including file: *||' \
|
||||
-e 's|\r||g' \
|
||||
-e 's|\\|/|g' \
|
||||
-e 's|^\([a-zA-Z]\):|$(WINENV_PREFIX)/\1|g' \
|
||||
-e '\|$(TOPDIR)|I !d' \
|
||||
-e 's|$$$$| \\|g' \
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# This pattern is used to transform a dependency file (.d) to a list
|
||||
# of make targets for dependent files (.d.targets)
|
||||
DEPENDENCY_TARGET_SED_PATTERN := \
|
||||
-e 's/\#.*//' \
|
||||
-e 's/^[^:]*: *//' \
|
||||
-e 's/ *\\$$$$//' \
|
||||
-e 's/^[ ]*//' \
|
||||
-e '/^$$$$/ d' \
|
||||
-e 's/$$$$/ :/' \
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# Create the recipe needed to compile a single native source file.
|
||||
#
|
||||
# Parameter 1 is the name of the rule, based on the name of the library/
|
||||
# program being build and the name of the source code file, e.g.
|
||||
# BUILD_LIBFOO_fooMain.cpp.
|
||||
#
|
||||
# Remaining parameters are named arguments:
|
||||
# FILE - The full path of the source file to compiler
|
||||
# BASE - The name of the rule for the entire binary to build ($1)
|
||||
#
|
||||
CreateCompiledNativeFile = $(NamedParamsMacroTemplate)
|
||||
define CreateCompiledNativeFileBody
|
||||
$1_FILENAME := $$(notdir $$($1_FILE))
|
||||
|
||||
# The target file to be generated.
|
||||
$1_OBJ := $$($$($1_BASE)_OBJECT_DIR)/$$(call replace_with_obj_extension, \
|
||||
$$($1_FILENAME))
|
||||
|
||||
# Generate the corresponding compile_commands.json fragment.
|
||||
$1_OBJ_JSON = $$(MAKESUPPORT_OUTPUTDIR)/compile-commands/$$(subst /,_,$$(subst \
|
||||
$$(OUTPUTDIR)/,,$$($1_OBJ))).json
|
||||
$$($1_BASE)_ALL_OBJS_JSON += $$($1_OBJ_JSON)
|
||||
|
||||
# Only continue if this object file hasn't been processed already. This lets
|
||||
# the first found source file override any other with the same name.
|
||||
ifeq ($$($1_OBJ_PROCESSED), )
|
||||
$1_OBJ_PROCESSED := true
|
||||
# This is the definite source file to use for $1_FILENAME.
|
||||
$1_SRC_FILE := $$($1_FILE)
|
||||
|
||||
$$(eval $$(call SetupCompileFileFlags,$1,$$($1_BASE)))
|
||||
|
||||
ifneq ($$(filter %.c, $$($1_FILENAME)), )
|
||||
# Compile as a C file
|
||||
$1_CFLAGS += $$($1_WARNINGS_FLAGS)
|
||||
$1_FLAGS := $(CFLAGS_CCACHE) $$($1_USE_PCH_FLAGS) $$($1_BASE_CFLAGS) \
|
||||
$$($1_OPT_CFLAGS) $$($1_CFLAGS) -c
|
||||
$1_COMPILER := $$($$($1_BASE)_CC)
|
||||
else ifneq ($$(filter %.m, $$($1_FILENAME)), )
|
||||
# Compile as an Objective-C file
|
||||
$1_CFLAGS += $$($1_WARNINGS_FLAGS)
|
||||
$1_FLAGS := -x objective-c $(CFLAGS_CCACHE) $$($1_USE_PCH_FLAGS) \
|
||||
$$($1_BASE_CFLAGS) $$($1_OPT_CFLAGS) $$($1_CFLAGS) -c
|
||||
$1_COMPILER := $$($$($1_BASE)_CC)
|
||||
else ifneq ($$(filter %.S, $$($1_FILENAME)), )
|
||||
# Compile as preprocessed assembler file
|
||||
$1_FLAGS := $(BASIC_ASFLAGS) $$($1_BASE_ASFLAGS)
|
||||
$1_COMPILER := $(AS)
|
||||
|
||||
# gcc or clang assembly files must contain an appropriate relative .file
|
||||
# path for reproducible builds.
|
||||
ifneq ($(findstring $(TOOLCHAIN_TYPE), gcc clang), )
|
||||
# If no absolute paths allowed, work out relative source file path
|
||||
# for assembly .file substitution, otherwise use full file path
|
||||
ifeq ($(ALLOW_ABSOLUTE_PATHS_IN_OUTPUT), false)
|
||||
$1_REL_ASM_SRC := $$(call RelativePath, $$($1_FILE), $(WORKSPACE_ROOT))
|
||||
else
|
||||
$1_REL_ASM_SRC := $$($1_FILE)
|
||||
endif
|
||||
$1_FLAGS := $$($1_FLAGS) -DASSEMBLY_SRC_FILE='"$$($1_REL_ASM_SRC)"' \
|
||||
-include $(TOPDIR)/make/data/autoheaders/assemblyprefix.h
|
||||
endif
|
||||
else ifneq ($$(filter %.cpp %.cc %.mm, $$($1_FILENAME)), )
|
||||
# Compile as a C++ or Objective-C++ file
|
||||
$1_CXXFLAGS += $$($1_WARNINGS_FLAGS)
|
||||
$1_FLAGS := $(CFLAGS_CCACHE) $$($1_USE_PCH_FLAGS) $$($1_BASE_CXXFLAGS) \
|
||||
$$($1_OPT_CXXFLAGS) $$($1_CXXFLAGS) -c
|
||||
$1_COMPILER := $$($$($1_BASE)_CXX)
|
||||
else
|
||||
$$(error Internal error in NativeCompilation.gmk: no compiler for file $$($1_FILENAME))
|
||||
endif
|
||||
|
||||
# And this is the dependency file for this obj file.
|
||||
$1_DEPS_FILE := $$(patsubst %$(OBJ_SUFFIX),%.d,$$($1_OBJ))
|
||||
# The dependency target file lists all dependencies as empty targets to
|
||||
# avoid make error "No rule to make target" for removed files
|
||||
$1_DEPS_TARGETS_FILE := $$(patsubst %$(OBJ_SUFFIX),%.d.targets,$$($1_OBJ))
|
||||
|
||||
# Only try to load individual dependency information files if the global
|
||||
# file hasn't been loaded (could happen if make was interrupted).
|
||||
ifneq ($$($$($1_BASE)_DEPS_FILE_LOADED), true)
|
||||
# Include previously generated dependency information. (if it exists)
|
||||
-include $$($1_DEPS_FILE)
|
||||
-include $$($1_DEPS_TARGETS_FILE)
|
||||
endif
|
||||
|
||||
ifneq ($$(strip $$($1_CFLAGS) $$($1_CXXFLAGS) $$($1_OPTIMIZATION)), )
|
||||
$1_VARDEPS := $$($1_CFLAGS) $$($1_CXXFLAGS) $$($1_OPTIMIZATION)
|
||||
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_OBJ).vardeps)
|
||||
endif
|
||||
|
||||
$1_OBJ_DEPS := $$($1_SRC_FILE) $$($$($1_BASE)_COMPILE_VARDEPS_FILE) \
|
||||
$$($$($1_BASE)_EXTRA_DEPS) $$($1_VARDEPS_FILE)
|
||||
$1_COMPILE_OPTIONS := $$($1_FLAGS) $(CC_OUT_OPTION)$$($1_OBJ) $$($1_SRC_FILE)
|
||||
# For reproducible builds with gcc and clang ensure random symbol generation is
|
||||
# seeded deterministically
|
||||
ifneq ($(findstring $(TOOLCHAIN_TYPE), gcc clang), )
|
||||
$1_COMPILE_OPTIONS += -frandom-seed="$$($1_FILENAME)"
|
||||
endif
|
||||
|
||||
$$($1_OBJ_JSON): $$($1_OBJ_DEPS)
|
||||
$$(call WriteCompileCommandsFragment, $$@, $$(PWD), $$($1_SRC_FILE), \
|
||||
$$($1_COMPILER) $$($1_COMPILE_OPTIONS))
|
||||
|
||||
$$($1_OBJ): $$($1_OBJ_DEPS) | $$($$($1_BASE)_BUILD_INFO)
|
||||
$$(call LogInfo, Compiling $$($1_FILENAME) (for $$($$($1_BASE)_BASENAME)))
|
||||
$$(call MakeDir, $$(@D))
|
||||
ifneq ($(TOOLCHAIN_TYPE), microsoft)
|
||||
$$(call ExecuteWithLog, $$@, $$(call MakeCommandRelative, \
|
||||
$$($1_COMPILER) $$(GENDEPS_FLAGS) \
|
||||
$$(addsuffix .tmp, $$($1_DEPS_FILE)) \
|
||||
$$($1_COMPILE_OPTIONS)))
|
||||
ifneq ($$($1_DEPS_FILE), )
|
||||
$$(call fix-deps-file, $$($1_DEPS_FILE))
|
||||
# Create a dependency target file from the dependency file.
|
||||
# Solution suggested by:
|
||||
# http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/
|
||||
$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_DEPS_FILE) \
|
||||
> $$($1_DEPS_TARGETS_FILE)
|
||||
endif
|
||||
else
|
||||
# The Visual Studio compiler lacks a feature for generating make
|
||||
# dependencies, but by setting -showIncludes, all included files are
|
||||
# printed. These are filtered out and parsed into make dependences.
|
||||
#
|
||||
# Keep as much as possible on one execution line for best performance
|
||||
# on Windows. No need to save exit code from compilation since
|
||||
# pipefail is always active on Windows.
|
||||
ifeq ($$(filter %.S, $$($1_FILENAME)), )
|
||||
$$(call ExecuteWithLog, $$@, $$(call MakeCommandRelative, \
|
||||
$$($1_COMPILER) -showIncludes $$($1_COMPILE_OPTIONS))) \
|
||||
| $(TR) -d '\r' | $(GREP) -v -e "^Note: including file:" \
|
||||
-e "^$$($1_FILENAME)$$$$" || test "$$$$?" = "1" ; \
|
||||
$(ECHO) $$@: \\ > $$($1_DEPS_FILE) ; \
|
||||
$(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_OBJ).log \
|
||||
| $(SORT) -u >> $$($1_DEPS_FILE) ; \
|
||||
$(ECHO) >> $$($1_DEPS_FILE) ; \
|
||||
$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_DEPS_FILE) > $$($1_DEPS_TARGETS_FILE)
|
||||
else
|
||||
# For assembler calls just create empty dependency lists
|
||||
$$(call ExecuteWithLog, $$@, $$(call MakeCommandRelative, \
|
||||
$$($1_COMPILER) $$($1_FLAGS) \
|
||||
$(CC_OUT_OPTION)$$($1_OBJ) -Ta $$($1_SRC_FILE))) \
|
||||
| $(TR) -d '\r' | $(GREP) -v -e "Assembling:" || test "$$$$?" = "1" ; \
|
||||
$(ECHO) > $$($1_DEPS_FILE) ; \
|
||||
$(ECHO) > $$($1_DEPS_TARGETS_FILE)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define CreatePrecompiledHeader
|
||||
ifneq ($$($1_PRECOMPILED_HEADER), )
|
||||
ifeq ($(USE_PRECOMPILED_HEADER), true)
|
||||
ifeq ($(TOOLCHAIN_TYPE), microsoft)
|
||||
$1_PCH_FILE := $$($1_OBJECT_DIR)/$1.pch
|
||||
$1_GENERATED_PCH_SRC := $$($1_OBJECT_DIR)/$1_pch.cpp
|
||||
$1_GENERATED_PCH_OBJ := $$($1_OBJECT_DIR)/$1_pch$(OBJ_SUFFIX)
|
||||
|
||||
$$(eval $$(call CreateCompiledNativeFile, $1_$$(notdir $$($1_GENERATED_PCH_SRC)), \
|
||||
FILE := $$($1_GENERATED_PCH_SRC), \
|
||||
BASE := $1, \
|
||||
EXTRA_CXXFLAGS := -Fp$$($1_PCH_FILE) -Yc$$(notdir $$($1_PRECOMPILED_HEADER)), \
|
||||
))
|
||||
|
||||
$1_USE_PCH_FLAGS := \
|
||||
-Fp$$($1_PCH_FILE) -Yu$$(notdir $$($1_PRECOMPILED_HEADER))
|
||||
|
||||
$$($1_ALL_OBJS): $$($1_GENERATED_PCH_OBJ)
|
||||
|
||||
# Explicitly add the pch obj file first to ease comparing to old
|
||||
# hotspot build.
|
||||
$1_ALL_OBJS := $$($1_GENERATED_PCH_OBJ) $$($1_ALL_OBJS)
|
||||
|
||||
$$($1_GENERATED_PCH_SRC):
|
||||
$(ECHO) "#include \"$$(notdir $$($1_PRECOMPILED_HEADER))\"" > $$@
|
||||
|
||||
else ifneq ($(findstring $(TOOLCHAIN_TYPE), gcc clang), )
|
||||
ifeq ($(TOOLCHAIN_TYPE), gcc)
|
||||
$1_PCH_FILE := $$($1_OBJECT_DIR)/precompiled/$$(notdir $$($1_PRECOMPILED_HEADER)).gch
|
||||
$1_USE_PCH_FLAGS := -I$$($1_OBJECT_DIR)/precompiled
|
||||
else ifeq ($(TOOLCHAIN_TYPE), clang)
|
||||
$1_PCH_FILE := $$($1_OBJECT_DIR)/precompiled/$$(notdir $$($1_PRECOMPILED_HEADER)).pch
|
||||
$1_USE_PCH_FLAGS := -include-pch $$($1_PCH_FILE)
|
||||
endif
|
||||
$1_PCH_DEPS_FILE := $$($1_PCH_FILE).d
|
||||
$1_PCH_DEPS_TARGETS_FILE := $$($1_PCH_FILE).d.targets
|
||||
|
||||
-include $$($1_PCH_DEPS_FILE)
|
||||
-include $$($1_PCH_DEPS_TARGETS_FILE)
|
||||
|
||||
$1_PCH_COMMAND := $$($1_CC) $$($1_CFLAGS) $$($1_EXTRA_CFLAGS) $$($1_SYSROOT_CFLAGS) \
|
||||
$$($1_OPT_CFLAGS) -x c++-header -c $(GENDEPS_FLAGS) \
|
||||
$$(addsuffix .tmp, $$($1_PCH_DEPS_FILE))
|
||||
|
||||
$$($1_PCH_FILE): $$($1_PRECOMPILED_HEADER) $$($1_COMPILE_VARDEPS_FILE)
|
||||
$$(call LogInfo, Generating precompiled header)
|
||||
$$(call MakeDir, $$(@D))
|
||||
$$(call ExecuteWithLog, $$@, $$(call MakeCommandRelative, \
|
||||
$$($1_PCH_COMMAND) $$< -o $$@))
|
||||
$$(call fix-deps-file, $$($1_PCH_DEPS_FILE))
|
||||
$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_PCH_DEPS_FILE) \
|
||||
> $$($1_PCH_DEPS_TARGETS_FILE)
|
||||
|
||||
$$($1_ALL_OBJS): $$($1_PCH_FILE)
|
||||
|
||||
# Generate the corresponding compile_commands.json fragment.
|
||||
$1_PCH_FILE_JSON := $$(MAKESUPPORT_OUTPUTDIR)/compile-commands/$$(subst /,_,$$(subst \
|
||||
$$(OUTPUTDIR)/,,$$($1_PCH_FILE))).json
|
||||
$1_ALL_OBJS_JSON += $$($1_PCH_FILE_JSON)
|
||||
|
||||
$$($1_PCH_FILE_JSON): $$($1_PRECOMPILED_HEADER) $$($1_COMPILE_VARDEPS_FILE)
|
||||
$$(call WriteCompileCommandsFragment, $$@, $$(PWD), $$<, \
|
||||
$$($1_PCH_COMMAND) $$< -o $$($1_PCH_FILE))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define CreateWindowsResourceFile
|
||||
ifneq ($$($1_VERSIONINFO_RESOURCE), )
|
||||
$1_RES := $$($1_OBJECT_DIR)/$$($1_BASENAME).res
|
||||
$1_RES_DEPS_FILE := $$($1_RES).d
|
||||
$1_RES_DEPS_TARGETS_FILE := $$($1_RES).d.targets
|
||||
-include $$($1_RES_DEPS_FILE)
|
||||
-include $$($1_RES_DEPS_TARGETS_FILE)
|
||||
|
||||
$1_RES_VARDEPS := $$($1_RC) $$($1_RCFLAGS)
|
||||
$1_RES_VARDEPS_FILE := $$(call DependOnVariable, $1_RES_VARDEPS, \
|
||||
$$($1_RES).vardeps)
|
||||
|
||||
$$($1_RES): $$($1_VERSIONINFO_RESOURCE) $$($1_RES_VARDEPS_FILE)
|
||||
$$(call LogInfo, Compiling resource $$(notdir $$($1_VERSIONINFO_RESOURCE)) (for $$($1_BASENAME)))
|
||||
$$(call MakeDir, $$(@D) $$($1_OBJECT_DIR))
|
||||
$$(call ExecuteWithLog, $$@, $$(call MakeCommandRelative, \
|
||||
$$($1_RC) $$($1_RCFLAGS) $$($1_SYSROOT_CFLAGS) $(CC_OUT_OPTION)$$@ \
|
||||
$$($1_VERSIONINFO_RESOURCE) 2>&1 ))
|
||||
# Windows RC compiler does not support -showIncludes, so we mis-use CL
|
||||
# for this. Filter out RC specific arguments that are unknown to CL.
|
||||
# For some unknown reason, in this case CL actually outputs the show
|
||||
# includes to stderr so need to redirect it to hide the output from the
|
||||
# main log.
|
||||
$$(call ExecuteWithLog, $$($1_RES_DEPS_FILE)$(OBJ_SUFFIX), \
|
||||
$$($1_CC) $$(filter-out -l%, $$($1_RCFLAGS)) \
|
||||
$$($1_SYSROOT_CFLAGS) -showIncludes -nologo -TC \
|
||||
$(CC_OUT_OPTION)$$($1_RES_DEPS_FILE)$(OBJ_SUFFIX) -P -Fi$$($1_RES_DEPS_FILE).pp \
|
||||
$$($1_VERSIONINFO_RESOURCE)) 2>&1 \
|
||||
| $(TR) -d '\r' | $(GREP) -v -e "^Note: including file:" \
|
||||
-e "^$$(notdir $$($1_VERSIONINFO_RESOURCE))$$$$" || test "$$$$?" = "1" ; \
|
||||
$(ECHO) $$($1_RES): \\ > $$($1_RES_DEPS_FILE) ; \
|
||||
$(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_RES_DEPS_FILE)$(OBJ_SUFFIX).log \
|
||||
>> $$($1_RES_DEPS_FILE) ; \
|
||||
$(ECHO) >> $$($1_RES_DEPS_FILE) ;\
|
||||
$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_RES_DEPS_FILE) \
|
||||
> $$($1_RES_DEPS_TARGETS_FILE)
|
||||
endif
|
||||
endef
|
||||
100
make/common/native/DebugSymbols.gmk
Normal file
100
make/common/native/DebugSymbols.gmk
Normal file
@@ -0,0 +1,100 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, 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.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# This file contains functionality related to native debug symbol handling.
|
||||
|
||||
################################################################################
|
||||
define CreateDebugSymbols
|
||||
ifneq ($$($1_COPY_DEBUG_SYMBOLS), false)
|
||||
$1_COPY_DEBUG_SYMBOLS := $(COPY_DEBUG_SYMBOLS)
|
||||
endif
|
||||
|
||||
ifneq ($$($1_ZIP_EXTERNAL_DEBUG_SYMBOLS), false)
|
||||
$1_ZIP_EXTERNAL_DEBUG_SYMBOLS := $(ZIP_EXTERNAL_DEBUG_SYMBOLS)
|
||||
endif
|
||||
|
||||
$1_CREATE_DEBUGINFO := false
|
||||
ifeq ($$($1_COPY_DEBUG_SYMBOLS), true)
|
||||
ifneq ($$($1_DEBUG_SYMBOLS), false)
|
||||
$$(call SetIfEmpty, $1_SYMBOLS_DIR, $$($1_OUTPUT_DIR))
|
||||
# Only copy debug symbols for dynamic libraries and programs.
|
||||
ifneq ($$($1_TYPE), STATIC_LIBRARY)
|
||||
$1_CREATE_DEBUGINFO := true
|
||||
|
||||
# Setup where the platform specific debuginfo files end up
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
$1_DEBUGINFO_FILES := $$($1_SYMBOLS_DIR)/$$($1_BASENAME).pdb \
|
||||
$$($1_SYMBOLS_DIR)/$$($1_BASENAME).map
|
||||
$1_DEBUGINFO_ZIP := $$($1_SYMBOLS_DIR)/$$($1_BASENAME).diz
|
||||
else ifeq ($(call isTargetOs, macosx), true)
|
||||
$1_DEBUGINFO_FILES := \
|
||||
$$($1_SYMBOLS_DIR)/$$($1_BASENAME).dSYM/Contents/Info.plist \
|
||||
$$($1_SYMBOLS_DIR)/$$($1_BASENAME).dSYM/Contents/Resources/DWARF/$$($1_BASENAME)
|
||||
$1_DEBUGINFO_ZIP := $$($1_SYMBOLS_DIR)/$$($1_NOSUFFIX).diz
|
||||
else ifeq ($(call isTargetOsType, unix), true)
|
||||
$1_DEBUGINFO_FILES := $$($1_SYMBOLS_DIR)/$$($1_NOSUFFIX).debuginfo
|
||||
$1_DEBUGINFO_ZIP := $$($1_SYMBOLS_DIR)/$$($1_NOSUFFIX).diz
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
$1_EXTRA_LDFLAGS += -debug "-pdb:$$($1_SYMBOLS_DIR)/$$($1_BASENAME).pdb" \
|
||||
"-map:$$($1_SYMBOLS_DIR)/$$($1_BASENAME).map"
|
||||
ifeq ($(SHIP_DEBUG_SYMBOLS), public)
|
||||
$1_EXTRA_LDFLAGS += "-pdbstripped:$$($1_SYMBOLS_DIR)/$$($1_BASENAME).stripped.pdb"
|
||||
endif
|
||||
endif
|
||||
|
||||
# Since the link rule creates more than one file that we want to track,
|
||||
# we have to use some tricks to get make to cooperate. To properly
|
||||
# trigger downstream dependants of $$($1_DEBUGINFO_FILES), we must have
|
||||
# a recipe in the rule below. To avoid rerunning the recipe every time
|
||||
# have it touch the target. If a debuginfo file is deleted by something
|
||||
# external, explicitly delete the TARGET to trigger a rebuild of both.
|
||||
ifneq ($$(wildcard $$($1_DEBUGINFO_FILES)), $$($1_DEBUGINFO_FILES))
|
||||
$$(call LogDebug, Deleting $$($1_BASENAME) because debuginfo files are missing)
|
||||
$$(shell $(RM) $$($1_TARGET))
|
||||
endif
|
||||
$$($1_DEBUGINFO_FILES): $$($1_TARGET)
|
||||
$$(if $$(CORRECT_FUNCTION_IN_RECIPE_EVALUATION), \
|
||||
$$(if $$(wildcard $$@), , $$(error $$@ was not created for $$<)) \
|
||||
)
|
||||
$(TOUCH) $$@
|
||||
|
||||
$1 += $$($1_DEBUGINFO_FILES)
|
||||
|
||||
ifeq ($$($1_ZIP_EXTERNAL_DEBUG_SYMBOLS), true)
|
||||
# The dependency on TARGET is needed for debuginfo files
|
||||
# to be rebuilt properly.
|
||||
$$($1_DEBUGINFO_ZIP): $$($1_DEBUGINFO_FILES) $$($1_TARGET)
|
||||
$(CD) $$($1_SYMBOLS_DIR) && \
|
||||
$(ZIPEXE) -q -r $$@ $$(subst $$($1_SYMBOLS_DIR)/,, $$($1_DEBUGINFO_FILES))
|
||||
|
||||
$1 += $$($1_DEBUGINFO_ZIP)
|
||||
endif
|
||||
endif # !STATIC_LIBRARY
|
||||
endif # $1_DEBUG_SYMBOLS != false
|
||||
endif # COPY_DEBUG_SYMBOLS
|
||||
endef
|
||||
225
make/common/native/Flags.gmk
Normal file
225
make/common/native/Flags.gmk
Normal file
@@ -0,0 +1,225 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, 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.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# This file contains functionality related to setting up compiler and linker
|
||||
# flags, based on various more abstract sources of compilation description,
|
||||
# like optimization level.
|
||||
|
||||
################################################################################
|
||||
# $1 is the prefix of the file to be compiled
|
||||
# $2 is the prefix of the library, i.e. $$($1_BASE)
|
||||
define SetupCompileFileFlags
|
||||
ifeq ($$($1_OPTIMIZATION), )
|
||||
$1_OPT_CFLAGS := $$($2_OPT_CFLAGS)
|
||||
$1_OPT_CXXFLAGS := $$($2_OPT_CXXFLAGS)
|
||||
else
|
||||
ifeq ($$($1_OPTIMIZATION), NONE)
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_NONE)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_NONE)
|
||||
else ifeq ($$($1_OPTIMIZATION), LOW)
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_NORM)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_NORM)
|
||||
else ifeq ($$($1_OPTIMIZATION), HIGH)
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_HI)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_HI)
|
||||
else ifeq ($$($1_OPTIMIZATION), HIGHEST)
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_HIGHEST)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_HIGHEST)
|
||||
else ifeq ($$($1_OPTIMIZATION), HIGHEST_JVM)
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_HIGHEST_JVM)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_HIGHEST_JVM)
|
||||
else ifeq ($$($1_OPTIMIZATION), SIZE)
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_SIZE)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_SIZE)
|
||||
else
|
||||
$$(error Unknown value for file OPTIMIZATION: $$($1_OPTIMIZATION))
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($$($2_PRECOMPILED_HEADER), )
|
||||
ifeq ($$(filter $$($1_FILENAME), $$($2_PRECOMPILED_HEADER_EXCLUDE)), )
|
||||
$1_USE_PCH_FLAGS := $$($2_USE_PCH_FLAGS)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(DISABLE_WARNING_PREFIX), )
|
||||
$1_WARNINGS_FLAGS := $$(addprefix $(DISABLE_WARNING_PREFIX), \
|
||||
$$($2_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)_$$($1_FILENAME)) \
|
||||
$$($2_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)_$(OPENJDK_TARGET_OS)_$$($1_FILENAME)))
|
||||
endif
|
||||
|
||||
$1_BASE_CFLAGS := $$($2_CFLAGS) $$($2_EXTRA_CFLAGS) \
|
||||
$$($2_SYSROOT_CFLAGS)
|
||||
$1_BASE_CXXFLAGS := $$($2_CXXFLAGS) $$($2_EXTRA_CXXFLAGS) \
|
||||
$$($2_SYSROOT_CFLAGS) $$($1_EXTRA_CXXFLAGS)
|
||||
$1_BASE_ASFLAGS := $$($2_ASFLAGS) $$($2_EXTRA_ASFLAGS)
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define SetupCompilerFlags
|
||||
# Pickup extra OPENJDK_TARGET_OS_TYPE, OPENJDK_TARGET_OS, TOOLCHAIN_TYPE and
|
||||
# OPENJDK_TARGET_OS plus OPENJDK_TARGET_CPU pair dependent variables for CFLAGS.
|
||||
$1_EXTRA_CFLAGS := $$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_CFLAGS_$(OPENJDK_TARGET_OS)) \
|
||||
$$($1_CFLAGS_$(TOOLCHAIN_TYPE)) \
|
||||
$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_$(OPENJDK_TARGET_CPU))
|
||||
|
||||
ifneq ($(DEBUG_LEVEL), release)
|
||||
# Pickup extra debug dependent variables for CFLAGS
|
||||
$1_EXTRA_CFLAGS += $$($1_CFLAGS_debug)
|
||||
$1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)_debug)
|
||||
$1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_debug)
|
||||
$1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_$(OPENJDK_TARGET_CPU)_debug)
|
||||
else
|
||||
$1_EXTRA_CFLAGS += $$($1_CFLAGS_release)
|
||||
$1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
|
||||
$1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_release)
|
||||
$1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_$(OPENJDK_TARGET_CPU)_release)
|
||||
endif
|
||||
ifeq ($(STATIC_LIBS), true)
|
||||
$1_EXTRA_CFLAGS += $$(STATIC_LIBS_CFLAGS)
|
||||
endif
|
||||
|
||||
# Pickup extra OPENJDK_TARGET_OS_TYPE, OPENJDK_TARGET_OS and/or TOOLCHAIN_TYPE
|
||||
# dependent variables for CXXFLAGS.
|
||||
$1_EXTRA_CXXFLAGS := $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)) \
|
||||
$$($1_CXXFLAGS_$(TOOLCHAIN_TYPE))
|
||||
|
||||
ifneq ($(DEBUG_LEVEL), release)
|
||||
# Pickup extra debug dependent variables for CXXFLAGS
|
||||
$1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_debug)
|
||||
$1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)_debug)
|
||||
$1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_debug)
|
||||
else
|
||||
$1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_release)
|
||||
$1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
|
||||
$1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release)
|
||||
endif
|
||||
ifeq ($(STATIC_LIBS), true)
|
||||
$1_EXTRA_CXXFLAGS += $$(STATIC_LIB_CFLAGS)
|
||||
endif
|
||||
|
||||
# If no C++ flags are explicitly set, default to using the C flags.
|
||||
# After that, we can set additional C++ flags that should not interfere
|
||||
# with the mechanism for copying the C flags by default.
|
||||
ifeq ($$($1_CXXFLAGS), )
|
||||
$1_CXXFLAGS := $$($1_CFLAGS)
|
||||
endif
|
||||
ifeq ($$(strip $$($1_EXTRA_CXXFLAGS)), )
|
||||
$1_EXTRA_CXXFLAGS := $$($1_EXTRA_CFLAGS)
|
||||
endif
|
||||
|
||||
$$(call SetIfEmpty, $1_COMPILE_WITH_DEBUG_SYMBOLS, $$(COMPILE_WITH_DEBUG_SYMBOLS))
|
||||
|
||||
ifeq ($(STATIC_LIBS), true)
|
||||
# For release builds where debug symbols are configured to be moved to
|
||||
# separate debuginfo files, disable debug symbols for static libs instead.
|
||||
# We don't currently support this configuration and we don't want symbol
|
||||
# information in release builds unless explicitly asked to provide it.
|
||||
ifeq ($(DEBUG_LEVEL), release)
|
||||
ifeq ($(COPY_DEBUG_SYMBOLS), true)
|
||||
$1_COMPILE_WITH_DEBUG_SYMBOLS := false
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($$($1_COMPILE_WITH_DEBUG_SYMBOLS), true)
|
||||
$1_EXTRA_CFLAGS += $$(CFLAGS_DEBUG_SYMBOLS)
|
||||
$1_EXTRA_CXXFLAGS += $$(CFLAGS_DEBUG_SYMBOLS)
|
||||
$1_EXTRA_ASFLAGS += $$(ASFLAGS_DEBUG_SYMBOLS)
|
||||
endif
|
||||
|
||||
# Pass the library name for static JNI library naming
|
||||
ifeq ($$($1_TYPE), STATIC_LIBRARY)
|
||||
$1_EXTRA_CFLAGS += -DLIBRARY_NAME=$$($1_NAME)
|
||||
$1_EXTRA_CXXFLAGS += -DLIBRARY_NAME=$$($1_NAME)
|
||||
endif
|
||||
|
||||
# Pick up disabled warnings, if possible on this platform.
|
||||
ifneq ($(DISABLE_WARNING_PREFIX), )
|
||||
$1_EXTRA_CFLAGS += $$(addprefix $(DISABLE_WARNING_PREFIX), \
|
||||
$$(DISABLED_WARNINGS) \
|
||||
$$(DISABLED_WARNINGS_C) \
|
||||
$$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)) \
|
||||
$$($1_DISABLED_WARNINGS_C_$(TOOLCHAIN_TYPE)) \
|
||||
$$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)_$(OPENJDK_TARGET_OS)) \
|
||||
$$($1_DISABLED_WARNINGS_C_$(TOOLCHAIN_TYPE)_$(OPENJDK_TARGET_OS)))
|
||||
$1_EXTRA_CXXFLAGS += $$(addprefix $(DISABLE_WARNING_PREFIX), \
|
||||
$$(DISABLED_WARNINGS) \
|
||||
$$(DISABLED_WARNINGS_CXX) \
|
||||
$$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)) \
|
||||
$$($1_DISABLED_WARNINGS_CXX_$(TOOLCHAIN_TYPE)) \
|
||||
$$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)_$(OPENJDK_TARGET_OS)) \
|
||||
$$($1_DISABLED_WARNINGS_CXX_$(TOOLCHAIN_TYPE)_$(OPENJDK_TARGET_OS)))
|
||||
endif
|
||||
|
||||
# Check if warnings should be considered errors.
|
||||
# Pick first binary and toolchain specific, then binary specific, then general setting.
|
||||
ifeq ($$($1_WARNINGS_AS_ERRORS_$(TOOLCHAIN_TYPE)), )
|
||||
ifeq ($$($1_WARNINGS_AS_ERRORS), )
|
||||
$1_WARNINGS_AS_ERRORS_$(TOOLCHAIN_TYPE) := $$(WARNINGS_AS_ERRORS)
|
||||
else
|
||||
$1_WARNINGS_AS_ERRORS_$(TOOLCHAIN_TYPE) := $$($1_WARNINGS_AS_ERRORS)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($$($1_WARNINGS_AS_ERRORS_$(TOOLCHAIN_TYPE)), true)
|
||||
$1_EXTRA_CFLAGS += $(CFLAGS_WARNINGS_ARE_ERRORS)
|
||||
$1_EXTRA_CXXFLAGS += $(CFLAGS_WARNINGS_ARE_ERRORS)
|
||||
endif
|
||||
|
||||
ifeq (NONE, $$($1_OPTIMIZATION))
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_NONE)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_NONE)
|
||||
else ifeq (LOW, $$($1_OPTIMIZATION))
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_NORM)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_NORM)
|
||||
else ifeq (HIGH, $$($1_OPTIMIZATION))
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_HI)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_HI)
|
||||
else ifeq (HIGHEST, $$($1_OPTIMIZATION))
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_HIGHEST)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_HIGHEST)
|
||||
else ifeq (HIGHEST_JVM, $$($1_OPTIMIZATION))
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_HIGHEST_JVM)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_HIGHEST_JVM)
|
||||
else ifeq (SIZE, $$($1_OPTIMIZATION))
|
||||
$1_OPT_CFLAGS := $(C_O_FLAG_SIZE)
|
||||
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_SIZE)
|
||||
else ifneq (, $$($1_OPTIMIZATION))
|
||||
$$(error Unknown value for OPTIMIZATION: $$($1_OPTIMIZATION))
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define SetupLinkerFlags
|
||||
# Pickup extra OPENJDK_TARGET_OS_TYPE, OPENJDK_TARGET_OS and TOOLCHAIN_TYPE
|
||||
# dependent variables for LDFLAGS and LIBS, and additionally the pair dependent
|
||||
# TOOLCHAIN_TYPE plus OPENJDK_TARGET_OS
|
||||
$1_EXTRA_LDFLAGS += $$($1_LDFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LDFLAGS_$(OPENJDK_TARGET_OS)) \
|
||||
$$($1_LDFLAGS_$(TOOLCHAIN_TYPE)) $$($1_LDFLAGS_$(TOOLCHAIN_TYPE)_$(OPENJDK_TARGET_OS))
|
||||
$1_EXTRA_LIBS += $$($1_LIBS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LIBS_$(OPENJDK_TARGET_OS)) \
|
||||
$$($1_LIBS_$(TOOLCHAIN_TYPE)) $$($1_LIBS_$(TOOLCHAIN_TYPE)_$(OPENJDK_TARGET_OS))
|
||||
endef
|
||||
203
make/common/native/Link.gmk
Normal file
203
make/common/native/Link.gmk
Normal file
@@ -0,0 +1,203 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, 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.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# This file contains functionality related to linking a native binary;
|
||||
# creating either a dynamic library, a static library or an executable.
|
||||
|
||||
################################################################################
|
||||
# GetEntitlementsFile
|
||||
# Find entitlements file for executable when signing on macosx. If no
|
||||
# specialized file is found, returns the default file.
|
||||
# This macro might be called from custom makefiles.
|
||||
# $1 Executable to find entitlements file for.
|
||||
ENTITLEMENTS_DIR := $(TOPDIR)/make/data/macosxsigning
|
||||
ifeq ($(MACOSX_CODESIGN_MODE), debug)
|
||||
CODESIGN_PLIST_SUFFIX := -debug
|
||||
else
|
||||
CODESIGN_PLIST_SUFFIX :=
|
||||
endif
|
||||
DEFAULT_ENTITLEMENTS_FILE := $(ENTITLEMENTS_DIR)/default$(CODESIGN_PLIST_SUFFIX).plist
|
||||
|
||||
GetEntitlementsFile = \
|
||||
$(foreach f, $(ENTITLEMENTS_DIR)/$(strip $(notdir $1))$(CODESIGN_PLIST_SUFFIX).plist, \
|
||||
$(if $(wildcard $f), $f, $(DEFAULT_ENTITLEMENTS_FILE)) \
|
||||
)
|
||||
|
||||
################################################################################
|
||||
define SetupLinking
|
||||
# Unless specifically set, stripping should only happen if symbols are also
|
||||
# being copied.
|
||||
$$(call SetIfEmpty, $1_STRIP_SYMBOLS, $$($1_COPY_DEBUG_SYMBOLS))
|
||||
|
||||
# Default to using the global STRIPFLAGS. Allow for overriding with an
|
||||
# empty value
|
||||
$1_STRIPFLAGS ?= $(STRIPFLAGS)
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define CreateLinkedResult
|
||||
ifeq ($$($1_TYPE), STATIC_LIBRARY)
|
||||
$$(eval $$(call CreateStaticLibrary,$1))
|
||||
else
|
||||
$$(eval $$(call CreateDynamicLibraryOrExecutable,$1))
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define CreateStaticLibrary
|
||||
# Include partial linking when building the static library with clang on linux
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
ifneq ($(findstring $(TOOLCHAIN_TYPE), clang), )
|
||||
$1_ENABLE_PARTIAL_LINKING := true
|
||||
endif
|
||||
endif
|
||||
|
||||
$1_VARDEPS := $$($1_AR) $$(ARFLAGS) $$($1_LIBS) \
|
||||
$$($1_EXTRA_LIBS)
|
||||
ifeq ($$($1_ENABLE_PARTIAL_LINKING), true)
|
||||
$1_VARDEPS += $$($1_LD) $$($1_SYSROOT_LDFLAGS)
|
||||
endif
|
||||
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
|
||||
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
|
||||
|
||||
$1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_EXTRA_LINK_DEPS) $$($1_VARDEPS_FILE)
|
||||
|
||||
$1_AR_OBJ_ARG := $$($1_LD_OBJ_ARG)
|
||||
# With clang on linux, partial linking is enabled and 'AR' takes the output
|
||||
# object from the partial linking step.
|
||||
ifeq ($$($1_ENABLE_PARTIAL_LINKING), true)
|
||||
$1_TARGET_RELOCATABLE := $$($1_OBJECT_DIR)/$$($1_PREFIX)$$($1_NAME)_relocatable$(OBJ_SUFFIX)
|
||||
$1_AR_OBJ_ARG := $$($1_TARGET_RELOCATABLE)
|
||||
endif
|
||||
|
||||
$$($1_TARGET): $$($1_TARGET_DEPS)
|
||||
ifneq ($$($1_OBJ_FILE_LIST), )
|
||||
ifeq ($$($1_LINK_OBJS_RELATIVE), true)
|
||||
$$(eval $$(call ListPathsSafely, $1_ALL_OBJS_RELATIVE, $$($1_OBJ_FILE_LIST)))
|
||||
else
|
||||
$$(eval $$(call ListPathsSafely, $1_ALL_OBJS, $$($1_OBJ_FILE_LIST)))
|
||||
endif
|
||||
endif
|
||||
$$(call LogInfo, Building static library $$($1_BASENAME))
|
||||
$$(call MakeDir, $$($1_OUTPUT_DIR) $$($1_SYMBOLS_DIR))
|
||||
# Do partial linking.
|
||||
ifeq ($$($1_ENABLE_PARTIAL_LINKING), true)
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_partial_link, \
|
||||
$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUTDIR) ; ) \
|
||||
$$($1_LD) $(LDFLAGS_CXX_PARTIAL_LINKING) $$($1_SYSROOT_LDFLAGS) \
|
||||
-o $$($1_TARGET_RELOCATABLE) $$($1_LD_OBJ_ARG))
|
||||
endif
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_run_ar, \
|
||||
$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUTDIR) ; ) \
|
||||
$$($1_AR) $$(ARFLAGS) -r -cs $$($1_TARGET) \
|
||||
$$($1_AR_OBJ_ARG) $$($1_RES))
|
||||
ifeq ($(STATIC_BUILD), true)
|
||||
$(RM) $$(@D)/$$(basename $$(@F)).symbols; \
|
||||
$(ECHO) "Getting symbols from nm"; \
|
||||
$(NM) $(NMFLAGS) -m $$($1_TARGET) | $(GREP) "__TEXT" | \
|
||||
$(EGREP) -v "non-external|private extern|__TEXT,__eh_frame" | \
|
||||
$(SED) -e 's/.* //' > $$(@D)/$$(basename $$(@F)).symbols
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define CreateDynamicLibraryOrExecutable
|
||||
# A shared dynamic library or an executable binary has been specified
|
||||
ifeq ($$($1_TYPE), LIBRARY)
|
||||
# Generating a dynamic library.
|
||||
$1_EXTRA_LDFLAGS += $$(call SET_SHARED_LIBRARY_NAME,$$($1_BASENAME))
|
||||
endif
|
||||
|
||||
ifeq ($(MACOSX_CODESIGN_MODE), hardened)
|
||||
$1_CODESIGN_OPTS := "$(MACOSX_CODESIGN_IDENTITY)" --timestamp \
|
||||
--options runtime
|
||||
else ifeq ($(MACOSX_CODESIGN_MODE), debug)
|
||||
$1_CODESIGN_OPTS := -
|
||||
endif
|
||||
|
||||
$1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) \
|
||||
$$($1_EXTRA_LDFLAGS) $$($1_LIBS) $$($1_EXTRA_LIBS) \
|
||||
$$($1_DEBUGINFO_FILES) $$($1_STRIPFLAGS)
|
||||
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
|
||||
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
|
||||
|
||||
$1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_EXTRA_LINK_DEPS) $$($1_VARDEPS_FILE)
|
||||
|
||||
$$($1_TARGET): $$($1_TARGET_DEPS)
|
||||
ifneq ($$($1_OBJ_FILE_LIST), )
|
||||
ifeq ($$($1_LINK_OBJS_RELATIVE), true)
|
||||
$$(eval $$(call ListPathsSafely, $1_ALL_OBJS_RELATIVE, $$($1_OBJ_FILE_LIST)))
|
||||
else
|
||||
$$(eval $$(call ListPathsSafely, $1_ALL_OBJS, $$($1_OBJ_FILE_LIST)))
|
||||
endif
|
||||
endif
|
||||
$$(call LogInfo, Linking $$($1_BASENAME))
|
||||
$$(call MakeDir, $$($1_OUTPUT_DIR) $$($1_SYMBOLS_DIR))
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_run_ld, \
|
||||
$$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUTDIR) ; ) \
|
||||
$$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \
|
||||
$$($1_SYSROOT_LDFLAGS) -o $$($1_TARGET) $$($1_LD_OBJ_ARG) \
|
||||
$$($1_LIBS) $$($1_EXTRA_LIBS))
|
||||
ifeq ($$($1_CREATE_DEBUGINFO), true)
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
# This cannot be run separately since it updates the original target
|
||||
# file.
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_create_debuginfo, \
|
||||
$$($1_OBJCOPY) --only-keep-debug $$($1_TARGET) $$($1_DEBUGINFO_FILES))
|
||||
$$(CHMOD) -x $$($1_DEBUGINFO_FILES)
|
||||
else ifeq ($(call isTargetOs, aix), true)
|
||||
# AIX does not provide the equivalent of objcopy to extract debug
|
||||
# symbols, so we copy unstripped library instead.
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_create_debuginfo, \
|
||||
$(CP) $$($1_TARGET) $$($1_DEBUGINFO_FILES))
|
||||
else ifeq ($(call isTargetOs, macosx), true)
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_create_debuginfo, \
|
||||
$(DSYMUTIL) --out $$($1_SYMBOLS_DIR)/$$($1_BASENAME).dSYM $$($1_TARGET))
|
||||
endif
|
||||
endif
|
||||
ifneq ($$($1_STRIP_SYMBOLS), false)
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_strip, \
|
||||
$$($1_STRIP) $$($1_STRIPFLAGS) $$($1_TARGET))
|
||||
endif
|
||||
ifeq ($$($1_CREATE_DEBUGINFO), true)
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
# Run this after strip is called, since strip can sometimes mangle
|
||||
# the embedded debuglink, which we want to avoid.
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_add_debuginfo_link, \
|
||||
$(CD) $$($1_SYMBOLS_DIR) && \
|
||||
$$($1_OBJCOPY) --add-gnu-debuglink=$$($1_DEBUGINFO_FILES) $$($1_TARGET))
|
||||
endif
|
||||
endif
|
||||
ifneq ($(MACOSX_CODESIGN_MODE), disabled)
|
||||
# Remove signature explicitly first to avoid warnings if the linker
|
||||
# added a default adhoc signature.
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_codesign_clear, \
|
||||
$(CODESIGN) --remove-signature $$@)
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_codesign_add, \
|
||||
$(CODESIGN) -f -s $$($1_CODESIGN_OPTS) --entitlements \
|
||||
$$(call GetEntitlementsFile, $$@) $$@)
|
||||
endif
|
||||
endef
|
||||
115
make/common/native/LinkMicrosoft.gmk
Normal file
115
make/common/native/LinkMicrosoft.gmk
Normal file
@@ -0,0 +1,115 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, 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.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# This file contains functionality related to linking a native binary;
|
||||
# creating either a dynamic library, a static library or an executable.
|
||||
|
||||
################################################################################
|
||||
define CreateLinkedResultMicrosoft
|
||||
ifeq ($$($1_TYPE), STATIC_LIBRARY)
|
||||
$$(eval $$(call CreateStaticLibraryMicrosoft,$1))
|
||||
else
|
||||
$$(eval $$(call CreateDynamicLibraryOrExecutableMicrosoft,$1))
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define CreateStaticLibraryMicrosoft
|
||||
$1_VARDEPS := $$($1_LIB) $$(LIBFLAGS) $$($1_LIBS) \
|
||||
$$($1_EXTRA_LIBS)
|
||||
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
|
||||
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
|
||||
|
||||
$1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_RES) $$($1_EXTRA_LINK_DEPS) \
|
||||
$$($1_VARDEPS_FILE)
|
||||
|
||||
$$($1_TARGET): $$($1_TARGET_DEPS)
|
||||
ifneq ($$($1_OBJ_FILE_LIST), )
|
||||
$$(eval $$(call ListPathsSafely, $1_ALL_OBJS, $$($1_OBJ_FILE_LIST)))
|
||||
endif
|
||||
$$(call LogInfo, Building static library $$($1_BASENAME))
|
||||
$$(call MakeDir, $$($1_OUTPUT_DIR) $$($1_SYMBOLS_DIR))
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_run_lib, \
|
||||
$$($1_LIB) -nologo $$(LIBFLAGS) -out:$$($1_TARGET) \
|
||||
$$($1_LD_OBJ_ARG) $$($1_RES))
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define CreateDynamicLibraryOrExecutableMicrosoft
|
||||
ifeq ($$($1_EMBED_MANIFEST), true)
|
||||
$1_EXTRA_LDFLAGS += -manifest:embed
|
||||
endif
|
||||
|
||||
$1_IMPORT_LIBRARY := $$($1_OBJECT_DIR)/$$($1_NAME).lib
|
||||
$1_EXTRA_LDFLAGS += "-implib:$$($1_IMPORT_LIBRARY)"
|
||||
|
||||
ifeq ($$($1_TYPE), LIBRARY)
|
||||
# To properly trigger downstream dependants of the import library, just as
|
||||
# for debug files, we must have a recipe in the rule. To avoid rerunning
|
||||
# the recipe every time have it touch the target. If an import library
|
||||
# file is deleted by something external, explicitly delete the target to
|
||||
# trigger a rebuild of both.
|
||||
ifneq ($$(wildcard $$($1_IMPORT_LIBRARY)), $$($1_IMPORT_LIBRARY))
|
||||
$$(call LogDebug, Deleting $$($1_BASENAME) because import library is missing)
|
||||
$$(shell $(RM) $$($1_TARGET))
|
||||
endif
|
||||
$$($1_IMPORT_LIBRARY): $$($1_TARGET)
|
||||
$(TOUCH) $$@
|
||||
|
||||
$1 += $$($1_IMPORT_LIBRARY)
|
||||
endif
|
||||
|
||||
$1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) \
|
||||
$$($1_EXTRA_LDFLAGS) $$($1_LIBS) $$($1_EXTRA_LIBS) $$($1_MT) \
|
||||
$$($1_MANIFEST_VERSION)
|
||||
|
||||
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
|
||||
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
|
||||
|
||||
$1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_RES) $$($1_MANIFEST) \
|
||||
$$($1_EXTRA_LINK_DEPS) $$($1_VARDEPS_FILE)
|
||||
|
||||
$$($1_TARGET): $$($1_TARGET_DEPS)
|
||||
ifneq ($$($1_OBJ_FILE_LIST), )
|
||||
$$(eval $$(call ListPathsSafely, $1_ALL_OBJS, $$($1_OBJ_FILE_LIST)))
|
||||
endif
|
||||
$$(call LogInfo, Linking $$($1_BASENAME))
|
||||
$$(call MakeDir, $$($1_OUTPUT_DIR) $$($1_SYMBOLS_DIR))
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_run_ld, \
|
||||
$$($1_LD) -nologo $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \
|
||||
$$($1_SYSROOT_LDFLAGS) -out:$$($1_TARGET) $$($1_LD_OBJ_ARG) \
|
||||
$$($1_RES) $$($1_LIBS) $$($1_EXTRA_LIBS)) \
|
||||
| $(GREP) -v "^ Creating library .*\.lib and object .*\.exp" || \
|
||||
test "$$$$?" = "1"
|
||||
ifeq ($(call isBuildOsEnv, windows.wsl2), true)
|
||||
$$(CHMOD) +x $$($1_TARGET)
|
||||
endif
|
||||
ifneq ($$($1_MANIFEST), )
|
||||
$$($1_MT) -nologo -manifest $$($1_MANIFEST) \
|
||||
-identity:"$$($1_NAME).exe, version=$$($1_MANIFEST_VERSION)" \
|
||||
-outputresource:$$@;#1
|
||||
endif
|
||||
endef
|
||||
242
make/common/native/Paths.gmk
Normal file
242
make/common/native/Paths.gmk
Normal file
@@ -0,0 +1,242 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, 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.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# This file contains functionality related to handling paths for source files
|
||||
# and object files. This is complicated by the fact that we usually, but not
|
||||
# always, use absolute instead of relative paths. It is further complicated
|
||||
# by the fact that not all tools allow inputting large lists of files as
|
||||
# "@-files", which we normally use to avoid hitting command line length limits.
|
||||
# Finally this file contains functionality for locating all source code files
|
||||
# that should be included in the compilation.
|
||||
|
||||
################################################################################
|
||||
# When absolute paths are not allowed in the output, and the compiler does not
|
||||
# support any options to avoid it, we need to rewrite compile commands to use
|
||||
# relative paths. By doing this, the __FILE__ macro will resolve to relative
|
||||
# paths. The relevant input paths on the command line are the -I flags and the
|
||||
# path to the source file itself.
|
||||
#
|
||||
# The macro MakeCommandRelative is used to rewrite the command line like this:
|
||||
# 'CD $(WORKSPACE_ROOT) && <cmd>'
|
||||
# and changes all paths in cmd to be relative to the workspace root. This only
|
||||
# works properly if the build dir is inside the workspace root. If it's not,
|
||||
# relative paths are still calculated, but depending on the distance between the
|
||||
# dirs, paths in the build dir may end up as essentially absolute anyway.
|
||||
#
|
||||
# The fix-deps-file macro is used to adjust the contents of the generated make
|
||||
# dependency files to contain paths compatible with make.
|
||||
#
|
||||
REWRITE_PATHS_RELATIVE = false
|
||||
ifeq ($(ALLOW_ABSOLUTE_PATHS_IN_OUTPUT)-$(FILE_MACRO_CFLAGS), false-)
|
||||
REWRITE_PATHS_RELATIVE = true
|
||||
endif
|
||||
|
||||
# CCACHE_BASEDIR needs fix-deps-file as makefiles use absolute filenames for
|
||||
# object files while CCACHE_BASEDIR will make ccache relativize all paths for
|
||||
# its compiler. The compiler then produces relative dependency files.
|
||||
# make does not know a relative and absolute filename is the same so it will
|
||||
# ignore such dependencies. This only applies when the OUTPUTDIR is inside
|
||||
# the WORKSPACE_ROOT.
|
||||
ifneq ($(CCACHE), )
|
||||
ifneq ($(filter $(WORKSPACE_ROOT)/%, $(OUTPUTDIR)), )
|
||||
REWRITE_PATHS_RELATIVE = true
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(REWRITE_PATHS_RELATIVE), true)
|
||||
# Need to handle -I flags as both '-Ifoo' and '-I foo'.
|
||||
MakeCommandRelative = \
|
||||
$(CD) $(WORKSPACE_ROOT) && \
|
||||
$(foreach o, $1, \
|
||||
$(if $(filter $(WORKSPACE_ROOT)/% $(OUTPUTDIR)/%, $o), \
|
||||
$(call RelativePath, $o, $(WORKSPACE_ROOT)) \
|
||||
, \
|
||||
$(if $(filter -I$(WORKSPACE_ROOT)/%, $o), \
|
||||
-I$(call RelativePath, $(patsubst -I%, %, $o), $(WORKSPACE_ROOT)) \
|
||||
, \
|
||||
$o \
|
||||
) \
|
||||
) \
|
||||
)
|
||||
|
||||
# When compiling with relative paths, the deps file may come out with relative
|
||||
# paths, and that path may start with './'. First remove any leading ./, then
|
||||
# add WORKSPACE_ROOT to any line not starting with /, while allowing for
|
||||
# leading spaces. There may also be multiple entries on the same line, so start
|
||||
# with splitting such lines.
|
||||
# Non GNU sed (BSD on macosx) cannot substitute in literal \n using regex.
|
||||
# Instead use a bash escaped literal newline. To avoid having unmatched quotes
|
||||
# ruin the ability for an editor to properly syntax highlight this file, define
|
||||
# that newline sequence as a separate variable and add the closing quote behind
|
||||
# a comment.
|
||||
sed_newline := \'$$'\n''#'
|
||||
define fix-deps-file
|
||||
$(SED) \
|
||||
-e 's|\([^ ]\) \{1,\}\([^\\:]\)|\1 \\$(sed_newline) \2|g' \
|
||||
$1.tmp \
|
||||
| $(SED) \
|
||||
-e 's|^\([ ]*\)\./|\1|' \
|
||||
-e '/^[ ]*[^/ ]/s|^\([ ]*\)|\1$(WORKSPACE_ROOT)/|' \
|
||||
> $1
|
||||
endef
|
||||
else
|
||||
# By default the MakeCommandRelative macro does nothing.
|
||||
MakeCommandRelative = $1
|
||||
|
||||
# No adjustment is needed.
|
||||
define fix-deps-file
|
||||
$(MV) $1.tmp $1
|
||||
endef
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
define SetupSourceFiles
|
||||
$$(foreach d, $$($1_SRC), $$(if $$(wildcard $$d), , \
|
||||
$$(error SRC specified to SetupNativeCompilation $1 contains missing directory $$d)))
|
||||
|
||||
$1_SRCS_RAW := $$(call FindFiles, $$($1_SRC))
|
||||
# Order src files according to the order of the src dirs
|
||||
$1_SRCS := $$(foreach d, $$($1_SRC), $$(filter $$d%, $$($1_SRCS_RAW)))
|
||||
$1_SRCS := $$(filter $$(NATIVE_SOURCE_EXTENSIONS), $$($1_SRCS))
|
||||
# Extract the C/C++ files.
|
||||
ifneq ($$($1_EXCLUDE_PATTERNS), )
|
||||
# We must not match the exclude pattern against the src root(s).
|
||||
$1_SRCS_WITHOUT_ROOTS := $$($1_SRCS)
|
||||
$$(foreach i, $$($1_SRC), $$(eval $1_SRCS_WITHOUT_ROOTS := $$(patsubst \
|
||||
$$i/%,%, $$($1_SRCS_WITHOUT_ROOTS))))
|
||||
$1_ALL_EXCLUDE_FILES := $$(call containing, $$($1_EXCLUDE_PATTERNS), \
|
||||
$$($1_SRCS_WITHOUT_ROOTS))
|
||||
endif
|
||||
ifneq ($$($1_EXCLUDE_FILES), )
|
||||
$1_ALL_EXCLUDE_FILES += $$($1_EXCLUDE_FILES)
|
||||
endif
|
||||
ifneq ($$($1_ALL_EXCLUDE_FILES), )
|
||||
$1_EXCLUDE_FILES_PAT := $$($1_ALL_EXCLUDE_FILES) \
|
||||
$$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$($1_ALL_EXCLUDE_FILES)))
|
||||
$1_EXCLUDE_FILES_PAT := $$(addprefix %, $$($1_EXCLUDE_FILES_PAT))
|
||||
$1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES_PAT), $$($1_SRCS))
|
||||
endif
|
||||
ifneq ($$($1_INCLUDE_FILES), )
|
||||
$1_INCLUDE_FILES_PAT := $$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$($1_INCLUDE_FILES)))
|
||||
$1_SRCS := $$(filter $$($1_INCLUDE_FILES_PAT), $$($1_SRCS))
|
||||
endif
|
||||
# Now we have a list of all c/c++ files to compile: $$($1_SRCS)
|
||||
|
||||
# Prepend the source/bin path to the filter expressions. Then do the filtering.
|
||||
ifneq ($$($1_INCLUDES), )
|
||||
$1_SRC_INCLUDES := $$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$(addsuffix /%, $$($1_INCLUDES))))
|
||||
$1_SRCS := $$(filter $$($1_SRC_INCLUDES), $$($1_SRCS))
|
||||
endif
|
||||
ifneq ($$($1_EXCLUDES), )
|
||||
$1_SRC_EXCLUDES := $$(addsuffix /%, $$($1_EXCLUDES))
|
||||
$1_SRC_EXCLUDES += $$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$(addsuffix /%, $$($1_EXCLUDES))))
|
||||
$1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES), $$($1_SRCS))
|
||||
endif
|
||||
|
||||
$1_SRCS += $$($1_EXTRA_FILES)
|
||||
|
||||
ifeq ($$($1_SRCS), )
|
||||
$$(error No sources found for $1 when looking inside the dirs $$($1_SRC))
|
||||
endif
|
||||
|
||||
ifeq ($$($1_TYPE), EXECUTABLE)
|
||||
ifeq ($(UBSAN_ENABLED), true)
|
||||
# We need to set the default options for UBSan. This needs to be included in every executable.
|
||||
# Rather than copy and paste code to everything with a main function, we add an additional
|
||||
# source file to every executable that exports __ubsan_default_options.
|
||||
ifneq ($$(filter %.cpp %.cc, $$($1_SRCS)), )
|
||||
$1_SRCS += $(TOPDIR)/make/data/ubsan/ubsan_default_options.cpp
|
||||
else
|
||||
$1_SRCS += $(TOPDIR)/make/data/ubsan/ubsan_default_options.c
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define SetupOutputFiles
|
||||
# Calculate the expected output from compiling the sources
|
||||
$1_EXPECTED_OBJS_FILENAMES := $$(call replace_with_obj_extension, $$(notdir $$($1_SRCS)))
|
||||
$1_EXPECTED_OBJS := $$(addprefix $$($1_OBJECT_DIR)/, $$($1_EXPECTED_OBJS_FILENAMES))
|
||||
# Sort to remove duplicates and provide a reproducible order on the input files to the linker.
|
||||
$1_ALL_OBJS := $$(sort $$($1_EXPECTED_OBJS) $$($1_EXTRA_OBJECT_FILES))
|
||||
ifeq ($(STATIC_LIBS), true)
|
||||
# Exclude the object files that match with $1_STATIC_LIB_EXCLUDE_OBJS.
|
||||
ifneq ($$($1_STATIC_LIB_EXCLUDE_OBJS), )
|
||||
$1_ALL_OBJS := $$(call not-containing, $$($1_STATIC_LIB_EXCLUDE_OBJS), $$($1_ALL_OBJS))
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define RemoveSuperfluousOutputFiles
|
||||
# Are there too many object files on disk? Perhaps because some source file was removed?
|
||||
$1_BINS := $$(wildcard $$($1_OBJECT_DIR)/*$(OBJ_SUFFIX))
|
||||
$1_SUPERFLOUS_OBJS := $$(sort $$(filter-out $$($1_EXPECTED_OBJS), $$($1_BINS)))
|
||||
# Clean out the superfluous object files.
|
||||
ifneq ($$($1_SUPERFLUOUS_OBJS), )
|
||||
$$(shell $(RM) -f $$($1_SUPERFLUOUS_OBJS))
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
define SetupObjectFileList
|
||||
$1_LD_OBJ_ARG := $$($1_ALL_OBJS)
|
||||
|
||||
# If there are many object files, use an @-file...
|
||||
ifneq ($$(word 17, $$($1_ALL_OBJS)), )
|
||||
$1_OBJ_FILE_LIST := $$($1_OBJECT_DIR)/_$1_objectfilenames.txt
|
||||
$1_LD_OBJ_ARG := @$$($1_OBJ_FILE_LIST)
|
||||
|
||||
# If we are building static library, 'AR' on macosx/aix may not support @-file.
|
||||
ifeq ($$($1_TYPE), STATIC_LIBRARY)
|
||||
ifeq ($(call isTargetOs, macosx aix), true)
|
||||
$1_LD_OBJ_ARG := `cat $$($1_OBJ_FILE_LIST)`
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Unfortunately the @-file trick does not work reliably when using clang.
|
||||
# Clang does not propagate the @-file parameter to the ld sub process, but
|
||||
# instead puts the full content on the command line. At least the llvm ld
|
||||
# does not even support an @-file.
|
||||
#
|
||||
# When linking a large amount of object files, we risk hitting the limit
|
||||
# of the command line length even on posix systems if the path length of
|
||||
# the output dir is very long due to our use of absolute paths. To
|
||||
# mitigate this, use paths relative to the output dir when linking over
|
||||
# 500 files with clang and the output dir path is deep.
|
||||
ifneq ($$(word 500, $$($1_ALL_OBJS)), )
|
||||
ifeq ($$(TOOLCHAIN_TYPE), clang)
|
||||
# There is no strlen function in make, but checking path depth is a
|
||||
# reasonable approximation.
|
||||
ifneq ($$(word 10, $$(subst /, ,$$(OUTPUTDIR))), )
|
||||
$1_LINK_OBJS_RELATIVE := true
|
||||
$1_ALL_OBJS_RELATIVE := $$(patsubst $$(OUTPUTDIR)/%, %, $$($1_ALL_OBJS))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
@@ -29,17 +29,17 @@ GTEST_VERSION=1.14.0
|
||||
JTREG_VERSION=7.3.1+1
|
||||
|
||||
LINUX_X64_BOOT_JDK_EXT=tar.gz
|
||||
LINUX_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk21/fd2272bbf8e04c3dbaee13770090416c/35/GPL/openjdk-21_linux-x64_bin.tar.gz
|
||||
LINUX_X64_BOOT_JDK_SHA256=a30c454a9bef8f46d5f1bf3122830014a8fbe7ac03b5f8729bc3add4b92a1d0a
|
||||
LINUX_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk22/830ec9fcccef480bb3e73fb7ecafe059/36/GPL/openjdk-22_linux-x64_bin.tar.gz
|
||||
LINUX_X64_BOOT_JDK_SHA256=4d65cc6ed28711768fd72c2043a7925f7c83f5f51bb64970bd9d52f7791fc6ac
|
||||
|
||||
MACOS_X64_BOOT_JDK_EXT=tar.gz
|
||||
MACOS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk21/fd2272bbf8e04c3dbaee13770090416c/35/GPL/openjdk-21_macos-x64_bin.tar.gz
|
||||
MACOS_X64_BOOT_JDK_SHA256=af32e84c11009f72f783fdcdc9917efc277893988f097e198e2576875d1e88c1
|
||||
MACOS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk22/830ec9fcccef480bb3e73fb7ecafe059/36/GPL/openjdk-22_macos-x64_bin.tar.gz
|
||||
MACOS_X64_BOOT_JDK_SHA256=ae31fe10916429e3fe284266095067a5ce9fecbdc03ff1a079d20459f731ca36
|
||||
|
||||
MACOS_AARCH64_BOOT_JDK_EXT=tar.gz
|
||||
MACOS_AARCH64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk21/fd2272bbf8e04c3dbaee13770090416c/35/GPL/openjdk-21_macos-aarch64_bin.tar.gz
|
||||
MACOS_AARCH64_BOOT_JDK_SHA256=f12e1e0a2dffc847951598f597c8ee60fb0913932f24b2b09c62cfd2f0f4dfb9
|
||||
MACOS_AARCH64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk22/830ec9fcccef480bb3e73fb7ecafe059/36/GPL/openjdk-22_macos-aarch64_bin.tar.gz
|
||||
MACOS_AARCH64_BOOT_JDK_SHA256=d10f82429d01047968c52c7975c326388cb5d212791e14c1de21c987463a4b53
|
||||
|
||||
WINDOWS_X64_BOOT_JDK_EXT=zip
|
||||
WINDOWS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk21/fd2272bbf8e04c3dbaee13770090416c/35/GPL/openjdk-21_windows-x64_bin.zip
|
||||
WINDOWS_X64_BOOT_JDK_SHA256=5434faaf029e66e7ce6e75770ca384de476750984a7d2881ef7686894c4b4944
|
||||
WINDOWS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk22/830ec9fcccef480bb3e73fb7ecafe059/36/GPL/openjdk-22_windows-x64_bin.zip
|
||||
WINDOWS_X64_BOOT_JDK_SHA256=8f5138fecb53c08c20abd4fa6812f9400051f3852582a2142ffda0dff73a5824
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2024, 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
|
||||
@@ -390,8 +390,8 @@ var getJibProfilesCommon = function (input, data) {
|
||||
};
|
||||
};
|
||||
|
||||
common.boot_jdk_version = "21";
|
||||
common.boot_jdk_build_number = "35";
|
||||
common.boot_jdk_version = "22";
|
||||
common.boot_jdk_build_number = "36";
|
||||
common.boot_jdk_home = input.get("boot_jdk", "install_path") + "/jdk-"
|
||||
+ common.boot_jdk_version
|
||||
+ (input.build_os == "macosx" ? ".jdk/Contents/Home" : "");
|
||||
@@ -441,7 +441,7 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
"macosx-x64": {
|
||||
target_os: "macosx",
|
||||
target_cpu: "x64",
|
||||
dependencies: ["devkit", "gtest", "pandoc"],
|
||||
dependencies: ["devkit", "gtest", "graphviz", "pandoc"],
|
||||
configure_args: concat(common.configure_args_64bit, "--with-zlib=system",
|
||||
"--with-macosx-version-max=11.00.00",
|
||||
"--enable-compatible-cds-alignment",
|
||||
@@ -453,7 +453,7 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
"macosx-aarch64": {
|
||||
target_os: "macosx",
|
||||
target_cpu: "aarch64",
|
||||
dependencies: ["devkit", "gtest", "pandoc"],
|
||||
dependencies: ["devkit", "gtest", "graphviz", "pandoc"],
|
||||
configure_args: concat(common.configure_args_64bit,
|
||||
"--with-macosx-version-max=11.00.00"),
|
||||
},
|
||||
@@ -486,7 +486,7 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
"linux-aarch64": {
|
||||
target_os: "linux",
|
||||
target_cpu: "aarch64",
|
||||
dependencies: ["devkit", "gtest", "build_devkit", "pandoc"],
|
||||
dependencies: ["devkit", "gtest", "build_devkit", "graphviz", "pandoc"],
|
||||
configure_args: [
|
||||
"--with-zlib=system",
|
||||
"--disable-dtrace",
|
||||
@@ -1181,12 +1181,6 @@ var getJibProfilesDependencies = function (input, common) {
|
||||
revision: (input.build_cpu == "x64" ? "Xcode11.3.1-MacOSX10.15+1.2" : devkit_platform_revisions[devkit_platform])
|
||||
},
|
||||
|
||||
cups: {
|
||||
organization: common.organization,
|
||||
ext: "tar.gz",
|
||||
revision: "1.0118+1.0"
|
||||
},
|
||||
|
||||
jtreg: {
|
||||
server: "jpg",
|
||||
product: "jtreg",
|
||||
@@ -1237,7 +1231,7 @@ var getJibProfilesDependencies = function (input, common) {
|
||||
graphviz: {
|
||||
organization: common.organization,
|
||||
ext: "tar.gz",
|
||||
revision: "2.38.0-1+1.1",
|
||||
revision: "9.0.0+1.0",
|
||||
module: "graphviz-" + input.target_platform,
|
||||
configure_args: "DOT=" + input.get("graphviz", "install_path") + "/dot",
|
||||
environment_path: input.get("graphviz", "install_path")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 2024, 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
|
||||
@@ -91,3 +91,50 @@ PLATFORM_MODULES= \
|
||||
PLATFORM_MODULES_windows= \
|
||||
jdk.crypto.mscapi \
|
||||
#
|
||||
|
||||
NATIVE_ACCESS_MODULES= \
|
||||
java.base \
|
||||
java.datatransfer \
|
||||
java.desktop \
|
||||
java.instrument \
|
||||
java.logging \
|
||||
java.management \
|
||||
java.management.rmi \
|
||||
java.naming \
|
||||
java.net.http \
|
||||
java.prefs \
|
||||
java.rmi \
|
||||
java.scripting \
|
||||
java.se \
|
||||
java.security.jgss \
|
||||
java.security.sasl \
|
||||
java.smartcardio \
|
||||
java.sql \
|
||||
java.sql.rowset \
|
||||
java.transaction.xa \
|
||||
java.xml \
|
||||
java.xml.crypto \
|
||||
jdk.accessibility \
|
||||
jdk.charsets \
|
||||
jdk.crypto.cryptoki \
|
||||
jdk.dynalink \
|
||||
jdk.httpserver \
|
||||
jdk.incubator.vector \
|
||||
jdk.internal.vm.ci \
|
||||
jdk.jfr \
|
||||
jdk.jsobject \
|
||||
jdk.localedata \
|
||||
jdk.management \
|
||||
jdk.management.agent \
|
||||
jdk.management.jfr \
|
||||
jdk.naming.dns \
|
||||
jdk.naming.rmi \
|
||||
jdk.net \
|
||||
jdk.nio.mapmode \
|
||||
jdk.sctp \
|
||||
jdk.security.auth \
|
||||
jdk.security.jgss \
|
||||
jdk.unsupported \
|
||||
jdk.xml.dom \
|
||||
jdk.zipfs \
|
||||
#
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -37,6 +37,6 @@ DEFAULT_VERSION_DATE=2024-09-17
|
||||
DEFAULT_VERSION_CLASSFILE_MAJOR=67 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
|
||||
DEFAULT_VERSION_CLASSFILE_MINOR=0
|
||||
DEFAULT_VERSION_DOCS_API_SINCE=11
|
||||
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="21 22 23"
|
||||
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="22 23"
|
||||
DEFAULT_JDK_SOURCE_TARGET_VERSION=23
|
||||
DEFAULT_PROMOTED_VERSION_PRE=ea
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2022, 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.
|
||||
#
|
||||
|
||||
JVM_handle_aix_signal
|
||||
numa_error
|
||||
numa_warn
|
||||
@@ -1,26 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2016, 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.
|
||||
#
|
||||
|
||||
JVM_AccessVMBooleanFlag
|
||||
JVM_AccessVMIntFlag
|
||||
JVM_VMBreakPoint
|
||||
@@ -1,27 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2022, 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.
|
||||
#
|
||||
|
||||
JVM_handle_linux_signal
|
||||
JVM_IsUseContainerSupport
|
||||
numa_error
|
||||
numa_warn
|
||||
@@ -1,24 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2016, 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.
|
||||
#
|
||||
|
||||
JVM_handle_bsd_signal
|
||||
@@ -1,35 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2023, 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.
|
||||
#
|
||||
|
||||
AsyncGetCallTrace
|
||||
jio_fprintf
|
||||
jio_printf
|
||||
jio_snprintf
|
||||
jio_vfprintf
|
||||
jio_vsnprintf
|
||||
JNI_CreateJavaVM
|
||||
JNI_GetCreatedJavaVMs
|
||||
JNI_GetDefaultJavaVMInitArgs
|
||||
JVM_IsForeignLinkerSupported
|
||||
JVM_FindClassFromBootLoader
|
||||
JVM_InitAgentProperties
|
||||
@@ -1,233 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2023, 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.
|
||||
#
|
||||
|
||||
JVM_ActiveProcessorCount
|
||||
JVM_AreNestMates
|
||||
JVM_ArrayCopy
|
||||
JVM_AssertionStatusDirectives
|
||||
JVM_BeforeHalt
|
||||
JVM_CallStackWalk
|
||||
JVM_Clone
|
||||
JVM_ConstantPoolGetClassAt
|
||||
JVM_ConstantPoolGetClassAtIfLoaded
|
||||
JVM_ConstantPoolGetClassRefIndexAt
|
||||
JVM_ConstantPoolGetDoubleAt
|
||||
JVM_ConstantPoolGetFieldAt
|
||||
JVM_ConstantPoolGetFieldAtIfLoaded
|
||||
JVM_ConstantPoolGetFloatAt
|
||||
JVM_ConstantPoolGetIntAt
|
||||
JVM_ConstantPoolGetLongAt
|
||||
JVM_ConstantPoolGetMemberRefInfoAt
|
||||
JVM_ConstantPoolGetMethodAt
|
||||
JVM_ConstantPoolGetMethodAtIfLoaded
|
||||
JVM_ConstantPoolGetNameAndTypeRefIndexAt
|
||||
JVM_ConstantPoolGetNameAndTypeRefInfoAt
|
||||
JVM_ConstantPoolGetSize
|
||||
JVM_ConstantPoolGetStringAt
|
||||
JVM_ConstantPoolGetTagAt
|
||||
JVM_ConstantPoolGetUTF8At
|
||||
JVM_CurrentCarrierThread
|
||||
JVM_CurrentThread
|
||||
JVM_SetCurrentThread
|
||||
JVM_CurrentTimeMillis
|
||||
JVM_DefineClass
|
||||
JVM_DefineClassWithSource
|
||||
JVM_DesiredAssertionStatus
|
||||
JVM_DumpAllStacks
|
||||
JVM_DumpClassListToFile
|
||||
JVM_DumpDynamicArchive
|
||||
JVM_DumpThreads
|
||||
JVM_ExpandStackFrameInfo
|
||||
JVM_FillInStackTrace
|
||||
JVM_FindClassFromCaller
|
||||
JVM_FindClassFromClass
|
||||
JVM_FindLibraryEntry
|
||||
JVM_FindLoadedClass
|
||||
JVM_FindPrimitiveClass
|
||||
JVM_FindSignal
|
||||
JVM_FreeMemory
|
||||
JVM_GC
|
||||
JVM_GetAllThreads
|
||||
JVM_GetAndClearReferencePendingList
|
||||
JVM_GetArrayElement
|
||||
JVM_GetArrayLength
|
||||
JVM_GetCallerClass
|
||||
JVM_GetClassAccessFlags
|
||||
JVM_GetClassAnnotations
|
||||
JVM_GetClassConstantPool
|
||||
JVM_GetClassContext
|
||||
JVM_GetClassCPEntriesCount
|
||||
JVM_GetClassCPTypes
|
||||
JVM_GetClassDeclaredConstructors
|
||||
JVM_GetClassDeclaredFields
|
||||
JVM_GetClassDeclaredMethods
|
||||
JVM_GetClassFieldsCount
|
||||
JVM_GetClassFileVersion
|
||||
JVM_GetClassInterfaces
|
||||
JVM_GetClassMethodsCount
|
||||
JVM_GetClassModifiers
|
||||
JVM_GetClassNameUTF
|
||||
JVM_GetClassSignature
|
||||
JVM_GetClassSigners
|
||||
JVM_GetClassTypeAnnotations
|
||||
JVM_GetCPClassNameUTF
|
||||
JVM_GetCPFieldClassNameUTF
|
||||
JVM_GetCPFieldModifiers
|
||||
JVM_GetCPFieldNameUTF
|
||||
JVM_GetCPFieldSignatureUTF
|
||||
JVM_GetCPMethodClassNameUTF
|
||||
JVM_GetCPMethodModifiers
|
||||
JVM_GetCPMethodNameUTF
|
||||
JVM_GetCPMethodSignatureUTF
|
||||
JVM_GetDeclaredClasses
|
||||
JVM_GetDeclaringClass
|
||||
JVM_GetEnclosingMethodInfo
|
||||
JVM_GetExtendedNPEMessage
|
||||
JVM_GetFieldIxModifiers
|
||||
JVM_GetFieldTypeAnnotations
|
||||
JVM_GetInheritedAccessControlContext
|
||||
JVM_GetManagement
|
||||
JVM_GetMethodIxArgsSize
|
||||
JVM_GetMethodIxByteCode
|
||||
JVM_GetMethodIxByteCodeLength
|
||||
JVM_GetMethodIxExceptionIndexes
|
||||
JVM_GetMethodIxExceptionsCount
|
||||
JVM_GetMethodIxExceptionTableEntry
|
||||
JVM_GetMethodIxExceptionTableLength
|
||||
JVM_GetMethodIxLocalsCount
|
||||
JVM_GetMethodIxMaxStack
|
||||
JVM_GetMethodIxModifiers
|
||||
JVM_GetMethodIxNameUTF
|
||||
JVM_GetMethodIxSignatureUTF
|
||||
JVM_GetMethodParameters
|
||||
JVM_GetMethodTypeAnnotations
|
||||
JVM_GetNanoTimeAdjustment
|
||||
JVM_GetNestHost
|
||||
JVM_GetNestMembers
|
||||
JVM_GetNextThreadIdOffset
|
||||
JVM_GetPermittedSubclasses
|
||||
JVM_GetPrimitiveArrayElement
|
||||
JVM_GetProperties
|
||||
JVM_GetProtectionDomain
|
||||
JVM_GetRandomSeedForDumping
|
||||
JVM_GetRecordComponents
|
||||
JVM_GetSimpleBinaryName
|
||||
JVM_GetStackAccessControlContext
|
||||
JVM_GetSystemPackage
|
||||
JVM_GetSystemPackages
|
||||
JVM_GetTemporaryDirectory
|
||||
JVM_GetVmArguments
|
||||
JVM_Halt
|
||||
JVM_HasReferencePendingList
|
||||
JVM_HoldsLock
|
||||
JVM_GetStackTrace
|
||||
JVM_IHashCode
|
||||
JVM_InitClassName
|
||||
JVM_InitStackTraceElement
|
||||
JVM_InitStackTraceElementArray
|
||||
JVM_InitializeFromArchive
|
||||
JVM_InternString
|
||||
JVM_Interrupt
|
||||
JVM_InvokeMethod
|
||||
JVM_IsArrayClass
|
||||
JVM_IsCDSDumpingEnabled
|
||||
JVM_IsConstructorIx
|
||||
JVM_IsDumpingClassList
|
||||
JVM_IsFinalizationEnabled
|
||||
JVM_IsHiddenClass
|
||||
JVM_IsInterface
|
||||
JVM_IsPreviewEnabled
|
||||
JVM_IsContinuationsSupported
|
||||
JVM_IsPrimitiveClass
|
||||
JVM_IsRecord
|
||||
JVM_IsSameClassPackage
|
||||
JVM_IsSharingEnabled
|
||||
JVM_IsSupportedJNIVersion
|
||||
JVM_IsVMGeneratedMethodIx
|
||||
JVM_LatestUserDefinedLoader
|
||||
JVM_LoadZipLibrary
|
||||
JVM_LoadLibrary
|
||||
JVM_LookupDefineClass
|
||||
JVM_LookupLambdaProxyClassFromArchive
|
||||
JVM_LogLambdaFormInvoker
|
||||
JVM_MaxMemory
|
||||
JVM_MaxObjectInspectionAge
|
||||
JVM_MonitorNotify
|
||||
JVM_MonitorNotifyAll
|
||||
JVM_MonitorWait
|
||||
JVM_MoreStackWalk
|
||||
JVM_NanoTime
|
||||
JVM_NativePath
|
||||
JVM_NewArray
|
||||
JVM_NewInstanceFromConstructor
|
||||
JVM_NewMultiArray
|
||||
JVM_PhantomReferenceRefersTo
|
||||
JVM_PrintWarningAtDynamicAgentLoad
|
||||
JVM_RaiseSignal
|
||||
JVM_RawMonitorCreate
|
||||
JVM_RawMonitorDestroy
|
||||
JVM_RawMonitorEnter
|
||||
JVM_RawMonitorExit
|
||||
JVM_ReferenceClear
|
||||
JVM_ReferenceRefersTo
|
||||
JVM_RegisterContinuationMethods
|
||||
JVM_RegisterLambdaProxyClassForArchiving
|
||||
JVM_RegisterSignal
|
||||
JVM_ReleaseUTF
|
||||
JVM_ReportFinalizationComplete
|
||||
JVM_SetArrayElement
|
||||
JVM_SetClassSigners
|
||||
JVM_SetNativeThreadName
|
||||
JVM_SetPrimitiveArrayElement
|
||||
JVM_SetStackWalkContinuation
|
||||
JVM_SetThreadPriority
|
||||
JVM_SleepNanos
|
||||
JVM_StartThread
|
||||
JVM_TotalMemory
|
||||
JVM_UnloadLibrary
|
||||
JVM_WaitForReferencePendingList
|
||||
JVM_Yield
|
||||
|
||||
# Module related API's
|
||||
JVM_AddModuleExports
|
||||
JVM_AddModuleExportsToAll
|
||||
JVM_AddModuleExportsToAllUnnamed
|
||||
JVM_AddReadsModule
|
||||
JVM_DefineArchivedModules
|
||||
JVM_DefineModule
|
||||
JVM_SetBootLoaderUnnamedModule
|
||||
|
||||
# Virtual thread notifications for JVMTI
|
||||
JVM_VirtualThreadStart
|
||||
JVM_VirtualThreadEnd
|
||||
JVM_VirtualThreadMount
|
||||
JVM_VirtualThreadUnmount
|
||||
JVM_VirtualThreadHideFrames
|
||||
JVM_VirtualThreadDisableSuspend
|
||||
|
||||
# Scoped values
|
||||
JVM_EnsureMaterializedForStackWalk_func
|
||||
JVM_FindScopedValueBindings
|
||||
JVM_ScopedValueCache
|
||||
JVM_SetScopedValueCache
|
||||
#
|
||||
11
make/data/hotspot-symbols/version-script.txt
Normal file
11
make/data/hotspot-symbols/version-script.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
SUNWprivate_1.1 {
|
||||
global:
|
||||
*;
|
||||
|
||||
local:
|
||||
__bss_start;
|
||||
_edata;
|
||||
_end;
|
||||
_fini;
|
||||
_init;
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash -e
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2017, 2024, 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,38 +26,106 @@
|
||||
# Create a bundle in the current directory, containing what's needed to run
|
||||
# the 'dot' program from the graphviz suite by the OpenJDK build.
|
||||
|
||||
TMPDIR=`mktemp -d -t graphvizbundle-XXXX`
|
||||
trap "rm -rf \"$TMPDIR\"" EXIT
|
||||
set -eux
|
||||
|
||||
ORIG_DIR=`pwd`
|
||||
cd "$TMPDIR"
|
||||
GRAPHVIZ_VERSION=2.38.0-1
|
||||
PACKAGE_VERSION=1.1
|
||||
TARGET_PLATFORM=linux_x64
|
||||
BUNDLE_NAME=graphviz-$TARGET_PLATFORM-$GRAPHVIZ_VERSION+$PACKAGE_VERSION.tar.gz
|
||||
wget http://www.graphviz.org/pub/graphviz/stable/redhat/el6/x86_64/os/graphviz-$GRAPHVIZ_VERSION.el6.x86_64.rpm
|
||||
wget http://www.graphviz.org/pub/graphviz/stable/redhat/el6/x86_64/os/graphviz-libs-$GRAPHVIZ_VERSION.el6.x86_64.rpm
|
||||
wget http://www.graphviz.org/pub/graphviz/stable/redhat/el6/x86_64/os/graphviz-plugins-core-$GRAPHVIZ_VERSION.el6.x86_64.rpm
|
||||
wget http://www.graphviz.org/pub/graphviz/stable/redhat/el6/x86_64/os/graphviz-plugins-x-$GRAPHVIZ_VERSION.el6.x86_64.rpm
|
||||
wget http://public-yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64/getPackage/libtool-ltdl-2.2.6-15.5.el6.x86_64.rpm
|
||||
mydir="$(cd -- $(dirname ${BASH_SOURCE[0]}) && pwd)"
|
||||
me="${mydir}/$(basename ${BASH_SOURCE[0]})"
|
||||
|
||||
mkdir graphviz
|
||||
cd graphviz
|
||||
for rpm in ../*.rpm; do
|
||||
rpm2cpio $rpm | cpio --extract --make-directories
|
||||
done
|
||||
EXPAT_VERSION="2.6.0"
|
||||
EXPAT_URL="https://github.com/libexpat/libexpat/releases/download/R_${EXPAT_VERSION//./_}/expat-${EXPAT_VERSION}.tar.gz"
|
||||
EXPAT_SHA256="a13447b9aa67d7c860783fdf6820f33ebdea996900d6d8bbc50a628f55f099f7"
|
||||
|
||||
cat > dot << EOF
|
||||
GRAPHVIZ_VERSION="9.0.0"
|
||||
GRAPHVIZ_URL="https://gitlab.com/api/v4/projects/4207231/packages/generic/graphviz-releases/${GRAPHVIZ_VERSION}/graphviz-${GRAPHVIZ_VERSION}.tar.xz"
|
||||
GRAPHVIZ_SHA256="6c9afda06a732af7658c2619ee713d2545818c3ff19b7b8fd48effcd06d57bf6"
|
||||
|
||||
uname_s="$(uname -s)"
|
||||
case ${uname_s} in
|
||||
Linux)
|
||||
bundle_os="linux"
|
||||
shacmd="sha256sum --strict --check -"
|
||||
lib_path_var="LD_LIBRARY_PATH"
|
||||
;;
|
||||
Darwin)
|
||||
bundle_os="macosx"
|
||||
shacmd="shasum -a 256 --strict --check -"
|
||||
lib_path_var="DYLD_LIBRARY_PATH"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown OS: ${uname_s}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
uname_m="$(uname -m)"
|
||||
case ${uname_m} in
|
||||
aarch64|arm64)
|
||||
bundle_cpu="aarch64"
|
||||
;;
|
||||
x86_64)
|
||||
bundle_cpu="x64"
|
||||
;;
|
||||
esac
|
||||
bundle_platform="${bundle_os}_${bundle_cpu}"
|
||||
|
||||
build_dir="${mydir}/../../build/graphviz"
|
||||
download_dir="${build_dir}/download"
|
||||
install_dir="${build_dir}/result/graphviz-${bundle_platform}-${GRAPHVIZ_VERSION}"
|
||||
bundle_file="${install_dir}.tar.gz"
|
||||
|
||||
expat_dir="${build_dir}/expat"
|
||||
expat_src_dir="${expat_dir}/src"
|
||||
|
||||
graphviz_dir="${build_dir}/graphviz"
|
||||
graphviz_src_dir="${graphviz_dir}/src"
|
||||
graphviz_doc_dir="${install_dir}/doc"
|
||||
|
||||
mkdir -p "${build_dir}"
|
||||
cd "${build_dir}"
|
||||
|
||||
download_and_unpack() {
|
||||
local url="$1"
|
||||
local sha256="$2"
|
||||
local file="$3"
|
||||
local dir="$4"
|
||||
|
||||
mkdir -p "$(dirname "${file}")"
|
||||
if [ ! -f "${file}" ]; then
|
||||
curl -L -o "${file}" "${url}"
|
||||
fi
|
||||
echo "${sha256} ${file}" | ${shacmd}
|
||||
if [ ! -d "${dir}" ]; then
|
||||
mkdir -p "${dir}"
|
||||
tar --extract --file "${file}" --directory "${dir}" --strip-components 1
|
||||
fi
|
||||
}
|
||||
|
||||
download_and_unpack "${EXPAT_URL}" "${EXPAT_SHA256}" "${download_dir}/expat.tar.gz" "${expat_src_dir}"
|
||||
download_and_unpack "${GRAPHVIZ_URL}" "${GRAPHVIZ_SHA256}" "${download_dir}/graphviz.tar.gz" "${graphviz_src_dir}"
|
||||
|
||||
(
|
||||
cd "${expat_src_dir}"
|
||||
./configure --prefix="${install_dir}"
|
||||
make -j install
|
||||
)
|
||||
|
||||
(
|
||||
cd "${graphviz_src_dir}"
|
||||
./configure --prefix="${install_dir}" EXPAT_CFLAGS="-I${install_dir}/include" EXPAT_LIBS="-L${install_dir}/lib -lexpat"
|
||||
make -j install
|
||||
)
|
||||
|
||||
cat > "${install_dir}/dot" << EOF
|
||||
#!/bin/bash
|
||||
# Get an absolute path to this script
|
||||
this_script_dir=\`dirname \$0\`
|
||||
this_script_dir=\`cd \$this_script_dir > /dev/null && pwd\`
|
||||
export LD_LIBRARY_PATH="\$this_script_dir/usr/lib64:\$LD_LIBRARY_PATH"
|
||||
exec \$this_script_dir/usr/bin/dot "\$@"
|
||||
this_script_dir="\$(dirname \$0)"
|
||||
this_script_dir="\$(cd \${this_script_dir} > /dev/null && pwd)"
|
||||
export ${lib_path_var}="\${this_script_dir}/lib:\${this_script_dir}/lib/graphviz"
|
||||
exec "\${this_script_dir}/bin/dot" "\$@"
|
||||
EOF
|
||||
chmod +x dot
|
||||
export LD_LIBRARY_PATH="$TMPDIR/graphviz/usr/lib64:$LD_LIBRARY_PATH"
|
||||
chmod +x "${install_dir}/dot"
|
||||
# create config file
|
||||
./dot -c
|
||||
tar -cvzf ../$BUNDLE_NAME *
|
||||
cp ../$BUNDLE_NAME "$ORIG_DIR"
|
||||
"${install_dir}/dot" -c
|
||||
|
||||
cp "${me}" "${install_dir}"
|
||||
|
||||
tar --create --gzip --file "${bundle_file}" -C "${install_dir}" .
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
include CopyFiles.gmk
|
||||
|
||||
# Copy all built libraries into exploded jdk
|
||||
LIB_TARGETS := $(filter $(LIB_OUTPUTDIR)/%, $(TARGETS))
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2024, 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,7 +29,7 @@ include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include Execute.gmk
|
||||
include JavaCompilation.gmk
|
||||
include NativeCompilation.gmk
|
||||
include JdkNativeCompilation.gmk
|
||||
include TextFileProcessing.gmk
|
||||
|
||||
include HotspotCommon.gmk
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2024, 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 @@ ifeq ($(call check-jvm-feature, compiler2), true)
|
||||
ADLC_CFLAGS := -qnortti -qeh -q64 -DAIX
|
||||
endif
|
||||
else ifeq ($(call isBuildOs, windows), true)
|
||||
ADLC_LDFLAGS += -nologo
|
||||
ADLC_CFLAGS := -nologo -EHsc
|
||||
ADLC_CFLAGS_WARNINGS := -W3 -D_CRT_SECURE_NO_WARNINGS
|
||||
endif
|
||||
@@ -69,15 +68,22 @@ ifeq ($(call check-jvm-feature, compiler2), true)
|
||||
ADLC_LDFLAGS += $(UBSAN_LDFLAGS)
|
||||
endif
|
||||
|
||||
$(eval $(call SetupNativeCompilation, BUILD_ADLC, \
|
||||
##############################################################################
|
||||
## Build adlc
|
||||
##############################################################################
|
||||
|
||||
$(eval $(call SetupJdkExecutable, BUILD_ADLC, \
|
||||
NAME := adlc, \
|
||||
TYPE := EXECUTABLE, \
|
||||
TOOLCHAIN := TOOLCHAIN_BUILD_LINK_CXX, \
|
||||
TARGET_TYPE := BUILD, \
|
||||
LINK_TYPE := C++, \
|
||||
SRC := $(TOPDIR)/src/hotspot/share/adlc, \
|
||||
EXTRA_FILES := $(TOPDIR)/src/hotspot/share/opto/opcodes.cpp, \
|
||||
DEFAULT_CFLAGS := false, \
|
||||
CFLAGS := $(ADLC_CFLAGS) $(ADLC_CFLAGS_WARNINGS), \
|
||||
DEFAULT_LDFLAGS := false, \
|
||||
LDFLAGS := $(ADLC_LDFLAGS), \
|
||||
LIBS := $(ADLC_LIBS), \
|
||||
DEFAULT_VERSIONINFO_RESOURCE := false, \
|
||||
OBJECT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/adlc/objs, \
|
||||
OUTPUT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/adlc, \
|
||||
DEBUG_SYMBOLS := false, \
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
include CopyFiles.gmk
|
||||
|
||||
$(eval $(call IncludeCustomExtension, hotspot/gensrc/GensrcJvmti.gmk))
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2016, 2024, 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,14 +26,13 @@
|
||||
$(eval $(call IncludeCustomExtension, hotspot/lib/CompileGtest.gmk))
|
||||
|
||||
GTEST_TEST_SRC += $(TOPDIR)/test/hotspot/gtest
|
||||
GTEST_LAUNCHER_SRC := $(TOPDIR)/test/hotspot/gtest/gtestLauncher.cpp
|
||||
|
||||
ifeq ($(ASAN_ENABLED), true)
|
||||
GTEST_LAUNCHER_SRC += $(TOPDIR)/make/data/asan/asan_default_options.cpp
|
||||
GTEST_LAUNCHER_EXTRA_FILES += $(TOPDIR)/make/data/asan/asan_default_options.cpp
|
||||
endif
|
||||
|
||||
ifeq ($(LSAN_ENABLED), true)
|
||||
GTEST_LAUNCHER_SRC += $(TOPDIR)/make/data/lsan/lsan_default_options.cpp
|
||||
GTEST_LAUNCHER_EXTRA_FILES += $(TOPDIR)/make/data/lsan/lsan_default_options.cpp
|
||||
endif
|
||||
|
||||
# On Windows, there are no internal debug symbols so must set copying to true
|
||||
@@ -45,12 +44,13 @@ else
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
## Build libgtest
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBGTEST, \
|
||||
NAME := gtest, \
|
||||
TYPE := STATIC_LIBRARY, \
|
||||
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
|
||||
LINK_TYPE := C++, \
|
||||
OUTPUT_DIR := $(JVM_OUTPUTDIR)/libgtest, \
|
||||
OBJECT_DIR := $(JVM_OUTPUTDIR)/libgtest/objs, \
|
||||
SRC := \
|
||||
@@ -59,6 +59,7 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBGTEST, \
|
||||
INCLUDE_FILES := gtest-all.cc gmock-all.cc, \
|
||||
DISABLED_WARNINGS_gcc := undef unused-result format-nonliteral maybe-uninitialized, \
|
||||
DISABLED_WARNINGS_clang := undef unused-result format-nonliteral, \
|
||||
DEFAULT_CFLAGS := false, \
|
||||
CFLAGS := $(JVM_CFLAGS) \
|
||||
-I$(GTEST_FRAMEWORK_SRC)/googletest \
|
||||
-I$(GTEST_FRAMEWORK_SRC)/googletest/include \
|
||||
@@ -75,25 +76,13 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBGTEST, \
|
||||
TARGETS += $(BUILD_GTEST_LIBGTEST)
|
||||
|
||||
################################################################################
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
GTEST_JVM_MAPFILE := $(JVM_MAPFILE)
|
||||
else
|
||||
GTEST_JVM_MAPFILE := $(JVM_OUTPUTDIR)/gtest/mapfile
|
||||
|
||||
$(JVM_OUTPUTDIR)/gtest/symbols: $(JVM_OUTPUTDIR)/symbols
|
||||
$(call MakeDir, $(@D))
|
||||
( $(CAT) $< ; echo "runUnitTests" ) > $@
|
||||
|
||||
$(GTEST_JVM_MAPFILE): $(JVM_OUTPUTDIR)/gtest/symbols
|
||||
$(call create-mapfile)
|
||||
endif
|
||||
## Build libjvm (for gtest)
|
||||
################################################################################
|
||||
|
||||
# Additional disabled warnings are due to code in the test source.
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBJVM, \
|
||||
NAME := jvm, \
|
||||
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
|
||||
LINK_TYPE := C++, \
|
||||
OUTPUT_DIR := $(JVM_OUTPUTDIR)/gtest, \
|
||||
OBJECT_DIR := $(JVM_OUTPUTDIR)/gtest/objs, \
|
||||
SRC := $(GTEST_TEST_SRC), \
|
||||
@@ -102,6 +91,7 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBJVM, \
|
||||
EXCLUDE_PATTERNS := $(JVM_EXCLUDE_PATTERNS), \
|
||||
EXTRA_OBJECT_FILES := $(filter-out %/operator_new$(OBJ_SUFFIX), \
|
||||
$(BUILD_LIBJVM_ALL_OBJS)), \
|
||||
DEFAULT_CFLAGS := false, \
|
||||
CFLAGS := $(JVM_CFLAGS) \
|
||||
-I$(GTEST_FRAMEWORK_SRC)/googletest/include \
|
||||
-I$(GTEST_FRAMEWORK_SRC)/googlemock/include \
|
||||
@@ -117,14 +107,12 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBJVM, \
|
||||
DISABLED_WARNINGS_clang_test_g1ServiceThread.cpp := delete-abstract-non-virtual-dtor, \
|
||||
DISABLED_WARNINGS_clang_test_logDecorations.cpp := missing-field-initializers, \
|
||||
DISABLED_WARNINGS_microsoft := $(DISABLED_WARNINGS_microsoft), \
|
||||
LD_SET_ORIGIN := false, \
|
||||
DEFAULT_LDFLAGS := false, \
|
||||
LDFLAGS := $(JVM_LDFLAGS), \
|
||||
LDFLAGS_unix := -L$(JVM_OUTPUTDIR)/libgtest, \
|
||||
JDK_LIBS := gtest:libgtest, \
|
||||
LIBS := $(JVM_LIBS), \
|
||||
LIBS_unix := -lgtest, \
|
||||
LIBS_windows := $(JVM_OUTPUTDIR)/libgtest/gtest.lib, \
|
||||
OPTIMIZATION := $(JVM_OPTIMIZATION), \
|
||||
MAPFILE := $(GTEST_JVM_MAPFILE), \
|
||||
USE_MAPFILE_FOR_SYMBOLS := true, \
|
||||
COPY_DEBUG_SYMBOLS := $(GTEST_COPY_DEBUG_SYMBOLS), \
|
||||
ZIP_EXTERNAL_DEBUG_SYMBOLS := false, \
|
||||
STRIP_SYMBOLS := false, \
|
||||
@@ -134,33 +122,39 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBJVM, \
|
||||
|
||||
$(BUILD_GTEST_LIBJVM) : $(BUILD_GTEST_LIBGTEST)
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
$(BUILD_GTEST_LIBJVM_TARGET): $(WIN_EXPORT_FILE)
|
||||
endif
|
||||
|
||||
|
||||
TARGETS += $(BUILD_GTEST_LIBJVM)
|
||||
|
||||
################################################################################
|
||||
## Build gtestLauncher
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupJdkExecutable, BUILD_GTEST_LAUNCHER, \
|
||||
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
|
||||
NAME := gtestLauncher, \
|
||||
TYPE := EXECUTABLE, \
|
||||
LINK_TYPE := C++, \
|
||||
OUTPUT_DIR := $(JVM_OUTPUTDIR)/gtest, \
|
||||
EXTRA_FILES := $(GTEST_LAUNCHER_SRC), \
|
||||
SRC := $(TOPDIR)/test/hotspot/gtest, \
|
||||
INCLUDE_FILES := gtestLauncher.cpp, \
|
||||
EXTRA_FILES := $(GTEST_LAUNCHER_EXTRA_FILES), \
|
||||
OBJECT_DIR := $(JVM_OUTPUTDIR)/gtest/launcher-objs, \
|
||||
DEFAULT_CFLAGS := false, \
|
||||
CFLAGS := $(JVM_CFLAGS) \
|
||||
-I$(GTEST_FRAMEWORK_SRC)/googletest \
|
||||
-I$(GTEST_FRAMEWORK_SRC)/googletest/include \
|
||||
-I$(GTEST_FRAMEWORK_SRC)/googlemock \
|
||||
-I$(GTEST_FRAMEWORK_SRC)/googlemock/include, \
|
||||
LDFLAGS := $(LDFLAGS_JDKEXE), \
|
||||
LDFLAGS_unix := -L$(JVM_OUTPUTDIR)/gtest $(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS_linux := $(LIBCXX), \
|
||||
LIBS_unix := -ljvm, \
|
||||
LIBS_windows := $(JVM_OUTPUTDIR)/gtest/objs/jvm.lib, \
|
||||
LD_SET_ORIGIN := false, \
|
||||
LDFLAGS_unix := $(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
JDK_LIBS := gtest:libjvm, \
|
||||
COPY_DEBUG_SYMBOLS := $(GTEST_COPY_DEBUG_SYMBOLS), \
|
||||
ZIP_EXTERNAL_DEBUG_SYMBOLS := false, \
|
||||
))
|
||||
|
||||
$(BUILD_GTEST_LAUNCHER): $(BUILD_GTEST_LIBJVM)
|
||||
|
||||
TARGETS += $(BUILD_GTEST_LAUNCHER)
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2024, 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
|
||||
@@ -23,6 +23,8 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
include CopyFiles.gmk
|
||||
|
||||
# Include support files that will setup compiler flags due to the selected
|
||||
# jvm feature set, specific file overrides, and general flags.
|
||||
include lib/JvmFeatures.gmk
|
||||
@@ -33,7 +35,6 @@ include lib/JvmFlags.gmk
|
||||
# Setup compilation of the main Hotspot native library (libjvm).
|
||||
|
||||
JVM_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/libjvm
|
||||
JVM_MAPFILE := $(JVM_OUTPUTDIR)/mapfile
|
||||
|
||||
################################################################################
|
||||
# Platform independent setup
|
||||
@@ -74,7 +75,6 @@ CFLAGS_VM_VERSION := \
|
||||
$(VERSION_CFLAGS) \
|
||||
-DHOTSPOT_VERSION_STRING='"$(VERSION_STRING)"' \
|
||||
-DDEBUG_LEVEL='"$(DEBUG_LEVEL)"' \
|
||||
-DHOTSPOT_BUILD_USER='"$(USERNAME)"' \
|
||||
-DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"' \
|
||||
-DCPU='"$(OPENJDK_TARGET_CPU_VM_VERSION)"' \
|
||||
-DHOTSPOT_BUILD_TIME='"$(HOTSPOT_BUILD_TIME)"' \
|
||||
@@ -98,8 +98,6 @@ ifneq ($(DEBUG_LEVEL), release)
|
||||
DISABLED_WARNINGS_gcc += strict-overflow
|
||||
endif
|
||||
|
||||
DISABLED_WARNINGS_xlc := tautological-compare shift-negative-value
|
||||
|
||||
DISABLED_WARNINGS_microsoft := 4624 4244 4291 4146 4127 4722
|
||||
|
||||
################################################################################
|
||||
@@ -132,7 +130,7 @@ endif
|
||||
JVM_OPTIMIZATION ?= HIGHEST_JVM
|
||||
|
||||
# Need to set JVM_STRIPFLAGS to the default value from SPEC since the STRIPFLAGS
|
||||
# parameter to SetupNativeCompilation allows an empty value to override the
|
||||
# parameter to SetupJdkLibrary allows an empty value to override the
|
||||
# default.
|
||||
JVM_STRIPFLAGS ?= $(STRIPFLAGS)
|
||||
|
||||
@@ -146,17 +144,35 @@ $(call FillFindCache, $(JVM_SRC_DIRS))
|
||||
# operator new.
|
||||
LIBJVM_STATIC_EXCLUDE_OBJS := operator_new.o
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
ifeq ($(STATIC_LIBS), true)
|
||||
WIN_EXPORT_FILE := $(JVM_OUTPUTDIR)/static-win-exports.def
|
||||
else
|
||||
WIN_EXPORT_FILE := $(JVM_OUTPUTDIR)/win-exports.def
|
||||
endif
|
||||
|
||||
JVM_LDFLAGS += -def:$(WIN_EXPORT_FILE)
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
HOTSPOT_VERSION_SCRIPT := $(TOPDIR)/make/data/hotspot-symbols/version-script.txt
|
||||
|
||||
JVM_LDFLAGS += -Wl,-version-script=$(HOTSPOT_VERSION_SCRIPT)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
## Build libjvm
|
||||
################################################################################
|
||||
# Now set up the actual compilation of the main hotspot native library
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
|
||||
NAME := jvm, \
|
||||
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
|
||||
LINK_TYPE := C++, \
|
||||
OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \
|
||||
SRC := $(JVM_SRC_DIRS), \
|
||||
EXCLUDES := $(JVM_EXCLUDES), \
|
||||
EXCLUDE_FILES := $(JVM_EXCLUDE_FILES), \
|
||||
EXCLUDE_PATTERNS := $(JVM_EXCLUDE_PATTERNS), \
|
||||
DEFAULT_CFLAGS := false, \
|
||||
CFLAGS := $(JVM_CFLAGS), \
|
||||
abstract_vm_version.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
|
||||
arguments.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
|
||||
@@ -169,6 +185,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
|
||||
DISABLED_WARNINGS_gcc_jvmciCodeInstaller.cpp := stringop-overflow, \
|
||||
DISABLED_WARNINGS_gcc_jvmtiTagMap.cpp := stringop-overflow, \
|
||||
DISABLED_WARNINGS_gcc_postaloc.cpp := address, \
|
||||
DISABLED_WARNINGS_gcc_shenandoahLock.cpp := stringop-overflow, \
|
||||
DISABLED_WARNINGS_gcc_synchronizer.cpp := stringop-overflow, \
|
||||
DISABLED_WARNINGS_clang := $(DISABLED_WARNINGS_clang), \
|
||||
DISABLED_WARNINGS_clang_arguments.cpp := missing-field-initializers, \
|
||||
@@ -187,15 +204,14 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
|
||||
DISABLED_WARNINGS_clang_aix_debug.cpp := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_aix_jvm.cpp := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_aix_osThread_aix.cpp := tautological-undefined-compare, \
|
||||
DISABLED_WARNINGS_xlc := $(DISABLED_WARNINGS_xlc), \
|
||||
DISABLED_WARNINGS_microsoft := $(DISABLED_WARNINGS_microsoft), \
|
||||
ASFLAGS := $(JVM_ASFLAGS), \
|
||||
LD_SET_ORIGIN := false, \
|
||||
DEFAULT_LDFLAGS := false, \
|
||||
LDFLAGS := $(JVM_LDFLAGS), \
|
||||
LIBS := $(JVM_LIBS), \
|
||||
OPTIMIZATION := $(JVM_OPTIMIZATION), \
|
||||
OBJECT_DIR := $(JVM_OUTPUTDIR)/objs, \
|
||||
MAPFILE := $(JVM_MAPFILE), \
|
||||
USE_MAPFILE_FOR_SYMBOLS := true, \
|
||||
STRIPFLAGS := $(JVM_STRIPFLAGS), \
|
||||
EMBED_MANIFEST := true, \
|
||||
RC_FILEDESC := $(HOTSPOT_VM_DISTRO) $(OPENJDK_TARGET_CPU_BITS)-Bit $(JVM_VARIANT) VM, \
|
||||
@@ -204,11 +220,47 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
|
||||
STATIC_LIB_EXCLUDE_OBJS := $(LIBJVM_STATIC_EXCLUDE_OBJS), \
|
||||
))
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
# The following lines create a list of vftable symbols to be filtered out of
|
||||
# the symbol file. Removing this line causes the linker to complain about too
|
||||
# many (> 64K) symbols, so the _guess_ is that this line is here to keep down
|
||||
# the number of exported symbols below that limit.
|
||||
#
|
||||
# Some usages of C++ lambdas require the vftable symbol of classes that use
|
||||
# the lambda type as a template parameter. The usage of those classes won't
|
||||
# link if their vftable symbols are removed. That's why there's an exception
|
||||
# for vftable symbols containing the string 'lambda'.
|
||||
#
|
||||
# A very simple example of a lambda usage that fails if the lambda vftable
|
||||
# symbols are missing in the symbol file:
|
||||
#
|
||||
# #include <functional>
|
||||
# std::function<void()> f = [](){}
|
||||
FILTER_SYMBOLS_AWK_SCRIPT := \
|
||||
'{ \
|
||||
if ($$7 ~ /\?\?_7.*@@6B@/ && $$7 !~ /type_info/ && $$7 !~ /lambda/) print " " $$7; \
|
||||
}'
|
||||
|
||||
# A more correct solution would be to send BUILD_LIBJVM_ALL_OBJS instead of
|
||||
# cd && *.obj, but this will result in very long command lines, which could be
|
||||
# problematic.
|
||||
$(WIN_EXPORT_FILE): $(BUILD_LIBJVM_ALL_OBJS)
|
||||
$(call LogInfo, Generating list of symbols to export from object files)
|
||||
$(call MakeDir, $(@D))
|
||||
$(ECHO) "EXPORTS" > $@.tmp
|
||||
$(CD) $(BUILD_LIBJVM_OBJECT_DIR) && \
|
||||
$(DUMPBIN) -symbols *$(OBJ_SUFFIX) | $(AWK) $(FILTER_SYMBOLS_AWK_SCRIPT) | $(SORT) -u >> $@.tmp
|
||||
$(RM) $@
|
||||
$(MV) $@.tmp $@
|
||||
|
||||
$(BUILD_LIBJVM_TARGET): $(WIN_EXPORT_FILE)
|
||||
endif
|
||||
|
||||
# Always recompile abstract_vm_version.cpp if libjvm needs to be relinked. This ensures
|
||||
# that the internal vm version is updated as it relies on __DATE__ and __TIME__
|
||||
# macros.
|
||||
ABSTRACT_VM_VERSION_OBJ := $(JVM_OUTPUTDIR)/objs/abstract_vm_version$(OBJ_SUFFIX)
|
||||
$(ABSTRACT_VM_VERSION_OBJ): $(filter-out $(ABSTRACT_VM_VERSION_OBJ) $(JVM_MAPFILE), \
|
||||
$(ABSTRACT_VM_VERSION_OBJ): $(filter-out $(ABSTRACT_VM_VERSION_OBJ), \
|
||||
$(BUILD_LIBJVM_TARGET_DEPS))
|
||||
|
||||
ifneq ($(GENERATE_COMPILE_COMMANDS_ONLY), true)
|
||||
@@ -236,11 +288,6 @@ endif
|
||||
# 1540-1090 : (I) The destructor of "..." might not be called.
|
||||
# 1540-1639 : (I) The behavior of long type bit fields has changed ...
|
||||
|
||||
# Include mapfile generation. It relies on BUILD_LIBJVM_ALL_OBJS which is only
|
||||
# defined after the above call to BUILD_LIBJVM. Mapfile will be generated
|
||||
# after all object files are built, but before the jvm library is linked.
|
||||
include lib/JvmMapfile.gmk
|
||||
|
||||
TARGETS += $(BUILD_LIBJVM)
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2024, 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
|
||||
@@ -214,7 +214,6 @@ ifeq ($(call check-jvm-feature, opt-size), true)
|
||||
frame_x86.cpp \
|
||||
genCollectedHeap.cpp \
|
||||
generation.cpp \
|
||||
genMarkSweep.cpp \
|
||||
growableArray.cpp \
|
||||
handles.cpp \
|
||||
hashtable.cpp \
|
||||
|
||||
@@ -1,176 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2023, 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.
|
||||
#
|
||||
|
||||
$(eval $(call IncludeCustomExtension, hotspot/lib/JvmMapfile.gmk))
|
||||
|
||||
################################################################################
|
||||
# Combine a list of static symbols
|
||||
|
||||
ifeq ($(call And, $(call isTargetOs, windows) $(call isTargetCpu, x86_64)), false)
|
||||
# On Windows x86_64, we should not have any symbols at all, since that
|
||||
# results in duplicate warnings from the linker (JDK-8043491).
|
||||
SYMBOLS_SRC += $(TOPDIR)/make/data/hotspot-symbols/symbols-shared
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOsType, unix), true)
|
||||
SYMBOLS_SRC += $(TOPDIR)/make/data/hotspot-symbols/symbols-unix
|
||||
endif
|
||||
|
||||
ifneq ($(wildcard $(TOPDIR)/make/data/hotspot-symbols/symbols-$(OPENJDK_TARGET_OS)), )
|
||||
SYMBOLS_SRC += $(TOPDIR)/make/data/hotspot-symbols/symbols-$(OPENJDK_TARGET_OS)
|
||||
endif
|
||||
|
||||
ifneq ($(findstring debug, $(DEBUG_LEVEL)), )
|
||||
ifneq ($(wildcard $(TOPDIR)/make/data/hotspot-symbols/symbols-$(OPENJDK_TARGET_OS)-debug), )
|
||||
SYMBOLS_SRC += $(TOPDIR)/make/data/hotspot-symbols/symbols-$(OPENJDK_TARGET_OS)-debug
|
||||
endif
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Create a dynamic list of symbols from the built object files. This is highly
|
||||
# platform dependent.
|
||||
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
DUMP_SYMBOLS_CMD := $(NM) $(NMFLAGS) --defined-only *$(OBJ_SUFFIX)
|
||||
ifneq ($(FILTER_SYMBOLS_PATTERN), )
|
||||
FILTER_SYMBOLS_PATTERN := $(FILTER_SYMBOLS_PATTERN)|
|
||||
endif
|
||||
FILTER_SYMBOLS_PATTERN := $(FILTER_SYMBOLS_PATTERN)^_ZTV|^gHotSpotVM|^UseSharedSpaces$$
|
||||
FILTER_SYMBOLS_PATTERN := $(FILTER_SYMBOLS_PATTERN)|^_ZN9Arguments17SharedArchivePathE$$
|
||||
FILTER_SYMBOLS_AWK_SCRIPT := \
|
||||
'{ \
|
||||
if ($$3 ~ /$(FILTER_SYMBOLS_PATTERN)/) print $$3; \
|
||||
}'
|
||||
|
||||
else ifeq ($(call isTargetOs, macosx), true)
|
||||
# nm on macosx prints out "warning: nm: no name list" to stderr for
|
||||
# files without symbols. Hide this, even at the expense of hiding real errors.
|
||||
DUMP_SYMBOLS_CMD := $(NM) $(NMFLAGS) -Uj *$(OBJ_SUFFIX) 2> /dev/null
|
||||
ifneq ($(FILTER_SYMBOLS_PATTERN), )
|
||||
FILTER_SYMBOLS_PATTERN := $(FILTER_SYMBOLS_PATTERN)|
|
||||
endif
|
||||
FILTER_SYMBOLS_PATTERN := $(FILTER_SYMBOLS_PATTERN)^_ZTV|^gHotSpotVM
|
||||
FILTER_SYMBOLS_AWK_SCRIPT := \
|
||||
'{ \
|
||||
if ($$3 ~ /$(FILTER_SYMBOLS_PATTERN)/) print $$3; \
|
||||
}'
|
||||
|
||||
# NOTE: The script is from the old build. It is broken and finds no symbols.
|
||||
# The script below might be what was intended, but it fails to link with tons
|
||||
# of 'cannot export hidden symbol vtable for X'.
|
||||
# '{ if ($$1 ~ /^__ZTV/ || $$1 ~ /^_gHotSpotVM/) print substr($$1, 2) }'
|
||||
else ifeq ($(call isTargetOs, aix), true)
|
||||
# NOTE: The old build had the solution below. This should to be fixed in
|
||||
# configure instead.
|
||||
|
||||
# On AIX we have to prevent that we pick up the 'nm' version from the GNU binutils
|
||||
# which may be installed under /opt/freeware/bin. So better use an absolute path here!
|
||||
# NM=/usr/bin/nm
|
||||
|
||||
DUMP_SYMBOLS_CMD := $(NM) $(NMFLAGS) -B -C *$(OBJ_SUFFIX)
|
||||
FILTER_SYMBOLS_AWK_SCRIPT := \
|
||||
'{ \
|
||||
if (($$2="d" || $$2="D") && ($$3 ~ /^__vft/ || $$3 ~ /^gHotSpotVM/)) print $$3; \
|
||||
if ($$3 ~ /^UseSharedSpaces$$/) print $$3; \
|
||||
if ($$3 ~ /^SharedArchivePath__9Arguments$$/) print $$3; \
|
||||
}'
|
||||
|
||||
else ifeq ($(call isTargetOs, windows), true)
|
||||
DUMP_SYMBOLS_CMD := $(DUMPBIN) -symbols *$(OBJ_SUFFIX)
|
||||
|
||||
# The following lines create a list of vftable symbols to be filtered out of
|
||||
# the mapfile. Removing this line causes the linker to complain about too many
|
||||
# (> 64K) symbols, so the _guess_ is that this line is here to keep down the
|
||||
# number of exported symbols below that limit.
|
||||
#
|
||||
# Some usages of C++ lambdas require the vftable symbol of classes that use
|
||||
# the lambda type as a template parameter. The usage of those classes won't
|
||||
# link if their vftable symbols are removed. That's why there's an exception
|
||||
# for vftable symbols containing the string 'lambda'.
|
||||
#
|
||||
# A very simple example of a lambda usage that fails if the lambda vftable
|
||||
# symbols are missing in the mapfile:
|
||||
#
|
||||
# #include <functional>
|
||||
# std::function<void()> f = [](){}
|
||||
|
||||
FILTER_SYMBOLS_AWK_SCRIPT := \
|
||||
'{ \
|
||||
if ($$7 ~ /\?\?_7.*@@6B@/ && $$7 !~ /type_info/ && $$7 !~ /lambda/) print $$7; \
|
||||
}'
|
||||
|
||||
else
|
||||
$(error Unknown target OS $(OPENJDK_TARGET_OS) in JvmMapfile.gmk)
|
||||
endif
|
||||
|
||||
# A more correct solution would be to send BUILD_LIBJVM_ALL_OBJS instead of
|
||||
# cd && *.o, but this will result in very long command lines, which is
|
||||
# problematic on some platforms.
|
||||
$(JVM_OUTPUTDIR)/symbols-objects: $(BUILD_LIBJVM_ALL_OBJS)
|
||||
$(call LogInfo, Generating symbol list from object files)
|
||||
$(CD) $(JVM_OUTPUTDIR)/objs && \
|
||||
$(DUMP_SYMBOLS_CMD) | $(AWK) $(FILTER_SYMBOLS_AWK_SCRIPT) | $(SORT) -u > $@
|
||||
|
||||
SYMBOLS_SRC += $(JVM_OUTPUTDIR)/symbols-objects
|
||||
|
||||
################################################################################
|
||||
# Now concatenate all symbol lists into a single file and remove comments.
|
||||
|
||||
$(JVM_OUTPUTDIR)/symbols: $(SYMBOLS_SRC)
|
||||
$(SED) -e '/^#/d' $^ > $@
|
||||
|
||||
################################################################################
|
||||
# Finally convert the symbol list into a platform-specific mapfile
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
# On macosx, we need to add a leading underscore
|
||||
define create-mapfile-work
|
||||
$(AWK) '{ if ($$0 ~ ".") { print " _" $$0 } }' < $^ > $@.tmp
|
||||
endef
|
||||
else ifeq ($(call isTargetOs, windows), true)
|
||||
# On windows, add an 'EXPORTS' header
|
||||
define create-mapfile-work
|
||||
$(ECHO) "EXPORTS" > $@.tmp
|
||||
$(AWK) '{ if ($$0 ~ ".") { print " " $$0 } }' < $^ >> $@.tmp
|
||||
endef
|
||||
else
|
||||
# Assume standard linker script
|
||||
define create-mapfile-work
|
||||
$(PRINTF) "SUNWprivate_1.1 { \n global: \n" > $@.tmp
|
||||
$(AWK) '{ if ($$0 ~ ".") { print " " $$0 ";" } }' < $^ >> $@.tmp
|
||||
$(PRINTF) " local: \n *; \n }; \n" >> $@.tmp
|
||||
endef
|
||||
endif
|
||||
|
||||
define create-mapfile
|
||||
$(call LogInfo, Creating mapfile)
|
||||
$(call MakeDir, $(@D))
|
||||
$(call create-mapfile-work)
|
||||
$(RM) $@
|
||||
$(MV) $@.tmp $@
|
||||
endef
|
||||
|
||||
$(JVM_MAPFILE): $(JVM_OUTPUTDIR)/symbols
|
||||
$(call create-mapfile)
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2024, 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
|
||||
@@ -73,7 +73,7 @@ ifeq ($(call isTargetOs, linux), true)
|
||||
NONPIC_SRC := $(filter $(NONPIC_FILTER), $(ALL_SRC)) globals.cpp location.cpp
|
||||
# Declare variables for each source file that needs the pic flag like this:
|
||||
# BUILD_JVM_<srcfile>_CXXFLAGS := -fno-PIC
|
||||
# This will get implicitly picked up by SetupNativeCompilation below.
|
||||
# This will get implicitly picked up by SetupJdkLibrary below.
|
||||
$(foreach s, $(NONPIC_SRC), $(eval BUILD_LIBJVM_$(notdir $s)_CXXFLAGS := -fno-PIC))
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2016, 2024, 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
|
||||
@@ -28,11 +28,13 @@ default: all
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
|
||||
$(foreach v, $(JVM_VARIANTS), \
|
||||
$(eval $(call SetupCopyFiles, COPY_GTEST_$v, \
|
||||
SRC := $(HOTSPOT_OUTPUTDIR)/variant-$v/libjvm/gtest, \
|
||||
DEST := $(TEST_IMAGE_DIR)/hotspot/gtest/$v, \
|
||||
FILES := $(call SHARED_LIBRARY,jvm) gtestLauncher$(EXECUTABLE_SUFFIX), \
|
||||
FILES := $(LIBRARY_PREFIX)jvm$(SHARED_LIBRARY_SUFFIX) gtestLauncher$(EXECUTABLE_SUFFIX), \
|
||||
)) \
|
||||
$(eval TARGETS += $$(COPY_GTEST_$v)) \
|
||||
)
|
||||
|
||||
@@ -78,8 +78,6 @@ EmitExtractedDefines = \
|
||||
# Remaining parameter(s) are named arguments:
|
||||
# NATURE - Which Eclipse Workspace nature to generate for the Workspace. Can
|
||||
# be one of JAVA, HOTSPOT, NATIVE, or MIXED.
|
||||
# SHARED - Workspace will share the same directory as the JDK if true. Can be
|
||||
# either true or false. Defaults to false if not specified.
|
||||
SetupEclipseWorkspace = $(NamedParamsMacroTemplate)
|
||||
define SetupEclipseWorkspaceBody
|
||||
|
||||
@@ -95,26 +93,12 @@ define SetupEclipseWorkspaceBody
|
||||
$$(error Unrecognised nature $$($1_NATURE) specified for Eclipse Workspace)
|
||||
endif
|
||||
|
||||
ifeq ($$($1_SHARED), )
|
||||
$$(info Workspace sharing option not given, assuming non-shared Eclipse Workspace)
|
||||
$1_SHARED := false
|
||||
else ifeq ($$(findstring $$($1_SHARED), true false), )
|
||||
$$(error $$($1_NATURE) is not a boolean word)
|
||||
endif
|
||||
|
||||
ifeq ($$($1_SHARED), true)
|
||||
$1_CLASSPATH_FILE := $(TOPDIR)/.classpath
|
||||
$1_WORKSPACE_FILE := $(TOPDIR)/.project
|
||||
$1_NATIVE_FILE := $(TOPDIR)/.cproject
|
||||
$1_SETTINGS_FILE := $(TOPDIR)/.settings/language.settings.xml
|
||||
else
|
||||
$1_IDE_OUTPUTDIR := $(OUTPUTDIR)/ide/eclipse
|
||||
$1_CLASSPATH_FILE := $$($1_IDE_OUTPUTDIR)/.classpath
|
||||
$1_WORKSPACE_FILE := $$($1_IDE_OUTPUTDIR)/.project
|
||||
$1_NATIVE_FILE := $$($1_IDE_OUTPUTDIR)/.cproject
|
||||
$1_SETTINGS_FILE := $$($1_IDE_OUTPUTDIR)/.settings/language.settings.xml
|
||||
$$(call MakeDir, $$($1_IDE_OUTPUTDIR))
|
||||
endif
|
||||
$1_IDE_OUTPUTDIR := $(OUTPUTDIR)/ide/eclipse
|
||||
$1_CLASSPATH_FILE := $$($1_IDE_OUTPUTDIR)/.classpath
|
||||
$1_WORKSPACE_FILE := $$($1_IDE_OUTPUTDIR)/.project
|
||||
$1_NATIVE_FILE := $$($1_IDE_OUTPUTDIR)/.cproject
|
||||
$1_SETTINGS_FILE := $$($1_IDE_OUTPUTDIR)/.settings/language.settings.xml
|
||||
$$(call MakeDir, $$($1_IDE_OUTPUTDIR))
|
||||
|
||||
ifneq ($$(findstring $$($1_NATURE), HOTSPOT NATIVE MIXED), )
|
||||
ifeq ($$(call isCompiler, microsoft), true)
|
||||
@@ -198,14 +182,11 @@ define SetupEclipseWorkspaceBody
|
||||
$1_MAKE := $$(call FixPath, $(MAKE))
|
||||
endif
|
||||
|
||||
$1_MATCHING_MAKE_TARGETS :=
|
||||
$1_PLAIN_MAKE_TARGETS := update-build-docs docs gensrc gendata \
|
||||
copy java launchers libs hotspot jdk product-images all-images test-image clean
|
||||
|
||||
# make reconfigure omitted since it is sensitive to which make was used
|
||||
ifeq ($$($1_SHARED), true)
|
||||
$1_PLAIN_MAKE_TARGETS += dist-clean
|
||||
endif
|
||||
# make dist-clean omitted since it would delete the Workspace as well
|
||||
$1_MATCHING_MAKE_TARGETS :=
|
||||
$1_PLAIN_MAKE_TARGETS := update-build-docs docs gensrc gendata copy java \
|
||||
launchers libs hotspot jdk product-images product-bundles all-images test-image clean
|
||||
|
||||
$1_MATCHING_MAKE_TARGETS += $$(foreach name,$$($1_PLAIN_MAKE_TARGETS), \
|
||||
<target name="$$(strip $$(name))" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder"> \
|
||||
@@ -232,11 +213,7 @@ define SetupEclipseWorkspaceBody
|
||||
|
||||
TARGETS += $$($1_CREATE_NATIVE_FILE)
|
||||
|
||||
ifeq ($$($1_SHARED), true)
|
||||
$$(call MakeDir, $(TOPDIR)/.settings)
|
||||
else
|
||||
$$(call MakeDir, $$($1_IDE_OUTPUTDIR)/.settings)
|
||||
endif
|
||||
$$(call MakeDir, $$($1_IDE_OUTPUTDIR)/.settings)
|
||||
|
||||
$1_CSETTINGS :=
|
||||
$1_CXXSETTINGS :=
|
||||
@@ -280,7 +257,6 @@ define SetupEclipseWorkspaceBody
|
||||
<resource project-relative-path="src/hotspot/share/runtime/abstract_vm_version.cpp"> \
|
||||
<entry kind="macro" name="HOTSPOT_VERSION_STRING" value=""$(VERSION_STRING)""/> \
|
||||
<entry kind="macro" name="DEBUG_LEVEL" value=""$(DEBUG_LEVEL)""/> \
|
||||
<entry kind="macro" name="HOTSPOT_BUILD_USER" value=""$(USERNAME)""/> \
|
||||
<entry kind="macro" name="HOTSPOT_VM_DISTRO" value=""$(HOTSPOT_VM_DISTRO)""/> \
|
||||
<entry kind="macro" name="CPU" value=""$(OPENJDK_TARGET_CPU_VM_VERSION)""/> \
|
||||
<entry kind="macro" name="HOTSPOT_BUILD_TIME" value=""$(if $(HOTSPOT_BUILD_TIME),$(HOTSPOT_BUILD_TIME),$(call EpochToISO8601,$(shell $(DATE) +"%s")))""/> \
|
||||
@@ -288,7 +264,6 @@ define SetupEclipseWorkspaceBody
|
||||
<resource project-relative-path="src/hotspot/share/runtime/arguments.cpp"> \
|
||||
<entry kind="macro" name="HOTSPOT_VERSION_STRING" value=""$(VERSION_STRING)""/> \
|
||||
<entry kind="macro" name="DEBUG_LEVEL" value=""$(DEBUG_LEVEL)""/> \
|
||||
<entry kind="macro" name="HOTSPOT_BUILD_USER" value=""$(USERNAME)""/> \
|
||||
<entry kind="macro" name="HOTSPOT_VM_DISTRO" value=""$(HOTSPOT_VM_DISTRO)""/> \
|
||||
<entry kind="macro" name="CPU" value=""$(OPENJDK_TARGET_CPU_VM_VERSION)""/> \
|
||||
<entry kind="macro" name="HOTSPOT_BUILD_TIME" value=""$(if $(HOTSPOT_BUILD_TIME),$(HOTSPOT_BUILD_TIME),$(call EpochToISO8601,$(shell $(DATE) +"%s")))""/> \
|
||||
@@ -316,40 +291,38 @@ define SetupEclipseWorkspaceBody
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($$($1_SHARED), false)
|
||||
ifneq ($$(findstring $$($1_NATURE), JAVA MIXED), )
|
||||
$1_LINKED_RESOURCES += $$(foreach src,$(JAVA_DIRS), \
|
||||
<link> \
|
||||
<name>$$(strip $$(src))</name> \
|
||||
<type>2</type> \
|
||||
<location>$$(subst \\,/,$$(call FixPath, $(TOPDIR)/$$(src)))</location> \
|
||||
</link>$$(NEWLINE))
|
||||
endif
|
||||
ifneq ($$(findstring $$($1_NATURE), JAVA MIXED), )
|
||||
$1_LINKED_RESOURCES += $$(foreach src,$(JAVA_DIRS), \
|
||||
<link> \
|
||||
<name>$$(strip $$(src))</name> \
|
||||
<type>2</type> \
|
||||
<location>$$(subst \\,/,$$(call FixPath, $(TOPDIR)/$$(src)))</location> \
|
||||
</link>$$(NEWLINE))
|
||||
endif
|
||||
|
||||
ifneq ($$(findstring $$($1_NATURE), HOTSPOT NATIVE MIXED), )
|
||||
# CDT includes a Makefile editor, so if CDT support was indicated there's no harm in
|
||||
# including the make sources as well, since the cost of indexing them is miniscule
|
||||
$1_LINKED_RESOURCES += \
|
||||
<link> \
|
||||
<name>make</name> \
|
||||
<type>2</type> \
|
||||
<location>$$(subst \\,/,$$(call FixPath, $(TOPDIR)/make))</location> \
|
||||
</link> \
|
||||
<link> \
|
||||
<name>src/hotspot</name> \
|
||||
<type>2</type> \
|
||||
<location>$$(subst \\,/,$$(call FixPath, $(TOPDIR)/src/hotspot))</location> \
|
||||
</link>$$(NEWLINE)
|
||||
endif
|
||||
ifneq ($$(findstring $$($1_NATURE), HOTSPOT NATIVE MIXED), )
|
||||
# CDT includes a Makefile editor, so if CDT support was indicated there's no harm in
|
||||
# including the make sources as well, since the cost of indexing them is miniscule
|
||||
$1_LINKED_RESOURCES += \
|
||||
<link> \
|
||||
<name>make</name> \
|
||||
<type>2</type> \
|
||||
<location>$$(subst \\,/,$$(call FixPath, $(TOPDIR)/make))</location> \
|
||||
</link> \
|
||||
<link> \
|
||||
<name>src/hotspot</name> \
|
||||
<type>2</type> \
|
||||
<location>$$(subst \\,/,$$(call FixPath, $(TOPDIR)/src/hotspot))</location> \
|
||||
</link>$$(NEWLINE)
|
||||
endif
|
||||
|
||||
ifneq ($$(findstring $$($1_NATURE), NATIVE MIXED), )
|
||||
$1_LINKED_RESOURCES += $$(foreach src,$(NATIVE_DIRS), \
|
||||
<link> \
|
||||
<name>$$(strip $$(src))</name> \
|
||||
<type>2</type> \
|
||||
<location>$$(subst \\,/,$$(call FixPath, $(TOPDIR)/$$(src)))</location> \
|
||||
</link>$$(NEWLINE))
|
||||
endif
|
||||
ifneq ($$(findstring $$($1_NATURE), NATIVE MIXED), )
|
||||
$1_LINKED_RESOURCES += $$(foreach src,$(NATIVE_DIRS), \
|
||||
<link> \
|
||||
<name>$$(strip $$(src))</name> \
|
||||
<type>2</type> \
|
||||
<location>$$(subst \\,/,$$(call FixPath, $(TOPDIR)/$$(src)))</location> \
|
||||
</link>$$(NEWLINE))
|
||||
endif
|
||||
|
||||
$$(eval $$(call SetupTextFileProcessing, $1_CREATE_WORKSPACE_FILE, \
|
||||
@@ -368,22 +341,18 @@ endef
|
||||
ifeq ($(WORKSPACE), java)
|
||||
$(eval $(call SetupEclipseWorkspace, SETUP_WORKSPACE, \
|
||||
NATURE := JAVA, \
|
||||
SHARED := $(SHARED), \
|
||||
))
|
||||
else ifeq ($(WORKSPACE), hotspot)
|
||||
$(eval $(call SetupEclipseWorkspace, SETUP_WORKSPACE, \
|
||||
NATURE := HOTSPOT, \
|
||||
SHARED := $(SHARED), \
|
||||
))
|
||||
else ifeq ($(WORKSPACE), native)
|
||||
$(eval $(call SetupEclipseWorkspace, SETUP_WORKSPACE, \
|
||||
NATURE := NATIVE, \
|
||||
SHARED := $(SHARED), \
|
||||
))
|
||||
else
|
||||
$(eval $(call SetupEclipseWorkspace, SETUP_WORKSPACE, \
|
||||
NATURE := MIXED, \
|
||||
SHARED := $(SHARED), \
|
||||
))
|
||||
endif
|
||||
|
||||
|
||||
@@ -221,7 +221,6 @@ class BuildConfig {
|
||||
Vector sysDefines = new Vector();
|
||||
sysDefines.add("WIN32");
|
||||
sysDefines.add("_WINDOWS");
|
||||
sysDefines.add("HOTSPOT_BUILD_USER=\\\""+System.getProperty("user.name")+"\\\"");
|
||||
sysDefines.add("HOTSPOT_BUILD_TARGET=\\\""+get("Build")+"\\\"");
|
||||
sysDefines.add("INCLUDE_JFR=1");
|
||||
sysDefines.add("_JNI_IMPLEMENTATION_");
|
||||
|
||||
@@ -78,7 +78,7 @@ public class ProjectCreator {
|
||||
System.err.println(" are both quoted strings.");
|
||||
System.err.println(" Default includes: \".\"");
|
||||
System.err
|
||||
.println(" Default defines: WIN32, _WINDOWS, \"HOTSPOT_BUILD_USER=$(USERNAME)\"");
|
||||
.println(" Default defines: WIN32, _WINDOWS");
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -97,7 +97,7 @@ public class CLDRConverter {
|
||||
private static final String DST = "dst";
|
||||
private static final String NO_SUBST = "-";
|
||||
|
||||
private static SupplementDataParseHandler handlerSuppl;
|
||||
private static SupplementalDataParseHandler handlerSuppl;
|
||||
private static LikelySubtagsParseHandler handlerLikelySubtags;
|
||||
private static WinZonesParseHandler handlerWinZones;
|
||||
static PluralsParseHandler handlerPlurals;
|
||||
@@ -128,9 +128,10 @@ public class CLDRConverter {
|
||||
static Map<String, String> pluralRules;
|
||||
static Map<String, String> dayPeriodRules;
|
||||
|
||||
// TZDB Short Names Map
|
||||
// TZDB maps
|
||||
private static final Map<String, String> tzdbShortNamesMap = HashMap.newHashMap(512);
|
||||
private static final Map<String, String> tzdbSubstLetters = HashMap.newHashMap(512);
|
||||
private static final Map<String, String> tzdbLinks = HashMap.newHashMap(512);
|
||||
|
||||
static enum DraftType {
|
||||
UNCONFIRMED,
|
||||
@@ -470,7 +471,7 @@ public class CLDRConverter {
|
||||
// SupplementalData file also provides the "parent" locales which
|
||||
// are othrwise not to be fallen back. Process them here as well.
|
||||
//
|
||||
handlerSuppl = new SupplementDataParseHandler();
|
||||
handlerSuppl = new SupplementalDataParseHandler();
|
||||
parseLDMLFile(new File(SPPL_SOURCE_FILE), handlerSuppl);
|
||||
Map<String, Object> parentData = handlerSuppl.getData("root");
|
||||
parentData.keySet().stream()
|
||||
@@ -762,12 +763,32 @@ public class CLDRConverter {
|
||||
|
||||
private static Map<String, Object> extractZoneNames(Map<String, Object> map, String id) {
|
||||
Map<String, Object> names = new TreeMap<>(KeyComparator.INSTANCE);
|
||||
var availableIds = getAvailableZoneIds();
|
||||
|
||||
getAvailableZoneIds().stream().forEach(tzid -> {
|
||||
availableIds.forEach(tzid -> {
|
||||
// If the tzid is deprecated, get the data for the replacement id
|
||||
String tzKey = Optional.ofNullable((String)handlerSupplMeta.get(tzid))
|
||||
.orElse(tzid);
|
||||
// Follow link, if needed
|
||||
var tzLink = tzdbLinks.get(tzKey);
|
||||
if (tzLink == null && tzdbLinks.containsValue(tzKey)) {
|
||||
// reverse link search
|
||||
// this is needed as in tzdb, "America/Buenos_Aires" links to
|
||||
// "America/Argentina/Buenos_Aires", but CLDR contains metaZone
|
||||
// "Argentina" only for "America/Buenos_Aires" (as of CLDR 44)
|
||||
// Both tzids should have "Argentina" meta zone names
|
||||
tzLink = tzdbLinks.entrySet().stream()
|
||||
.filter(e -> e.getValue().equals(tzKey))
|
||||
.map(Map.Entry::getKey)
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
|
||||
}
|
||||
Object data = map.get(TIMEZONE_ID_PREFIX + tzKey);
|
||||
if (data == null && tzLink != null) {
|
||||
// data for tzLink
|
||||
data = map.get(TIMEZONE_ID_PREFIX + tzLink);
|
||||
}
|
||||
|
||||
if (data instanceof String[] tznames) {
|
||||
// Hack for UTC. UTC is an alias to Etc/UTC in CLDR
|
||||
@@ -777,20 +798,36 @@ public class CLDRConverter {
|
||||
names.put("UTC", META_ETCUTC_ZONE_NAME);
|
||||
} else {
|
||||
// TZDB short names
|
||||
tznames = Arrays.copyOf(tznames, tznames.length);
|
||||
fillTZDBShortNames(tzid, tznames);
|
||||
names.put(tzid, tznames);
|
||||
}
|
||||
} else {
|
||||
String meta = handlerMetaZones.get(tzKey);
|
||||
if (meta == null && tzLink != null) {
|
||||
// Check for tzLink
|
||||
meta = handlerMetaZones.get(tzLink);
|
||||
}
|
||||
if (meta != null) {
|
||||
String metaKey = METAZONE_ID_PREFIX + meta;
|
||||
data = map.get(metaKey);
|
||||
if (data instanceof String[] tznames) {
|
||||
// TZDB short names
|
||||
tznames = Arrays.copyOf((String[])names.getOrDefault(metaKey, tznames), 6);
|
||||
fillTZDBShortNames(tzid, tznames);
|
||||
// Keep the metazone prefix here.
|
||||
names.put(metaKey, data);
|
||||
names.putIfAbsent(metaKey, tznames);
|
||||
names.put(tzid, meta);
|
||||
if (tzLink != null && availableIds.contains(tzLink)) {
|
||||
names.put(tzLink, meta);
|
||||
}
|
||||
}
|
||||
} else if (id.equals("root")) {
|
||||
// supply TZDB short names if available
|
||||
if (tzdbShortNamesMap.containsKey(tzid)) {
|
||||
var tznames = new String[6];
|
||||
fillTZDBShortNames(tzid, tznames);
|
||||
names.put(tzid, tznames);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1263,7 +1300,7 @@ public class CLDRConverter {
|
||||
}
|
||||
|
||||
/*
|
||||
* Generates two maps from TZ database files, where they have usual abbreviation
|
||||
* Generates three maps from TZ database files, where they have usual abbreviation
|
||||
* of the time zone names as "FORMAT".
|
||||
*
|
||||
* `tzdbShortNamesMap` maps the time zone id, such as "America/Los_Angeles" to
|
||||
@@ -1273,53 +1310,46 @@ public class CLDRConverter {
|
||||
*
|
||||
* "America/Los_Angeles" -> "P%sT<NBSP>US"
|
||||
*
|
||||
* The other map, `tzdbSubstLetters` maps the Rule to its substitution letters.
|
||||
* The map, `tzdbSubstLetters` maps the Rule to its substitution letters.
|
||||
* The key of the map is the Rule name, appended with "<NBSP>std" or "<NBSP>dst"
|
||||
* depending on the savings, e.g.,
|
||||
*
|
||||
* "US<NBSP>std" -> "S"
|
||||
* "US<NBSP>dst" -> "D"
|
||||
*
|
||||
* These two mappings resolve the short names for time zones in each type,
|
||||
* These mappings resolve the short names for time zones in each type,
|
||||
* such as:
|
||||
*
|
||||
* Standard short name for "America/Los_Angeles" -> "PST"
|
||||
* DST short name for "America/Los_Angeles" -> "PDT"
|
||||
* Generic short name for "America/Los_Angeles" -> "PT"
|
||||
*
|
||||
* The map, `tzdbLinks` retains `Link`s of time zones. For example,
|
||||
* the mapping:
|
||||
*
|
||||
* "US/Hawaii" -> "Pacific/Honolulu"
|
||||
*
|
||||
* resolves names for "US/Hawaii" correctly with "Pacific/Honolulu"
|
||||
* names.
|
||||
*/
|
||||
private static void generateTZDBShortNamesMap() throws IOException {
|
||||
Files.walk(Path.of(tzDataDir), 1, FileVisitOption.FOLLOW_LINKS)
|
||||
.filter(p -> p.toFile().isFile() && !p.endsWith("jdk11_backward"))
|
||||
.filter(p -> p.toFile().isFile())
|
||||
.forEach(p -> {
|
||||
try {
|
||||
String zone = null;
|
||||
String rule = null;
|
||||
String format = null;
|
||||
boolean inVanguard = false;
|
||||
boolean inRearguard = false;
|
||||
for (var line : Files.readAllLines(p)) {
|
||||
// Interpret the line in rearguard mode so that STD/DST
|
||||
// correctly handles negative DST cases, such as "GMT/IST"
|
||||
// vs. "IST/GMT" case for Europe/Dublin
|
||||
if (inVanguard) {
|
||||
if (line.startsWith("# Rearguard")) {
|
||||
inVanguard = false;
|
||||
inRearguard = true;
|
||||
}
|
||||
continue;
|
||||
} else if (line.startsWith("# Vanguard")) {
|
||||
// check for Vanguard lines
|
||||
if (line.startsWith("# Vanguard section")) {
|
||||
inVanguard = true;
|
||||
continue;
|
||||
}
|
||||
if (inRearguard) {
|
||||
if (line.startsWith("# End of rearguard")) {
|
||||
inRearguard = false;
|
||||
continue;
|
||||
} else {
|
||||
if (line.startsWith("#\t")) {
|
||||
line = line.substring(1); // omit #
|
||||
}
|
||||
}
|
||||
if (inVanguard && line.startsWith("# Rearguard section")) {
|
||||
inVanguard = false;
|
||||
continue;
|
||||
}
|
||||
if (line.isBlank() || line.matches("^[ \t]*#.*")) {
|
||||
// ignore blank/comment lines
|
||||
@@ -1336,7 +1366,7 @@ public class CLDRConverter {
|
||||
var zl = line.split("[ \t]+", -1);
|
||||
zone = zl[1];
|
||||
rule = zl[3];
|
||||
format = zl[4];
|
||||
format = flipIfNeeded(inVanguard, zl[4]);
|
||||
} else {
|
||||
if (zone != null) {
|
||||
if (line.startsWith("Rule") ||
|
||||
@@ -1348,7 +1378,7 @@ public class CLDRConverter {
|
||||
} else {
|
||||
var s = line.split("[ \t]+", -1);
|
||||
rule = s[2];
|
||||
format = s[3];
|
||||
format = flipIfNeeded(inVanguard, s[3]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1359,6 +1389,17 @@ public class CLDRConverter {
|
||||
tzdbSubstLetters.put(rl[1] + NBSP + (rl[8].equals("0") ? STD : DST),
|
||||
rl[9].replace(NO_SUBST, ""));
|
||||
}
|
||||
|
||||
// Link line
|
||||
if (line.startsWith("Link")) {
|
||||
var ll = line.split("[ \t]+", -1);
|
||||
tzdbLinks.put(ll[2], ll[1]);
|
||||
}
|
||||
}
|
||||
|
||||
// Last entry
|
||||
if (zone != null) {
|
||||
tzdbShortNamesMap.put(zone, format + NBSP + rule);
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
throw new UncheckedIOException(ioe);
|
||||
@@ -1366,11 +1407,24 @@ public class CLDRConverter {
|
||||
});
|
||||
}
|
||||
|
||||
// Reverse the std/dst FORMAT in Vanguard so that it
|
||||
// correctly handles negative DST cases, such as "GMT/IST"
|
||||
// vs. "IST/GMT" case for Europe/Dublin
|
||||
private static String flipIfNeeded(boolean inVanguard, String format) {
|
||||
if (inVanguard) {
|
||||
var stddst = format.split("/");
|
||||
if (stddst.length == 2) {
|
||||
return stddst[1] + "/" + stddst[0];
|
||||
}
|
||||
}
|
||||
return format;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fill the TZDB short names if there is no name provided by the CLDR
|
||||
*/
|
||||
private static void fillTZDBShortNames(String tzid, String[] names) {
|
||||
var val = tzdbShortNamesMap.get(tzid);
|
||||
var val = tzdbShortNamesMap.get(tzdbLinks.getOrDefault(tzid, tzid));
|
||||
if (val != null) {
|
||||
var format = val.split(NBSP)[0];
|
||||
var rule = val.split(NBSP)[1];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2024, 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
|
||||
@@ -38,11 +38,11 @@ import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
* Handles parsing of files in Locale Data Markup Language for SupplementData.xml
|
||||
* Handles parsing of files in Locale Data Markup Language for supplementalData.xml
|
||||
* and produces a map that uses the keys and values of JRE locale data.
|
||||
*/
|
||||
|
||||
class SupplementDataParseHandler extends AbstractLDMLHandler<Object> {
|
||||
class SupplementalDataParseHandler extends AbstractLDMLHandler<Object> {
|
||||
//UNM49 region and composition code used in supplementalData.xml
|
||||
private static final String WORLD = "001";
|
||||
|
||||
@@ -73,7 +73,7 @@ class SupplementDataParseHandler extends AbstractLDMLHandler<Object> {
|
||||
// "component" specific to this parent locale chain
|
||||
private String currentParentLocaleComponent;
|
||||
|
||||
SupplementDataParseHandler() {
|
||||
SupplementalDataParseHandler() {
|
||||
firstDayMap = new HashMap<>();
|
||||
minDaysMap = new HashMap<>();
|
||||
parentLocalesMap = new HashMap<>();
|
||||
@@ -132,32 +132,15 @@ class SupplementDataParseHandler extends AbstractLDMLHandler<Object> {
|
||||
switch (qName) {
|
||||
case "firstDay":
|
||||
if (!isIgnored(attributes)) {
|
||||
String fd;
|
||||
|
||||
switch (attributes.getValue("day")) {
|
||||
case "sun":
|
||||
fd = "1";
|
||||
break;
|
||||
default:
|
||||
case "mon":
|
||||
fd = "2";
|
||||
break;
|
||||
case "tue":
|
||||
fd = "3";
|
||||
break;
|
||||
case "wed":
|
||||
fd = "4";
|
||||
break;
|
||||
case "thu":
|
||||
fd = "5";
|
||||
break;
|
||||
case "fri":
|
||||
fd = "6";
|
||||
break;
|
||||
case "sat":
|
||||
fd = "7";
|
||||
break;
|
||||
}
|
||||
String fd = switch (attributes.getValue("day")) {
|
||||
case "sun" -> "1";
|
||||
case "tue" -> "3";
|
||||
case "wed" -> "4";
|
||||
case "thu" -> "5";
|
||||
case "fri" -> "6";
|
||||
case "sat" -> "7";
|
||||
default -> "2"; // Mon
|
||||
};
|
||||
firstDayMap.put(attributes.getValue("territories"), fd);
|
||||
}
|
||||
break;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2024, 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
|
||||
@@ -36,7 +36,7 @@ import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
* Handles parsing of files in Locale Data Markup Language for
|
||||
* SupplementalMetadata.xml
|
||||
* supplementalMetadata.xml
|
||||
*/
|
||||
|
||||
class SupplementalMetadataParseHandler extends AbstractLDMLHandler<Object> {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2024, 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
|
||||
@@ -48,6 +48,7 @@ public class GenModuleLoaderMap {
|
||||
// default set of boot modules and ext modules
|
||||
Stream<String> bootModules = Stream.empty();
|
||||
Stream<String> platformModules = Stream.empty();
|
||||
Stream<String> nativeAccessModules = Stream.empty();
|
||||
Path outfile = null;
|
||||
Path source = null;
|
||||
for (int i=0; i < args.length; i++) {
|
||||
@@ -60,6 +61,9 @@ public class GenModuleLoaderMap {
|
||||
} else if (option.equals("-platform")) {
|
||||
String[] mns = arg.split(",");
|
||||
platformModules = Stream.concat(platformModules, Arrays.stream(mns));
|
||||
} else if (option.equals("-native-access")) {
|
||||
String[] mns = arg.split(",");
|
||||
nativeAccessModules = Stream.concat(nativeAccessModules, Arrays.stream(mns));
|
||||
} else if (option.equals("-o")) {
|
||||
outfile = Paths.get(arg);
|
||||
} else {
|
||||
@@ -84,6 +88,8 @@ public class GenModuleLoaderMap {
|
||||
line = patch(line, "@@BOOT_MODULE_NAMES@@", bootModules);
|
||||
} else if (line.contains("@@PLATFORM_MODULE_NAMES@@")) {
|
||||
line = patch(line, "@@PLATFORM_MODULE_NAMES@@", platformModules);
|
||||
} else if (line.contains("@@NATIVE_ACCESS_MODULE_NAMES@@")) {
|
||||
line = patch(line, "@@NATIVE_ACCESS_MODULE_NAMES@@", nativeAccessModules);
|
||||
}
|
||||
writer.println(line);
|
||||
}
|
||||
|
||||
@@ -43,14 +43,8 @@ public class CompilerThreadPool {
|
||||
this.pool = Executors.newFixedThreadPool(POOLSIZE);
|
||||
}
|
||||
|
||||
public int dispatchCompilation(String[] args) {
|
||||
Log log = Log.get();
|
||||
try {
|
||||
return pool.submit(() -> Server.runCompiler(log, args)).get();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException("Error during compile", e);
|
||||
}
|
||||
public void execute(Runnable runnable) {
|
||||
this.pool.execute(runnable);
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
|
||||
@@ -168,10 +168,8 @@ public class Server {
|
||||
do {
|
||||
try {
|
||||
Socket socket = serverSocket.accept();
|
||||
// Handle each incoming request in a separate thread. This is just for socket communication,
|
||||
// the actual compilation will be done by the threadpool.
|
||||
Thread requestHandler = new Thread(() -> handleRequest(socket));
|
||||
requestHandler.start();
|
||||
// Handle each incoming request in a threapool thread
|
||||
compilerThreadPool.execute(() -> handleRequest(socket));
|
||||
} catch (SocketException se) {
|
||||
// Caused by serverSocket.close() and indicates shutdown
|
||||
}
|
||||
@@ -206,9 +204,9 @@ public class Server {
|
||||
// If there has been any internal errors, notify client
|
||||
checkInternalErrorLog();
|
||||
|
||||
// Perform compilation. This will call runCompiler() on a
|
||||
// thread in the thread pool
|
||||
int exitCode = compilerThreadPool.dispatchCompilation(args);
|
||||
// Perform compilation
|
||||
int exitCode = runCompiler(args);
|
||||
|
||||
Protocol.sendExitCode(out, exitCode);
|
||||
|
||||
// Check for internal errors again.
|
||||
@@ -220,15 +218,14 @@ public class Server {
|
||||
// Not much to be done at this point. The client side request
|
||||
// code will most likely throw an IOException and the
|
||||
// compilation will fail.
|
||||
ex.printStackTrace();
|
||||
Log.error(ex);
|
||||
} finally {
|
||||
Log.setLogForCurrentThread(null);
|
||||
}
|
||||
}
|
||||
|
||||
public static int runCompiler(Log log, String[] args) {
|
||||
Log.setLogForCurrentThread(log);
|
||||
|
||||
public static int runCompiler(String[] args) {
|
||||
// Direct logging to our byte array stream.
|
||||
StringWriter strWriter = new StringWriter();
|
||||
PrintWriter printWriter = new PrintWriter(strWriter);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2024, 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
|
||||
@@ -50,17 +50,16 @@ public class PortFile {
|
||||
// Followed by a 4 byte int, with the port nr.
|
||||
// Followed by a 8 byte long, with cookie nr.
|
||||
|
||||
private String filename;
|
||||
private File file;
|
||||
private File stopFile;
|
||||
private final String filename;
|
||||
private final File file;
|
||||
private final File stopFile;
|
||||
private RandomAccessFile rwfile;
|
||||
private FileChannel channel;
|
||||
|
||||
// FileLock used to solve inter JVM synchronization, lockSem used to avoid
|
||||
// JVM internal OverlappingFileLockExceptions.
|
||||
// Class invariant: lock.isValid() <-> lockSem.availablePermits() == 0
|
||||
private FileLock lock;
|
||||
private Semaphore lockSem = new Semaphore(1);
|
||||
private final Semaphore lockSem = new Semaphore(1);
|
||||
|
||||
private boolean containsPortInfo;
|
||||
private int serverPort;
|
||||
@@ -89,17 +88,18 @@ public class PortFile {
|
||||
}
|
||||
// The rwfile should only be readable by the owner of the process
|
||||
// and no other! How do we do that on a RandomAccessFile?
|
||||
channel = rwfile.getChannel();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lock the port file.
|
||||
*/
|
||||
public void lock() throws IOException, InterruptedException {
|
||||
if (channel == null) {
|
||||
initializeChannel();
|
||||
}
|
||||
lockSem.acquire();
|
||||
if (rwfile != null) {
|
||||
throw new IllegalStateException("rwfile not null");
|
||||
}
|
||||
initializeChannel();
|
||||
FileChannel channel = rwfile.getChannel();
|
||||
lock = channel.lock();
|
||||
}
|
||||
|
||||
@@ -110,8 +110,7 @@ public class PortFile {
|
||||
public void getValues() {
|
||||
containsPortInfo = false;
|
||||
if (lock == null) {
|
||||
// Not locked, remain ignorant about port file contents.
|
||||
return;
|
||||
throw new IllegalStateException("Must lock before calling getValues");
|
||||
}
|
||||
try {
|
||||
if (rwfile.length()>0) {
|
||||
@@ -156,6 +155,9 @@ public class PortFile {
|
||||
* Store the values into the locked port file.
|
||||
*/
|
||||
public void setValues(int port, long cookie) throws IOException {
|
||||
if (lock == null) {
|
||||
throw new IllegalStateException("Must lock before calling setValues");
|
||||
}
|
||||
rwfile.seek(0);
|
||||
// Write the magic nr that identifies a port file.
|
||||
rwfile.writeInt(magicNr);
|
||||
@@ -169,19 +171,19 @@ public class PortFile {
|
||||
* Delete the port file.
|
||||
*/
|
||||
public void delete() throws IOException, InterruptedException {
|
||||
// Access to file must be closed before deleting.
|
||||
rwfile.close();
|
||||
|
||||
file.delete();
|
||||
|
||||
// Wait until file has been deleted (deletes are asynchronous on Windows!) otherwise we
|
||||
if (!file.exists()) { // file deleted already
|
||||
return;
|
||||
}
|
||||
// Keep trying until file has been deleted, otherwise we
|
||||
// might shutdown the server and prevent another one from starting.
|
||||
for (int i = 0; i < 10 && file.exists(); i++) {
|
||||
for (int i = 0; i < 10 && file.exists() && !file.delete(); i++) {
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
if (file.exists()) {
|
||||
throw new IOException("Failed to delete file.");
|
||||
}
|
||||
// allow some time for late clients to connect
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -210,10 +212,12 @@ public class PortFile {
|
||||
*/
|
||||
public void unlock() throws IOException {
|
||||
if (lock == null) {
|
||||
return;
|
||||
throw new IllegalStateException("Not locked");
|
||||
}
|
||||
lock.release();
|
||||
lock = null;
|
||||
rwfile.close();
|
||||
rwfile = null;
|
||||
lockSem.release();
|
||||
}
|
||||
|
||||
|
||||
@@ -246,6 +246,18 @@ ifeq ($(ENABLE_LIBFFI_BUNDLING), true)
|
||||
TARGETS += $(COPY_LIBFFI)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Copy tzmappings file for Windows
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
$(eval $(call SetupCopyFiles, COPY_TZMAPPINGS, \
|
||||
FILES := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/windows/conf/tzmappings, \
|
||||
DEST := $(call FindLibDirForModule, $(MODULE)), \
|
||||
))
|
||||
|
||||
TARGETS += $(COPY_TZMAPPINGS)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Optionally copy hsdis into the image
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user