Compare commits

..

140 Commits

Author SHA1 Message Date
Ravi Reddy
a3fde486b1 8341059: Change Entrust TLS distrust date to November 12, 2024
Backport-of: cc6f90a77b
2024-09-30 05:51:47 +00:00
Ravi Reddy
047c522c4f 8341057: Add 2 SSL.com TLS roots
Backport-of: 6b9dcdbcb2
2024-09-30 05:46:11 +00:00
Ravi Reddy
9935c12398 8337664: Distrust TLS server certificates issued after Oct 2024 and anchored by Entrust Root CAs
Backport-of: 7d49c52272
2024-09-09 08:40:22 +00:00
Ravi Reddy
5c4fdea834 8338696: (fs) BasicFileAttributes.creationTime() falls back to epoch if birth time is unavailable (Linux)
Backport-of: 3e84510822
2024-08-27 14:19:15 +00:00
Ravi Reddy
17c3506d5c Merge 2024-08-27 06:55:27 +00:00
Stefan Karlsson
9ad2e63f17 8338139: {ClassLoading,Memory}MXBean::isVerbose methods are inconsistent with their setVerbose methods
Reviewed-by: kevinw
Backport-of: 9775d57168
2024-08-20 15:57:04 +00:00
Ravi Reddy
799b98e132 Merge 2024-08-13 12:34:38 +00:00
Daniel D. Daugherty
6f582f4ee3 8337831: Remove EA from the JDK 23 version string with first RC promotion
Reviewed-by: dholmes
2024-08-06 22:08:22 +00:00
Ravi Reddy
e514e2e953 Merge 2024-08-06 11:26:54 +00:00
Brian Burkhalter
b7ede41a2d 8337716: ByteBuffer hashCode implementations are inconsistent
Reviewed-by: jpai, alanb
Backport-of: 8bd3cd5156
2024-08-05 15:12:46 +00:00
Damon Nguyen
2eb7709ec3 8337054: JDK 23 RDP2 L10n resource files update
Reviewed-by: jlu, prappo, naoto, vromero
2024-08-01 22:56:49 +00:00
Tobias Hartmann
8b2288fd17 8335713: Enhance vectorization analysis
Backport-of: 4e22d8c050
2024-08-01 14:15:29 +00:00
Jaikiran Pai
946c6cc6c7 8334167: Test java/lang/instrument/NativeMethodPrefixApp.java timed out
Reviewed-by: dholmes, sspitsyn
Backport-of: 3babffd400
2024-07-31 10:41:24 +00:00
Alexey Ivanov
6a6591e88c 8335967: "text-decoration: none" does not work with "A" HTML tags
Reviewed-by: prr
Backport-of: 374fca0fcb
2024-07-29 18:39:43 +00:00
Pavel Kharskii
c7e7b90762 8336366: Change milestone to fcs for all releases
8337103: The change for RDP2 CPU24_10 has corrupted line endings in the file version-numbers.conf.

Reviewed-by: robm
2024-07-25 05:40:17 +00:00
Ravi Reddy
dbbaa9e632 Merge 2024-07-23 08:17:19 +00:00
Justin Lu
82220915e5 8331446: Improve deserialization support
Reviewed-by: naoto
Backport-of: 8e4a392832f83e16d521024505b52c96d0a993f2
2024-07-22 16:59:19 +00:00
SendaoYan
2288c052e6 8334339: Test java/nio/file/attribute/BasicFileAttributeView/CreationTime.java fails on alinux3
Reviewed-by: alanb
Backport-of: 7baddc202a
2024-07-22 12:33:22 +00:00
luwang1103
cc687e87d9 8334239: Introduce macro for ubsan method/function exclusions
Backport-of: ff30240926
2024-07-22 08:36:17 +00:00
David Holmes
5473e9e488 8325280: Update troff manpages in JDK 23 before RC
Reviewed-by: alanb, iris
2024-07-21 23:07:13 +00:00
Dean Long
dfbb5e3ffa 8332644: Improve graph optimizations
Reviewed-by: kvn
Backport-of: 7c16d649a8118d2e7ee77cedba87e620c83294b4
2024-07-19 23:49:47 +00:00
Xiaolong Peng
9805cbbd25 8331411: Shenandoah: Reconsider spinning duration in ShenandoahLock
Reviewed-by: shade
Backport-of: 817edcb697
2024-07-19 15:19:58 +00:00
Jorn Vernee
65197a3207 8325984: 4 jcstress tests are failing in Tier6 4 times each
Reviewed-by: shade
Backport-of: ee82346bd5
2024-07-19 10:06:14 +00:00
Jan Lahoda
e83e2b305e 8335817: javac AssertionError addLocalVar checkNull
Reviewed-by: mcimadamore
Backport-of: 2b0adfc2de
2024-07-18 04:52:31 +00:00
Jan Lahoda
0c82e4bf19 8336375: Crash on paste to JShell
Reviewed-by: jvernee
Backport-of: b9b0b8504e
2024-07-18 04:46:59 +00:00
Markus Grönlund
88775f95f2 8334781: JFR crash: assert(((((JfrTraceIdBits::load(klass)) & ((JfrTraceIdEpoch::this_epoch_method_and_class_bits()))) != 0))) failed: invariant
Reviewed-by: egahlin
Backport-of: 67979eb077
2024-07-17 12:16:22 +00:00
Shivangi Gupta
c5f294b439 8336301: test/jdk/java/nio/channels/AsyncCloseAndInterrupt.java leaves around a FIFO file upon test completion
Backport-of: ae9f318fc3
2024-07-17 12:13:38 +00:00
Ravi Reddy
39aab17724 Merge 2024-07-17 11:42:33 +00:00
luwang1103
e9d86d853f 8332818: ubsan: archiveHeapLoader.cpp:70:27: runtime error: applying non-zero offset 18446744073707454464 to null pointer
Backport-of: 6861766b63
2024-07-17 09:21:58 +00:00
luwang1103
821a3aa53e 8333887: ubsan: unsafe.cpp:247:13: runtime error: store to null pointer of type 'volatile int'
Backport-of: 0d3a3771c3
2024-07-17 09:20:01 +00:00
Vanitha B P
8883b15634 8325525: Create jtreg test case for JDK-8325203
Backport-of: 81a0d1ba03
2024-07-17 07:20:13 +00:00
Tobias Hartmann
ec1782cd5b 8331194: NPE in ArrayCreationTree.java with -XX:-UseCompressedOops
Reviewed-by: kvn
Backport-of: 005fb67e99
2024-07-17 06:33:55 +00:00
SendaoYan
024b39c36b 8269657: Test java/nio/channels/DatagramChannel/Loopback.java failed: Unexpected message
Reviewed-by: jpai
Backport-of: c798316bc4
2024-07-17 06:12:13 +00:00
Jaikiran Pai
7afb958e8d Merge
Reviewed-by: djelinski, dholmes
2024-07-17 06:06:04 +00:00
Jayathirth D V
d876cacf73 8323390: Enhance mask blit functionality
Reviewed-by: prr, rhalade, psadhukhan
2024-07-17 05:41:28 +05:30
Phil Race
7aaf83df1d 8320097: Improve Image transformations
Reviewed-by: jdv, psadhukhan, aivanov, rhalade
2024-07-17 05:41:28 +05:30
Christian Hagedorn
f2e126dd5f 8327413: Enhance compilation efficiency
Co-authored-by: Roland Westrelin <roland@openjdk.org>
Reviewed-by: ahgross, rhalade, thartmann, epeter, mbalao, fferrari
2024-07-17 05:41:28 +05:30
Jayathirth D V
73e83a3e19 8324559: Improve 2D image handling
Reviewed-by: rhalade, mschoene, psadhukhan, prr
2024-07-17 05:41:28 +05:30
David Holmes
30260adb13 8325600: Better symbol storage
Reviewed-by: coleenp, rhalade, matsaave
2024-07-17 05:41:27 +05:30
David Holmes
cf1b618dc7 8319859: Better symbol storage
Reviewed-by: rhalade, coleenp, matsaave, iklam
2024-07-17 05:41:27 +05:30
Matias Saavedra Silva
58a274dc23 8314794: Improve UTF8 String supports
Reviewed-by: dholmes, coleenp, rhalade
2024-07-17 05:41:27 +05:30
Emanuel Peter
794cd0e591 8320548: Improved loop handling
Reviewed-by: mschoene, rhalade, thartmann, chagedorn
2024-07-17 05:41:27 +05:30
Tobias Hartmann
343da68432 8323231: Improve array management
Co-authored-by: Martin Balao <mbalao@openjdk.org>
Reviewed-by: iveresov, rhalade, mschoene, dlong, kvn
2024-07-17 05:41:27 +05:30
Patricio Chilano Mateo
d7b7c1724d 8335409: Can't allocate and retain memory from resource area in frame::oops_interpreted_do oop closure after 8329665
Reviewed-by: shade
Backport-of: 7ab96c74e2
2024-07-16 14:38:23 +00:00
Matthias Baesken
e4d80b1f6c 8334123: log the opening of Type 1 fonts
Backport-of: f8c657f671
2024-07-16 13:30:23 +00:00
Justin Lu
5162e1a31c 8334653: ISO 4217 Amendment 177 Update
Reviewed-by: naoto, iris
Backport-of: 86b0cf259f
2024-07-15 19:33:14 +00:00
Chen Liang
908d1e92fc 8336259: Wrong link to stylesheet.css in JavaDoc API documentation
Reviewed-by: iris, prappo
Backport-of: 5bc86f3329
2024-07-15 15:41:41 +00:00
Chen Liang
fd3860685d 8325369: @sealedGraph: Bad link to image for tag on nested classes
Reviewed-by: prappo
Backport-of: d06d79c809
2024-07-15 15:41:25 +00:00
Matthew Donovan
a106e522f8 8324841: PKCS11 tests still skip execution
Reviewed-by: jpai
Backport-of: 9d4a4bd2c2
2024-07-15 11:56:46 +00:00
Adam Sotona
52cd9bb534 8335820: java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java fails due to IllegalArgumentException: hash must be nonzero
Reviewed-by: jpai
Backport-of: 3f2636d9b7
2024-07-15 09:04:12 +00:00
Jaikiran Pai
7cc50a181a 8334719: (se) Deferred close of SelectableChannel may result in a Selector doing the final close before concurrent I/O on channel has completed
Reviewed-by: alanb
Backport-of: 9bb675f89d
2024-07-15 01:37:34 +00:00
Chen Liang
cfbfe4a472 8318106: Generated HTML for snippet does not always contain an id
Reviewed-by: prappo
Backport-of: 4166e53452
2024-07-14 13:27:28 +00:00
Chen Liang
d1373a2fd6 8336036: Synthetic documentation for a record's equals is incorrect for floating-point types
Reviewed-by: prappo
Backport-of: b3ef2a600c
2024-07-14 13:27:17 +00:00
Justin Lu
0a9e3bfc90 8334418: Update IANA Language Subtag Registry to Version 2024-06-14
Reviewed-by: naoto, iris
Backport-of: 861aefcafa
2024-07-12 20:18:30 +00:00
Chen Liang
06191aca86 8335935: Chained builders not sending transformed models to next transforms
Reviewed-by: asotona
Backport-of: cad68e06ec
2024-07-11 20:51:38 +00:00
Jorn Vernee
9620b912dd 8333884: MemorySegment::reinterpret removes read-only property
Reviewed-by: liach, sundar
Backport-of: 6f7f0f1de0
2024-07-11 12:42:21 +00:00
Jan Lahoda
e991c0f921 8335766: Switch case with pattern matching and guard clause compiles inconsistently
Reviewed-by: vromero
Backport-of: 537d20afbf
2024-07-11 11:08:31 +00:00
Shivangi Gupta
4ca2e48acb 8299813: java/nio/channels/DatagramChannel/Disconnect.java fails with jtreg test timeout due to lost datagram
Backport-of: 49eb00da8d
2024-07-11 10:37:51 +00:00
Jaikiran Pai
6720685abd 8335966: Remove incorrect problem listing of java/lang/instrument/NativeMethodPrefixAgent.java in ProblemList-Virtual.txt
Reviewed-by: kevinw
Backport-of: dcf4e0d51f
2024-07-11 08:20:10 +00:00
Joe Darcy
4aab58be4a 8335637: Add explicit non-null return value expectations to Object.toString()
Reviewed-by: jpai
Backport-of: 66db71563c
2024-07-11 03:06:38 +00:00
Andrew John Hughes
5cfaec2df8 8335775: Remove extraneous 's' in comment of rawmonitor.cpp test file
Backport-of: ff49f677ee
2024-07-11 01:26:48 +00:00
Rob McKenna
13e53b8e3d Merge 2024-07-10 19:48:56 +00:00
Jorn Vernee
5b9ecb1786 8333886: Explicitly specify that asSlice and reinterpret return a memory segment backed by the same region of memory.
Reviewed-by: sundar
Backport-of: c80e2eb35c
2024-07-10 16:58:04 +00:00
Ravi Reddy
8f5c6e6b02 Merge 2024-07-10 14:32:14 +00:00
Kevin Walls
70ad622bc2 8335124: com/sun/management/ThreadMXBean/ThreadCpuTimeArray.java failed with CPU time out of expected range
Reviewed-by: cjplummer
Backport-of: 79a3554e1d
2024-07-09 19:39:25 +00:00
Liam Miller-Cushon
ca37a482cc 8334757: AssertionError: Missing type variable in where clause
Reviewed-by: jlahoda, vromero
Backport-of: babf6df7d9
2024-07-09 16:05:45 +00:00
Thomas Schatzl
ae10055b2c 8335824: Test gc/arguments/TestMinInitialErgonomics.java is timing out
Reviewed-by: kbarrett, ayang
Backport-of: 953c35eb5b
2024-07-09 08:12:38 +00:00
Jan Lahoda
4e52320979 8334433: jshell.exe runs an executable test.exe on startup
Reviewed-by: vromero
Backport-of: 99d2bbf767
2024-07-09 07:35:22 +00:00
Qizheng Xing
e0dad6d5ae 8335536: Fix assertion failure in IdealGraphPrinter when append is true
Backport-of: 6db4c6a772
2024-07-09 07:23:49 +00:00
Weibing Xiao
bbbfb7ff61 8334653: ISO 4217 Amendment 177 Update
Reviewed-by: naoto
Backport-of: 86b0cf259f
2024-07-08 13:00:34 +00:00
Chen Liang
2f60d36848 8335475: ClassBuilder incorrectly calculates max_locals in some cases
Reviewed-by: asotona
Backport-of: 1ef34c1833
2024-07-08 11:01:53 +00:00
Christoph Langer
b415b98139 8334297: (so) java/nio/channels/SocketChannel/OpenLeak.java should not depend on SecurityManager
Reviewed-by: mbaesken, dfuchs
Backport-of: 50bed6c67b
2024-07-06 20:01:16 +00:00
Erik Gahlin
90d5b5b4c4 8324089: Fix typo in the manual page for "jcmd" (man jcmd)
Reviewed-by: mgronlun
Backport-of: 0bb9c76288
2024-07-05 10:53:09 +00:00
Erik Gahlin
653c481d71 8335479: JFR: Missing documentation for -XX:StartFlightRecording
Reviewed-by: mgronlun
Backport-of: 68ffec9800
2024-07-05 10:17:50 +00:00
Erik Gahlin
10b28babe5 8322812: Manpage for jcmd is missing JFR.view command
Reviewed-by: mgronlun
Backport-of: 350f9c1947
2024-07-05 09:58:56 +00:00
Erik Österlund
d383365ea4 8334890: Missing unconditional cross modifying fence in nmethod entry barriers
Reviewed-by: aboldtch
Backport-of: c0604fb823
2024-07-05 07:54:43 +00:00
Neethu Prasad
2723ffa8ed 8333716: Shenandoah: Check for disarmed method before taking the nmethod lock
Reviewed-by: shade
Backport-of: 18e7d7b5e7
2024-07-05 05:19:17 +00:00
Sean Coffey
a4f938c623 8307383: Enhance DTLS connections
Backport-of: 362dbbaa952b3d4a5270c6bfae879a12e9bdf4d1
2024-07-04 15:27:37 +00:00
Vladimir Kozlov
b6d0ead93f 8335221: Some C2 intrinsics incorrectly assume that type argument is compile-time constant
Reviewed-by: thartmann
Backport-of: 166f9d9ac0
2024-07-02 17:04:13 +00:00
Emanuel Peter
272d11a389 8335390: C2 MergeStores: wrong result with Unsafe
Reviewed-by: thartmann
Backport-of: 9046d7aee3
2024-07-02 14:27:45 +00:00
Ravi Reddy
58dc4c7e0e Merge 2024-07-02 08:36:17 +00:00
Chris Plummer
9d744b0e04 8335134: Test com/sun/jdi/BreakpointOnClassPrepare.java timeout
Reviewed-by: dholmes
Backport-of: 4e8cbf884a
2024-07-01 22:43:47 +00:00
SendaoYan
4410cdc839 8334600: TEST java/net/MulticastSocket/IPMulticastIF.java fails on linux-aarch64
Reviewed-by: clanger
Backport-of: f23295ec1d
2024-07-01 15:48:32 +00:00
Sean Coffey
9a4fc097e0 Merge 2024-07-01 14:35:51 +00:00
Coleen Phillimore
7040de19bd 8333542: Breakpoint in parallel code does not work
Reviewed-by: cjplummer
Backport-of: b3bf31a0a0
2024-07-01 12:16:58 +00:00
Axel Boldt-Christmas
e5fbc631ca 8326820: Metadata artificially kept alive
Reviewed-by: stefank
Backport-of: 5909d54147
2024-07-01 10:24:28 +00:00
Daniel Fuchs
e78c682142 8333849: (dc) DatagramChannel send/receive fails with UOE if buffer backed by memory segment allocated from shared arena
Reviewed-by: alanb
Backport-of: e7dc76b577
2024-07-01 07:55:31 +00:00
Gui Cao
d494c21b9b 8333652: RISC-V: compiler/vectorapi/VectorGatherMaskFoldingTest.java fails when using RVV
Backport-of: ce5727df44
2024-06-29 11:32:09 +00:00
Vladimir Kozlov
87a29629e3 8335220: C2: Missing check for Opaque4 node in EscapeAnalysis
Reviewed-by: vlivanov
Backport-of: 9d986a013d
2024-06-29 02:20:07 +00:00
Alexey Ivanov
e2db30a534 6967482: TAB-key does not work in JTables after selecting details-view in JFileChooser
8166352: FilePane.createDetailsView() removes JTable TAB, SHIFT-TAB functionality

Backport-of: 711e723819
2024-06-28 13:59:29 +00:00
Erik Gahlin
32ed61572c 8334886: jdk/jfr/api/recording/time/TestTimeMultiple.java failed with RuntimeException: getStopTime() > afterStop
Reviewed-by: mgronlun
Backport-of: 0e6b0cbaaa
2024-06-27 22:07:32 +00:00
Vladimir Kozlov
62d0ee9cc0 8334421: assert(!oldbox->is_unbalanced()) failed: this should not be called for unbalanced region
Reviewed-by: shade, thartmann
Backport-of: 9c89f0861c
2024-06-27 19:29:18 +00:00
Matias Saavedra Silva
b5bf9a6605 8311208: Improve CDS Support
Reviewed-by: mschoene, ccheung, iklam
Backport-of: 2c60805bc380945a8266112c7b5aee0498cb7d5b
2024-06-27 18:01:07 +00:00
Anthony Scarpino
98fd657cfa 8326705: Test CertMsgCheck.java fails to find alert certificate_required
Reviewed-by: rhalade
Backport-of: 4ffc5e6077
2024-06-27 14:17:56 +00:00
Stefan Karlsson
d7b9454205 8324781: runtime/Thread/TestAlwaysPreTouchStacks.java failed with Expected a higher ratio between stack committed and reserved
8325218: gc/parallel/TestAlwaysPreTouchBehavior.java fails

Reviewed-by: tschatzl
Backport-of: 31e8debae6
2024-06-27 14:01:23 +00:00
nibjen
9449a53217 8332524: Instead of printing "TLSv1.3," it is showing "TLS13"
Backport-of: e681b4e9b3
2024-06-27 12:23:28 +00:00
Volodymyr Paprotski
b5fbdb2166 8333583: Crypto-XDH.generateSecret regression after JDK-8329538
Reviewed-by: thartmann, sviswanathan
Backport-of: f101e153ce
2024-06-26 15:24:19 +00:00
Tobias Hartmann
2086b0f070 8334629: [BACKOUT] PhaseIdealLoop::conditional_move is too conservative
Reviewed-by: chagedorn, qamai
Backport-of: 933eababf2
2024-06-26 10:49:44 +00:00
Aleksey Shipilev
d1510505c1 8334594: Generational ZGC: Deadlock after OopMap rewrites in 8331572
Reviewed-by: stefank
Backport-of: 05ff3185ed
2024-06-26 07:46:27 +00:00
Prasanta Sadhukhan
ae49182985 8334580: Deprecate no-arg constructor BasicSliderUI() for removal
Reviewed-by: aivanov
Backport-of: e527e1c32f
2024-06-26 02:59:02 +00:00
Sean Coffey
1ea6456172 8328726: Better Kerberos support
Backport-of: 7325899a11f17bf4516d39495a12796385e459ed
2024-06-25 11:41:04 +00:00
Erik Österlund
37ebecec88 8332717: ZGC: Division by zero in heuristics
Reviewed-by: shade
Backport-of: 2d4185f4f1
2024-06-25 07:57:09 +00:00
Sean Coffey
17858b2f07 Merge 2024-06-25 07:25:18 +00:00
Christoph Langer
08c7c38342 8222884: ConcurrentClassDescLookup.java times out intermittently
Reviewed-by: mdoerr
Backport-of: bd046d9b9e
2024-06-25 03:38:09 +00:00
Erik Gahlin
fa7521b29e 8323196: jdk/jfr/api/consumer/filestream/TestOrdered.java failed with "Events are not ordered! Reuse = false"
Reviewed-by: mgronlun
Backport-of: bdd96604ae
2024-06-24 17:53:14 +00:00
Prasanta Sadhukhan
fbcf6d9c4f 8334509: Cancelling PageDialog does not return the same PageFormat object
Reviewed-by: prr
Backport-of: 689cee3d09
2024-06-24 17:26:11 +00:00
Chen Liang
a124e6e5c7 8333748: javap crash - Fatal error: Unmatched bit position 0x2 for location CLASS
Reviewed-by: asotona
Backport-of: 7e55ed3b10
2024-06-24 12:57:37 +00:00
Vicente Romero
0779f0d668 8334762: [BACKOUT BACKPORT] Improve error for illegal early access from nested class
Reviewed-by: liach, mcimadamore
2024-06-24 12:38:19 +00:00
SendaoYan
bd66b6b6f9 8333358: java/io/IO/IO.java test fails intermittently
Reviewed-by: prappo
Backport-of: 1b1dba8082
2024-06-24 09:53:50 +00:00
Hannes Greule
3edf379b67 8334708: FFM: two javadoc problems
Reviewed-by: jpai
Backport-of: 72ca7bafcd
2024-06-24 06:30:12 +00:00
SendaoYan
10d81a337d 8334441: Mark tests in jdk_security_infra group as manual
Reviewed-by: clanger
Backport-of: 8e1d2b091c
2024-06-23 16:43:27 +00:00
Chen Liang
1dbad8058b 8333854: IllegalAccessError with proxies after JDK-8332457
Reviewed-by: asotona
Backport-of: 91bd85d65d
2024-06-21 22:33:23 +00:00
SendaoYan
215149310c 8334333: MissingResourceCauseTestRun.java fails if run by root
Reviewed-by: naoto
Backport-of: de8ee97718
2024-06-21 16:39:18 +00:00
Kevin Walls
23f2c97f4c 8333344: JMX attaching of Subject does not work when security manager not allowed
Reviewed-by: dfuchs
Backport-of: bcf4bb4882
2024-06-21 10:09:14 +00:00
Vicente Romero
e84e0cdf62 8334488: Improve error for illegal early access from nested class
Reviewed-by: mcimadamore
Backport-of: 7b3a96d570
2024-06-20 18:02:13 +00:00
Erik Gahlin
2243974d29 8304732: jdk/jfr/api/consumer/recordingstream/TestStop.java failed again with "Expected outer stream to have 3 events"
Reviewed-by: mgronlun
Backport-of: 856931d01f
2024-06-20 13:55:55 +00:00
Ravi Reddy
7e6693aeba 8328286: Enhance HTTP client
Backport-of: cf8dc79f392c8ec3414d8b36803f026852c4e386
2024-06-20 11:02:42 +00:00
Richard Reingruber
79dd575113 8334402: ProblemList test/hotspot/jtreg/compiler/c2/TestMergeStores.java on big endian platforms
Reviewed-by: kvn
2024-06-20 07:09:24 +00:00
Vicente Romero
12a61bce8d 8334043: VerifyError when inner class is accessed in prologue
Reviewed-by: jpai
Backport-of: d4c1373717
2024-06-19 04:00:58 +00:00
Vicente Romero
d9dd2d19b0 8334258: Compiler erronousely allows access to instance variable in argument expression of a constructor invocation
Reviewed-by: jpai
Backport-of: e227c7e37d
2024-06-19 04:00:37 +00:00
Daniel Fuchs
b21d7b23c1 8333804: java/net/httpclient/ForbiddenHeadTest.java threw an exception with 0 failures
Reviewed-by: jpai
Backport-of: ec1664e8c9
2024-06-18 18:46:03 +00:00
SendaoYan
867312a7e5 8334332: TestIOException.java fails if run by root
Reviewed-by: prappo
Backport-of: 472b935b44
2024-06-18 13:13:31 +00:00
Christoph Langer
a4b49253e3 8331675: gtest CollectorPolicy.young_min_ergo_vm fails after 8272364
Reviewed-by: ayang, mdoerr
Backport-of: badf1cb9ce
2024-06-18 12:11:28 +00:00
Daniel Fuchs
86fcbe09f8 8299487: Test java/net/httpclient/whitebox/SSLTubeTestDriver.java timed out
Reviewed-by: jpai
Backport-of: 81083a0e10
2024-06-17 16:03:26 +00:00
Markus Grönlund
48997f54c9 8326715: ZGC: RunThese24H fails with ExitCode 139 during shutdown
Reviewed-by: egahlin
Backport-of: cdf22b1320
2024-06-17 14:22:29 +00:00
Christoph Langer
4e3bfc926e 8211847: [aix] java/lang/ProcessHandle/InfoTest.java fails: "reported cputime less than expected"
Reviewed-by: mbaesken
Backport-of: f5213671f7
2024-06-17 12:20:39 +00:00
Christoph Langer
d0b4f9baab 8334222: exclude containers/cgroup/PlainRead.java
Reviewed-by: mbaesken
Backport-of: 5e09397bf6
2024-06-17 12:19:36 +00:00
Christoph Langer
cb3c45a698 8211854: [aix] java/net/ServerSocket/AcceptInheritHandle.java fails: read times out
Reviewed-by: mbaesken
Backport-of: 9d8439c107
2024-06-17 12:19:27 +00:00
Tobias Hartmann
63e95d8987 8328544: Improve handling of vectorization
Backport-of: b5174c9159fbffdf335ee6835267ba0e674cf432
2024-06-17 09:01:05 +00:00
Marc R. Hoffmann
10f71f7dd4 8334032: javax.print: Missing @since tag in new class OutputBin
Reviewed-by: prr
Backport-of: 0721dbe442
2024-06-13 22:25:10 +00:00
Damon Nguyen
a7964453cf 8333827: JDK 23 RDP1 L10n resource files update
Reviewed-by: jlu, naoto
Backport-of: c4702ca8c0
2024-06-13 21:48:34 +00:00
Viktor Klang
5230786a0d 8334162: Gatherer.defaultCombiner has an erronous @see-link
Reviewed-by: iris
Backport-of: cff048c735
2024-06-13 16:58:58 +00:00
Christoph Langer
378cd12f6b 8333724: Problem list security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java#teliasonerarootcav1
Reviewed-by: mbaesken
Backport-of: 8ffc35d117
2024-06-13 13:25:26 +00:00
Christian Hagedorn
d96476d8bd 8332920: C2: Partial Peeling is wrongly applied for CmpU with negative limit
Reviewed-by: thartmann
Backport-of: ef101f1bf2
2024-06-12 06:17:07 +00:00
Ravi Reddy
1a43190e41 Merge 2024-06-12 05:48:21 +00:00
Rob McKenna
90bf3a809a 8334041: Bump version numbers for 23.0.1
Reviewed-by: kcr, iris
2024-06-11 20:33:03 +00:00
Serguei Spitsyn
b17a1c092f 8333931: Problemlist serviceability/jvmti/vthread/CarrierThreadEventNotification
Reviewed-by: cjplummer
Backport-of: fe9c63cf73
2024-06-11 17:19:03 +00:00
Matthew Donovan
9e22b6dec3 8333829: ProblemList sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java due to JDK-8333317
Reviewed-by: mullan
Backport-of: b25476200a
2024-06-11 12:43:10 +00:00
Volker Simonis
fdbc2b24d3 8333722: Fix CompilerDirectives for non-compiler JVM variants
Reviewed-by: thartmann
Backport-of: 5f9d3e3af8
2024-06-10 14:31:34 +00:00
Kevin Rushforth
31696a445c 8333743: Change .jcheck/conf branches property to match valid branches
Reviewed-by: iris, erikj
Backport-of: 2a37764e74
2024-06-06 22:07:16 +00:00
21483 changed files with 797834 additions and 1153382 deletions

View File

@@ -1,14 +0,0 @@
root = true
[*]
charset = utf-8
[*.{cpp,hpp,c,h,java,cc,hh,m,mm,S,md,properties,gmk,m4,ac}]
trim_trailing_whitespace = true
[Makefile]
trim_trailing_whitespace = true
[src/hotspot/**.{cpp,hpp,h}]
indent_style = space
indent_size = 2

1
.gitattributes vendored
View File

@@ -1,5 +1,4 @@
* -text
* encoding=utf-8
*.java diff=java
*.c diff=cpp
*.h diff=cpp

View File

@@ -1,68 +0,0 @@
#
# Copyright (c) 2023, 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.
#
name: 'Build JTReg'
description: 'Build JTReg'
runs:
using: composite
steps:
- name: 'Get JTReg version configuration'
id: version
uses: ./.github/actions/config
with:
var: JTREG_VERSION
- name: 'Check cache for already built JTReg'
id: get-cached
uses: actions/cache@v4
with:
path: jtreg/installed
key: jtreg-${{ steps.version.outputs.value }}
- name: 'Checkout the JTReg source'
uses: actions/checkout@v4
with:
repository: openjdk/jtreg
ref: jtreg-${{ steps.version.outputs.value }}
path: jtreg/src
if: (steps.get-cached.outputs.cache-hit != 'true')
- name: 'Build JTReg'
run: |
# Build JTReg and move files to the proper locations
bash make/build.sh --jdk "$JAVA_HOME_17_X64"
mkdir ../installed
mv build/images/jtreg/* ../installed
working-directory: jtreg/src
shell: bash
if: (steps.get-cached.outputs.cache-hit != 'true')
- name: 'Upload JTReg artifact'
uses: actions/upload-artifact@v4
with:
name: bundles-jtreg-${{ steps.version.outputs.value }}
path: jtreg/installed
retention-days: 5

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 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
@@ -41,6 +41,6 @@ runs:
id: read-config
run: |
# Extract value from configuration file
value="$(grep -h '^${{ inputs.var }}'= make/conf/github-actions.conf | cut -d '=' -f 2-)"
value="$(grep -h ${{ inputs.var }}= make/conf/github-actions.conf | cut -d '=' -f 2-)"
echo "value=$value" >> $GITHUB_OUTPUT
shell: bash

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 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
@@ -42,7 +42,7 @@ runs:
- name: 'Build'
id: build
run: >
make -k LOG=info ${{ inputs.make-target }}
make LOG=info ${{ inputs.make-target }}
|| bash ./.github/scripts/gen-build-failure-report.sh "$GITHUB_STEP_SUMMARY"
shell: bash

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2022, 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

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 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
@@ -32,16 +32,10 @@ inputs:
debug-suffix:
description: 'File name suffix denoting debug level, possibly empty'
required: false
static-suffix:
description: 'Static bundle file name suffix'
required: false
outputs:
jdk-path:
description: 'Path to the installed JDK bundle'
value: ${{ steps.path-name.outputs.jdk }}
static-jdk-path:
description: 'Path to the installed static JDK bundle'
value: ${{ steps.path-name.outputs.static_jdk }}
symbols-path:
description: 'Path to the installed symbols bundle'
value: ${{ steps.path-name.outputs.symbols }}
@@ -67,15 +61,6 @@ runs:
path: bundles
if: steps.download-bundles.outcome == 'failure'
- name: 'Download static bundles artifact'
id: download-static-bundles
uses: actions/download-artifact@v4
with:
name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}${{ inputs.static-suffix }}
path: bundles
continue-on-error: true
if: ${{ inputs.static-suffix == '-static' }}
- name: 'Unpack bundles'
run: |
if [[ -e bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}.zip ]]; then
@@ -90,20 +75,6 @@ runs:
tar -xf bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz -C bundles/jdk
fi
if [[ '${{ inputs.static-suffix }}' == '-static' ]]; then
if [[ -e bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}${{ inputs.static-suffix }}.zip ]]; then
echo 'Unpacking static jdk bundle...'
mkdir -p bundles/static-jdk
unzip -q bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}${{ inputs.static-suffix }}.zip -d bundles/static-jdk
fi
if [[ -e bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}${{ inputs.static-suffix }}.tar.gz ]]; then
echo 'Unpacking static jdk bundle...'
mkdir -p bundles/static-jdk
tar -xf bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}${{ inputs.static-suffix }}.tar.gz -C bundles/static-jdk
fi
fi
if [[ -e bundles/symbols-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz ]]; then
echo 'Unpacking symbols bundle...'
mkdir -p bundles/symbols
@@ -135,12 +106,4 @@ runs:
echo "jdk=$jdk_dir" >> $GITHUB_OUTPUT
echo "symbols=$symbols_dir" >> $GITHUB_OUTPUT
echo "tests=$tests_dir" >> $GITHUB_OUTPUT
if [[ '${{ inputs.static-suffix }}' == '-static' ]]; then
static_jdk_dir="$GITHUB_WORKSPACE/$(dirname $(find bundles/static-jdk -name bin -type d))"
if [[ '${{ runner.os }}' == 'Windows' ]]; then
static_jdk_dir="$(cygpath $static_jdk_dir)"
fi
echo "static_jdk=$static_jdk_dir" >> $GITHUB_OUTPUT
fi
shell: bash

View File

@@ -49,6 +49,6 @@ runs:
- name: 'Export path to where GTest is installed'
id: path-name
run: |
# Export the absolute path
echo "path=`pwd`/gtest" >> $GITHUB_OUTPUT
# Export the path
echo 'path=gtest' >> $GITHUB_OUTPUT
shell: bash

View File

@@ -24,7 +24,7 @@
#
name: 'Get JTReg'
description: 'Get JTReg'
description: 'Download JTReg from cache or source location'
outputs:
path:
description: 'Path to the installed JTReg'
@@ -39,16 +39,40 @@ runs:
with:
var: JTREG_VERSION
- name: 'Download JTReg artifact'
id: download-jtreg
uses: actions/download-artifact@v4
- name: 'Check cache for JTReg'
id: get-cached-jtreg
uses: actions/cache@v4
with:
name: bundles-jtreg-${{ steps.version.outputs.value }}
path: jtreg/installed
key: jtreg-${{ steps.version.outputs.value }}
- name: 'Checkout the JTReg source'
uses: actions/checkout@v4
with:
repository: openjdk/jtreg
ref: jtreg-${{ steps.version.outputs.value }}
path: jtreg/src
if: steps.get-cached-jtreg.outputs.cache-hit != 'true'
- 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 "$JDK"
mkdir ../installed
mv build/images/jtreg/* ../installed
working-directory: jtreg/src
shell: bash
if: steps.get-cached-jtreg.outputs.cache-hit != 'true'
- name: 'Export path to where JTReg is installed'
id: path-name
run: |
# Export the absolute path
echo "path=`pwd`/jtreg/installed" >> $GITHUB_OUTPUT
# Export the path
echo 'path=jtreg/installed' >> $GITHUB_OUTPUT
shell: bash

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2022, 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
@@ -30,15 +30,15 @@ runs:
using: composite
steps:
- name: 'Install MSYS2'
id: msys2
uses: msys2/setup-msys2@v2.28.0
uses: msys2/setup-msys2@v2.22.0
with:
install: 'autoconf tar unzip zip make'
path-type: minimal
release: false
location: ${{ runner.tool_cache }}/msys2
# We can't run bash until this is completed, so stick with pwsh
- name: 'Set MSYS2 path'
run: |
echo "${{ steps.msys2.outputs.msys2-location }}/usr/bin" >> $env:GITHUB_PATH
# Prepend msys2/msys64/usr/bin to the PATH
echo "$env:RUNNER_TOOL_CACHE/msys2/msys64/usr/bin" >> $env:GITHUB_PATH
shell: pwsh

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 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
@@ -32,12 +32,6 @@ inputs:
debug-suffix:
description: 'File name suffix denoting debug level, possibly empty'
required: false
bundle-suffix:
description: 'Bundle name suffix, possibly empty'
required: false
static-suffix:
description: 'Static JDK bundle name suffix, possibly empty'
required: false
runs:
using: composite
@@ -49,11 +43,8 @@ runs:
# Rename bundles to consistent names
jdk_bundle_zip="$(ls build/*/bundles/jdk-*_bin${{ inputs.debug-suffix }}.zip 2> /dev/null || true)"
jdk_bundle_tar_gz="$(ls build/*/bundles/jdk-*_bin${{ inputs.debug-suffix }}.tar.gz 2> /dev/null || true)"
static_jdk_bundle_zip="$(ls build/*/bundles/static-jdk-*_bin${{ inputs.debug-suffix }}.zip 2> /dev/null || true)"
static_jdk_bundle_tar_gz="$(ls build/*/bundles/static-jdk-*_bin${{ inputs.debug-suffix }}.tar.gz 2> /dev/null || true)"
symbols_bundle="$(ls build/*/bundles/jdk-*_bin${{ inputs.debug-suffix }}-symbols.tar.gz 2> /dev/null || true)"
tests_bundle="$(ls build/*/bundles/jdk-*_bin-tests${{ inputs.debug-suffix }}.tar.gz 2> /dev/null || true)"
static_libs_bundle="$(ls build/*/bundles/jdk-*_bin-static-libs${{ inputs.debug-suffix }}.tar.gz 2> /dev/null || true)"
mkdir bundles
@@ -63,23 +54,14 @@ runs:
if [[ "$jdk_bundle_tar_gz" != "" ]]; then
mv "$jdk_bundle_tar_gz" "bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz"
fi
if [[ "$static_jdk_bundle_zip" != "" ]]; then
mv "$static_jdk_bundle_zip" "bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}${{ inputs.static-suffix }}.zip"
fi
if [[ "$static_jdk_bundle_tar_gz" != "" ]]; then
mv "$static_jdk_bundle_tar_gz" "bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}${{ inputs.static-suffix }}.tar.gz"
fi
if [[ "$symbols_bundle" != "" ]]; then
mv "$symbols_bundle" "bundles/symbols-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz"
fi
if [[ "$tests_bundle" != "" ]]; then
mv "$tests_bundle" "bundles/tests-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz"
fi
if [[ "$static_libs_bundle" != "" ]]; then
mv "$static_libs_bundle" "bundles/static-libs-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz"
fi
if [[ "$jdk_bundle_zip$jdk_bundle_tar_gz$static_jdk_bundle_zip$static_jdk_bundle_tar_gz$symbols_bundle$tests_bundle$static_libs_bundle" != "" ]]; then
if [[ "$jdk_bundle_zip$jdk_bundle_tar_gz$symbols_bundle$tests_bundle" != "" ]]; then
echo 'bundles-found=true' >> $GITHUB_OUTPUT
else
echo 'bundles-found=false' >> $GITHUB_OUTPUT
@@ -89,7 +71,7 @@ runs:
- name: 'Upload bundles artifact'
uses: actions/upload-artifact@v4
with:
name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}${{ inputs.static-suffix }}${{ inputs.bundle-suffix }}
name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}
path: bundles
retention-days: 5
retention-days: 1
if: steps.bundles.outputs.bundles-found == 'true'

View File

@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 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
@@ -24,19 +24,12 @@
# questions.
#
# Import common utils
. .github/scripts/report-utils.sh
GITHUB_STEP_SUMMARY="$1"
BUILD_DIR="$(ls -d build/*)"
# Send signal to the do-build action that we failed
touch "$BUILD_DIR/build-failure"
# Collect hs_errs for build-time crashes, e.g. javac, jmod, jlink, CDS.
# These usually land in make/
hs_err_files=$(ls make/hs_err*.log 2> /dev/null || true)
(
echo '### :boom: Build failure summary'
echo ''
@@ -53,20 +46,6 @@ hs_err_files=$(ls make/hs_err*.log 2> /dev/null || true)
echo '</details>'
echo ''
for hs_err in $hs_err_files; do
echo "<details><summary><b>View HotSpot error log: "$hs_err"</b></summary>"
echo ''
echo '```'
echo "$hs_err:"
echo ''
cat "$hs_err"
echo '```'
echo '</details>'
echo ''
done
echo ''
echo ':arrow_right: To see the entire test log, click the job in the list to the left. To download logs, see the `failure-logs` [artifact above](#artifacts).'
) >> $GITHUB_STEP_SUMMARY
truncate_summary

View File

@@ -24,9 +24,6 @@
# questions.
#
# Import common utils
. .github/scripts/report-utils.sh
GITHUB_STEP_SUMMARY="$1"
test_suite_name=$(cat build/run-test-prebuilt/test-support/test-last-ids.txt)
@@ -92,6 +89,18 @@ for test in $failures $errors; do
fi
done >> $GITHUB_STEP_SUMMARY
echo ':arrow_right: To see the entire test log, click the job in the list to the left.' >> $GITHUB_STEP_SUMMARY
# With many failures, the summary can easily exceed 1024 kB, the limit set by Github
# Trim it down if so.
summary_size=$(wc -c < $GITHUB_STEP_SUMMARY)
if [[ $summary_size -gt 1000000 ]]; then
# Trim to below 1024 kB, and cut off after the last detail group
head -c 1000000 $GITHUB_STEP_SUMMARY | tac | sed -n -e '/<\/details>/,$ p' | tac > $GITHUB_STEP_SUMMARY.tmp
mv $GITHUB_STEP_SUMMARY.tmp $GITHUB_STEP_SUMMARY
(
echo ''
echo ':x: **WARNING: Summary is too large and has been truncated.**'
echo ''
) >> $GITHUB_STEP_SUMMARY
fi
truncate_summary
echo ':arrow_right: To see the entire test log, click the job in the list to the left.' >> $GITHUB_STEP_SUMMARY

View File

@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 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

View File

@@ -1,41 +0,0 @@
#!/bin/bash
#
# Copyright (c) 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.
#
function truncate_summary() {
# With large hs_errs, the summary can easily exceed 1024 kB, the limit set by Github
# Trim it down if so.
summary_size=$(wc -c < $GITHUB_STEP_SUMMARY)
if [[ $summary_size -gt 1000000 ]]; then
# Trim to below 1024 kB, and cut off after the last detail group
head -c 1000000 $GITHUB_STEP_SUMMARY | tac | sed -n -e '/<\/details>/,$ p' | tac > $GITHUB_STEP_SUMMARY.tmp
mv $GITHUB_STEP_SUMMARY.tmp $GITHUB_STEP_SUMMARY
(
echo ''
echo ':x: **WARNING: Summary is too large and has been truncated.**'
echo ''
) >> $GITHUB_STEP_SUMMARY
fi
}

View File

@@ -1,118 +0,0 @@
#
# Copyright (c) 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.
#
name: 'Build (alpine-linux)'
on:
workflow_call:
inputs:
platform:
required: true
type: string
extra-conf-options:
required: false
type: string
make-target:
required: false
type: string
default: 'product-bundles test-bundles'
debug-levels:
required: false
type: string
default: '[ "debug", "release" ]'
apk-extra-packages:
required: false
type: string
configure-arguments:
required: false
type: string
make-arguments:
required: false
type: string
dry-run:
required: false
type: boolean
default: false
jobs:
build-linux:
name: build
runs-on: ubuntu-22.04
container:
image: alpine:3.20
strategy:
fail-fast: false
matrix:
debug-level: ${{ fromJSON(inputs.debug-levels) }}
include:
- debug-level: debug
flags: --with-debug-level=fastdebug
suffix: -debug+
steps:
- name: 'Checkout the JDK source'
uses: actions/checkout@v4
- name: 'Install toolchain and dependencies'
run: |
apk update
apk add alpine-sdk alsa-lib-dev autoconf bash cups-dev cups-libs fontconfig-dev freetype-dev grep libx11-dev libxext-dev libxrandr-dev libxrender-dev libxt-dev libxtst-dev linux-headers wget zip ${{ inputs.apk-extra-packages }}
- name: 'Get the BootJDK'
id: bootjdk
uses: ./.github/actions/get-bootjdk
with:
platform: alpine-linux-x64
- name: 'Configure'
run: >
bash configure
--with-conf-name=${{ inputs.platform }}
${{ matrix.flags }}
--with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA}
--with-boot-jdk=${{ steps.bootjdk.outputs.path }}
--with-zlib=system
--with-jmod-compress=zip-1
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
echo "Dumping config.log:" &&
cat config.log &&
exit 1)
- name: 'Build'
id: build
uses: ./.github/actions/do-build
with:
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
platform: ${{ inputs.platform }}
debug-suffix: '${{ matrix.suffix }}'
if: ${{ inputs.dry-run == false }}
- name: 'Upload bundles'
uses: ./.github/actions/upload-bundles
with:
platform: ${{ inputs.platform }}
debug-suffix: '${{ matrix.suffix }}'
if: ${{ inputs.dry-run == false }}

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2022, 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
@@ -40,10 +40,6 @@ on:
make-arguments:
required: false
type: string
dry-run:
required: false
type: boolean
default: false
jobs:
build-cross-compile:
@@ -64,26 +60,26 @@ jobs:
gnu-arch: aarch64
debian-arch: arm64
debian-repository: https://httpredir.debian.org/debian/
debian-version: bookworm
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: bookworm
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: bookworm
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: bookworm
debian-version: bullseye
tolerate-sysroot-errors: false
- target-cpu: riscv64
gnu-arch: riscv64
@@ -135,7 +131,6 @@ jobs:
id: create-sysroot
run: >
sudo debootstrap
--no-merged-usr
--arch=${{ matrix.debian-arch }}
--verbose
--include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype-dev,libpng-dev
@@ -156,9 +151,6 @@ jobs:
rm -rf sysroot/usr/{sbin,bin,share}
rm -rf sysroot/usr/lib/{apt,gcc,udev,systemd}
rm -rf sysroot/usr/libexec/gcc
# /{bin,sbin,lib}/ are not symbolic links to /usr/{bin,sbin,lib}/ when debootstrap with --no-merged-usr
rm -rf sysroot/{sbin,bin}
rm -rf sysroot/lib/{udev,systemd}
if: steps.create-sysroot.outcome == 'success' && steps.get-cached-sysroot.outputs.cache-hit != 'true'
- name: 'Remove broken sysroot'
@@ -193,4 +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') && inputs.dry-run == false)
if: steps.create-sysroot.outcome == 'success' || steps.get-cached-sysroot.outputs.cache-hit == 'true'

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2022, 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
@@ -61,16 +61,6 @@ on:
make-arguments:
required: false
type: string
dry-run:
required: false
type: boolean
default: false
bundle-suffix:
required: false
type: string
static-suffix:
required: false
type: string
jobs:
build-linux:
@@ -81,6 +71,10 @@ jobs:
fail-fast: false
matrix:
debug-level: ${{ fromJSON(inputs.debug-levels) }}
include:
- debug-level: debug
flags: --with-debug-level=fastdebug
suffix: -debug
steps:
- name: 'Checkout the JDK source'
@@ -124,7 +118,7 @@ jobs:
run: >
bash configure
--with-conf-name=${{ inputs.platform }}
${{ matrix.debug-level == 'debug' && '--with-debug-level=fastdebug' || '' }}
${{ matrix.flags }}
--with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA}
--with-boot-jdk=${{ steps.bootjdk.outputs.path }}
--with-jtreg=${{ steps.jtreg.outputs.path }}
@@ -142,14 +136,10 @@ jobs:
with:
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
platform: ${{ inputs.platform }}
debug-suffix: "${{ matrix.debug-level == 'debug' && '-debug' || '' }}"
if: ${{ inputs.dry-run == false }}
debug-suffix: '${{ matrix.suffix }}'
- name: 'Upload bundles'
uses: ./.github/actions/upload-bundles
with:
platform: ${{ inputs.platform }}
debug-suffix: "${{ matrix.debug-level == 'debug' && '-debug' || '' }}"
bundle-suffix: ${{ inputs.bundle-suffix }}
static-suffix: ${{ inputs.static-suffix }}
if: ${{ inputs.dry-run == false }}
debug-suffix: '${{ matrix.suffix }}'

View File

@@ -54,10 +54,6 @@ on:
make-arguments:
required: false
type: string
dry-run:
required: false
type: boolean
default: false
jobs:
build-macos:
@@ -122,11 +118,9 @@ jobs:
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
platform: ${{ inputs.platform }}
debug-suffix: '${{ matrix.suffix }}'
if: ${{ inputs.dry-run == false }}
- name: 'Upload bundles'
uses: ./.github/actions/upload-bundles
with:
platform: ${{ inputs.platform }}
debug-suffix: '${{ matrix.suffix }}'
if: ${{ inputs.dry-run == false }}

View File

@@ -54,10 +54,6 @@ on:
make-arguments:
required: false
type: string
dry-run:
required: false
type: boolean
default: false
env:
# These are needed to make the MSYS2 bash work properly
@@ -67,7 +63,7 @@ env:
jobs:
build-windows:
name: build
runs-on: windows-2025
runs-on: windows-2019
defaults:
run:
shell: bash
@@ -106,7 +102,7 @@ jobs:
id: toolchain-check
run: |
set +e
'/c/Program Files/Microsoft Visual Studio/2022/Enterprise/vc/auxiliary/build/vcvars64.bat' -vcvars_ver=${{ inputs.msvc-toolset-version }}
'/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/vc/auxiliary/build/vcvars64.bat' -vcvars_ver=${{ inputs.msvc-toolset-version }}
if [ $? -eq 0 ]; then
echo "Toolchain is already installed"
echo "toolchain-installed=true" >> $GITHUB_OUTPUT
@@ -119,7 +115,7 @@ jobs:
run: |
# Run Visual Studio Installer
'/c/Program Files (x86)/Microsoft Visual Studio/Installer/vs_installer.exe' \
modify --quiet --installPath 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise' \
modify --quiet --installPath 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise' \
--add Microsoft.VisualStudio.Component.VC.${{ inputs.msvc-toolset-version }}.${{ inputs.msvc-toolset-architecture }}
if: steps.toolchain-check.outputs.toolchain-installed != 'true'
@@ -143,7 +139,6 @@ jobs:
# Set PATH to "", so just GITHUB_PATH is included
PATH: ''
shell: env /usr/bin/bash --login -eo pipefail {0}
if: ${{ inputs.dry-run == false }}
- name: 'Build'
id: build
@@ -152,11 +147,9 @@ jobs:
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
platform: ${{ inputs.platform }}
debug-suffix: '${{ matrix.suffix }}'
if: ${{ inputs.dry-run == false }}
- name: 'Upload bundles'
uses: ./.github/actions/upload-bundles
with:
platform: ${{ inputs.platform }}
debug-suffix: '${{ matrix.suffix }}'
if: ${{ inputs.dry-run == false }}

View File

@@ -28,22 +28,21 @@ name: 'OpenJDK GHA Sanity Checks'
on:
push:
branches-ignore:
- master
- pr/*
- jdk*
workflow_dispatch:
inputs:
platforms:
description: 'Platform(s) to execute on (comma separated, e.g. "linux-x64, macos, aarch64")'
required: true
default: 'linux-x64, linux-x64-variants, linux-cross-compile, alpine-linux-x64, macos-x64, macos-aarch64, windows-x64, windows-aarch64, docs'
default: 'linux-x64, linux-x86, linux-x64-variants, linux-cross-compile, macos-x64, macos-aarch64, windows-x64, windows-aarch64, docs'
configure-arguments:
description: 'Additional configure arguments'
required: false
make-arguments:
description: 'Additional make arguments'
required: false
dry-run:
description: 'Dry run: skip actual builds and tests'
required: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@@ -55,38 +54,22 @@ jobs:
### Determine platforms to include
###
prepare:
name: 'Prepare the run'
select:
name: 'Select platforms'
runs-on: ubuntu-22.04
env:
# List of platforms to exclude by default
EXCLUDED_PLATFORMS: 'alpine-linux-x64'
outputs:
linux-x64: ${{ steps.include.outputs.linux-x64 }}
linux-x86: ${{ steps.include.outputs.linux-x86 }}
linux-x64-variants: ${{ steps.include.outputs.linux-x64-variants }}
linux-cross-compile: ${{ steps.include.outputs.linux-cross-compile }}
alpine-linux-x64: ${{ steps.include.outputs.alpine-linux-x64 }}
macos-x64: ${{ steps.include.outputs.macos-x64 }}
macos-aarch64: ${{ steps.include.outputs.macos-aarch64 }}
windows-x64: ${{ steps.include.outputs.windows-x64 }}
windows-aarch64: ${{ steps.include.outputs.windows-aarch64 }}
docs: ${{ steps.include.outputs.docs }}
dry-run: ${{ steps.include.outputs.dry-run }}
steps:
- name: 'Checkout the scripts'
uses: actions/checkout@v4
with:
sparse-checkout: |
.github
make/conf/github-actions.conf
- name: 'Build JTReg'
id: jtreg
uses: ./.github/actions/build-jtreg
# TODO: Now that we are checking out the repo scripts, we can put the following code
# into a separate file
# This function must be inlined in main.yml, or we'd be forced to checkout the repo
- name: 'Check what jobs to run'
id: include
run: |
@@ -95,10 +78,6 @@ jobs:
# Returns 'true' if the input platform list matches any of the platform monikers given as argument,
# 'false' otherwise.
# arg $1: platform name or names to look for
# Convert EXCLUDED_PLATFORMS from a comma-separated string to an array
IFS=',' read -r -a excluded_array <<< "$EXCLUDED_PLATFORMS"
function check_platform() {
if [[ $GITHUB_EVENT_NAME == workflow_dispatch ]]; then
input='${{ github.event.inputs.platforms }}'
@@ -115,13 +94,7 @@ jobs:
normalized_input="$(echo ,$input, | tr -d ' ')"
if [[ "$normalized_input" == ",," ]]; then
# For an empty input, assume all platforms should run, except those in the EXCLUDED_PLATFORMS list
for excluded in "${excluded_array[@]}"; do
if [[ "$1" == "$excluded" ]]; then
echo 'false'
return
fi
done
# For an empty input, assume all platforms should run
echo 'true'
return
else
@@ -132,58 +105,20 @@ jobs:
return
fi
done
# If not explicitly included, check against the EXCLUDED_PLATFORMS list
for excluded in "${excluded_array[@]}"; do
if [[ "$1" == "$excluded" ]]; then
echo 'false'
return
fi
done
fi
echo 'false'
}
function check_dry_run() {
if [[ $GITHUB_EVENT_NAME == workflow_dispatch ]]; then
# Take the user-specified one.
echo '${{ github.event.inputs.dry-run }}'
return
elif [[ $GITHUB_EVENT_NAME == push ]]; then
# Cut out the real branch name
BRANCH=${GITHUB_REF##*/}
# Dry run rebuilds the caches in current branch, so they can be reused
# for any child PR branches. Because of this, we want to trigger this
# workflow in master branch, so that actual PR branches can use the cache.
# This workflow would trigger every time contributors sync their master
# branches in their personal forks.
if [[ $BRANCH == "master" ]]; then
echo 'true'
return
fi
# ...same for stabilization branches
if [[ $BRANCH =~ "jdk(.*)" ]]; then
echo 'true'
return
fi
fi
echo 'false'
}
echo "linux-x64=$(check_platform linux-x64 linux x64)" >> $GITHUB_OUTPUT
echo "linux-x86=$(check_platform linux-x86 linux x86)" >> $GITHUB_OUTPUT
echo "linux-x64-variants=$(check_platform linux-x64-variants variants)" >> $GITHUB_OUTPUT
echo "linux-cross-compile=$(check_platform linux-cross-compile cross-compile)" >> $GITHUB_OUTPUT
echo "alpine-linux-x64=$(check_platform alpine-linux-x64 alpine-linux x64)" >> $GITHUB_OUTPUT
echo "macos-x64=$(check_platform macos-x64 macos x64)" >> $GITHUB_OUTPUT
echo "macos-aarch64=$(check_platform macos-aarch64 macos aarch64)" >> $GITHUB_OUTPUT
echo "windows-x64=$(check_platform windows-x64 windows x64)" >> $GITHUB_OUTPUT
echo "windows-aarch64=$(check_platform windows-aarch64 windows aarch64)" >> $GITHUB_OUTPUT
echo "docs=$(check_platform docs)" >> $GITHUB_OUTPUT
echo "dry-run=$(check_dry_run)" >> $GITHUB_OUTPUT
###
### Build jobs
@@ -191,19 +126,35 @@ jobs:
build-linux-x64:
name: linux-x64
needs: prepare
needs: select
uses: ./.github/workflows/build-linux.yml
with:
platform: linux-x64
gcc-major-version: '10'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
if: needs.prepare.outputs.linux-x64 == 'true'
if: needs.select.outputs.linux-x64 == 'true'
build-linux-x86:
name: linux-x86
needs: select
uses: ./.github/workflows/build-linux.yml
with:
platform: linux-x86
gcc-major-version: '10'
gcc-package-suffix: '-multilib'
apt-architecture: 'i386'
# Some multilib libraries do not have proper inter-dependencies, so we have to
# install their dependencies manually.
apt-extra-packages: 'libfreetype-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386 libc6-i386 libgcc-s1:i386 libstdc++6:i386 libffi-dev:i386'
extra-conf-options: '--with-target-bits=32 --enable-fallback-linker --enable-libffi-bundling'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
if: needs.select.outputs.linux-x86 == 'true'
build-linux-x64-hs-nopch:
name: linux-x64-hs-nopch
needs: prepare
needs: select
uses: ./.github/workflows/build-linux.yml
with:
platform: linux-x64
@@ -213,12 +164,11 @@ jobs:
extra-conf-options: '--disable-precompiled-headers'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
if: needs.prepare.outputs.linux-x64-variants == 'true'
if: needs.select.outputs.linux-x64-variants == 'true'
build-linux-x64-hs-zero:
name: linux-x64-hs-zero
needs: prepare
needs: select
uses: ./.github/workflows/build-linux.yml
with:
platform: linux-x64
@@ -228,12 +178,11 @@ jobs:
extra-conf-options: '--with-jvm-variants=zero --disable-precompiled-headers'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
if: needs.prepare.outputs.linux-x64-variants == 'true'
if: needs.select.outputs.linux-x64-variants == 'true'
build-linux-x64-hs-minimal:
name: linux-x64-hs-minimal
needs: prepare
needs: select
uses: ./.github/workflows/build-linux.yml
with:
platform: linux-x64
@@ -243,12 +192,11 @@ jobs:
extra-conf-options: '--with-jvm-variants=minimal --disable-precompiled-headers'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
if: needs.prepare.outputs.linux-x64-variants == 'true'
if: needs.select.outputs.linux-x64-variants == 'true'
build-linux-x64-hs-optimized:
name: linux-x64-hs-optimized
needs: prepare
needs: select
uses: ./.github/workflows/build-linux.yml
with:
platform: linux-x64
@@ -259,71 +207,22 @@ jobs:
extra-conf-options: '--with-debug-level=optimized --disable-precompiled-headers'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
if: needs.prepare.outputs.linux-x64-variants == 'true'
build-linux-x64-static:
name: linux-x64-static
needs: prepare
uses: ./.github/workflows/build-linux.yml
with:
platform: linux-x64
make-target: 'static-jdk-bundles'
# There are issues with fastdebug static build in GHA due to space limit.
# Only do release build for now.
debug-levels: '[ "release" ]'
gcc-major-version: '10'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
static-suffix: "-static"
if: needs.prepare.outputs.linux-x64 == 'true'
build-linux-x64-static-libs:
name: linux-x64-static-libs
needs: prepare
uses: ./.github/workflows/build-linux.yml
with:
platform: linux-x64
make-target: 'static-libs-bundles'
# Only build static-libs-bundles for release builds.
# For debug builds, building static-libs often exceeds disk space.
debug-levels: '[ "release" ]'
gcc-major-version: '10'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
# Upload static libs bundles separately to avoid interference with normal linux-x64 bundle.
# This bundle is not used by testing jobs, but downstreams use it to check that
# dependent projects, e.g. libgraal, builds fine.
bundle-suffix: "-static-libs"
if: needs.prepare.outputs.linux-x64-variants == 'true'
if: needs.select.outputs.linux-x64-variants == 'true'
build-linux-cross-compile:
name: linux-cross-compile
needs: prepare
needs:
- select
uses: ./.github/workflows/build-cross-compile.yml
with:
gcc-major-version: '10'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
if: needs.prepare.outputs.linux-cross-compile == 'true'
build-alpine-linux-x64:
name: alpine-linux-x64
needs: prepare
uses: ./.github/workflows/build-alpine-linux.yml
with:
platform: alpine-linux-x64
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
if: needs.prepare.outputs.alpine-linux-x64 == 'true'
if: needs.select.outputs.linux-cross-compile == 'true'
build-macos-x64:
name: macos-x64
needs: prepare
needs: select
uses: ./.github/workflows/build-macos.yml
with:
platform: macos-x64
@@ -331,53 +230,49 @@ jobs:
xcode-toolset-version: '14.3.1'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
if: needs.prepare.outputs.macos-x64 == 'true'
if: needs.select.outputs.macos-x64 == 'true'
build-macos-aarch64:
name: macos-aarch64
needs: prepare
needs: select
uses: ./.github/workflows/build-macos.yml
with:
platform: macos-aarch64
runs-on: 'macos-14'
xcode-toolset-version: '15.4'
xcode-toolset-version: '14.3.1'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
if: needs.prepare.outputs.macos-aarch64 == 'true'
if: needs.select.outputs.macos-aarch64 == 'true'
build-windows-x64:
name: windows-x64
needs: prepare
needs: select
uses: ./.github/workflows/build-windows.yml
with:
platform: windows-x64
msvc-toolset-version: '14.44'
msvc-toolset-version: '14.29'
msvc-toolset-architecture: 'x86.x64'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
if: needs.prepare.outputs.windows-x64 == 'true'
if: needs.select.outputs.windows-x64 == 'true'
build-windows-aarch64:
name: windows-aarch64
needs: prepare
needs: select
uses: ./.github/workflows/build-windows.yml
with:
platform: windows-aarch64
msvc-toolset-version: '14.44'
msvc-toolset-version: '14.29'
msvc-toolset-architecture: 'arm64'
make-target: 'hotspot'
extra-conf-options: '--openjdk-target=aarch64-unknown-cygwin'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
if: needs.prepare.outputs.windows-aarch64 == 'true'
if: needs.select.outputs.windows-aarch64 == 'true'
build-docs:
name: docs
needs: prepare
needs: select
uses: ./.github/workflows/build-linux.yml
with:
platform: linux-x64
@@ -389,8 +284,7 @@ jobs:
gcc-major-version: '10'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
if: needs.prepare.outputs.docs == 'true'
if: needs.select.outputs.docs == 'true'
###
### Test jobs
@@ -399,53 +293,96 @@ jobs:
test-linux-x64:
name: linux-x64
needs:
- prepare
- build-linux-x64
uses: ./.github/workflows/test.yml
with:
platform: linux-x64
bootjdk-platform: linux-x64
runs-on: ubuntu-22.04
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
debug-suffix: -debug
test-linux-x64-static:
name: linux-x64-static
test-linux-x86:
name: linux-x86
needs:
- prepare
- build-linux-x64
- build-linux-x64-static
- build-linux-x86
uses: ./.github/workflows/test.yml
with:
platform: linux-x64
platform: linux-x86
bootjdk-platform: linux-x64
runs-on: ubuntu-22.04
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
static-suffix: "-static"
test-macos-x64:
name: macos-x64
needs:
- build-macos-x64
uses: ./.github/workflows/test.yml
with:
platform: macos-x64
bootjdk-platform: macos-x64
runs-on: macos-13
test-macos-aarch64:
name: macos-aarch64
needs:
- prepare
- build-macos-aarch64
uses: ./.github/workflows/test.yml
with:
platform: macos-aarch64
bootjdk-platform: macos-aarch64
runs-on: macos-14
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
xcode-toolset-version: '15.4'
debug-suffix: -debug
test-windows-x64:
name: windows-x64
needs:
- prepare
- build-windows-x64
uses: ./.github/workflows/test.yml
with:
platform: windows-x64
bootjdk-platform: windows-x64
runs-on: windows-2025
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
debug-suffix: -debug
runs-on: windows-2019
# Remove bundles so they are not misconstrued as binary distributions from the JDK project
remove-bundles:
name: 'Remove bundle artifacts'
runs-on: ubuntu-22.04
if: always()
needs:
- build-linux-x64
- build-linux-x86
- build-linux-x64-hs-nopch
- build-linux-x64-hs-zero
- build-linux-x64-hs-minimal
- build-linux-x64-hs-optimized
- build-linux-cross-compile
- build-macos-x64
- build-macos-aarch64
- build-windows-x64
- build-windows-aarch64
- test-linux-x64
- test-linux-x86
- test-macos-x64
- test-windows-x64
steps:
# Hack to get hold of the api environment variables that are only defined for actions
- name: 'Get API configuration'
id: api
uses: actions/github-script@v7
with:
script: 'return { url: process.env["ACTIONS_RUNTIME_URL"], token: process.env["ACTIONS_RUNTIME_TOKEN"] }'
- name: 'Remove bundle artifacts'
run: |
# Find and remove all bundle artifacts
ALL_ARTIFACT_URLS="$(curl -s \
-H 'Accept: application/json;api-version=6.0-preview' \
-H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \
'${{ fromJson(steps.api.outputs.result).url }}_apis/pipelines/workflows/${{ github.run_id }}/artifacts?api-version=6.0-preview')"
BUNDLE_ARTIFACT_URLS="$(echo "$ALL_ARTIFACT_URLS" | jq -r -c '.value | map(select(.name|startswith("bundles-"))) | .[].url')"
for url in $BUNDLE_ARTIFACT_URLS; do
echo "Removing $url"
curl -s \
-H 'Accept: application/json;api-version=6.0-preview' \
-H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \
-X DELETE "$url" \
|| echo "Failed to remove bundle"
done

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2022, 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
@@ -37,19 +37,6 @@ on:
runs-on:
required: true
type: string
xcode-toolset-version:
required: false
type: string
dry-run:
required: false
type: boolean
default: false
debug-suffix:
required: false
type: string
static-suffix:
required: false
type: string
env:
# These are needed to make the MSYS2 bash work properly
@@ -76,6 +63,7 @@ jobs:
- 'hs/tier1 compiler part 1'
- 'hs/tier1 compiler part 2'
- 'hs/tier1 compiler part 3'
- 'hs/tier1 compiler not-xcomp'
- 'hs/tier1 gc'
- 'hs/tier1 runtime'
- 'hs/tier1 serviceability'
@@ -96,35 +84,39 @@ jobs:
- test-name: 'hs/tier1 common'
test-suite: 'test/hotspot/jtreg/:tier1_common'
debug-suffix: ${{ inputs.debug-suffix }}
debug-suffix: -debug
- test-name: 'hs/tier1 compiler part 1'
test-suite: 'test/hotspot/jtreg/:tier1_compiler_1'
debug-suffix: ${{ inputs.debug-suffix }}
debug-suffix: -debug
- test-name: 'hs/tier1 compiler part 2'
test-suite: 'test/hotspot/jtreg/:tier1_compiler_2'
debug-suffix: ${{ inputs.debug-suffix }}
debug-suffix: -debug
- test-name: 'hs/tier1 compiler part 3'
test-suite: 'test/hotspot/jtreg/:tier1_compiler_3'
debug-suffix: ${{ inputs.debug-suffix }}
debug-suffix: -debug
- test-name: 'hs/tier1 compiler not-xcomp'
test-suite: 'test/hotspot/jtreg/:tier1_compiler_not_xcomp'
debug-suffix: -debug
- test-name: 'hs/tier1 gc'
test-suite: 'test/hotspot/jtreg/:tier1_gc'
debug-suffix: ${{ inputs.debug-suffix }}
debug-suffix: -debug
- test-name: 'hs/tier1 runtime'
test-suite: 'test/hotspot/jtreg/:tier1_runtime'
debug-suffix: ${{ inputs.debug-suffix }}
debug-suffix: -debug
- test-name: 'hs/tier1 serviceability'
test-suite: 'test/hotspot/jtreg/:tier1_serviceability'
debug-suffix: ${{ inputs.debug-suffix }}
debug-suffix: -debug
- test-name: 'lib-test/tier1'
test-suite: 'test/lib-test/:tier1'
debug-suffix: ${{ inputs.debug-suffix }}
debug-suffix: -debug
steps:
- name: 'Checkout the JDK source'
@@ -150,14 +142,12 @@ jobs:
with:
platform: ${{ inputs.platform }}
debug-suffix: ${{ matrix.debug-suffix }}
static-suffix: ${{ inputs.static-suffix }}
if: ${{ inputs.dry-run == false }}
- name: 'Install dependencies'
run: |
# On macOS we need to install some dependencies for testing
brew install make
sudo xcode-select --switch /Applications/Xcode_${{ inputs.xcode-toolset-version }}.app/Contents/Developer
sudo xcode-select --switch /Applications/Xcode_14.3.1.app/Contents/Developer
# This will make GNU make available as 'make' and not only as 'gmake'
echo '/usr/local/opt/make/libexec/gnubin' >> $GITHUB_PATH
if: runner.os == 'macOS'
@@ -172,21 +162,6 @@ jobs:
else
echo "value=$PATH" >> $GITHUB_OUTPUT
fi
if [[ '${{ inputs.static-suffix }}' == '-static' ]]; then
echo "static-hotspot-problemlist-path=`pwd`/test/hotspot/jtreg/ProblemList-StaticJdk.txt" >> $GITHUB_OUTPUT
echo "static-jdk-problemlist-path=`pwd`/test/jdk/ProblemList-StaticJdk.txt" >> $GITHUB_OUTPUT
echo "static-langtools-problemlist-path=`pwd`/test/langtools/ProblemList-StaticJdk.txt" >> $GITHUB_OUTPUT
echo "static-lib-test-problemlist-path=`pwd`/test/lib-test/ProblemList-StaticJdk.txt" >> $GITHUB_OUTPUT
fi
- name: 'Set Extra Options'
id: extra-options
run: |
if [[ '${{ inputs.static-suffix }}' == '-static' ]]; then
echo "test-jdk=JDK_UNDER_TEST=${{ steps.bundles.outputs.static-jdk-path }}" >> $GITHUB_OUTPUT
echo "compile-jdk=JDK_FOR_COMPILE=${{ steps.bundles.outputs.jdk-path }}" >> $GITHUB_OUTPUT
echo "extra-problem-lists=EXTRA_PROBLEM_LISTS=${{ steps.path.outputs.static-hotspot-problemlist-path }}%20${{ steps.path.outputs.static-jdk-problemlist-path }}%20${{ steps.path.outputs.static-langtools-problemlist-path }}%20${{ steps.path.outputs.static-lib-test-problemlist-path }}" >> $GITHUB_OUTPUT
fi
- name: 'Run tests'
id: run-tests
@@ -198,13 +173,10 @@ jobs:
JDK_IMAGE_DIR=${{ steps.bundles.outputs.jdk-path }}
SYMBOLS_IMAGE_DIR=${{ steps.bundles.outputs.symbols-path }}
TEST_IMAGE_DIR=${{ steps.bundles.outputs.tests-path }}
${{ steps.extra-options.outputs.test-jdk }}
${{ steps.extra-options.outputs.compile-jdk }}
JTREG='JAVA_OPTIONS=-XX:-CreateCoredumpOnCrash;VERBOSE=fail,error,time;KEYWORDS=!headful;${{ steps.extra-options.outputs.extra-problem-lists }}'
JTREG='JAVA_OPTIONS=-XX:-CreateCoredumpOnCrash;VERBOSE=fail,error,time;KEYWORDS=!headful'
&& bash ./.github/scripts/gen-test-summary.sh "$GITHUB_STEP_SUMMARY" "$GITHUB_OUTPUT"
env:
PATH: ${{ steps.path.outputs.value }}
if: ${{ inputs.dry-run == false }}
# This is a separate step, since if the markdown from a step gets bigger than
# 1024 kB it is skipped, but then the short summary above is still generated
@@ -234,7 +206,7 @@ jobs:
echo '::warning ::Missing test-support directory'
fi
artifact_name="results-${{ inputs.platform }}-$(echo ${{ matrix.test-name }}${{ inputs.static-suffix }} | tr '/ ' '__')"
artifact_name="results-${{ inputs.platform }}-$(echo ${{ matrix.test-name }} | tr '/ ' '__')"
echo "artifact-name=$artifact_name" >> $GITHUB_OUTPUT
if: always()

5
.gitignore vendored
View File

@@ -20,8 +20,3 @@ NashornProfile.txt
/.settings/
/compile_commands.json
/.cache
/.gdbinit
/.lldbinit
**/core.[0-9]*
*.rej
*.orig

View File

@@ -1,11 +1,11 @@
[general]
project=jdk
project=jdk-updates
jbs=JDK
version=26
version=23.0.1
[checks]
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists,copyright
warning=issuestitle,binary
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
warning=issuestitle
[repository]
tags=(?:jdk-(?:[1-9]([0-9]*)(?:\.(?:0|[1-9][0-9]*)){0,4})(?:\+(?:(?:[0-9]+))|(?:-ga)))|(?:jdk[4-9](?:u\d{1,3})?-(?:(?:b\d{2,3})|(?:ga)))|(?:hs\d\d(?:\.\d{1,2})?-b\d\d)
@@ -34,8 +34,3 @@ pattern=^([124-8][0-9]{6}): (\S.*)$
[checks "problemlists"]
dirs=test/jdk|test/langtools|test/lib-test|test/hotspot/jtreg|test/jaxp
[checks "copyright"]
files=^(?!LICENSE|license\.txt|.*\.bin|.*\.gif|.*\.jpg|.*\.png|.*\.icon|.*\.tiff|.*\.dat|.*\.patch|.*\.wav|.*\.class|.*-header|.*\.jar).*
oracle_locator=.*Copyright \(c\)(.*)Oracle and/or its affiliates\. All rights reserved\.
oracle_validator=.*Copyright \(c\) (\d{4})(?:, (\d{4}))?, Oracle and/or its affiliates\. All rights reserved\.

View File

@@ -1,3 +1,3 @@
# Contributing to the JDK
Please see the [OpenJDK Developers' Guide](https://openjdk.org/guide/).
Please see the [OpenJDK Developers Guide](https://openjdk.org/guide/).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, 2015, 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,8 @@
#
###
### This file is just a very small wrapper which will include make/PreInit.gmk,
### where the real work is done. This wrapper also performs some sanity checks
### on make that must be done before we can include another file.
### This file is just a very small wrapper needed to run the real make/Init.gmk.
### It also performs some sanity checks on make.
###
# The shell code below will be executed on /usr/bin/make on Solaris, but not in GNU Make.
@@ -59,7 +58,7 @@ ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))),)
else
makefile_path := $(lastword $(MAKEFILE_LIST))
endif
TOPDIR := $(strip $(patsubst %/, %, $(dir $(makefile_path))))
topdir := $(strip $(patsubst %/, %, $(dir $(makefile_path))))
# ... and then we can include the real makefile to bootstrap the build
include $(TOPDIR)/make/PreInit.gmk
# ... and then we can include the real makefile
include $(topdir)/make/Init.gmk

View File

@@ -1,3 +0,0 @@
# JDK Vulnerabilities
Please follow the process outlined in the [OpenJDK Vulnerability Policy](https://openjdk.org/groups/vulnerability/report) to disclose vulnerabilities in the JDK.

View File

@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2009, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -99,7 +99,7 @@ if [ "$VERBOSE" = "true" ] ; then
echo "idea template dir: $IDEA_TEMPLATE"
fi
cd $TOP ; make idea-gen-config ALLOW=IDEA_OUTPUT,MODULES IDEA_OUTPUT=$IDEA_OUTPUT MODULES="$*" $CONF_ARG || exit 1
cd $TOP ; make -f "$IDEA_MAKE/idea.gmk" -I $MAKE_DIR/.. idea MAKEOVERRIDES= OUT=$IDEA_OUTPUT/env.cfg MODULES="$*" $CONF_ARG || exit 1
cd $SCRIPT_DIR
. $IDEA_OUTPUT/env.cfg
@@ -125,8 +125,7 @@ if [ -d "$TOPLEVEL_DIR/.hg" ] ; then
VCS_TYPE="hg4idea"
fi
# Git worktrees use a '.git' file rather than directory, so test both.
if [ -d "$TOPLEVEL_DIR/.git" -o -f "$TOPLEVEL_DIR/.git" ] ; then
if [ -d "$TOPLEVEL_DIR/.git" ] ; then
VCS_TYPE="Git"
fi

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -78,6 +78,7 @@ src/jdk.jdi : jdk/src/jdk.jdi
src/jdk.jdwp.agent : jdk/src/jdk.jdwp.agent
src/jdk.jlink : jdk/src/jdk.jlink
src/jdk.jshell : langtools/src/jdk.jshell
src/jdk.jsobject : jdk/src/jdk.jsobject
src/jdk.jstatd : jdk/src/jdk.jstatd
src/jdk.localedata : jdk/src/jdk.localedata
src/jdk.management : jdk/src/jdk.management

View File

@@ -282,34 +282,9 @@ possible, use an SSD. The build process is very disk intensive, and
having slow disk access will significantly increase build times. If you
need to use a network share for the source code, see below for
suggestions on how to keep the build artifacts on a local disk.</p></li>
<li><p>UTF-8 support is needed to compile the JDK. On Unix systems, this
typically means that the <code>C.UTF-8</code> or
<code>en_US.UTF-8</code> locale needs to be available. For Windows
users, please see the section on <a href="#locale-requirements">Locale
Requirements</a> below.</p></li>
<li><p>On Windows, extra care must be taken to have a smooth building
experience:</p>
<ul>
<li><p>Make sure that all relevant paths have short names. Short names
are used by the build system to create space-free alternative paths.
Short name creation is enabled per volume. The default setting can be
checked with the command: <code>fsutil 8dot3name query</code>. If short
name creation was turned off when a directory was created, it will not
have a short name. Whether a short name exists can be checked by running
<code>dir /X</code> in the containing directory (in cmd.exe). If a short
path is present you should see something like 'ASDF~1' being displayed
in one of the columns of the ouput. If a directory is missing a short
name, the safest way to get one is to enable short names for that
particular volume with
<code>fsutil 8dot3name set &lt;drive letter&gt;: 0</code> (note that
you need to run as administrator for this), and then re-create the
particular directory. A short name should be generated automatically
then. Another option is to manually assign a short name to the directory
using
<code>fsutil file setShortName &lt;path&gt; &lt;short name&gt;</code>.</p></li>
<li><p>If using <a href="#cygwin">Cygwin</a>, you must make sure the
file permissions and attributes between Windows and Cygwin are
consistent. It is recommended that you follow this procedure:</p>
<li><p>On Windows, if using <a href="#cygwin">Cygwin</a>, extra care
must be taken to make sure the environment is consistent. It is
recommended that you follow this procedure:</p>
<ul>
<li><p>Create the directory that is going to contain the top directory
of the JDK clone by using the <code>mkdir</code> command in the Cygwin
@@ -319,9 +294,6 @@ it's children will inherit those attributes.</p></li>
<li><p>Do not put the JDK clone in a path under your Cygwin home
directory. This is especially important if your user name contains
spaces and/or mixed upper and lower case letters.</p></li>
</ul>
<p>Failure to follow these procedures might result in hard-to-debug
build problems.</p></li>
<li><p>You need to install a git client. You have two choices, Cygwin
git or Git for Windows. Unfortunately there are pros and cons with each
choice.</p>
@@ -339,7 +311,9 @@ It does work well with the Skara CLI tooling, however. To alleviate the
line ending problems, make sure you set <code>core.autocrlf</code> to
<code>false</code> (this is asked during installation).</p></li>
</ul></li>
</ul></li>
</ul>
<p>Failure to follow this procedure might result in hard-to-debug build
problems.</p></li>
</ul>
<h2 id="build-hardware-requirements">Build Hardware Requirements</h2>
<p>The JDK is a massive project, and require machines ranging from
@@ -355,8 +329,8 @@ GB of free disk space is required.</p>
<p>Even for 32-bit builds, it is recommended to use a 64-bit build
machine, and instead create a 32-bit target using
<code>--with-target-bits=32</code>.</p>
<p>Note: The 32-bit x86 port is deprecated and may be removed in a
future release.</p>
<p>Note: The Windows 32-bit x86 port is deprecated and may be removed in
a future release.</p>
<h3 id="building-on-aarch64">Building on aarch64</h3>
<p>At a minimum, a machine with 8 cores is advisable, as well as 8 GB of
RAM. (The more cores to use, the more memory you need.) At least 6 GB of
@@ -402,7 +376,7 @@ to date at the time of writing.</p>
</tr>
<tr class="odd">
<td>macOS</td>
<td>macOS 14.x</td>
<td>macOS 13.x (Ventura)</td>
</tr>
<tr class="even">
<td>Windows</td>
@@ -419,7 +393,8 @@ Build Platforms</a>. From time to time, this is updated by contributors
to list successes or failures of building on different platforms.</p>
<h3 id="windows">Windows</h3>
<p>Windows XP is not a supported platform, but all newer Windows should
be able to build the JDK.</p>
be able to build the JDK. (Note: The Windows 32-bit x86 port is
deprecated and may be removed in a future release.)</p>
<p>On Windows, it is important that you pay attention to the
instructions in the <a href="#special-considerations">Special
Considerations</a>.</p>
@@ -539,8 +514,8 @@ this makes it difficult for a project such as the JDK to keep pace with
a continuously updated machine running macOS. See the section on <a
href="#apple-xcode">Apple Xcode</a> on some strategies to deal with
this.</p>
<p>It is recommended that you use at least macOS 14 and Xcode 15.4, but
earlier versions may also work.</p>
<p>It is recommended that you use at least macOS 13 (Ventura) and Xcode
14, but earlier versions may also work.</p>
<p>The standard macOS environment contains the basic tooling needed to
build, but for external libraries a package manager is recommended. The
JDK uses <a href="https://brew.sh/">homebrew</a> in the examples, but
@@ -612,15 +587,15 @@ to compile successfully without issues.</p>
<tbody>
<tr class="odd">
<td>Linux</td>
<td>gcc 14.2.0</td>
<td>gcc 13.2.0</td>
</tr>
<tr class="even">
<td>macOS</td>
<td>Apple Xcode 15.4 (using clang 15.0.0)</td>
<td>Apple Xcode 14.3.1 (using clang 14.0.3)</td>
</tr>
<tr class="odd">
<td>Windows</td>
<td>Microsoft Visual Studio 2022 version 17.13.2</td>
<td>Microsoft Visual Studio 2022 version 17.6.5</td>
</tr>
</tbody>
</table>
@@ -630,7 +605,7 @@ standard for C, and C++14 for C++.</p>
<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
14.2 or newer.</p>
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 13. Older versions will not
@@ -639,9 +614,10 @@ be accepted by <code>configure</code>.</p>
<code>--with-toolchain-type=clang</code>.</p>
<h3 id="apple-xcode">Apple Xcode</h3>
<p>The oldest supported version of Xcode is 13.0.</p>
<p>You will need to download Xcode either from the App Store or specific
versions can be easily located via the <a
href="https://xcodereleases.com">Xcode Releases</a> website.</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>
<pre><code>xcode-select --install</code></pre>
<p>When updating Xcode, it is advisable to keep an older version for
building the JDK. To use a specific version of Xcode you have multiple
options:</p>
@@ -889,12 +865,12 @@ 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 man pages and the full docs (see the
<p>In order to build the full docs (see the
<code>--enable-full-docs</code> configure option) <a
href="https://pandoc.org">Pandoc</a> is required. For full docs also <a
href="https://www.graphviz.org">Graphviz</a> is 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>
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
@@ -1451,10 +1427,10 @@ of a cross-compiling toolchain and a sysroot environment which can
easily be used together with the <code>--with-devkit</code> configure
option to cross compile the JDK. On Linux/x86_64, the following
command:</p>
<pre><code>bash configure --with-devkit=&lt;devkit-path&gt; --openjdk-target=ppc64le-linux-gnu &amp;&amp; make</code></pre>
<p>will configure and build the JDK for Linux/ppc64le assuming that
<code>&lt;devkit-path&gt;</code> points to a Linux/x86_64 to
Linux/ppc64le devkit.</p>
<pre><code>bash configure --with-devkit=&lt;devkit-path&gt; --openjdk-target=ppc64-linux-gnu &amp;&amp; make</code></pre>
<p>will configure and build the JDK for Linux/ppc64 assuming that
<code>&lt;devkit-path&gt;</code> points to a Linux/x86_64 to Linux/ppc64
devkit.</p>
<p>Devkits can be created from the <code>make/devkit</code> directory by
executing:</p>
<pre><code>make [ TARGETS=&quot;&lt;TARGET_TRIPLET&gt;+&quot; ] [ BASE_OS=&lt;OS&gt; ] [ BASE_OS_VERSION=&lt;VER&gt; ]</code></pre>
@@ -1481,22 +1457,22 @@ following targets are known to work:</p>
<td>arm-linux-gnueabihf</td>
</tr>
<tr class="even">
<td>ppc64le-linux-gnu</td>
<td>ppc64-linux-gnu</td>
</tr>
<tr class="odd">
<td>riscv64-linux-gnu</td>
<td>ppc64le-linux-gnu</td>
</tr>
<tr class="even">
<td>s390x-linux-gnu</td>
</tr>
</tbody>
</table>
<p><code>BASE_OS</code> must be one of <code>OL</code> for Oracle
Enterprise Linux or <code>Fedora</code>. If the base OS is
<code>Fedora</code> the corresponding Fedora release can be specified
with the help of the <code>BASE_OS_VERSION</code> option. If the build
is successful, the new devkits can be found in the
<code>build/devkit/result</code> subdirectory:</p>
<p><code>BASE_OS</code> must be one of "OEL6" for Oracle Enterprise
Linux 6 or "Fedora" (if not specified "OEL6" will be the default). If
the base OS is "Fedora" the corresponding Fedora release can be
specified with the help of the <code>BASE_OS_VERSION</code> option (with
"27" as default version). If the build is successful, the new devkits
can be found in the <code>build/devkit/result</code> subdirectory:</p>
<pre><code>cd make/devkit
make TARGETS=&quot;ppc64le-linux-gnu aarch64-linux-gnu&quot; BASE_OS=Fedora BASE_OS_VERSION=21
ls -1 ../../build/devkit/result/
@@ -1748,20 +1724,6 @@ packages in the sysroot, configure the build with
--with-devkit=$DEVKIT \
--with-sysroot=$SYSROOT</code></pre>
<p>and run <code>make</code> normally.</p>
<h4 id="building-for-windows-aarch64">Building for Windows AArch64</h4>
<p>The Visual Studio Build Tools can be used for building the JDK
without a full Visual Studio installation. To set up the Visual Studio
2022 Build Tools on a Windows AArch64 machine for a native build, launch
the installer as follows in a Windows command prompt:</p>
<pre><code>vs_buildtools.exe --quiet --wait --norestart --nocache ^
--installPath &quot;%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools&quot; ^
--add Microsoft.VisualStudio.Component.VC.CoreBuildTools ^
--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 ^
--add Microsoft.VisualStudio.Component.Windows11SDK.22621</code></pre>
<p>To generate Windows AArch64 builds using Cygwin on a Windows x64
machine, you must set the proper target platform by adding
<code>--openjdk-target=aarch64-unknown-cygwin</code> to your configure
command line.</p>
<h2 id="build-performance">Build Performance</h2>
<p>Building the JDK requires a lot of horsepower. Some of the build
tools can be adjusted to utilize more or less of resources such as
@@ -2055,18 +2017,10 @@ some directory names have spaces. Usually, it assumes those directories
have <a
href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-8dot3name">short
paths</a>. You can run <code>fsutil file setshortname</code> in
<code>cmd</code> on directories to assign arbitrary short paths so
<code>configure</code> can access them. If the result says "Access
denied", it may be that there are processes running in that directory;
in this case, you can reboot Windows in safe mode and run the command on
those directories again.</p>
<p>The only directories required to have short paths are
<code>Microsoft Visual Studio</code> and <code>Windows Kits</code>; the
rest of the "contains space" warnings from <code>configure</code>, such
as <code>IntelliJ IDEA</code>, can be ignored. You can choose any short
name; once it is set, <code>configure</code>'s tools like
<code>cygpath</code> can convert the directory with spaces to your
chosen short name and pass it to the build system.</p>
<code>cmd</code> on certain directories, such as
<code>Microsoft Visual Studio</code> or <code>Windows Kits</code>, to
assign arbitrary short paths so <code>configure</code> can access
them.</p>
<h3 id="getting-help">Getting Help</h3>
<p>If none of the suggestions in this document helps you, or if you find
what you believe is a bug in the build system, please contact the Build

View File

@@ -83,44 +83,19 @@ on where and how to check out the source code.
for the source code, see below for suggestions on how to keep the build
artifacts on a local disk.
* UTF-8 support is needed to compile the JDK. On Unix systems, this typically
means that the `C.UTF-8` or `en_US.UTF-8` locale needs to be available. For
Windows users, please see the section on [Locale
Requirements](#locale-requirements) below.
* On Windows, if using [Cygwin](#cygwin), extra care must be taken to make sure
the environment is consistent. It is recommended that you follow this
procedure:
* On Windows, extra care must be taken to have a smooth building experience:
* Create the directory that is going to contain the top directory of the JDK
clone by using the `mkdir` command in the Cygwin bash shell. That is, do
*not* create it using Windows Explorer. This will ensure that it will have
proper Cygwin attributes, and that it's children will inherit those
attributes.
* Make sure that all relevant paths have short names. Short names are used by
the build system to create space-free alternative paths. Short name
creation is enabled per volume. The default setting can be checked with the
command: `fsutil 8dot3name query`. If short name creation was turned off
when a directory was created, it will not have a short name. Whether a
short name exists can be checked by running `dir /X` in the containing
directory (in cmd.exe). If a short path is present you should see something
like 'ASDF~1' being displayed in one of the columns of the ouput. If a
directory is missing a short name, the safest way to get one is to enable
short names for that particular volume with `fsutil 8dot3name set <drive
letter>: 0` (note that you need to run as administrator for this), and then
re-create the particular directory. A short name should be generated
automatically then. Another option is to manually assign a short name to
the directory using `fsutil file setShortName <path> <short name>`.
* If using [Cygwin](#cygwin), you must make sure the file permissions and
attributes between Windows and Cygwin are consistent. It is recommended
that you follow this procedure:
* Create the directory that is going to contain the top directory of the
JDK clone by using the `mkdir` command in the Cygwin bash shell. That is,
do *not* create it using Windows Explorer. This will ensure that it will
have proper Cygwin attributes, and that it's children will inherit those
attributes.
* Do not put the JDK clone in a path under your Cygwin home directory. This
is especially important if your user name contains spaces and/or mixed
upper and lower case letters.
Failure to follow these procedures might result in hard-to-debug build
problems.
* Do not put the JDK clone in a path under your Cygwin home directory. This
is especially important if your user name contains spaces and/or mixed
upper and lower case letters.
* You need to install a git client. You have two choices, Cygwin git or Git
for Windows. Unfortunately there are pros and cons with each choice.
@@ -138,6 +113,9 @@ on where and how to check out the source code.
make sure you set `core.autocrlf` to `false` (this is asked during
installation).
Failure to follow this procedure might result in hard-to-debug build
problems.
## Build Hardware Requirements
The JDK is a massive project, and require machines ranging from decent to
@@ -156,7 +134,8 @@ space is required.
Even for 32-bit builds, it is recommended to use a 64-bit build machine, and
instead create a 32-bit target using `--with-target-bits=32`.
Note: The 32-bit x86 port is deprecated and may be removed in a future release.
Note: The Windows 32-bit x86 port is deprecated and may be removed in a future
release.
### Building on aarch64
@@ -197,7 +176,7 @@ time of writing.
| ----------------- | ---------------------------------- |
| Linux/x64 | Oracle Enterprise Linux 6.4 / 8.x |
| Linux/aarch64 | Oracle Enterprise Linux 7.6 / 8.x |
| macOS | macOS 14.x |
| macOS | macOS 13.x (Ventura) |
| Windows | Windows Server 2016 |
The double version numbers for Linux are due to the hybrid model used at
@@ -212,7 +191,8 @@ on different platforms.
### Windows
Windows XP is not a supported platform, but all newer Windows should be able to
build the JDK.
build the JDK. (Note: The Windows 32-bit x86 port is deprecated and may be
removed in a future release.)
On Windows, it is important that you pay attention to the instructions in the
[Special Considerations](#special-considerations).
@@ -349,7 +329,7 @@ difficult for a project such as the JDK to keep pace with a continuously
updated machine running macOS. See the section on [Apple Xcode](#apple-xcode)
on some strategies to deal with this.
It is recommended that you use at least macOS 14 and Xcode 15.4, but
It is recommended that you use at least macOS 13 (Ventura) and Xcode 14, but
earlier versions may also work.
The standard macOS environment contains the basic tooling needed to build, but
@@ -412,11 +392,11 @@ possible to compile the JDK with both older and newer versions, but the closer
you stay to this list, the more likely you are to compile successfully without
issues.
| Operating system | Toolchain version |
| ------------------ | -------------------------------------------- |
| Linux | gcc 14.2.0 |
| macOS | Apple Xcode 15.4 (using clang 15.0.0) |
| Windows | Microsoft Visual Studio 2022 version 17.13.2 |
| Operating system | Toolchain version |
| ------------------ | ------------------------------------------- |
| Linux | gcc 13.2.0 |
| macOS | Apple Xcode 14.3.1 (using clang 14.0.3) |
| Windows | Microsoft Visual Studio 2022 version 17.6.5 |
All compilers are expected to be able to handle the C11 language standard for
C, and C++14 for C++.
@@ -426,7 +406,7 @@ C, and C++14 for C++.
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 14.2 or
The JDK is currently known to compile successfully with gcc version 13.2 or
newer.
In general, any version between these two should be usable.
@@ -442,9 +422,13 @@ To use clang instead of gcc on Linux, use `--with-toolchain-type=clang`.
The oldest supported version of Xcode is 13.0.
You will need to download Xcode either from the App Store or specific versions
can be easily located via the [Xcode Releases](https://xcodereleases.com)
website.
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
simplest way to install these is to run:
```
xcode-select --install
```
When updating Xcode, it is advisable to keep an older version for building the
JDK. To use a specific version of Xcode you have multiple options:
@@ -702,9 +686,9 @@ At least version 3.2 of GNU Bash must be used.
### Graphviz and Pandoc
In order to build man pages and the full docs (see the `--enable-full-docs`
configure option) [Pandoc](https://pandoc.org) is required. For full docs also
[Graphviz](https://www.graphviz.org) is required. Any recent versions should
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.
@@ -1258,11 +1242,11 @@ toolchain and a sysroot environment which can easily be used together with the
following command:
```
bash configure --with-devkit=<devkit-path> --openjdk-target=ppc64le-linux-gnu && make
bash configure --with-devkit=<devkit-path> --openjdk-target=ppc64-linux-gnu && make
```
will configure and build the JDK for Linux/ppc64le assuming that `<devkit-path>`
points to a Linux/x86_64 to Linux/ppc64le devkit.
will configure and build the JDK for Linux/ppc64 assuming that `<devkit-path>`
points to a Linux/x86_64 to Linux/ppc64 devkit.
Devkits can be created from the `make/devkit` directory by executing:
@@ -1281,14 +1265,16 @@ at least the following targets are known to work:
| x86_64-linux-gnu |
| aarch64-linux-gnu |
| arm-linux-gnueabihf |
| ppc64-linux-gnu |
| ppc64le-linux-gnu |
| riscv64-linux-gnu |
| s390x-linux-gnu |
`BASE_OS` must be one of `OL` for Oracle Enterprise Linux or `Fedora`. If the
base OS is `Fedora` the corresponding Fedora release can be specified with the
help of the `BASE_OS_VERSION` option. If the build is successful, the new
devkits can be found in the `build/devkit/result` subdirectory:
`BASE_OS` must be one of "OEL6" for Oracle Enterprise Linux 6 or "Fedora" (if
not specified "OEL6" will be the default). If the base OS is "Fedora" the
corresponding Fedora release can be specified with the help of the
`BASE_OS_VERSION` option (with "27" as default version). If the build is
successful, the new devkits can be found in the `build/devkit/result`
subdirectory:
```
cd make/devkit
@@ -1477,24 +1463,6 @@ sh ./configure --with-jvm-variants=server \
and run `make` normally.
#### Building for Windows AArch64
The Visual Studio Build Tools can be used for building the JDK without a full
Visual Studio installation. To set up the Visual Studio 2022 Build Tools on a
Windows AArch64 machine for a native build, launch the installer as follows
in a Windows command prompt:
```
vs_buildtools.exe --quiet --wait --norestart --nocache ^
--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" ^
--add Microsoft.VisualStudio.Component.VC.CoreBuildTools ^
--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 ^
--add Microsoft.VisualStudio.Component.Windows11SDK.22621
```
To generate Windows AArch64 builds using Cygwin on a Windows x64 machine,
you must set the proper target platform by adding
`--openjdk-target=aarch64-unknown-cygwin` to your configure command line.
## Build Performance
Building the JDK requires a lot of horsepower. Some of the build tools can be
@@ -1836,17 +1804,9 @@ temporarily.
On Windows, when configuring, `fixpath.sh` may report that some directory names
have spaces. Usually, it assumes those directories have [short
paths](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-8dot3name).
You can run `fsutil file setshortname` in `cmd` on directories to assign
arbitrary short paths so `configure` can access them. If the result says "Access
denied", it may be that there are processes running in that directory; in this
case, you can reboot Windows in safe mode and run the command on those directories
again.
The only directories required to have short paths are `Microsoft Visual Studio`
and `Windows Kits`; the rest of the "contains space" warnings from `configure`,
such as `IntelliJ IDEA`, can be ignored. You can choose any short name; once it
is set, `configure`'s tools like `cygpath` can convert the directory with spaces
to your chosen short name and pass it to the build system.
You can run `fsutil file setshortname` in `cmd` on certain directories, such as
`Microsoft Visual Studio` or `Windows Kits`, to assign arbitrary short paths so
`configure` can access them.
### Getting Help

View File

@@ -32,12 +32,11 @@
<ul>
<li><a href="#introduction" id="toc-introduction">Introduction</a>
<ul>
<li><a href="#changing-this-document"
id="toc-changing-this-document">Changing this Document</a></li>
<li><a href="#why-care-about-style" id="toc-why-care-about-style">Why
Care About Style?</a></li>
<li><a href="#counterexamples"
id="toc-counterexamples">Counterexamples</a></li>
<li><a href="#counterexamples-and-updates"
id="toc-counterexamples-and-updates">Counterexamples and
Updates</a></li>
</ul></li>
<li><a href="#structure-and-formatting"
id="toc-structure-and-formatting">Structure and Formatting</a>
@@ -77,9 +76,6 @@ SFINAE</a></li>
<li><a href="#thread_local" id="toc-thread_local">thread_local</a></li>
<li><a href="#nullptr" id="toc-nullptr">nullptr</a></li>
<li><a href="#atomic" id="toc-atomic">&lt;atomic&gt;</a></li>
<li><a href="#initializing-variables-with-static-storage-duration"
id="toc-initializing-variables-with-static-storage-duration">Initializing
variables with static storage duration</a></li>
<li><a href="#uniform-initialization"
id="toc-uniform-initialization">Uniform Initialization</a></li>
<li><a href="#local-function-objects"
@@ -87,7 +83,6 @@ id="toc-local-function-objects">Local Function Objects</a></li>
<li><a href="#inheriting-constructors"
id="toc-inheriting-constructors">Inheriting constructors</a></li>
<li><a href="#attributes" id="toc-attributes">Attributes</a></li>
<li><a href="#noexcept" id="toc-noexcept">noexcept</a></li>
<li><a href="#additional-permitted-features"
id="toc-additional-permitted-features">Additional Permitted
Features</a></li>
@@ -104,21 +99,6 @@ writing HotSpot code. Following these will help new code fit in with
existing HotSpot code, making it easier to read and maintain. Failure to
follow these guidelines may lead to discussion during code reviews, if
not outright rejection of a change.</p>
<h3 id="changing-this-document">Changing this Document</h3>
<p>Proposed changes should be discussed on the <a
href="mailto:hotspot-dev@openjdk.org">HotSpot Developers</a> mailing
list. Changes are likely to be cautious and incremental, since HotSpot
coders have been using these guidelines for years.</p>
<p>Substantive changes are approved by <a
href="https://www.rfc-editor.org/rfc/rfc7282.html">rough consensus</a>
of the <a href="https://openjdk.org/census#hotspot">HotSpot Group</a>
Members. The Group Lead determines whether consensus has been
reached.</p>
<p>Editorial changes (changes that only affect the description of
HotSpot style, not its substance) do not require the full consensus
gathering process. The normal HotSpot pull request process may be used
for editorial changes, with the additional requirement that the
requisite reviewers are also HotSpot Group Members.</p>
<h3 id="why-care-about-style">Why Care About Style?</h3>
<p>Some programmers seem to have lexers and even C preprocessors
installed directly behind their eyeballs. The rest of us require code
@@ -144,7 +124,7 @@ conforms locally to its own peculiar conventions, it is not worth
reformatting the whole thing. Also consider separating changes that make
extensive stylistic updates from those which make functional
changes.</p>
<h3 id="counterexamples">Counterexamples</h3>
<h3 id="counterexamples-and-updates">Counterexamples and Updates</h3>
<p>Many of the guidelines mentioned here have (sometimes widespread)
counterexamples in the HotSpot code base. Finding a counterexample is
not sufficient justification for new code to follow the counterexample
@@ -157,6 +137,20 @@ bring it up for discussion and possible change. The architectural rule,
of course, is "When in Rome do as the Romans". Sometimes in the suburbs
of Rome the rules are a little different; these differences can be
pointed out here.</p>
<p>Proposed changes should be discussed on the <a
href="mailto:hotspot-dev@openjdk.org">HotSpot Developers</a> mailing
list. Changes are likely to be cautious and incremental, since HotSpot
coders have been using these guidelines for years.</p>
<p>Substantive changes are approved by <a
href="https://www.rfc-editor.org/rfc/rfc7282.html">rough consensus</a>
of the <a href="https://openjdk.org/census#hotspot">HotSpot Group</a>
Members. The Group Lead determines whether consensus has been
reached.</p>
<p>Editorial changes (changes that only affect the description of
HotSpot style, not its substance) do not require the full consensus
gathering process. The normal HotSpot pull request process may be used
for editorial changes, with the additional requirement that the
requisite reviewers are also HotSpot Group Members.</p>
<h2 id="structure-and-formatting">Structure and Formatting</h2>
<h3 id="factoring-and-class-design">Factoring and Class Design</h3>
<ul>
@@ -213,38 +207,23 @@ the simple "getter".</p></li>
<ul>
<li><p>All source files must have a globally unique basename. The build
system depends on this uniqueness.</p></li>
<li><p>Keep the include lines within a section alphabetically sorted by
their lowercase value. If an include must be out of order for
correctness, suffix with it a comment such as
<code>// do not reorder</code>. Source code processing tools can also
use this hint.</p></li>
<li><p>Put conditional inclusions (<code>#if ...</code>) at the end of
the section of HotSpot include lines. This also applies to
macro-expanded includes of platform dependent files.</p></li>
<li><p>Put system includes in a section after the HotSpot include lines
with a blank line separating the two sections.</p></li>
<li><p>Do not put non-trivial function implementations in .hpp files. If
the implementation depends on other .hpp files, put it in a .cpp or a
.inline.hpp file.</p></li>
<li><p>.inline.hpp files should only be included in .cpp or .inline.hpp
files.</p></li>
<li><p>All .inline.hpp files should include their corresponding .hpp
file as the first include line with a blank line separating it from the
rest of the include lines. Declarations needed by other files should be
put in the .hpp file, and not in the .inline.hpp file. This rule exists
to resolve problems with circular dependencies between .inline.hpp
files.</p></li>
<li><p>Do not include a .hpp file if the corresponding .inline.hpp file
is included.</p></li>
<li><p>Use include guards for .hpp and .inline.hpp files. The name of
the defined guard should be derived from the full search path of the
file relative to the hotspot source directory. The guard should be all
upper case with all paths separators and periods replaced by
underscores.</p></li>
<li><p>Some build configurations use precompiled headers to speed up the
build times. The precompiled headers are included in the precompiled.hpp
file. Note that precompiled.hpp is just a build time optimization, so
don't rely on it to resolve include problems.</p></li>
file as the first include line. Declarations needed by other files
should be put in the .hpp file, and not in the .inline.hpp file. This
rule exists to resolve problems with circular dependencies between
.inline.hpp files.</p></li>
<li><p>All .cpp files include precompiled.hpp as the first include
line.</p></li>
<li><p>precompiled.hpp is just a build time optimization, so don't rely
on it to resolve include problems.</p></li>
<li><p>Keep the include lines alphabetically sorted.</p></li>
<li><p>Put conditional inclusions (<code>#if ...</code>) at the end of
the include list.</p></li>
</ul>
<h3 id="jtreg-tests">JTReg Tests</h3>
<ul>
@@ -795,33 +774,6 @@ differ from what the Java compilers implement.</p>
"conservative" memory ordering, which may differ from (may be stronger
than) sequentially consistent. There are algorithms in HotSpot that are
believed to rely on that ordering.</p>
<h3
id="initializing-variables-with-static-storage-duration">Initializing
variables with static storage duration</h3>
<p>Variables with static storage duration and <em>dynamic
initialization</em> <a
href="https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf">C++14
3.6.2</a>). should be avoided, unless an implementation is permitted to
perform the initialization as a static initialization. The order in
which dynamic initializations occur is incompletely specified.
Initialization order problems can be difficult to deal with and lead to
surprises.</p>
<p>Variables with static storage duration and non-trivial destructors
should be avoided. HotSpot doesn't generally try to cleanup on exit, and
running destructors at exit can lead to problems.</p>
<p>Some of the approaches used in HotSpot to avoid dynamic
initialization include:</p>
<ul>
<li><p>Use the <code>Deferred&lt;T&gt;</code> class template. Add a call
to its initialization function at an appropriate place during VM
initialization. The underlying object is never destroyed.</p></li>
<li><p>For objects of class type, use a variable whose value is a
pointer to the class, initialized to <code>nullptr</code>. Provide an
initialization function that sets the variable to a dynamically
allocated object. Add a call to that function at an appropriate place
during VM initialization. Such objects are usually never
destroyed.</p></li>
</ul>
<h3 id="uniform-initialization">Uniform Initialization</h3>
<p>The use of <em>uniform initialization</em> (<a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm">n2672</a>),
@@ -1141,58 +1093,6 @@ function name and the parameter list.</li>
<code>memory_order_consume</code>.</li>
<li><code>[[deprecated]]</code> - Not relevant in HotSpot code.</li>
</ul>
<h3 id="noexcept">noexcept</h3>
<p>Use of <code>noexcept</code> exception specifications (<a
href="http://wg21.link/n3050">n3050</a>) are permitted with restrictions
described below.</p>
<ul>
<li>Only the argument-less form of <code>noexcept</code> exception
specifications are permitted.</li>
<li>Allocation functions that may return <code>nullptr</code> to
indicate allocation failure must be declared <code>noexcept</code>.</li>
<li>All other uses of <code>noexcept</code> exception specifications are
forbidden.</li>
<li><code>noexcept</code> expressions are forbidden.</li>
<li>Dynamic exception specifications are forbidden.</li>
</ul>
<p>HotSpot is built with exceptions disabled, e.g. compile with
<code>-fno-exceptions</code> (gcc, clang) or no <code>/EH</code> option
(MSVC++). So why do we need to consider <code>noexcept</code> at all?
It's because <code>noexcept</code> exception specifications serve two
distinct purposes.</p>
<p>The first is to allow the compiler to avoid generating code or data
in support of exceptions being thrown by a function. But this is
unnecessary, because exceptions are disabled.</p>
<p>The second is to allow the compiler and library code to choose
different algorithms, depending on whether some function may throw
exceptions. This is only relevant to a certain set of functions.</p>
<ul>
<li><p>Some allocation functions (<code>operator new</code> and
<code>operator new[]</code>) return <code>nullptr</code> to indicate
allocation failure. If a <code>new</code> expression calls such an
allocation function, it must check for and handle that possibility.
Declaring such a function <code>noexcept</code> informs the compiler
that <code>nullptr</code> is a possible result. If an allocation
function is not declared <code>noexcept</code> then the compiler may
elide that checking and handling for a <code>new</code> expression
calling that function.</p></li>
<li><p>Certain Standard Library facilities (notably containers) provide
different guarantees for some operations (and may choose different
algorithms to implement those operations), depending on whether certain
functions (constructors, copy/move operations, swap) are nothrow or not.
They detect this using type traits that test whether a function is
declared <code>noexcept</code>. This can have a significant performance
impact if, for example, copying is chosen over a potentially throwing
move. But this isn't relevant, since HotSpot forbids the use of most
Standard Library facilities.</p></li>
</ul>
<p>HotSpot code can assume no exceptions will ever be thrown, even from
functions not declared <code>noexcept</code>. So HotSpot code doesn't
ever need to check, either with conditional exception specifications or
with <code>noexcept</code> expressions.</p>
<p>Dynamic exception specifications were deprecated in C++11. C++17
removed all but <code>throw()</code>, with that remaining a deprecated
equivalent to <code>noexcept</code>.</p>
<h3 id="additional-permitted-features">Additional Permitted
Features</h3>
<ul>
@@ -1281,6 +1181,12 @@ Library names.</p></li>
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html">n2179</a>)
— HotSpot does not permit the use of exceptions, so this feature isn't
useful.</p></li>
<li><p>Avoid non-local variables with non-constexpr initialization. In
particular, avoid variables with types requiring non-trivial
initialization or destruction. Initialization order problems can be
difficult to deal with and lead to surprises, as can destruction
ordering. HotSpot doesn't generally try to cleanup on exit, and running
destructors at exit can also lead to problems.</p></li>
<li><p>Avoid most operator overloading, preferring named functions. When
operator overloading is used, ensure the semantics conform to the normal
expected behavior of the operation.</p></li>

View File

@@ -8,24 +8,6 @@ HotSpot code, making it easier to read and maintain. Failure to
follow these guidelines may lead to discussion during code reviews, if
not outright rejection of a change.
### Changing this Document
Proposed changes should be discussed on the
[HotSpot Developers](mailto:hotspot-dev@openjdk.org) mailing
list. Changes are likely to be cautious and incremental, since HotSpot
coders have been using these guidelines for years.
Substantive changes are approved by
[rough consensus](https://www.rfc-editor.org/rfc/rfc7282.html) of
the [HotSpot Group](https://openjdk.org/census#hotspot) Members.
The Group Lead determines whether consensus has been reached.
Editorial changes (changes that only affect the description of HotSpot
style, not its substance) do not require the full consensus gathering
process. The normal HotSpot pull request process may be used for
editorial changes, with the additional requirement that the requisite
reviewers are also HotSpot Group Members.
### Why Care About Style?
Some programmers seem to have lexers and even C preprocessors
@@ -56,7 +38,7 @@ reformatting the whole thing. Also consider separating changes that
make extensive stylistic updates from those which make functional
changes.
### Counterexamples
### Counterexamples and Updates
Many of the guidelines mentioned here have (sometimes widespread)
counterexamples in the HotSpot code base. Finding a counterexample is
@@ -72,6 +54,22 @@ rule, of course, is "When in Rome do as the Romans". Sometimes in the
suburbs of Rome the rules are a little different; these differences
can be pointed out here.
Proposed changes should be discussed on the
[HotSpot Developers](mailto:hotspot-dev@openjdk.org) mailing
list. Changes are likely to be cautious and incremental, since HotSpot
coders have been using these guidelines for years.
Substantive changes are approved by
[rough consensus](https://www.rfc-editor.org/rfc/rfc7282.html) of
the [HotSpot Group](https://openjdk.org/census#hotspot) Members.
The Group Lead determines whether consensus has been reached.
Editorial changes (changes that only affect the description of HotSpot
style, not its substance) do not require the full consensus gathering
process. The normal HotSpot pull request process may be used for
editorial changes, with the additional requirement that the requisite
reviewers are also HotSpot Group Members.
## Structure and Formatting
### Factoring and Class Design
@@ -137,21 +135,9 @@ change should be done with a "setter" accessor matched to the simple
### Source Files
* All source files must have a globally unique basename. The build
* All source files must have a globally unique basename. The build
system depends on this uniqueness.
* Keep the include lines within a section alphabetically sorted by their
lowercase value. If an include must be out of order for correctness,
suffix with it a comment such as `// do not reorder`. Source code
processing tools can also use this hint.
* Put conditional inclusions (`#if ...`) at the end of the section of HotSpot
include lines. This also applies to macro-expanded includes of platform
dependent files.
* Put system includes in a section after the HotSpot include lines with a blank
line separating the two sections.
* Do not put non-trivial function implementations in .hpp files. If
the implementation depends on other .hpp files, put it in a .cpp or
a .inline.hpp file.
@@ -160,22 +146,18 @@ a .inline.hpp file.
files.
* All .inline.hpp files should include their corresponding .hpp file as
the first include line with a blank line separating it from the rest of the
include lines. Declarations needed by other files should be put in the .hpp
file, and not in the .inline.hpp file. This rule exists to resolve problems
with circular dependencies between .inline.hpp files.
the first include line. Declarations needed by other files should be put
in the .hpp file, and not in the .inline.hpp file. This rule exists to
resolve problems with circular dependencies between .inline.hpp files.
* Do not include a .hpp file if the corresponding .inline.hpp file is included.
* All .cpp files include precompiled.hpp as the first include line.
* Use include guards for .hpp and .inline.hpp files. The name of the defined
guard should be derived from the full search path of the file relative to the
hotspot source directory. The guard should be all upper case with all paths
separators and periods replaced by underscores.
* precompiled.hpp is just a build time optimization, so don't rely on
it to resolve include problems.
* Some build configurations use precompiled headers to speed up the
build times. The precompiled headers are included in the precompiled.hpp
file. Note that precompiled.hpp is just a build time optimization, so
don't rely on it to resolve include problems.
* Keep the include lines alphabetically sorted.
* Put conditional inclusions (`#if ...`) at the end of the include list.
### JTReg Tests
@@ -770,32 +752,6 @@ ordering, which may differ from (may be stronger than) sequentially
consistent. There are algorithms in HotSpot that are believed to rely
on that ordering.
### Initializing variables with static storage duration
Variables with static storage duration and _dynamic initialization_
[C++14 3.6.2](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf)).
should be avoided, unless an implementation is permitted to perform the
initialization as a static initialization. The order in which dynamic
initializations occur is incompletely specified. Initialization order
problems can be difficult to deal with and lead to surprises.
Variables with static storage duration and non-trivial destructors should be
avoided. HotSpot doesn't generally try to cleanup on exit, and running
destructors at exit can lead to problems.
Some of the approaches used in HotSpot to avoid dynamic initialization
include:
* Use the `Deferred<T>` class template. Add a call to its initialization
function at an appropriate place during VM initialization. The underlying
object is never destroyed.
* For objects of class type, use a variable whose value is a pointer to the
class, initialized to `nullptr`. Provide an initialization function that sets
the variable to a dynamically allocated object. Add a call to that function at
an appropriate place during VM initialization. Such objects are usually never
destroyed.
### Uniform Initialization
The use of _uniform initialization_
@@ -1130,57 +1086,6 @@ The following attributes are expressly forbidden:
* `[[carries_dependency]]` - Related to `memory_order_consume`.
* `[[deprecated]]` - Not relevant in HotSpot code.
### noexcept
Use of `noexcept` exception specifications
([n3050](http://wg21.link/n3050))
are permitted with restrictions described below.
* Only the argument-less form of `noexcept` exception specifications are
permitted.
* Allocation functions that may return `nullptr` to indicate allocation
failure must be declared `noexcept`.
* All other uses of `noexcept` exception specifications are forbidden.
* `noexcept` expressions are forbidden.
* Dynamic exception specifications are forbidden.
HotSpot is built with exceptions disabled, e.g. compile with `-fno-exceptions`
(gcc, clang) or no `/EH` option (MSVC++). So why do we need to consider
`noexcept` at all? It's because `noexcept` exception specifications serve two
distinct purposes.
The first is to allow the compiler to avoid generating code or data in support
of exceptions being thrown by a function. But this is unnecessary, because
exceptions are disabled.
The second is to allow the compiler and library code to choose different
algorithms, depending on whether some function may throw exceptions. This is
only relevant to a certain set of functions.
* Some allocation functions (`operator new` and `operator new[]`) return
`nullptr` to indicate allocation failure. If a `new` expression calls such an
allocation function, it must check for and handle that possibility. Declaring
such a function `noexcept` informs the compiler that `nullptr` is a possible
result. If an allocation function is not declared `noexcept` then the compiler
may elide that checking and handling for a `new` expression calling that
function.
* Certain Standard Library facilities (notably containers) provide different
guarantees for some operations (and may choose different algorithms to
implement those operations), depending on whether certain functions
(constructors, copy/move operations, swap) are nothrow or not. They detect
this using type traits that test whether a function is declared `noexcept`.
This can have a significant performance impact if, for example, copying is
chosen over a potentially throwing move. But this isn't relevant, since
HotSpot forbids the use of most Standard Library facilities.
HotSpot code can assume no exceptions will ever be thrown, even from functions
not declared `noexcept`. So HotSpot code doesn't ever need to check, either
with conditional exception specifications or with `noexcept` expressions.
Dynamic exception specifications were deprecated in C++11. C++17 removed all
but `throw()`, with that remaining a deprecated equivalent to `noexcept`.
### Additional Permitted Features
* `alignof`
@@ -1276,6 +1181,13 @@ namespace std;` to avoid needing to qualify Standard Library names.
([n2179](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html)) &mdash;
HotSpot does not permit the use of exceptions, so this feature isn't useful.
* Avoid non-local variables with non-constexpr initialization.
In particular, avoid variables with types requiring non-trivial
initialization or destruction. Initialization order problems can be
difficult to deal with and lead to surprises, as can destruction
ordering. HotSpot doesn't generally try to cleanup on exit, and
running destructors at exit can also lead to problems.
* Avoid most operator overloading, preferring named functions. When
operator overloading is used, ensure the semantics conform to the
normal expected behavior of the operation.

View File

@@ -189,7 +189,7 @@ wants to find) and design tests using those models.</p>
<p>Prefer having checks inside test code.</p>
<p>Not only does having test logic outside, e.g. verification method,
depending on asserts in product code contradict with several items above
but also decreases test's readability and stability. It is much easier
but also decreases tests readability and stability. It is much easier
to understand that a test is testing when all testing logic is located
inside a test or nearby in shared test libraries. As a rule of thumb,
the closer a check to a test, the better.</p>
@@ -198,7 +198,7 @@ the closer a check to a test, the better.</p>
<p>Prefer <code>EXPECT</code> over <code>ASSERT</code> if possible.</p>
<p>This is related to the <a href="#informativeness">informativeness</a>
property of tests, information for other checks can help to better
localize a defect's root-cause. One should use <code>ASSERT</code> if it
localize a defects root-cause. One should use <code>ASSERT</code> if it
is impossible to continue test execution or if it does not make much
sense. Later in the text, <code>EXPECT</code> forms will be used to
refer to both <code>ASSERT/EXPECT</code>.</p>
@@ -235,7 +235,7 @@ which checks that the absolute value of the difference between
<code>eps</code>.</p>
<h3 id="c-string-comparison">C string comparison</h3>
<p>Use string special macros for C strings comparisons.</p>
<p><code>EXPECT_EQ</code> just compares pointers' values, which is
<p><code>EXPECT_EQ</code> just compares pointers values, which is
hardly what one wants comparing C strings. GoogleTest provides
<code>EXPECT_STREQ</code> and <code>EXPECT_STRNE</code> macros to
compare C string contents. There are also case-insensitive versions
@@ -245,7 +245,7 @@ compare C string contents. There are also case-insensitive versions
<p>All GoogleTest asserts print compared expressions and their values,
so there is no need to have them in error messages. Asserts print only
compared values, they do not print any of interim variables, e.g.
<code>ASSERT_TRUE((val1 == val2 &amp;&amp; isFail(foo(8))) || i == 18)</code>
<code>ASSERT_TRUE((val1 == val2 &amp;&amp; isFail(foo(8)) || i == 18)</code>
prints only one value. If you use some complex predicates, please
consider <code>EXPECT_PRED*</code> or <code>EXPECT_FORMAT_PRED</code>
assertions family, they check that a predicate returns true/success and
@@ -293,7 +293,7 @@ subsystem, etc.</p>
<p>This naming scheme helps to find tests, filter them and simplifies
test failure analysis. For example, class <code>Foo</code> - test group
<code>Foo</code>, compiler logging subsystem - test group
<code>CompilerLogging</code>, G1 GC - test group <code>G1GC</code>, and
<code>CompilerLogging</code>, G1 GC test group <code>G1GC</code>, and
so forth.</p>
<h3 id="filename">Filename</h3>
<p>A test file must have <code>test_</code> prefix and <code>.cpp</code>
@@ -345,7 +345,7 @@ name starts or ends with an underscore are enough to be safe.</p>
<h3 id="friend-classes">Friend classes</h3>
<p>All test purpose friends should have either <code>Test</code> or
<code>Testable</code> suffix.</p>
<p>It greatly simplifies understanding of friendship's purpose and
<p>It greatly simplifies understanding of friendships purpose and
allows statically check that private members are not exposed
unexpectedly. Having <code>FooTest</code> as a friend of
<code>Foo</code> without any comments will be understood as a necessary
@@ -435,7 +435,7 @@ inapplicable tests.</p>
<h3 id="flag-restoring">Flag restoring</h3>
<p>Restore changed flags.</p>
<p>It is quite common for tests to configure JVM in a certain way
changing flags' values. GoogleTest provides two ways to set up
changing flags values. GoogleTest provides two ways to set up
environment before a test and restore it afterward: using either
constructor and destructor or <code>SetUp</code> and
<code>TearDown</code> functions. Both ways require to use a test fixture
@@ -444,7 +444,7 @@ class, which sometimes is too wordy. The simpler facilities like
be used in such cases to restore/set values.</p>
<p>Caveats:</p>
<ul>
<li><p>Changing a flag's value could break the invariants between flags'
<li><p>Changing a flags value could break the invariants between flags'
values and hence could lead to unexpected/unsupported JVM
state.</p></li>
<li><p><code>FLAG_SET_*</code> macros can change more than one flag (in

View File

@@ -106,7 +106,7 @@ Prefer having checks inside test code.
Not only does having test logic outside, e.g. verification method,
depending on asserts in product code contradict with several items
above but also decreases test's readability and stability. It is much
above but also decreases tests readability and stability. It is much
easier to understand that a test is testing when all testing logic is
located inside a test or nearby in shared test libraries. As a rule of
thumb, the closer a check to a test, the better.
@@ -119,7 +119,7 @@ Prefer `EXPECT` over `ASSERT` if possible.
This is related to the [informativeness](#informativeness) property of
tests, information for other checks can help to better localize a
defect's root-cause. One should use `ASSERT` if it is impossible to
defects root-cause. One should use `ASSERT` if it is impossible to
continue test execution or if it does not make much sense. Later in
the text, `EXPECT` forms will be used to refer to both
`ASSERT/EXPECT`.
@@ -160,7 +160,7 @@ value of the difference between `v1` and `v2` is not greater than `eps`.
Use string special macros for C strings comparisons.
`EXPECT_EQ` just compares pointers' values, which is hardly what one
`EXPECT_EQ` just compares pointers values, which is hardly what one
wants comparing C strings. GoogleTest provides `EXPECT_STREQ` and
`EXPECT_STRNE` macros to compare C string contents. There are also
case-insensitive versions `EXPECT_STRCASEEQ`, `EXPECT_STRCASENE`.
@@ -172,7 +172,7 @@ Provide informative, but not too verbose error messages.
All GoogleTest asserts print compared expressions and their values, so
there is no need to have them in error messages. Asserts print only
compared values, they do not print any of interim variables, e.g.
`ASSERT_TRUE((val1 == val2 && isFail(foo(8))) || i == 18)` prints only
`ASSERT_TRUE((val1 == val2 && isFail(foo(8)) || i == 18)` prints only
one value. If you use some complex predicates, please consider
`EXPECT_PRED*` or `EXPECT_FORMAT_PRED` assertions family, they check that
a predicate returns true/success and print out all parameters values.
@@ -226,7 +226,7 @@ subsystem, etc.
This naming scheme helps to find tests, filter them and simplifies
test failure analysis. For example, class `Foo` - test group `Foo`,
compiler logging subsystem - test group `CompilerLogging`, G1 GC - test
compiler logging subsystem - test group `CompilerLogging`, G1 GC test
group `G1GC`, and so forth.
### Filename
@@ -287,7 +287,7 @@ Fixture classes should be named after tested classes, subsystems, etc
All test purpose friends should have either `Test` or `Testable` suffix.
It greatly simplifies understanding of friendship's purpose and allows
It greatly simplifies understanding of friendships purpose and allows
statically check that private members are not exposed unexpectedly.
Having `FooTest` as a friend of `Foo` without any comments will be
understood as a necessary evil to get testability.
@@ -397,7 +397,7 @@ and filter out inapplicable tests.
Restore changed flags.
It is quite common for tests to configure JVM in a certain way
changing flags' values. GoogleTest provides two ways to set up
changing flags values. GoogleTest provides two ways to set up
environment before a test and restore it afterward: using either
constructor and destructor or `SetUp` and `TearDown` functions. Both ways
require to use a test fixture class, which sometimes is too wordy. The
@@ -406,7 +406,7 @@ be used in such cases to restore/set values.
Caveats:
* Changing a flag's value could break the invariants between flags' values and hence could lead to unexpected/unsupported JVM state.
* Changing a flags value could break the invariants between flags' values and hence could lead to unexpected/unsupported JVM state.
* `FLAG_SET_*` macros can change more than one flag (in order to
maintain invariants) so it is hard to predict what flags will be

View File

@@ -63,12 +63,11 @@ workspace has been generated. To use it, choose
<p>The main <code>vscode-project</code> target configures the default
C++ support in Visual Studio Code. There are also other source indexers
that can be installed, that may provide additional features. It's
currently possible to generate configuration for three such indexers, <a
href="https://clang.llvm.org/extra/clangd/">clangd</a>, <a
href="https://github.com/MaskRay/ccls/wiki/Visual-Studio-Code">ccls</a>
and <a href="https://github.com/Andersbakken/rtags">rtags</a>. These can
be configured by appending the name of the indexer to the make target,
such as:</p>
currently possible to generate configuration for two such indexers, <a
href="https://clang.llvm.org/extra/clangd/">clangd</a> and <a
href="https://github.com/Andersbakken/rtags">rtags</a>. These can be
configured by appending the name of the indexer to the make target, such
as:</p>
<pre class="shell"><code>make vscode-project-clangd</code></pre>
<p>Additional instructions for configuring the given indexer will be
displayed after the workspace has been generated.</p>

View File

@@ -32,8 +32,7 @@ choose `File -> Open Workspace...` in Visual Studio Code.
The main `vscode-project` target configures the default C++ support in Visual
Studio Code. There are also other source indexers that can be installed, that
may provide additional features. It's currently possible to generate
configuration for three such indexers, [clangd](https://clang.llvm.org/extra/clangd/),
[ccls](https://github.com/MaskRay/ccls/wiki/Visual-Studio-Code)
configuration for two such indexers, [clangd](https://clang.llvm.org/extra/clangd/)
and [rtags](https://github.com/Andersbakken/rtags). These can be configured by
appending the name of the indexer to the make target, such as:

View File

@@ -1,124 +0,0 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>Explanation of start of release changes</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
ul.task-list li input[type="checkbox"] {
width: 0.8em;
margin: 0 0.8em 0.2em -1.6em;
vertical-align: middle;
}
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
</style>
<link rel="stylesheet" href="../make/data/docs-resources/resources/jdk-default.css" />
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<header id="title-block-header">
<h1 class="title">Explanation of start of release changes</h1>
</header>
<nav id="TOC" role="doc-toc">
<ul>
<li><a href="#overview" id="toc-overview">Overview</a></li>
<li><a href="#details-and-file-updates"
id="toc-details-and-file-updates">Details and file updates</a>
<ul>
<li><a href="#meta-data-files" id="toc-meta-data-files">Meta-data
files</a></li>
<li><a href="#src-files" id="toc-src-files"><code>src</code>
files</a></li>
<li><a href="#test-files" id="toc-test-files"><code>test</code>
files</a></li>
</ul></li>
</ul>
</nav>
<h2 id="overview">Overview</h2>
<p>The start of release changes, the changes that turn JDK <em>N</em>
into JDK (<em>N</em>+1), are primarily small updates to various files
along with new files to store symbol information to allow
<code>javac --release N ...</code> to run on JDK (<em>N</em>+1).</p>
<p>The updates include changes to files holding meta-data about the
release, files under the <code>src</code> directory for API and tooling
updates, and incidental updates under the <code>test</code>
directory.</p>
<h2 id="details-and-file-updates">Details and file updates</h2>
<p>As a matter of policy, there are a number of semantically distinct
concepts which get incremented separately at the start of a new
release:</p>
<ul>
<li>Feature value of <code>Runtime.version()</code></li>
<li>Highest source version modeled by
<code>javax.lang.model.SourceVersion</code></li>
<li>Highest class file format major version recognized by the
platform</li>
<li>Highest
<code>-source</code>/<code>-target</code>/<code>--release</code>
argument recognized by <code>javac</code> and related tools</li>
</ul>
<p>The expected file updates are listed below. Additional files may need
to be updated for a particular release.</p>
<h3 id="meta-data-files">Meta-data files</h3>
<ul>
<li><code>jcheck/conf</code>: update meta-data used by
<code>jcheck</code> and the Skara tooling</li>
<li><code>make/conf/version-numbers.conf</code>: update to meta-data
used in the build</li>
</ul>
<h3 id="src-files"><code>src</code> files</h3>
<ul>
<li><code>src/hotspot/share/classfile/classFileParser.cpp</code>: add a
<code>#define</code> for the new version</li>
<li><code>src/java.base/share/classes/java/lang/classfile/ClassFile.java</code>:
add a constant for the new class file format version</li>
<li><code>src/java.base/share/classes/java/lang/reflect/ClassFileFormatVersion.java</code>:
add an <code>enum</code> constant for the new class file format
version</li>
<li><code>src/java.compiler/share/classes/javax/lang/model/SourceVersion.java</code>:
add an <code>enum</code> constant for the new source version</li>
<li><code>src/java.compiler/share/classes/javax/lang/model/util/*</code>
visitors: Update <code>@SupportedSourceVersion</code> annotations to
latest value. Note this update is done in lieu of introducing another
set of visitors for each Java SE release.</li>
<li><code>src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java</code>:
add an <code>enum</code> constant for the new source version internal to
<code>javac</code></li>
<li><code>src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassFile.java</code>:
add an <code>enum</code> constant for the new class file format version
internal to <code>javac</code></li>
<li><code>src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java</code>:
add an <code>enum</code> constant for the new target version internal to
<code>javac</code></li>
<li><code>src/jdk.compiler/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java</code>
update printing processor to support the new source version</li>
<li>The symbol information for <code>--release</code> is stored as new
text files in the <code>src/jdk.compiler/share/data/symbols</code>
directory, one file per module. The README file in that directory
contains directions on how to create the files.</li>
</ul>
<h3 id="test-files"><code>test</code> files</h3>
<ul>
<li><code>test/langtools/tools/javac/api/TestGetSourceVersions.java</code>:
add new <code>SourceVersion</code> constant to test matrix.</li>
<li><code>test/langtools/tools/javac/classfiles/ClassVersionChecker.java</code>:
add new enum constant for the new class file version</li>
<li><code>test/langtools/tools/javac/lib/JavacTestingAbstractProcessor.java</code>
update annotation processor extended by <code>javac</code> tests to
cover the new source version</li>
<li><code>test/langtools/tools/javac/preview/classReaderTest/Client.nopreview.out</code>
and
<code>test/langtools/tools/javac/preview/classReaderTest/Client.preview.out</code>:
update expected messages for preview errors and warnings</li>
</ul>
</body>
</html>

View File

@@ -1,68 +0,0 @@
% Explanation of start of release changes
## Overview
The start of release changes, the changes that turn JDK _N_ into JDK
(_N_+1), are primarily small updates to various files along with new files to
store symbol information to allow `javac --release N ...` to run on
JDK (_N_+1).
The updates include changes to files holding meta-data about the
release, files under the `src` directory for API and tooling updates,
and incidental updates under the `test` directory.
## Details and file updates
As a matter of policy, there are a number of semantically distinct
concepts which get incremented separately at the start of a new
release:
* Feature value of `Runtime.version()`
* Highest source version modeled by `javax.lang.model.SourceVersion`
* Highest class file format major version recognized by the platform
* Highest `-source`/`-target`/`--release` argument recognized by
`javac` and related tools
The expected file updates are listed below. Additional files may need
to be updated for a particular release.
### Meta-data files
* `jcheck/conf`: update meta-data used by `jcheck` and the Skara tooling
* `make/conf/version-numbers.conf`: update to meta-data used in the build
### `src` files
* `src/hotspot/share/classfile/classFileParser.cpp`: add a `#define`
for the new version
* `src/java.base/share/classes/java/lang/classfile/ClassFile.java`:
add a constant for the new class file format version
* `src/java.base/share/classes/java/lang/reflect/ClassFileFormatVersion.java`:
add an `enum` constant for the new class file format version
* `src/java.compiler/share/classes/javax/lang/model/SourceVersion.java`:
add an `enum` constant for the new source version
* `src/java.compiler/share/classes/javax/lang/model/util/*` visitors: Update
`@SupportedSourceVersion` annotations to latest value. Note this update
is done in lieu of introducing another set of visitors for each Java
SE release.
* `src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java`:
add an `enum` constant for the new source version internal to `javac`
* `src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassFile.java`:
add an `enum` constant for the new class file format version internal to `javac`
* `src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java`:
add an `enum` constant for the new target version internal to `javac`
* `src/jdk.compiler/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java`
update printing processor to support the new source version
* The symbol information for `--release` is stored as new text files in the
`src/jdk.compiler/share/data/symbols` directory, one file per
module. The README file in that directory contains directions on how
to create the files.
### `test` files
* `test/langtools/tools/javac/api/TestGetSourceVersions.java`: add new `SourceVersion` constant to test matrix.
* `test/langtools/tools/javac/classfiles/ClassVersionChecker.java`: add new enum constant for the new class file version
* `test/langtools/tools/javac/lib/JavacTestingAbstractProcessor.java`
update annotation processor extended by `javac` tests to cover the new source version
* `test/langtools/tools/javac/preview/classReaderTest/Client.nopreview.out` and `test/langtools/tools/javac/preview/classReaderTest/Client.preview.out`: update expected messages for preview errors and warnings

View File

@@ -72,12 +72,6 @@ id="toc-notes-for-specific-tests">Notes for Specific Tests</a>
<li><a href="#non-us-locale" id="toc-non-us-locale">Non-US
locale</a></li>
<li><a href="#pkcs11-tests" id="toc-pkcs11-tests">PKCS11 Tests</a></li>
<li><a href="#testing-ahead-of-time-optimizations"
id="toc-testing-ahead-of-time-optimizations">Testing Ahead-of-time
Optimizations</a></li>
<li><a href="#testing-with-alternative-security-providers"
id="toc-testing-with-alternative-security-providers">Testing with
alternative security providers</a></li>
<li><a href="#client-ui-tests" id="toc-client-ui-tests">Client UI
Tests</a></li>
</ul></li>
@@ -414,13 +408,6 @@ instrumentation
special target <code>jcov-test</code> instead of <code>test</code>, e.g.
<code>make jcov-test TEST=jdk_lang</code>. This will make sure the JCov
image is built, and that JCov reporting is enabled.</p>
<p>To include JCov coverage for just a subset of all modules, you can
use the <code>--with-jcov-modules</code> arguments to
<code>configure</code>, e.g.
<code>--with-jcov-modules=jdk.compiler,java.desktop</code>.</p>
<p>For more fine-grained control, you can pass arbitrary filters to JCov
using <code>--with-jcov-filters</code>, and you can specify a specific
JDK to instrument using <code>--with-jcov-input-jdk</code>.</p>
<p>The JCov report is stored in
<code>build/$BUILD/test-results/jcov-output/report</code>.</p>
<p>Please note that running with JCov reporting can be very memory
@@ -433,9 +420,6 @@ the diff between the specified revision and the repository tip.</p>
<p>The report is stored in
<code>build/$BUILD/test-results/jcov-output/diff_coverage_report</code>
file.</p>
<h4 id="aot_jdk">AOT_JDK</h4>
<p>See <a href="#testing-ahead-of-time-optimizations">Testing
Ahead-of-time optimizations</a>.</p>
<h3 id="jtreg-keywords">JTReg keywords</h3>
<h4 id="jobs-1">JOBS</h4>
<p>The test concurrency (<code>-concurrency</code>).</p>
@@ -450,7 +434,7 @@ GB/2</em>.</p>
<p>Sets the argument <code>-timeoutHandlerTimeout</code> for JTReg. The
default value is 0. This is only valid if the failure handler is
built.</p>
<h4 id="test_thread_factory">TEST_THREAD_FACTORY</h4>
<h4 id="jtreg_test_thread_factory">JTREG_TEST_THREAD_FACTORY</h4>
<p>Sets the <code>-testThreadFactory</code> for JTReg. It should be the
fully qualified classname of a class which implements
<code>java.util.concurrent.ThreadFactory</code>. One such implementation
@@ -458,12 +442,6 @@ class, named Virtual, is currently part of the JDK build in the
<code>test/jtreg_test_thread_factory/</code> directory. This class gets
compiled during the test image build. The implementation of the Virtual
class creates a new virtual thread for executing each test class.</p>
<h4 id="jvmti_stress_agent">JVMTI_STRESS_AGENT</h4>
<p>Executes JTReg tests with JVM TI stress agent. The stress agent is
the part of test library and located in
<code>test/lib/jdk/test/lib/jvmti/libJvmtiStressAgent.cpp</code>. The
value of this argument is set as JVM TI agent options. This mode uses
ProblemList-jvmti-stress-agent.txt as an additional exclude list.</p>
<h4 id="test_mode">TEST_MODE</h4>
<p>The test mode (<code>agentvm</code> or <code>othervm</code>).</p>
<p>Defaults to <code>agentvm</code>.</p>
@@ -563,12 +541,6 @@ each fork. Same as specifying <code>-wi &lt;num&gt;</code>.</p>
same values as <code>-rff</code>, i.e., <code>text</code>,
<code>csv</code>, <code>scsv</code>, <code>json</code>, or
<code>latex</code>.</p>
<h4 id="test_jdk">TEST_JDK</h4>
<p>The path to the JDK that will be used to run the benchmarks.</p>
<p>Defaults to <code>build/&lt;CONF-NAME&gt;/jdk</code>.</p>
<h4 id="benchmarks_jar">BENCHMARKS_JAR</h4>
<p>The path to the JAR containing the benchmarks.</p>
<p>Defaults to <code>test/micro/benchmarks.jar</code>.</p>
<h4 id="vm_options-2">VM_OPTIONS</h4>
<p>Additional VM arguments to provide to forked off VMs. Same as
<code>-jvmArgs &lt;args&gt;</code></p>
@@ -614,49 +586,6 @@ element of the appropriate <code>@Artifact</code> class. (See
JTREG=&quot;JAVA_OPTIONS=-Djdk.test.lib.artifacts.nsslib-linux_aarch64=/path/to/NSS-libs&quot;</code></pre>
<p>For more notes about the PKCS11 tests, please refer to
test/jdk/sun/security/pkcs11/README.</p>
<h3 id="testing-ahead-of-time-optimizations">Testing Ahead-of-time
Optimizations</h3>
<p>One way to improve test coverage of ahead-of-time (AOT) optimizations
in the JDK is to run existing jtreg test cases in a special "AOT_JDK"
mode. Example:</p>
<pre><code>$ make test JTREG=&quot;AOT_JDK=onestep&quot; \
TEST=open/test/hotspot/jtreg/runtime/invokedynamic</code></pre>
<p>In this testing mode, we first perform an AOT training run (see
https://openjdk.org/jeps/483) of a special test program (<a
href="../test/setup_aot/TestSetupAOT.java">test/setup_aot/TestSetupAOT.java</a>)
that accesses about 5,0000 classes in the JDK core libraries.
Optimization artifacts for these classes (such as pre-linked lambda
expressions, execution profiles, and pre-generated native code) are
stored into an AOT cache file, which will be used by all the JVMs
launched by the selected jtreg test cases.</p>
<p>When the jtreg tests call into the core libraries classes that are in
the AOT cache, we will be able to test the AOT optimizations that were
used on those classes.</p>
<p>Please note that not all existing jtreg test cases can be executed
with the AOT_JDK mode. See <a
href="../test/hotspot/jtreg/ProblemList-AotJdk.txt">test/hotspot/jtreg/ProblemList-AotJdk.txt</a>
and <a
href="../test/jdk/ProblemList-AotJdk.txt">test/jdk/ProblemList-AotJdk.txt</a>.</p>
<p>Also, test cases that were written specifically to test AOT, such as
the tests under <a
href="../test/hotspot/jtreg/runtime/cds/">test/hotspot/jtreg/runtime/cds</a>,
cannot be executed with the AOT_JDK mode.</p>
<p>Valid values for <code>AOT_JDK</code> are <code>onestep</code> and
<code>twostep</code>. These control how the AOT cache is generated. See
https://openjdk.org/jeps/514 for details. All other values are
ignored.</p>
<h3 id="testing-with-alternative-security-providers">Testing with
alternative security providers</h3>
<p>Some security tests use a hardcoded provider for
<code>KeyFactory</code>, <code>Cipher</code>,
<code>KeyPairGenerator</code>, <code>KeyGenerator</code>,
<code>AlgorithmParameterGenerator</code>, <code>KeyAgreement</code>,
<code>Mac</code>, <code>MessageDigest</code>, <code>SecureRandom</code>,
<code>Signature</code>, <code>AlgorithmParameters</code>,
<code>Configuration</code>, <code>Policy</code>, or
<code>SecretKeyFactory</code> objects. Specify the
<code>-Dtest.provider.name=NAME</code> property to use a different
provider for the service(s).</p>
<h3 id="client-ui-tests">Client UI Tests</h3>
<h4 id="system-key-shortcuts">System key shortcuts</h4>
<p>Some Client UI tests use key sequences which may be reserved by the

View File

@@ -345,14 +345,6 @@ The simplest way to run tests with JCov coverage report is to use the special
target `jcov-test` instead of `test`, e.g. `make jcov-test TEST=jdk_lang`. This
will make sure the JCov image is built, and that JCov reporting is enabled.
To include JCov coverage for just a subset of all modules, you can use the
`--with-jcov-modules` arguments to `configure`, e.g.
`--with-jcov-modules=jdk.compiler,java.desktop`.
For more fine-grained control, you can pass arbitrary filters to JCov using
`--with-jcov-filters`, and you can specify a specific JDK to instrument
using `--with-jcov-input-jdk`.
The JCov report is stored in `build/$BUILD/test-results/jcov-output/report`.
Please note that running with JCov reporting can be very memory intensive.
@@ -367,10 +359,6 @@ between the specified revision and the repository tip.
The report is stored in
`build/$BUILD/test-results/jcov-output/diff_coverage_report` file.
#### AOT_JDK
See [Testing Ahead-of-time optimizations](#testing-ahead-of-time-optimizations).
### JTReg keywords
#### JOBS
@@ -392,7 +380,7 @@ Defaults to 4.
Sets the argument `-timeoutHandlerTimeout` for JTReg. The default value is 0.
This is only valid if the failure handler is built.
#### TEST_THREAD_FACTORY
#### JTREG_TEST_THREAD_FACTORY
Sets the `-testThreadFactory` for JTReg. It should be the fully qualified
classname of a class which implements `java.util.concurrent.ThreadFactory`. One
@@ -401,13 +389,6 @@ the `test/jtreg_test_thread_factory/` directory. This class gets compiled
during the test image build. The implementation of the Virtual class creates a
new virtual thread for executing each test class.
#### JVMTI_STRESS_AGENT
Executes JTReg tests with JVM TI stress agent. The stress agent is the part of
test library and located in `test/lib/jdk/test/lib/jvmti/libJvmtiStressAgent.cpp`.
The value of this argument is set as JVM TI agent options.
This mode uses ProblemList-jvmti-stress-agent.txt as an additional exclude list.
#### TEST_MODE
The test mode (`agentvm` or `othervm`).
@@ -556,18 +537,6 @@ Amount of time to spend in each warmup iteration. Same as specifying `-w
Specify to have the test run save a log of the values. Accepts the same values
as `-rff`, i.e., `text`, `csv`, `scsv`, `json`, or `latex`.
#### TEST_JDK
The path to the JDK that will be used to run the benchmarks.
Defaults to `build/<CONF-NAME>/jdk`.
#### BENCHMARKS_JAR
The path to the JAR containing the benchmarks.
Defaults to `test/micro/benchmarks.jar`.
#### VM_OPTIONS
Additional VM arguments to provide to forked off VMs. Same as `-jvmArgs <args>`
@@ -634,52 +603,6 @@ $ make test TEST="jtreg:sun/security/pkcs11/Secmod/AddTrustedCert.java" \
For more notes about the PKCS11 tests, please refer to
test/jdk/sun/security/pkcs11/README.
### Testing Ahead-of-time Optimizations
One way to improve test coverage of ahead-of-time (AOT) optimizations in
the JDK is to run existing jtreg test cases in a special "AOT_JDK" mode.
Example:
```
$ make test JTREG="AOT_JDK=onestep" \
TEST=open/test/hotspot/jtreg/runtime/invokedynamic
```
In this testing mode, we first perform an AOT training run
(see https://openjdk.org/jeps/483) of a special test program
([test/setup_aot/TestSetupAOT.java](../test/setup_aot/TestSetupAOT.java))
that accesses about 5,0000 classes in the JDK core libraries.
Optimization artifacts for these classes (such as pre-linked
lambda expressions, execution profiles, and pre-generated native code)
are stored into an AOT cache file, which will be used by all the JVMs
launched by the selected jtreg test cases.
When the jtreg tests call into the core libraries classes that are in
the AOT cache, we will be able to test the AOT optimizations that were
used on those classes.
Please note that not all existing jtreg test cases can be executed with
the AOT_JDK mode. See
[test/hotspot/jtreg/ProblemList-AotJdk.txt](../test/hotspot/jtreg/ProblemList-AotJdk.txt)
and [test/jdk/ProblemList-AotJdk.txt](../test/jdk/ProblemList-AotJdk.txt).
Also, test cases that were written specifically to test AOT, such as the tests
under [test/hotspot/jtreg/runtime/cds](../test/hotspot/jtreg/runtime/cds/),
cannot be executed with the AOT_JDK mode.
Valid values for `AOT_JDK` are `onestep` and `twostep`. These control how
the AOT cache is generated. See https://openjdk.org/jeps/514 for details.
All other values are ignored.
### Testing with alternative security providers
Some security tests use a hardcoded provider for `KeyFactory`, `Cipher`,
`KeyPairGenerator`, `KeyGenerator`, `AlgorithmParameterGenerator`,
`KeyAgreement`, `Mac`, `MessageDigest`, `SecureRandom`, `Signature`,
`AlgorithmParameters`, `Configuration`, `Policy`, or `SecretKeyFactory` objects.
Specify the `-Dtest.provider.name=NAME` property to use a different provider for
the service(s).
### Client UI Tests
#### System key shortcuts

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2025, 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
@@ -23,9 +23,10 @@
# questions.
#
include MakeFileStart.gmk
default: all
################################################################################
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk
include MakeIO.gmk
@@ -42,6 +43,8 @@ ifeq ($(call isBuildOs, windows), true)
TAR_IGNORE_EXIT_VALUE := || test "$$$$?" = "1"
endif
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, Bundles-pre.gmk))
################################################################################
# BUNDLE : Name of bundle to create
# FILES : Files in BASE_DIRS to add to bundle
@@ -174,11 +177,9 @@ else
JRE_IMAGE_HOMEDIR := $(JRE_IMAGE_DIR)
JDK_BUNDLE_SUBDIR := jdk-$(VERSION_NUMBER)
JRE_BUNDLE_SUBDIR := jre-$(VERSION_NUMBER)
STATIC_JDK_BUNDLE_SUBDIR := static-jdk-$(VERSION_NUMBER)
ifneq ($(DEBUG_LEVEL), release)
JDK_BUNDLE_SUBDIR := $(JDK_BUNDLE_SUBDIR)/$(DEBUG_LEVEL)
JRE_BUNDLE_SUBDIR := $(JRE_BUNDLE_SUBDIR)/$(DEBUG_LEVEL)
STATIC_JDK_BUNDLE_SUBDIR := $(STATIC_JDK_BUNDLE_SUBDIR)/$(DEBUG_LEVEL)
endif
# In certain situations, the JDK_IMAGE_DIR points to an image without the
# the symbols and demos. If so, the symobls and demos can be found in a
@@ -244,10 +245,7 @@ ifneq ($(filter product-bundles% legacy-bundles, $(MAKECMDGOALS)), )
)
JDK_SYMBOLS_BUNDLE_FILES := \
$(filter-out \
%.stripped.pdb, \
$(call FindFiles, $(SYMBOLS_IMAGE_DIR)) \
)
$(call FindFiles, $(SYMBOLS_IMAGE_DIR))
TEST_DEMOS_BUNDLE_FILES := $(filter $(JDK_DEMOS_IMAGE_HOMEDIR)/demo/%, \
$(ALL_JDK_DEMOS_FILES))
@@ -286,7 +284,7 @@ ifneq ($(filter product-bundles% legacy-bundles, $(MAKECMDGOALS)), )
ifeq ($(MACOSX_CODESIGN_MODE), hardened)
# Macosx release build and code signing available.
############################################################################
################################################################################
# JDK bundle
$(eval $(call SetupCopyFiles, CREATE_JDK_BUNDLE_DIR_SIGNED, \
SRC := $(JDK_IMAGE_DIR), \
@@ -315,7 +313,7 @@ ifneq ($(filter product-bundles% legacy-bundles, $(MAKECMDGOALS)), )
PRODUCT_TARGETS += $(BUILD_JDK_BUNDLE)
############################################################################
################################################################################
# JRE bundle
$(eval $(call SetupCopyFiles, CREATE_JRE_BUNDLE_DIR_SIGNED, \
SRC := $(JRE_IMAGE_DIR), \
@@ -502,20 +500,10 @@ ifneq ($(filter static-libs-graal-bundles, $(MAKECMDGOALS)), )
STATIC_LIBS_GRAAL_TARGETS += $(BUILD_STATIC_LIBS_GRAAL_BUNDLE)
endif
#################################################################################
################################################################################
ifneq ($(filter static-jdk-bundles, $(MAKECMDGOALS)), )
STATIC_JDK_BUNDLE_FILES := $(call FindFiles, $(STATIC_JDK_IMAGE_DIR))
$(eval $(call SetupBundleFile, BUILD_STATIC_JDK_BUNDLE, \
BUNDLE_NAME := $(STATIC_JDK_BUNDLE_NAME), \
FILES := $(STATIC_JDK_BUNDLE_FILES), \
BASE_DIRS := $(STATIC_JDK_IMAGE_DIR), \
SUBDIR := $(STATIC_JDK_BUNDLE_SUBDIR), \
))
STATIC_JDK_TARGETS += $(BUILD_STATIC_JDK_BUNDLE)
endif
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, Bundles.gmk))
################################################################################
@@ -527,13 +515,8 @@ docs-javase-bundles: $(DOCS_JAVASE_TARGETS)
docs-reference-bundles: $(DOCS_REFERENCE_TARGETS)
static-libs-bundles: $(STATIC_LIBS_TARGETS)
static-libs-graal-bundles: $(STATIC_LIBS_GRAAL_TARGETS)
static-jdk-bundles: $(STATIC_JDK_TARGETS)
jcov-bundles: $(JCOV_TARGETS)
.PHONY: product-bundles test-bundles \
.PHONY: all default product-bundles test-bundles \
docs-jdk-bundles docs-javase-bundles docs-reference-bundles \
static-libs-bundles static-libs-graal-bundles static-jdk-bundles jcov-bundles
################################################################################
include MakeFileEnd.gmk
static-libs-bundles static-libs-graal-bundles jcov-bundles

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,10 @@
# questions.
#
include MakeFileStart.gmk
default: all
################################################################################
include $(SPEC)
include MakeBase.gmk
# When FIXPATH is set, let it process the file to make sure all paths are usable
# by system native tools. The FIXPATH tool assumes arguments preceded by an @
@@ -49,6 +50,6 @@ $(OUTPUTDIR)/compile_commands.json: $(wildcard $(MAKESUPPORT_OUTPUTDIR)/compile-
TARGETS += $(OUTPUTDIR)/compile_commands.json
################################################################################
all: $(TARGETS)
include MakeFileEnd.gmk
.PHONY: all

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2025, 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,17 +23,23 @@
# questions.
#
include MakeFileStart.gmk
################################################################################
# Build demos for the JDK into $(SUPPORT_OUTPUTDIR)/demos/image.
################################################################################
default: all
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk
include JavaCompilation.gmk
include TextFileProcessing.gmk
include ZipArchive.gmk
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, CompileDemos-pre.gmk))
# Prepare the find cache.
DEMO_SRC_DIRS += $(TOPDIR)/src/demo
@@ -126,19 +132,12 @@ define SetupBuildDemoBody
JARMAIN := $$($1_MAIN_CLASS), \
MANIFEST := $(DEMO_MANIFEST), \
EXTRA_MANIFEST_ATTR := $$($1_EXTRA_MANIFEST_ATTR), \
SRCZIP := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1/src.zip, \
EXCLUDE_FILES := $$($1_EXCLUDE_FILES), \
DISABLED_WARNINGS := $$($1_DISABLED_WARNINGS), \
))
$1 += $$(BUILD_DEMO_$1)
$$(eval $$(call SetupZipArchive, ZIP_SRC_DEMO_$1, \
SRC := $$($1_MAIN_SRC) $$($1_EXTRA_SRC_DIR), \
ZIP := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1/src.zip, \
EXCLUDE_FILES := $$($1_EXCLUDE_FILES), \
))
$1 += $$(ZIP_SRC_DEMO_$1)
endif
# Copy files. Sort is needed to remove duplicates.
@@ -258,8 +257,11 @@ ifneq ($(filter images, $(MAKECMDGOALS)), )
IMAGES_TARGETS := $(COPY_TO_TEST_IMAGE)
endif
################################################################################
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, CompileDemos-post.gmk))
all: $(TARGETS)
images: $(IMAGES_TARGETS)
################################################################################
include MakeFileEnd.gmk
.PHONY: all

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2025, 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
@@ -23,9 +23,11 @@
# questions.
#
include MakeFileStart.gmk
# This must be the first rule
default: all
################################################################################
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk
include JavaCompilation.gmk
@@ -63,7 +65,7 @@ $(BUILDTOOLS_OUTPUTDIR)/gensrc/java.compiler.interim/javax/tools/ToolProvider.ja
$(SED) $(INTERIM_TOOL_PROVIDER_PATTERN) $< > $@
java.compiler.interim_EXTRA_FILES := \
$(BUILDTOOLS_OUTPUTDIR)/gensrc/java.compiler.interim/javax/tools/ToolProvider.java
$(BUILDTOOLS_OUTPUTDIR)/gensrc/java.compiler.interim/javax/tools/ToolProvider.java
TARGETS += $(BUILDTOOLS_OUTPUTDIR)/gensrc/java.compiler.interim/javax/tools/ToolProvider.java
@@ -95,16 +97,14 @@ define SetupInterimModule
SRC := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim \
$$(wildcard $(SUPPORT_OUTPUTDIR)/gensrc/$1) \
$(TOPDIR)/src/$1/share/classes, \
EXCLUDES := sun, \
EXCLUDES := sun javax/tools/snippet-files, \
EXCLUDE_FILES := $(TOPDIR)/src/$1/share/classes/module-info.java \
$(TOPDIR)/src/$1/share/classes/javax/tools/ToolProvider.java \
$(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/Main.java \
$(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/MemoryClassLoader.java \
$(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/MemoryContext.java \
$(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/MemoryModuleFinder.java \
$(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/SourceLauncher.java \
Standard.java, \
EXCLUDE_PATTERNS := -files, \
EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java \
$($1.interim_EXTRA_FILES), \
COPY := .gif .png .xml .css .svg .js .js.template .txt .woff .woff2 javax.tools.JavaCompilerTool, \
@@ -148,4 +148,5 @@ TARGETS += $(BUILD_JAVAC_SERVER)
################################################################################
include MakeFileEnd.gmk
all: $(TARGETS)

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -23,12 +23,13 @@
# questions.
#
include MakeFileStart.gmk
# This must be the first rule
default: all
################################################################################
include JavaCompilation.gmk
include $(SPEC)
include MakeBase.gmk
include Modules.gmk
include JavaCompilation.gmk
################################################################################
# If this is an imported module that has prebuilt classes, only compile
@@ -74,26 +75,18 @@ $(JDK_OUTPUTDIR)/modules/%_zh_HK.properties: $(JDK_OUTPUTDIR)/modules/%_zh_TW.pr
CreateHkTargets = \
$(call FilterExcludedTranslations, \
$(patsubst $(TOPDIR)/src/%, $(JDK_OUTPUTDIR)/modules/%, \
$(subst /share/classes,, \
$(subst _zh_TW,_zh_HK, $(filter %_zh_TW.properties, $1)) \
) \
), \
.properties \
$(patsubst $(TOPDIR)/src/%, $(JDK_OUTPUTDIR)/modules/%, \
$(subst /share/classes,, \
$(subst _zh_TW,_zh_HK, $(filter %_zh_TW.properties, $1)) \
) \
), \
.properties \
)
################################################################################
# Include module specific build settings
THIS_SNIPPET := $(call GetModuleSnippetName, Java)
ifneq ($(wildcard $(THIS_SNIPPET)), )
include MakeSnippetStart.gmk
include $(THIS_SNIPPET)
include MakeSnippetEnd.gmk
endif
-include Java.gmk
################################################################################
# Setup the main compilation
@@ -113,9 +106,7 @@ $(eval $(call SetupJavaCompilation, $(MODULE), \
DISABLED_WARNINGS := $(DISABLED_WARNINGS_java), \
EXCLUDES := $(EXCLUDES), \
EXCLUDE_FILES := $(EXCLUDE_FILES), \
EXCLUDE_PATTERNS := -files, \
KEEP_ALL_TRANSLATIONS := $(KEEP_ALL_TRANSLATIONS), \
TARGET_RELEASE := $(TARGET_RELEASE), \
JAVAC_FLAGS := \
$(DOCLINT) \
$(JAVAC_FLAGS) \
@@ -157,4 +148,6 @@ endif
################################################################################
include MakeFileEnd.gmk
all: $(TARGETS)
.PHONY: all

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
# 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
@@ -23,12 +23,14 @@
# questions.
#
include MakeFileStart.gmk
default: all
include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
################################################################################
include JavaCompilation.gmk
TOOLS_CLASSES_DIR := $(BUILDTOOLS_OUTPUTDIR)/tools_jigsaw_classes
# When using an external BUILDJDK, make it possible to shortcut building of
@@ -62,4 +64,4 @@ TARGETS += $(BUILD_JIGSAW_TOOLS)
################################################################################
include MakeFileEnd.gmk
all: $(TARGETS)

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -23,12 +23,19 @@
# questions.
#
include MakeFileStart.gmk
# This must be the first rule
default: all
################################################################################
include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
TARGETS :=
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, hotspot/CompileTools.gmk))
################################################################################
# Build tools needed for the JFR source code generation
@@ -44,6 +51,7 @@ $(eval $(call SetupJavaCompilation, BUILD_TOOLS_HOTSPOT, \
TARGETS += $(BUILD_TOOLS_HOTSPOT)
################################################################################
include MakeFileEnd.gmk
all: $(TARGETS)
.PHONY: all

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2025, 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,14 +23,21 @@
# questions.
#
include MakeFileStart.gmk
default: all
################################################################################
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk
include JavaCompilation.gmk
include TextFileProcessing.gmk
################################################################################
$(eval $(call IncludeCustomExtension, CompileTools.gmk))
################################################################################
# Use += to be able to add to this from a custom extension
BUILD_TOOLS_SRC_DIRS += \
$(TOPDIR)/make/jdk/src/classes \
@@ -45,7 +52,8 @@ $(eval $(call SetupJavaCompilation, BUILD_TOOLS_JDK, \
build/tools/deps \
build/tools/docs \
build/tools/jigsaw \
build/tools/depend, \
build/tools/depend \
, \
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes, \
DISABLED_WARNINGS := dangling-doc-comments options, \
JAVAC_FLAGS := \
@@ -58,19 +66,17 @@ $(eval $(call SetupJavaCompilation, BUILD_TOOLS_JDK, \
TARGETS += $(BUILD_TOOLS_JDK)
$(eval $(call SetupCopyFiles, COPY_NIMBUS_TEMPLATES, \
$(eval $(call SetupCopyFiles,COPY_NIMBUS_TEMPLATES, \
SRC := $(TOPDIR)/src/java.desktop/share/classes/javax/swing/plaf/nimbus, \
DEST := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes/build/tools/generatenimbus/resources, \
FILES := $(wildcard $(TOPDIR)/src/java.desktop/share/classes/javax/swing/plaf/nimbus/*.template), \
))
FILES := $(wildcard $(TOPDIR)/src/java.desktop/share/classes/javax/swing/plaf/nimbus/*.template)))
TARGETS += $(COPY_NIMBUS_TEMPLATES)
$(eval $(call SetupCopyFiles, COPY_CLDRCONVERTER_PROPERTIES, \
$(eval $(call SetupCopyFiles,COPY_CLDRCONVERTER_PROPERTIES, \
SRC := $(TOPDIR)/make/jdk/src/classes/build/tools/cldrconverter, \
DEST := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes/build/tools/cldrconverter, \
FILES := $(wildcard $(TOPDIR)/make/jdk/src/classes/build/tools/cldrconverter/*.properties), \
))
FILES := $(wildcard $(TOPDIR)/make/jdk/src/classes/build/tools/cldrconverter/*.properties)))
TARGETS += $(COPY_CLDRCONVERTER_PROPERTIES)
@@ -153,6 +159,4 @@ ifeq ($(ENABLE_PANDOC), true)
TARGETS += $(PANDOC_HTML_MANPAGE_FILTER_SETUP)
endif
################################################################################
include MakeFileEnd.gmk
all: $(TARGETS)

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2015, 2019, 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,12 +23,13 @@
# questions.
#
include MakeFileStart.gmk
################################################################################
# This makefile is called for every imported module to copy the non class
# contents into the exploded jdk image.
################################################################################
default: all
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk
@@ -102,6 +103,4 @@ ifneq ($(CONF_DIR), )
TARGETS += $(COPY_CONF)
endif
################################################################################
include MakeFileEnd.gmk
all: $(TARGETS)

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2019, 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,12 +23,15 @@
# questions.
#
include MakeFileStart.gmk
default: all
################################################################################
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk
##########################################################################################
### TZDB tool needs files from java.time.zone package
define tzdb_copyfiles
@@ -38,17 +41,12 @@ define tzdb_copyfiles
< $(<) > $@
endef
$(eval $(call SetupCopyFiles, COPY_INTERIM_TZDB, \
$(eval $(call SetupCopyFiles,COPY_INTERIM_TZDB, \
SRC := $(TOPDIR)/src/java.base/share/classes/java/time/zone, \
DEST := $(BUILDTOOLS_OUTPUTDIR)/interim_tzdb_classes/build/tools/tzdb, \
FILES := ZoneRules.java ZoneOffsetTransition.java ZoneOffsetTransitionRule.java Ser.java, \
MACRO := tzdb_copyfiles, \
))
MACRO := tzdb_copyfiles))
################################################################################
##########################################################################################
all: $(COPY_INTERIM_TZDB)
################################################################################
include MakeFileEnd.gmk

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2018, 2019, 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
@@ -22,7 +22,8 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
include MakeFileStart.gmk
include $(SPEC)
include MakeBase.gmk
################################################################################
@@ -34,33 +35,23 @@ else
JCOV_INPUT_IMAGE_DIR := $(JDK_IMAGE_DIR)
endif
JCOV_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/jcov
#moving instrumented jdk image in and out of jcov_temp because of CODETOOLS-7902299
JCOV_TEMP := $(JCOV_SUPPORT_DIR)/temp
ifneq ($(JCOV_MODULES), )
JCOV_MODULES_FILTER := $(foreach m, $(JCOV_MODULES), -include_module $m)
endif
JCOV_TEMP := $(SUPPORT_OUTPUTDIR)/jcov_temp
$(JCOV_IMAGE_DIR)/release: $(JCOV_INPUT_IMAGE_DIR)/release
$(call LogWarn, Creating instrumented jdk image with JCov)
$(call MakeDir, $(JCOV_TEMP) $(IMAGES_OUTPUTDIR))
$(RM) -r $(JCOV_IMAGE_DIR) $(JCOV_TEMP)/*
$(CP) -r $(JCOV_INPUT_IMAGE_DIR) $(JCOV_TEMP)/$(JCOV_IMAGE_SUBDIR)
$(call ExecuteWithLog, $(JCOV_SUPPORT_DIR)/run-jcov, \
$(JAVA) -Xmx3g -jar $(JCOV_HOME)/lib/jcov.jar JREInstr \
$(JAVA) -Xmx3g -jar $(JCOV_HOME)/lib/jcov.jar JREInstr \
-t $(JCOV_TEMP)/$(JCOV_IMAGE_SUBDIR)/template.xml \
-rt $(JCOV_HOME)/lib/jcov_network_saver.jar \
-exclude 'java.lang.Object' \
-exclude 'jdk.internal.org.objectweb.**' \
-exclude jdk.test.Main -exclude '**\$Proxy*' \
$(JCOV_MODULES_FILTER) $(JCOV_FILTERS) \
$(JCOV_TEMP)/$(JCOV_IMAGE_SUBDIR))
$(JCOV_FILTERS) \
$(JCOV_TEMP)/$(JCOV_IMAGE_SUBDIR)
$(MV) $(JCOV_TEMP)/$(JCOV_IMAGE_SUBDIR) $(JCOV_IMAGE_DIR)
$(RMDIR) $(JCOV_TEMP)
jcov-image: $(JCOV_IMAGE_DIR)/release
################################################################################
include MakeFileEnd.gmk

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 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
@@ -23,9 +23,10 @@
# questions.
#
include MakeFileStart.gmk
default: all
################################################################################
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk
include Execute.gmk
@@ -35,6 +36,8 @@ ifeq ($(MODULE), )
$(error MODULE must be set when calling CreateJmods.gmk)
endif
$(eval $(call IncludeCustomExtension, CreateJmods.gmk))
################################################################################
JMODS_DIR := $(IMAGES_OUTPUTDIR)/jmods
@@ -184,15 +187,7 @@ endif
################################################################################
# Include module specific build settings
THIS_SNIPPET := $(call GetModuleSnippetName, Jmod)
ifneq ($(wildcard $(THIS_SNIPPET)), )
include MakeSnippetStart.gmk
include $(THIS_SNIPPET)
include MakeSnippetEnd.gmk
endif
-include Jmod.gmk
# Set main class
ifneq ($(JMOD_FLAGS_main_class), )
@@ -234,21 +229,8 @@ ifeq ($(INTERIM_JMOD), true)
# Interim JMODs are not shipped anywhere, so there is no reason
# to compress them at all.
JMOD_FLAGS += --compress zip-0
JMOD_TARGET_OS := $(OPENJDK_BUILD_OS)
ifeq ($(JMOD_TARGET_OS), macosx)
JMOD_TARGET_OS := macos
endif
JMOD_TARGET_CPU := $(OPENJDK_BUILD_CPU)
ifeq ($(JMOD_TARGET_CPU), x86_64)
JMOD_TARGET_CPU := amd64
endif
JMOD_TARGET_PLATFORM := $(JMOD_TARGET_OS)-$(JMOD_TARGET_CPU)
else
JMOD_FLAGS += --compress $(JMOD_COMPRESS)
JMOD_TARGET_PLATFORM := $(OPENJDK_MODULE_TARGET_PLATFORM)
endif
# Create jmods in the support dir and then move them into place to keep the
@@ -260,7 +242,7 @@ $(eval $(call SetupExecute, create_$(JMOD_FILE), \
SUPPORT_DIR := $(JMODS_SUPPORT_DIR), \
PRE_COMMAND := $(RM) $(JMODS_DIR)/$(JMOD_FILE) $(JMODS_SUPPORT_DIR)/$(JMOD_FILE), \
COMMAND := $(JMOD) $(JMOD_SMALL_FLAGS) create --module-version $(VERSION_SHORT) \
--target-platform '$(JMOD_TARGET_PLATFORM)' \
--target-platform '$(OPENJDK_MODULE_TARGET_PLATFORM)' \
--module-path $(JMODS_DIR) $(JMOD_FLAGS) \
--date $(SOURCE_DATE_ISO_8601) \
$(JMODS_SUPPORT_DIR)/$(JMOD_FILE), \
@@ -271,4 +253,6 @@ TARGETS += $(create_$(JMOD_FILE))
################################################################################
include MakeFileEnd.gmk
all: $(TARGETS)
################################################################################

View File

@@ -1,4 +1,4 @@
# Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1997, 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
@@ -22,7 +22,26 @@
# questions.
#
include MakeFileStart.gmk
default: all
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk
include Execute.gmk
include Modules.gmk
include ModuleTools.gmk
include ProcessMarkdown.gmk
include ToolsJdk.gmk
include ZipArchive.gmk
include TextFileProcessing.gmk
# This is needed to properly setup DOCS_MODULES.
$(eval $(call ReadImportMetaData))
################################################################################
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, Docs.gmk))
################################################################################
# This file generates all documentation for OpenJDK.
@@ -35,19 +54,7 @@ include MakeFileStart.gmk
#
# We will also generate separate, free-standing specifications from either
# markdown or existing html files.
################################################################################
include CopyFiles.gmk
include Execute.gmk
include Modules.gmk
include ProcessMarkdown.gmk
include TextFileProcessing.gmk
include ZipArchive.gmk
include $(TOPDIR)/make/ModuleTools.gmk
include $(TOPDIR)/make/ToolsJdk.gmk
# This is needed to properly setup DOCS_MODULES.
$(eval $(call ReadImportMetaData))
#
################################################################################
# Javadoc settings
@@ -92,17 +99,23 @@ REFERENCE_TAGS := $(JAVADOC_TAGS)
JAVADOC_DISABLED_DOCLINT_WARNINGS := missing
JAVADOC_DISABLED_DOCLINT_PACKAGES := org.w3c.* javax.smartcardio
# Allow overriding on the command line
# (intentionally sharing name with the javac option)
JAVA_WARNINGS_ARE_ERRORS ?= -Werror
# The initial set of options for javadoc
JAVADOC_OPTIONS := -use -keywords -notimestamp \
-serialwarn -encoding utf-8 -docencoding utf-8 -breakiterator \
-encoding ISO-8859-1 -docencoding UTF-8 -breakiterator \
-splitIndex --system none -javafx --expand-requires transitive \
--override-methods=summary
--override-methods=summary \
--no-external-specs-page
# The reference options must stay stable to allow for comparisons across the
# development cycle.
REFERENCE_OPTIONS := -XDignore.symbol.file=true -use -keywords -notimestamp \
-serialwarn -encoding utf-8 -breakiterator -splitIndex --system none \
-html5 -javafx --expand-requires transitive
-encoding ISO-8859-1 -breakiterator -splitIndex --system none \
-html5 -javafx --expand-requires transitive \
--no-external-specs-page
# Should we add DRAFT stamps to the generated javadoc?
ifeq ($(VERSION_IS_GA), true)
@@ -234,10 +247,10 @@ define create_overview_file
<!DOCTYPE html> \
<html><head></head><body> \
#
ifneq ($$($1_GROUPS), )
ifneq ($$($1_GROUPS),)
$1_OVERVIEW_TEXT += \
<p>This document has \
$$(subst 2,two,$$(subst 3,three,$$(words $$($1_GROUPS)))) major sections:</p> \
<p>This document is divided into \
$$(subst 2,two,$$(subst 3,three,$$(words $$($1_GROUPS)))) sections:</p> \
<blockquote><dl> \
#
$1_OVERVIEW_TEXT += $$(foreach g, $$($1_GROUPS), \
@@ -246,10 +259,7 @@ define create_overview_file
)
$1_OVERVIEW_TEXT += \
</dl></blockquote> \
<p><a href="../specs/index.html">Related documents</a> specify the Java \
programming language, the Java Virtual Machine, various protocols and file \
formats pertaining to the Java platform, and tools included in the JDK.</p> \
#
#
endif
$1_OVERVIEW_TEXT += \
</body></html> \
@@ -263,7 +273,7 @@ define create_overview_file
$$($1_OVERVIEW): $$($1_OVERVIEW_VARDEPS_FILE)
$$(call LogInfo, Creating overview.html for $1)
$$(call MakeDir, $$(@D))
$$(PRINTF) "%s" '$$($1_OVERVIEW_TEXT)' > $$@
$$(PRINTF) > $$@ '$$($1_OVERVIEW_TEXT)'
endef
################################################################################
@@ -321,9 +331,7 @@ define SetupApiDocsGenerationBody
# Ignore the doclint warnings in certain packages
$1_OPTIONS += -Xdoclint/package:$$(call CommaList, $$(addprefix -, \
$$(JAVADOC_DISABLED_DOCLINT_PACKAGES)))
ifeq ($$(JAVA_WARNINGS_AS_ERRORS), true)
$1_OPTIONS += -Werror
endif
$1_OPTIONS += $$(JAVA_WARNINGS_ARE_ERRORS)
$1_DOC_TITLE := $$($1_LONG_NAME)<br>Version $$(VERSION_SPECIFICATION) API \
Specification
@@ -543,9 +551,7 @@ $(eval $(call SetupApiDocsGeneration, REFERENCE_API, \
# Format: space-delimited list of names, including at most one '%' as a
# wildcard. Spec source files match if their filename or any enclosing folder
# name matches one of the items in SPEC_FILTER.
ifeq ($(SPEC_FILTER), )
SPEC_FILTER := %
endif
SPEC_FILTER := %
ApplySpecFilter = \
$(strip $(foreach file, $(1), \
@@ -676,7 +682,7 @@ ifeq ($(ENABLE_PANDOC), true)
$(foreach m, $(ALL_MODULES), \
$(eval MAN_$m := $(call ApplySpecFilter, $(filter %.md, $(call FindFiles, \
$(call FindModuleManDirsForDocs, $m))))) \
$(call FindModuleManDirs, $m))))) \
$(if $(MAN_$m), \
$(eval $(call SetupProcessMarkdown, MAN_TO_HTML_$m, \
FILES := $(MAN_$m), \
@@ -708,7 +714,7 @@ SPEC_HEADER_BLOCK := \
<div class="navbar"> \
<div>$(HEADER_RIGHT_SIDE_INFO)</div> \
<nav><ul><li><a href="PATH_TO_SPECS/../api/index.html">API</a> \
<li><a href="PATH_TO_SPECS/index.html">OTHER SPECIFICATIONS</a> \
<li><a href="PATH_TO_SPECS/index.html">OTHER SPECIFICATIONS \
<li><a href="PATH_TO_SPECS/man/index.html">TOOL GUIDES</a></ul></nav> \
</div> \
</header>
@@ -757,6 +763,10 @@ $(eval $(call SetupZipArchive, BUILD_JAVADOC_ZIP, \
ZIP_TARGETS += $(BUILD_JAVADOC_ZIP)
################################################################################
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, Docs-post.gmk))
################################################################################
# Bundles all generated specs into a zip archive, skipping javadocs.
@@ -798,11 +808,7 @@ all: docs-jdk-api-javadoc docs-jdk-api-graphs docs-javase-api-javadoc \
docs-reference-api-graphs docs-jdk-specs docs-jdk-index docs-zip \
docs-specs-zip
.PHONY: docs-jdk-api-javadoc docs-jdk-api-graphs \
.PHONY: default all docs-jdk-api-javadoc docs-jdk-api-graphs \
docs-javase-api-javadoc docs-javase-api-graphs \
docs-reference-api-javadoc docs-reference-api-graphs docs-jdk-specs \
docs-jdk-index docs-zip docs-specs-zip
################################################################################
include MakeFileEnd.gmk

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 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
@@ -23,11 +23,18 @@
# questions.
#
include MakeFileStart.gmk
default: all
include $(SPEC)
include MakeBase.gmk
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, Doctor.gmk))
################################################################################
#
# Help user diagnose possible errors and problems with the build environment.
################################################################################
#
prologue:
$(ECHO)
@@ -138,8 +145,4 @@ doctor: $(TARGETS)
all: doctor
.PHONY: doctor $(TARGETS)
################################################################################
include MakeFileEnd.gmk
.PHONY: default all doctor $(TARGETS)

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2019, 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,15 +23,17 @@
# questions.
#
include MakeFileStart.gmk
################################################################################
# Runs a tool on the exploded image to improve performance
################################################################################
default: all
include $(SPEC)
include MakeBase.gmk
include Execute.gmk
include $(TOPDIR)/make/ModuleTools.gmk
################################################################################
ALL_MODULEINFO_CLASSES := $(wildcard $(JDK_OUTPUTDIR)/modules/*/module-info.class)
$(eval $(call SetupExecute, optimize_image, \
@@ -45,4 +47,6 @@ TARGETS := $(optimize_image_TARGET)
################################################################################
include MakeFileEnd.gmk
all: $(TARGETS)
.PHONY: all default

View File

@@ -1,38 +0,0 @@
#
# Copyright (c) 2025, 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.
#
include MakeFileStart.gmk
################################################################################
# This makefile is a thin wrapper around FindTests.gmk, just to make FindTest
# fill the cache.
################################################################################
GENERATE_FIND_TESTS_FILE := true
include FindTests.gmk
################################################################################
include MakeFileEnd.gmk

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2025, 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
@@ -23,12 +23,15 @@
# questions.
#
include MakeFileStart.gmk
################################################################################
# Generate classlist
################################################################################
default: all
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk
include JavaCompilation.gmk
@@ -59,15 +62,6 @@ ifeq ($(EXTERNAL_BUILDJDK), true)
INTERIM_IMAGE_DIR := $(BUILD_JDK)
endif
# To make the classlist deterministic:
# - The classlist can be influenced by locale. Always set it to en/US.
# - Concurrency in the core libraries can cause constant pool resolution
# to be non-deterministic. Since the benefits of resolved CP references in the
# default classlist is minimal, let's filter out the '@cp' lines until we can
# find a proper solution.
CLASSLIST_FILE_VM_OPTS = \
-Duser.language=en -Duser.country=US
# Save the stderr output of the command and print it along with stdout in case
# something goes wrong.
$(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXECUTABLE_SUFFIX) $(CLASSLIST_JAR)
@@ -75,24 +69,18 @@ $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXECUTABLE_SUFFIX) $(CLASSLIST
$(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%, %, $@))
$(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%, %, $(JLI_TRACE_FILE)))
$(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@.raw \
$(CLASSLIST_FILE_VM_OPTS) \
-Xlog:aot=off \
-Xlog:cds=off \
-Duser.language=en -Duser.country=US \
-cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
build.tools.classlist.HelloClasslist $(LOG_DEBUG)
$(GREP) -v HelloClasslist $@.raw > $@.interim
$(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -Xshare:dump \
-Xlog:aot=off \
-Xlog:cds=off \
-XX:SharedClassListFile=$@.interim -XX:SharedArchiveFile=$@.jsa \
-Xmx128M -Xms128M $(LOG_INFO)
$(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@.raw.2 \
-XX:SharedClassListFile=$@.interim -XX:SharedArchiveFile=$@.jsa \
-Djava.lang.invoke.MethodHandle.TRACE_RESOLVE=true \
$(CLASSLIST_FILE_VM_OPTS) \
-Duser.language=en -Duser.country=US \
--module-path $(SUPPORT_OUTPUTDIR)/classlist.jar \
-Xlog:aot=off \
-Xlog:cds=off \
-cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
build.tools.classlist.HelloClasslist \
2> $(LINK_OPT_DIR)/stderr > $(JLI_TRACE_FILE) \
@@ -104,12 +92,9 @@ $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXECUTABLE_SUFFIX) $(CLASSLIST
exit $$exitcode \
)
$(GREP) -v HelloClasslist $@.raw.2 > $@.raw.3
$(GREP) -v @cp $@.raw.3 > $@.raw.4
$(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java \
-Xlog:aot=off \
-Xlog:cds=off \
-cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
build.tools.classlist.SortClasslist $@.raw.4 > $@
build.tools.classlist.SortClasslist $@.raw.3 > $@
# The jli trace is created by the same recipe as classlist. By declaring these
# dependencies, make will correctly rebuild both jli trace and classlist
@@ -153,4 +138,4 @@ TARGETS += $(COPY_JLI_TRACE)
################################################################################
include MakeFileEnd.gmk
all: $(TARGETS)

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,12 @@
# questions.
#
include MakeFileStart.gmk
# Default target declared first
default: all
################################################################################
include $(TOPDIR)/make/ModuleTools.gmk
include $(SPEC)
include MakeBase.gmk
include ModuleTools.gmk
GENGRAPHS_DIR := $(IMAGES_OUTPUTDIR)/gengraphs
SPEC_DOTFILES_DIR := $(GENGRAPHS_DIR)/spec-dotfiles
@@ -49,7 +50,3 @@ $(GENGRAPHS_DIR)/module-summary.html: $(BUILD_JIGSAW_TOOLS) $(GENGRAPHS_DIR)/tec
$(TOOL_MODULESUMMARY) -o $@ --module-path $(IMAGES_OUTPUTDIR)/jmods
all: $(GENGRAPHS_DIR)/jdk.dot $(GENGRAPHS_DIR)/module-summary.html $(SPEC_DOTFILES_DIR)/java.se.dot
################################################################################
include MakeFileEnd.gmk

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, 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
@@ -28,7 +28,7 @@
###
# Helper macro to allow $(info) to properly print strings beginning with spaces.
_ :=
_:=
help:
$(info )
@@ -102,15 +102,13 @@ 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 $(_) TEST_DEPS="dependency1 ..." # Specify additional dependencies for running tests, e.g docs-jdk)
$(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 $(_) ALLOW="FOO,BAR" # Do not warn that FOO and BAR are non-control variables)
$(info )
$(if $(all_confs), $(info Available configurations in $(build_dir):) $(foreach var,$(all_confs),$(info * $(var))), \
$(if $(all_confs), $(info Available configurations in $(build_dir):) $(foreach var,$(all_confs),$(info * $(var))),\
$(info No configurations were found in $(build_dir).) $(info Run 'bash configure' to create a configuration.))
# We need a dummy rule otherwise make will complain
@true
@@ -121,12 +119,12 @@ print-configurations:
@true
test-prebuilt:
@( cd $(TOPDIR) && \
@( cd $(topdir) && \
$(MAKE) --no-print-directory -r -R -I make/common/ -f make/RunTestsPrebuilt.gmk \
test-prebuilt CUSTOM_MAKE_DIR=$(CUSTOM_MAKE_DIR) TEST="$(TEST)" )
test-prebuilt-with-exit-code:
@( cd $(TOPDIR) && \
@( cd $(topdir) && \
$(MAKE) --no-print-directory -r -R -I make/common/ -f make/RunTestsPrebuilt.gmk \
test-prebuilt-with-exit-code CUSTOM_MAKE_DIR=$(CUSTOM_MAKE_DIR) TEST="$(TEST)" )

View File

@@ -23,15 +23,20 @@
# questions.
#
include MakeFileStart.gmk
################################################################################
# This makefile creates a jdk image overlaid with statically linked core
# libraries.
################################################################################
default: all
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk
################################################################################
TARGETS :=
$(eval $(call SetupCopyFiles, COPY_JDK_IMG, \
SRC := $(JDK_IMAGE_DIR)/, \
DEST := $(GRAAL_BUILDER_IMAGE_DIR)/, \
@@ -49,4 +54,6 @@ TARGETS += $(COPY_STATIC_LIBS)
################################################################################
include MakeFileEnd.gmk
all: $(TARGETS)
.PHONY: all

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2020, 2025, 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
@@ -23,14 +23,17 @@
# questions.
#
include MakeFileStart.gmk
default: all
include $(SPEC)
include MakeBase.gmk
include JdkNativeCompilation.gmk
################################################################################
# This makefile compiles and installs the hsdis library
#
################################################################################
include JdkNativeCompilation.gmk
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)
@@ -198,8 +201,8 @@ endif
TARGETS += install
.PHONY: build install
################################################################################
include MakeFileEnd.gmk
all: $(TARGETS)
.PHONY: all default build install

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2025, 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
@@ -23,12 +23,12 @@
# questions.
#
include MakeFileStart.gmk
default: all
################################################################################
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk
include DebugInfoUtils.gmk
include Execute.gmk
include Modules.gmk
include Utils.gmk
@@ -36,6 +36,9 @@ include Utils.gmk
JDK_TARGETS :=
JRE_TARGETS :=
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, Images-pre.gmk))
################################################################################
# All modules for the current target platform.
@@ -93,14 +96,6 @@ JLINK_DISABLE_WARNINGS := | ( $(GREP) -v -e "WARNING: Using incubator module" ||
JDK_IMAGE_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jdk
JRE_IMAGE_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jre
ifeq ($(JLINK_PRODUCE_LINKABLE_RUNTIME), true)
JLINK_JDK_EXTRA_OPTS += --generate-linkable-runtime
endif
ifneq ($(JLINK_USER_EXTRA_FLAGS), )
JLINK_JDK_EXTRA_OPTS += $(JLINK_USER_EXTRA_FLAGS)
endif
$(eval $(call SetupExecute, jlink_jdk, \
WARN := Creating jdk image, \
DEPS := $(JDK_JMODS) $(BASE_RELEASE_FILE) \
@@ -137,19 +132,13 @@ CDS_DUMP_FLAGS = -Xmx128M -Xms128M
# Helper function for creating the CDS archives for the JDK and JRE
#
# Param1 - VM variant (e.g., server, client, zero, ...)
# Param2 - _nocoops, _coh, _nocoops_coh, or empty
# Param2 - _nocoops, or empty
define CreateCDSArchive
$1_$2_COOPS_OPTION := $(if $(findstring _nocoops, $2),-XX:-UseCompressedOops)
# enable and also explicitly disable coh as needed.
ifeq ($(call isTargetCpuBits, 64), true)
$1_$2_COH_OPTION := -XX:+UnlockExperimentalVMOptions \
$(if $(findstring _coh, $2),-XX:+UseCompactObjectHeaders,-XX:-UseCompactObjectHeaders)
endif
$1_$2_DUMP_EXTRA_ARG := $$($1_$2_COOPS_OPTION) $$($1_$2_COH_OPTION)
$1_$2_DUMP_TYPE := $(if $(findstring _nocoops, $2),-NOCOOPS,)$(if $(findstring _coh, $2),-COH,)
$1_$2_DUMP_EXTRA_ARG := $(if $(filter _nocoops, $2),-XX:-UseCompressedOops,)
$1_$2_DUMP_TYPE := $(if $(filter _nocoops, $2),-NOCOOPS,)
# Only G1 supports dumping the shared heap, so explicitly use G1 if the JVM supports it.
$1_$2_CDS_DUMP_FLAGS := $(CDS_DUMP_FLAGS) $(if $(filter g1gc, $(JVM_FEATURES_$1)), -XX:+UseG1GC)
$1_$2_CDS_DUMP_FLAGS := $(CDS_DUMP_FLAGS) $(if $(filter g1gc, $(JVM_FEATURES_$1)),-XX:+UseG1GC)
ifeq ($(OPENJDK_TARGET_OS), windows)
$1_$2_CDS_ARCHIVE := bin/$1/classes$2.jsa
@@ -162,7 +151,7 @@ define CreateCDSArchive
endif
ifeq ($(DEBUG_CDS_ARCHIVE), true)
$1_$2_CDS_DUMP_FLAGS += -Xlog:aot+map*=trace:file=$$(JDK_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE).cdsmap:none:filesize=0
$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, \
@@ -201,14 +190,6 @@ ifeq ($(BUILD_CDS_ARCHIVE), true)
$(foreach v, $(JVM_VARIANTS), \
$(eval $(call CreateCDSArchive,$v,_nocoops)) \
)
ifeq ($(BUILD_CDS_ARCHIVE_COH), true)
$(foreach v, $(JVM_VARIANTS), \
$(eval $(call CreateCDSArchive,$v,_coh)) \
)
$(foreach v, $(JVM_VARIANTS), \
$(eval $(call CreateCDSArchive,$v,_nocoops_coh)) \
)
endif
endif
endif
@@ -254,7 +235,7 @@ endif
ifeq ($(GCOV_ENABLED), true)
$(eval $(call SetupCopyFiles, COPY_GCOV_GCNO, \
$(eval $(call SetupCopyFiles,COPY_GCOV_GCNO, \
SRC := $(OUTPUTDIR), \
DEST := $(SYMBOLS_IMAGE_DIR)/gcov, \
FILES := $(call FindFiles, $(HOTSPOT_OUTPUTDIR) \
@@ -270,7 +251,6 @@ endif
# Since debug symbols are not included in the jmod files, they need to be copied
# in manually after generating the images.
# These variables are read by SetupCopyDebuginfo
ALL_JDK_MODULES := $(JDK_MODULES)
ALL_JRE_MODULES := $(sort $(JRE_MODULES), $(foreach m, $(JRE_MODULES), \
$(call FindTransitiveDepsForModule, $m)))
@@ -283,6 +263,27 @@ else
endif
CMDS_TARGET_SUBDIR := bin
# Param 1 - dir to find debuginfo files in
FindDebuginfoFiles = \
$(wildcard $(addprefix $1/*, $(DEBUGINFO_SUFFIXES)) \
$(addprefix $1/*/*, $(DEBUGINFO_SUFFIXES)) \
$(addprefix $1/*/*/*, $(DEBUGINFO_SUFFIXES)))
# Pick the correct debug info files to copy, either zipped or not.
ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), true)
DEBUGINFO_SUFFIXES += .diz
else
DEBUGINFO_SUFFIXES := .debuginfo .pdb .map
# On Macosx, if debug symbols have not been zipped, find all files inside *.dSYM
# dirs.
ifeq ($(call isTargetOs, macosx), true)
$(call FillFindCache, \
$(SUPPORT_OUTPUTDIR)/modules_libs $(SUPPORT_OUTPUTDIR)/modules_cmds)
FindDebuginfoFiles = \
$(if $(wildcard $1), $(call containing, .dSYM/, $(call FindFiles, $1)))
endif
endif
# Param 1 - either JDK or JRE
SetupCopyDebuginfo = \
$(foreach m, $(ALL_$1_MODULES), \
@@ -310,6 +311,12 @@ $(call SetupCopyDebuginfo,SYMBOLS)
################################################################################
# Include custom post hook here to make it possible to augment the target lists
# before actual target prerequisites are declared.
$(eval $(call IncludeCustomExtension, Images-post.gmk))
################################################################################
$(JRE_TARGETS): $(JLINK_JRE_TARGETS)
$(JDK_TARGETS): $(JLINK_JDK_TARGETS)
@@ -319,8 +326,4 @@ symbols: $(SYMBOLS_TARGETS)
all: jdk jre symbols
.PHONY: jdk jre symbols
################################################################################
include MakeFileEnd.gmk
.PHONY: default all jdk jre symbols

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, 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
@@ -23,78 +23,263 @@
# questions.
#
include MakeFileStart.gmk
################################################################################
# Init.gmk sits between PreInit.gmk and Main.gmk when bootstrapping the build.
# It is called from PreInit.gmk, and its main responsibility is to launch
# Main.gmk with the proper make and the proper make arguments.
# PreMain.gmk has provided us with a proper SPEC. This allows us to use the
# value of $(MAKE) for all further make calls.
# This is the bootstrapping part of the build. This file is included from the
# top level Makefile, and is responsible for launching the Main.gmk file with
# the proper make and the proper make arguments.
################################################################################
# Our helper functions.
include $(TOPDIR)/make/InitSupport.gmk
include LogUtils.gmk
# This must be the first rule
default:
.PHONY: default
# Inclusion of this pseudo-target will cause make to execute this file
# serially, regardless of -j.
.NOTPARALLEL:
# Parse COMPARE_BUILD (for makefile development)
$(eval $(call ParseCompareBuild))
ifeq ($(HAS_SPEC),)
##############################################################################
# This is the default mode. We have not been recursively called with a SPEC.
##############################################################################
# Setup reproducible build environment
$(eval $(call SetupReproducibleBuild))
# Include our helper functions.
include $(topdir)/make/InitSupport.gmk
# If no LOG= was given on command line, but we have a non-standard default
# value, use that instead and re-parse log level.
ifeq ($(LOG), )
ifneq ($(DEFAULT_LOG), )
override LOG := $(DEFAULT_LOG)
$(eval $(call ParseLogLevel))
# Here are "global" targets, i.e. targets that can be executed without having
# a configuration. This will define ALL_GLOBAL_TARGETS.
include $(topdir)/make/Global.gmk
# Targets provided by Init.gmk.
ALL_INIT_TARGETS := print-modules print-targets print-configuration \
print-tests reconfigure pre-compare-build post-compare-build
# CALLED_TARGETS is the list of targets that the user provided,
# or "default" if unspecified.
CALLED_TARGETS := $(if $(MAKECMDGOALS), $(MAKECMDGOALS), default)
# Extract non-global targets that require a spec file.
CALLED_SPEC_TARGETS := $(filter-out $(ALL_GLOBAL_TARGETS), $(CALLED_TARGETS))
# If we have only global targets, or if we are called with -qp (assuming an
# external part, e.g. bash completion, is trying to understand our targets),
# we will skip SPEC location and the sanity checks.
ifeq ($(CALLED_SPEC_TARGETS), )
ONLY_GLOBAL_TARGETS := true
endif
ifeq ($(findstring p, $(MAKEFLAGS))$(findstring q, $(MAKEFLAGS)), pq)
ONLY_GLOBAL_TARGETS := true
endif
endif
ifeq ($(LOG_NOFILE), true)
# Disable build log if LOG=[level,]nofile was given
override BUILD_LOG_PIPE :=
override BUILD_LOG_PIPE_SIMPLE :=
endif
ifeq ($(ONLY_GLOBAL_TARGETS), true)
############################################################################
# We have only global targets, or are called with -pq.
############################################################################
ifeq ($(filter dist-clean, $(SEQUENTIAL_TARGETS)), dist-clean)
# We can't have a log file if we're about to remove it.
override BUILD_LOG_PIPE :=
override BUILD_LOG_PIPE_SIMPLE :=
endif
ifeq ($(wildcard $(SPEC)), )
# If we have no SPEC provided, we will just make a "best effort" target list.
# First try to grab any available pre-existing main-targets.gmk.
main_targets_file := $(firstword $(wildcard $(build_dir)/*/make-support/main-targets.gmk))
ifneq ($(main_targets_file), )
# Extract the SPEC that corresponds to this main-targets.gmk file.
SPEC := $(patsubst %/make-support/main-targets.gmk, %/spec.gmk, $(main_targets_file))
else
# None found, pick an arbitrary SPEC for which to generate a file
SPEC := $(firstword $(all_spec_files))
endif
endif
ifeq ($(OUTPUT_SYNC_SUPPORTED), true)
OUTPUT_SYNC_FLAG := -O$(OUTPUT_SYNC)
endif
ifneq ($(wildcard $(SPEC)), )
$(eval $(call DefineMainTargets, LAZY, $(SPEC)))
else
# If we have no configurations we can not provide any main targets.
ALL_MAIN_TARGETS :=
endif
##############################################################################
# Init targets. These are handled fully, here and now.
##############################################################################
ALL_TARGETS := $(sort $(ALL_GLOBAL_TARGETS) $(ALL_MAIN_TARGETS) $(ALL_INIT_TARGETS))
print-modules:
# Just list all our targets.
$(ALL_TARGETS):
.PHONY: $(ALL_TARGETS)
else
############################################################################
# This is the normal case, we have been called from the command line by the
# user and we need to call ourself back with a proper SPEC.
# We have at least one non-global target, so we need to find a spec file.
############################################################################
# Basic checks on environment and command line.
$(eval $(call CheckControlVariables))
$(eval $(call CheckDeprecatedEnvironment))
$(eval $(call CheckInvalidMakeFlags))
# Check that CONF_CHECK is valid.
$(eval $(call ParseConfCheckOption))
# Check that the LOG given is valid, and set LOG_LEVEL, LOG_NOFILE, MAKE_LOG_VARS and MAKE_LOG_FLAGS.
$(eval $(call ParseLogLevel))
# After this SPECS contain 1..N spec files (otherwise ParseConfAndSpec fails).
$(eval $(call ParseConfAndSpec))
# Extract main targets from Main.gmk using the spec(s) provided. In theory,
# with multiple specs, we should find the intersection of targets provided
# by all specs, but we approximate this by an arbitrary spec from the list.
# This will setup ALL_MAIN_TARGETS.
$(eval $(call DefineMainTargets, FORCE, $(firstword $(SPECS))))
# Separate called targets depending on type.
INIT_TARGETS := $(filter $(ALL_INIT_TARGETS), $(CALLED_SPEC_TARGETS))
MAIN_TARGETS := $(filter $(ALL_MAIN_TARGETS), $(CALLED_SPEC_TARGETS))
SEQUENTIAL_TARGETS := $(filter dist-clean clean%, $(MAIN_TARGETS))
PARALLEL_TARGETS := $(filter-out $(SEQUENTIAL_TARGETS), $(MAIN_TARGETS))
# The spec files depend on the autoconf source code. This check makes sure
# the configuration is up to date after changes to configure.
$(SPECS): $(wildcard $(topdir)/make/autoconf/*) \
$(if $(CUSTOM_CONFIG_DIR), $(wildcard $(CUSTOM_CONFIG_DIR)/*)) \
$(addprefix $(topdir)/make/conf/, version-numbers.conf branding.conf) \
$(if $(CUSTOM_CONF_DIR), $(wildcard $(addprefix $(CUSTOM_CONF_DIR)/, \
version-numbers.conf branding.conf)))
ifeq ($(CONF_CHECK), fail)
@echo Error: The configuration is not up to date for \
"'$(lastword $(subst /, , $(dir $@)))'."
$(call PrintConfCheckFailed)
@exit 2
else ifeq ($(CONF_CHECK), auto)
@echo Note: The configuration is not up to date for \
"'$(lastword $(subst /, , $(dir $@)))'."
@( cd $(topdir) && \
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -f $(topdir)/make/Init.gmk \
SPEC=$@ HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) \
reconfigure )
else ifeq ($(CONF_CHECK), ignore)
# Do nothing
endif
# Do not let make delete spec files even if aborted while doing a reconfigure
.PRECIOUS: $(SPECS)
# Unless reconfigure is explicitly called, let all main targets depend on
# the spec files to be up to date.
ifeq ($(findstring reconfigure, $(INIT_TARGETS)), )
$(MAIN_TARGETS): $(SPECS)
endif
make-info:
ifneq ($(findstring $(LOG_LEVEL),info debug trace),)
$(info Running make as '$(strip $(MAKE) $(MFLAGS) \
$(COMMAND_LINE_VARIABLES) $(MAKECMDGOALS))')
endif
MAKE_INIT_WITH_SPEC_ARGUMENTS := ACTUAL_TOPDIR=$(topdir) \
USER_MAKE_VARS="$(USER_MAKE_VARS)" MAKE_LOG_FLAGS=$(MAKE_LOG_FLAGS) \
$(MAKE_LOG_VARS) \
INIT_TARGETS="$(INIT_TARGETS)" \
SEQUENTIAL_TARGETS="$(SEQUENTIAL_TARGETS)" \
PARALLEL_TARGETS="$(PARALLEL_TARGETS)"
# Now the init and main targets will be called, once for each SPEC. The
# recipe will be run once for every target specified, but we only want to
# execute the recipe a single time, hence the TARGET_DONE with a dummy
# command if true.
# The COMPARE_BUILD part implements special support for makefile development.
$(ALL_INIT_TARGETS) $(ALL_MAIN_TARGETS): make-info
@$(if $(TARGET_DONE), \
true \
, \
( cd $(topdir) && \
$(foreach spec, $(SPECS), \
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -j 1 -f $(topdir)/make/Init.gmk \
SPEC=$(spec) HAS_SPEC=true $(MAKE_INIT_WITH_SPEC_ARGUMENTS) \
main && \
$(if $(and $(COMPARE_BUILD), $(PARALLEL_TARGETS)), \
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -f $(topdir)/make/Init.gmk \
SPEC=$(spec) HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) \
COMPARE_BUILD="$(COMPARE_BUILD)" pre-compare-build && \
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -j 1 -f $(topdir)/make/Init.gmk \
SPEC=$(spec) HAS_SPEC=true $(MAKE_INIT_WITH_SPEC_ARGUMENTS) \
COMPARE_BUILD="$(COMPARE_BUILD):NODRYRUN=true" main && \
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -f $(topdir)/make/Init.gmk \
SPEC=$(spec) HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) \
COMPARE_BUILD="$(COMPARE_BUILD):NODRYRUN=true" post-compare-build && \
) \
) true ) \
$(eval TARGET_DONE=true) \
)
.PHONY: $(ALL_MAIN_TARGETS) $(ALL_INIT_TARGETS)
endif # $(ONLY_GLOBAL_TARGETS)!=true
else # HAS_SPEC=true
##############################################################################
# Now we have a spec. This part provides the "main" target that acts as a
# trampoline to call the Main.gmk with the value of $(MAKE) found in the spec
# file.
##############################################################################
include $(SPEC)
# Our helper functions.
include $(TOPDIR)/make/InitSupport.gmk
# Parse COMPARE_BUILD (for makefile development)
$(eval $(call ParseCompareBuild))
# Setup reproducible build environment
$(eval $(call SetupReproducibleBuild))
# If no LOG= was given on command line, but we have a non-standard default
# value, use that instead and re-parse log level.
ifeq ($(LOG), )
ifneq ($(DEFAULT_LOG), )
override LOG := $(DEFAULT_LOG)
$(eval $(call ParseLogLevel))
endif
endif
ifeq ($(LOG_NOFILE), true)
# Disable build log if LOG=[level,]nofile was given
override BUILD_LOG_PIPE :=
override BUILD_LOG_PIPE_SIMPLE :=
endif
ifeq ($(filter dist-clean, $(SEQUENTIAL_TARGETS)), dist-clean)
# We can't have a log file if we're about to remove it.
override BUILD_LOG_PIPE :=
override BUILD_LOG_PIPE_SIMPLE :=
endif
ifeq ($(OUTPUT_SYNC_SUPPORTED), true)
OUTPUT_SYNC_FLAG := -O$(OUTPUT_SYNC)
endif
##############################################################################
# Init targets
##############################################################################
print-modules:
( cd $(TOPDIR) && \
$(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
NO_RECIPES=true print-modules )
print-targets:
print-targets:
( cd $(TOPDIR) && \
$(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
NO_RECIPES=true print-targets )
print-tests:
print-tests:
( cd $(TOPDIR) && \
$(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
NO_RECIPES=true print-tests )
print-configuration:
$(ECHO) $(CONFIGURE_COMMAND_LINE)
print-configuration:
$(ECHO) $(CONFIGURE_COMMAND_LINE)
reconfigure:
reconfigure:
ifneq ($(REAL_CONFIGURE_COMMAND_EXEC_FULL), )
$(ECHO) "Re-running configure using original command line '$(REAL_CONFIGURE_COMMAND_EXEC_SHORT) $(REAL_CONFIGURE_COMMAND_LINE)'"
$(eval RECONFIGURE_COMMAND := $(REAL_CONFIGURE_COMMAND_EXEC_FULL) $(REAL_CONFIGURE_COMMAND_LINE))
@@ -110,50 +295,34 @@ reconfigure:
CUSTOM_CONFIG_DIR="$(CUSTOM_CONFIG_DIR)" \
$(RECONFIGURE_COMMAND) )
# Create files that are needed to run most targets in Main.gmk
create-make-helpers:
( cd $(TOPDIR) && \
$(MAKE) $(MAKE_ARGS) -j 1 -f make/GenerateFindTests.gmk \
$(USER_MAKE_VARS) )
( cd $(TOPDIR) && \
$(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
UPDATE_MODULE_DEPS=true NO_RECIPES=true \
create-main-targets-include )
##############################################################################
# The main target, for delegating into Main.gmk
##############################################################################
.PHONY: print-modules print-targets print-tests print-configuration \
reconfigure create-make-helpers
MAIN_TARGETS := $(SEQUENTIAL_TARGETS) $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE)
# If building the default target, add what they are to the description.
DESCRIPTION_TARGETS := $(strip $(MAIN_TARGETS))
ifeq ($(DESCRIPTION_TARGETS), default)
DESCRIPTION_TARGETS += ($(DEFAULT_MAKE_TARGET))
endif
TARGET_DESCRIPTION := target$(if $(word 2, $(MAIN_TARGETS)),s) \
'$(strip $(DESCRIPTION_TARGETS))' in configuration '$(CONF_NAME)'
##############################################################################
# The main target. This will delegate all other targets into Main.gmk.
##############################################################################
# MAKEOVERRIDES is automatically set and propagated by Make to sub-Make calls.
# We need to clear it of the init-specific variables. The user-specified
# variables are explicitly propagated using $(USER_MAKE_VARS).
main: MAKEOVERRIDES :=
MAIN_TARGETS := $(SEQUENTIAL_TARGETS) $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE)
# If building the default target, add what they are to the description.
DESCRIPTION_TARGETS := $(strip $(MAIN_TARGETS))
ifeq ($(DESCRIPTION_TARGETS), default)
DESCRIPTION_TARGETS += ($(DEFAULT_MAKE_TARGET))
endif
TARGET_DESCRIPTION := target$(if $(word 2, $(MAIN_TARGETS)),s) \
'$(strip $(DESCRIPTION_TARGETS))' in configuration '$(CONF_NAME)'
# MAKEOVERRIDES is automatically set and propagated by Make to sub-Make calls.
# We need to clear it of the init-specific variables. The user-specified
# variables are explicitly propagated using $(USER_MAKE_VARS).
main: MAKEOVERRIDES :=
main: $(INIT_TARGETS) create-make-helpers
main: $(INIT_TARGETS)
ifneq ($(SEQUENTIAL_TARGETS)$(PARALLEL_TARGETS), )
$(call RotateLogFiles)
$(ECHO) "Building $(TARGET_DESCRIPTION)" $(BUILD_LOG_PIPE_SIMPLE)
$(PRINTF) "Building $(TARGET_DESCRIPTION)\n" $(BUILD_LOG_PIPE_SIMPLE)
ifneq ($(SEQUENTIAL_TARGETS), )
# Don't touch build output dir since we might be cleaning. That
# means no log pipe.
( cd $(TOPDIR) && \
$(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
$(SEQUENTIAL_TARGETS) )
# We might have cleaned away essential files, recreate them.
( cd $(TOPDIR) && \
$(MAKE) $(MAKE_ARGS) -j 1 -f make/Init.gmk create-make-helpers )
endif
ifneq ($(PARALLEL_TARGETS), )
$(call PrepareFailureLogs)
@@ -164,15 +333,14 @@ main: $(INIT_TARGETS) create-make-helpers
# treat it as NOT using jobs at all.
( cd $(TOPDIR) && \
$(NICE) $(MAKE) $(MAKE_ARGS) $(OUTPUT_SYNC_FLAG) \
$(if $(JOBS), -j $(JOBS)) \
$(if $(JOBS), -j $(JOBS)) \
-f make/Main.gmk $(USER_MAKE_VARS) \
$(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE) $(BUILD_LOG_PIPE) || \
( exitcode=$$? && \
$(ECHO) "" $(BUILD_LOG_PIPE_SIMPLE) && \
$(ECHO) "ERROR: Build failed for $(TARGET_DESCRIPTION) (exit code $$exitcode)" \
$(PRINTF) "\nERROR: Build failed for $(TARGET_DESCRIPTION) (exit code $$exitcode) \n" \
$(BUILD_LOG_PIPE_SIMPLE) && \
cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -j 1 -f make/Init.gmk \
on-failure ; \
HAS_SPEC=true on-failure ; \
exit $$exitcode ) )
$(call CleanupJavacServer)
$(call StopGlobalTimer)
@@ -181,35 +349,31 @@ main: $(INIT_TARGETS) create-make-helpers
if test -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error ; then \
exit 1 ; \
fi
$(ECHO) "Finished building $(TARGET_DESCRIPTION)" $(BUILD_LOG_PIPE_SIMPLE)
$(PRINTF) "Finished building $(TARGET_DESCRIPTION)\n" $(BUILD_LOG_PIPE_SIMPLE)
$(call ReportProfileTimes)
endif
on-failure:
on-failure:
$(call CleanupJavacServer)
$(call StopGlobalTimer)
$(call ReportBuildTimes)
$(call PrintFailureReports)
$(call PrintBuildLogFailures)
$(call ReportProfileTimes)
$(ECHO) "HELP: Run 'make doctor' to diagnose build problems."
$(ECHO) ""
$(PRINTF) "HELP: Run 'make doctor' to diagnose build problems.\n\n"
ifneq ($(COMPARE_BUILD), )
$(call CleanupCompareBuild)
endif
# Support targets for COMPARE_BUILD, used for makefile development
pre-compare-build:
# Support targets for COMPARE_BUILD, used for makefile development
pre-compare-build:
$(call WaitForJavacServerFinish)
$(call PrepareCompareBuild)
post-compare-build:
post-compare-build:
$(call WaitForJavacServerFinish)
$(call CleanupCompareBuild)
$(call CompareBuildDoComparison)
.PHONY: main on-failure pre-compare-build post-compare-build
################################################################################
include MakeFileEnd.gmk
.PHONY: print-targets print-modules reconfigure main on-failure
endif

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2025, 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,114 +23,396 @@
# questions.
#
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################
# This file contains helper functions for Init.gmk.
# It is divided in two parts, depending on if a SPEC is present or not
# (HAS_SPEC is true or not).
################################################################################
# Define basic logging setup
BUILD_LOG := $(OUTPUTDIR)/build.log
BUILD_PROFILE_LOG := $(OUTPUTDIR)/build-profile.log
ifndef _INITSUPPORT_GMK
_INITSUPPORT_GMK := 1
BUILD_LOG_PIPE := > >($(TEE) -a $(BUILD_LOG)) 2> >($(TEE) -a $(BUILD_LOG) >&2) && wait
# Use this for simple echo/printf commands that are never expected to print
# to stderr.
BUILD_LOG_PIPE_SIMPLE := | $(TEE) -a $(BUILD_LOG)
ifeq ($(HAS_SPEC),)
# Setup the build environment to match the requested specification on
# level of reproducible builds
define SetupReproducibleBuild
ifeq ($$(SOURCE_DATE), updated)
# For static values of SOURCE_DATE (not "updated"), these are set in spec.gmk
export SOURCE_DATE_EPOCH := $$(shell $$(DATE) +"%s")
export SOURCE_DATE_ISO_8601 := $$(call EpochToISO8601, $$(SOURCE_DATE_EPOCH))
# COMMA is defined in spec.gmk, but that is not included yet
COMMA := ,
# Include the corresponding closed file, if present.
ifneq ($(CUSTOM_MAKE_DIR), )
-include $(CUSTOM_MAKE_DIR)/InitSupport.gmk
endif
endef
# Parse COMPARE_BUILD into COMPARE_BUILD_*
# Syntax: COMPARE_BUILD=CONF=<configure options>:PATCH=<patch file>:
# MAKE=<make targets>:COMP_OPTS=<compare script options>:
# COMP_DIR=<compare script base dir>|<default>:
# FAIL=<bool>
# If neither CONF or PATCH is given, assume <default> means CONF if it
# begins with "--", otherwise assume it means PATCH.
# MAKE and COMP_OPTS can only be used with CONF and/or PATCH specified.
# If any value contains "+", it will be replaced by space.
# FAIL can be set to false to have the return value of compare be ignored.
define ParseCompareBuild
ifneq ($$(COMPARE_BUILD), )
COMPARE_BUILD_OUTPUTDIR := $(WORKSPACE_ROOT)/build/compare-build/$(CONF_NAME)
COMPARE_BUILD_FAIL := true
##############################################################################
# Helper functions for the initial part of Init.gmk, before the spec file is
# loaded. Most of these functions provide parsing and setting up make options
# from the command-line.
##############################################################################
ifneq ($$(findstring :, $$(COMPARE_BUILD)), )
$$(foreach part, $$(subst :, , $$(COMPARE_BUILD)), \
$$(if $$(filter PATCH=%, $$(part)), \
$$(eval COMPARE_BUILD_PATCH = $$(strip $$(patsubst PATCH=%, %, $$(part)))) \
) \
$$(if $$(filter CONF=%, $$(part)), \
$$(eval COMPARE_BUILD_CONF = $$(strip $$(subst +, , $$(patsubst CONF=%, %, $$(part))))) \
) \
$$(if $$(filter MAKE=%, $$(part)), \
$$(eval COMPARE_BUILD_MAKE = $$(strip $$(subst +, , $$(patsubst MAKE=%, %, $$(part))))) \
) \
$$(if $$(filter COMP_OPTS=%, $$(part)), \
$$(eval COMPARE_BUILD_COMP_OPTS = $$(strip $$(subst +, , $$(patsubst COMP_OPTS=%, %, $$(part))))) \
) \
$$(if $$(filter COMP_DIR=%, $$(part)), \
$$(eval COMPARE_BUILD_COMP_DIR = $$(strip $$(subst +, , $$(patsubst COMP_DIR=%, %, $$(part))))) \
) \
$$(if $$(filter FAIL=%, $$(part)), \
$$(eval COMPARE_BUILD_FAIL = $$(strip $$(subst +, , $$(patsubst FAIL=%, %, $$(part))))) \
) \
$$(if $$(filter NODRYRUN=%, $$(part)), \
$$(eval COMPARE_BUILD_NODRYRUN = $$(strip $$(subst +, , $$(patsubst NODRYRUN=%, %, $$(part))))) \
) \
)
else
# Separate handling for single field case, to allow for spaces in values.
ifneq ($$(filter PATCH=%, $$(COMPARE_BUILD)), )
COMPARE_BUILD_PATCH = $$(strip $$(patsubst PATCH=%, %, $$(COMPARE_BUILD)))
else ifneq ($$(filter CONF=%, $$(COMPARE_BUILD)), )
COMPARE_BUILD_CONF = $$(strip $$(subst +, , $$(patsubst CONF=%, %, $$(COMPARE_BUILD))))
else ifneq ($$(filter --%, $$(COMPARE_BUILD)), )
# Assume CONF if value begins with --
COMPARE_BUILD_CONF = $$(strip $$(subst +, , $$(COMPARE_BUILD)))
# Make control variables, handled by Init.gmk
INIT_CONTROL_VARIABLES += LOG CONF CONF_NAME SPEC JOBS TEST_JOBS CONF_CHECK \
COMPARE_BUILD JTREG GTEST MICRO TEST_OPTS TEST_VM_OPTS
# All known make control variables
MAKE_CONTROL_VARIABLES := $(INIT_CONTROL_VARIABLES) TEST JDK_FILTER SPEC_FILTER
# Define a simple reverse function.
# Should maybe move to MakeBase.gmk, but we can't include that file now.
reverse = \
$(if $(strip $(1)), $(call reverse, $(wordlist 2, $(words $(1)), $(1)))) \
$(firstword $(1))
# The variable MAKEOVERRIDES contains variable assignments from the command
# line, but in reverse order to what the user entered.
# The '\#' <=> '\ 'dance is needed to keep values with space in them connected.
COMMAND_LINE_VARIABLES := $(subst \#,\ , $(call reverse, $(subst \ ,\#,$(MAKEOVERRIDES))))
# A list like FOO="val1" BAR="val2" containing all user-supplied make
# variables that we should propagate.
# The '\#' <=> '\ 'dance is needed to keep values with space in them connected.
USER_MAKE_VARS := $(subst \#,\ , $(filter-out $(addsuffix =%, $(INIT_CONTROL_VARIABLES)), \
$(subst \ ,\#,$(MAKEOVERRIDES))))
# Setup information about available configurations, if any.
ifneq ($(CUSTOM_ROOT), )
build_dir=$(CUSTOM_ROOT)/build
else
build_dir=$(topdir)/build
endif
all_spec_files=$(wildcard $(build_dir)/*/spec.gmk)
# Extract the configuration names from the path
all_confs=$(patsubst %/spec.gmk, %, $(patsubst $(build_dir)/%, %, $(all_spec_files)))
# Check for unknown command-line variables
define CheckControlVariables
command_line_variables := $$(strip $$(foreach var, \
$$(subst \ ,_,$$(MAKEOVERRIDES)), \
$$(firstword $$(subst =, , $$(var)))))
unknown_command_line_variables := $$(strip \
$$(filter-out $$(MAKE_CONTROL_VARIABLES), $$(command_line_variables)))
ifneq ($$(unknown_command_line_variables), )
$$(info Note: Command line contains non-control variables:)
$$(foreach var, $$(unknown_command_line_variables), $$(info * $$(var)=$$($$(var))))
$$(info Make sure it is not mistyped, and that you intend to override this variable.)
$$(info 'make help' will list known control variables.)
$$(info )
endif
endef
# Check for deprecated ALT_ variables
define CheckDeprecatedEnvironment
defined_alt_variables := $$(filter ALT_%, $$(.VARIABLES))
ifneq ($$(defined_alt_variables), )
$$(info Warning: You have the following ALT_ variables set:)
$$(foreach var, $$(defined_alt_variables), $$(info * $$(var)=$$($$(var))))
$$(info ALT_ variables are deprecated, and may result in a failed build.)
$$(info Please clean your environment.)
$$(info )
endif
endef
# Check for invalid make flags like -j
define CheckInvalidMakeFlags
# This is a trick to get this rule to execute before any other rules
# MAKEFLAGS only indicate -j if read in a recipe (!)
$$(topdir)/make/Init.gmk: .FORCE
$$(if $$(findstring --jobserver, $$(MAKEFLAGS)), \
$$(info Error: 'make -jN' is not supported, use 'make JOBS=N') \
$$(error Cannot continue) \
)
.FORCE:
.PHONY: .FORCE
endef
# Check that the CONF_CHECK option is valid and set up handling
define ParseConfCheckOption
ifeq ($$(CONF_CHECK), )
# Default behavior is fail
CONF_CHECK := fail
else ifneq ($$(filter-out auto fail ignore, $$(CONF_CHECK)),)
$$(info Error: CONF_CHECK must be one of: auto, fail or ignore.)
$$(error Cannot continue)
endif
endef
define ParseConfAndSpec
ifneq ($$(origin SPEC), undefined)
# We have been given a SPEC, check that it works out properly
ifneq ($$(origin CONF), undefined)
# We also have a CONF argument. We can't have both.
$$(info Error: Cannot use CONF=$$(CONF) and SPEC=$$(SPEC) at the same time. Choose one.)
$$(error Cannot continue)
endif
ifneq ($$(origin CONF_NAME), undefined)
# We also have a CONF_NAME argument. We can't have both.
$$(info Error: Cannot use CONF_NAME=$$(CONF_NAME) and SPEC=$$(SPEC) at the same time. Choose one.)
$$(error Cannot continue)
endif
ifeq ($$(wildcard $$(SPEC)),)
$$(info Error: Cannot locate spec.gmk, given by SPEC=$$(SPEC).)
$$(error Cannot continue)
endif
ifeq ($$(filter /%, $$(SPEC)),)
# If given with relative path, make it absolute
SPECS := $$(CURDIR)/$$(strip $$(SPEC))
else
# Otherwise assume patch file
COMPARE_BUILD_PATCH = $$(strip $$(COMPARE_BUILD))
SPECS := $$(SPEC)
endif
# For now, unset this SPEC variable.
override SPEC :=
else
# Use spec.gmk files in the build output directory
ifeq ($$(all_spec_files),)
ifneq ($(CUSTOM_ROOT), )
$$(info Error: No configurations found for $$(CUSTOM_ROOT).)
else
$$(info Error: No configurations found for $$(topdir).)
endif
$$(info Please run 'bash configure' to create a configuration.)
$$(info )
$$(error Cannot continue)
endif
ifneq ($$(origin CONF_NAME), undefined)
ifneq ($$(origin CONF), undefined)
# We also have a CONF argument. We can't have both.
$$(info Error: Cannot use CONF=$$(CONF) and CONF_NAME=$$(CONF_NAME) at the same time. Choose one.)
$$(error Cannot continue)
endif
matching_conf := $$(strip $$(filter $$(CONF_NAME), $$(all_confs)))
ifeq ($$(matching_conf),)
$$(info Error: No configurations found matching CONF_NAME=$$(CONF_NAME).)
$$(info Available configurations in $$(build_dir):)
$$(foreach var, $$(all_confs), $$(info * $$(var)))
$$(error Cannot continue)
else ifneq ($$(words $$(matching_conf)), 1)
$$(info Error: Matching more than one configuration CONF_NAME=$$(CONF_NAME).)
$$(info Available configurations in $$(build_dir):)
$$(foreach var, $$(all_confs), $$(info * $$(var)))
$$(error Cannot continue)
else
$$(info Building configuration '$$(matching_conf)' (matching CONF_NAME=$$(CONF_NAME)))
endif
# Create a SPEC definition. This will contain the path to exactly one spec file.
SPECS := $$(build_dir)/$$(matching_conf)/spec.gmk
else ifneq ($$(origin CONF), undefined)
# User have given a CONF= argument.
ifeq ($$(CONF),)
# If given CONF=, match all configurations
matching_confs := $$(strip $$(all_confs))
else
# Otherwise select those that contain the given CONF string
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)
# Don't repeat this output on make restarts caused by including
# generated files.
ifeq ($$(MAKE_RESTARTS),)
$$(info Using exact match for CONF=$$(CONF) (other matches are possible))
endif
endif
endif
ifeq ($$(matching_confs),)
$$(info Error: No configurations found matching CONF=$$(CONF).)
$$(info Available configurations in $$(build_dir):)
$$(foreach var, $$(all_confs), $$(info * $$(var)))
$$(error Cannot continue)
else
# Don't repeat this output on make restarts caused by including
# generated files.
ifeq ($$(MAKE_RESTARTS),)
ifeq ($$(words $$(matching_confs)), 1)
ifneq ($$(findstring $$(LOG_LEVEL), info debug trace),)
$$(info Building configuration '$$(matching_confs)' (matching CONF=$$(CONF)))
endif
else
$$(info Building these configurations (matching CONF=$$(CONF)):)
$$(foreach var, $$(matching_confs), $$(info * $$(var)))
endif
endif
endif
# Create a SPEC definition. This will contain the path to one or more spec.gmk files.
SPECS := $$(addsuffix /spec.gmk, $$(addprefix $$(build_dir)/, $$(matching_confs)))
else
# No CONF or SPEC given, check the available configurations
ifneq ($$(words $$(all_spec_files)), 1)
$$(info Error: No CONF given, but more than one configuration found.)
$$(info Available configurations in $$(build_dir):)
$$(foreach var, $$(all_confs), $$(info * $$(var)))
$$(info Please retry building with CONF=<config pattern> (or SPEC=<spec file>).)
$$(info )
$$(error Cannot continue)
endif
# We found exactly one configuration, use it
SPECS := $$(strip $$(all_spec_files))
endif
endif
ifneq ($$(COMPARE_BUILD_PATCH), )
ifneq ($$(wildcard $$(WORKSPACE_ROOT)/$$(COMPARE_BUILD_PATCH)), )
# Assume relative path, if file exists
COMPARE_BUILD_PATCH := $$(wildcard $$(WORKSPACE_ROOT)/$$(COMPARE_BUILD_PATCH))
else ifeq ($$(wildcard $$(COMPARE_BUILD_PATCH)), )
$$(error Patch file $$(COMPARE_BUILD_PATCH) does not exist)
endef
# Extract main targets from Main.gmk using the spec provided in $2.
#
# Param 1: FORCE = force generation of main-targets.gmk or LAZY = do not force.
# Param 2: The SPEC file to use.
define DefineMainTargets
# We will start by making sure the main-targets.gmk file is removed, if
# make has not been restarted. By the -include, we will trigger the
# rule for generating the file (which is never there since we removed it),
# thus generating it fresh, and make will restart, incrementing the restart
# count.
main_targets_file := $$(dir $(strip $2))make-support/main-targets.gmk
ifeq ($$(MAKE_RESTARTS),)
# Only do this if make has not been restarted, and if we do not force it.
ifeq ($(strip $1), FORCE)
$$(shell rm -f $$(main_targets_file))
endif
ifneq ($$(COMPARE_BUILD_NODRYRUN), true)
PATCH_DRY_RUN := $$(shell cd $$(WORKSPACE_ROOT) && $$(PATCH) --dry-run -p1 < $$(COMPARE_BUILD_PATCH) > /dev/null 2>&1 || $$(ECHO) FAILED)
ifeq ($$(PATCH_DRY_RUN), FAILED)
$$(error Patch file $$(COMPARE_BUILD_PATCH) does not apply cleanly)
endif
$$(main_targets_file):
@( cd $$(topdir) && \
$$(MAKE) $$(MAKE_LOG_FLAGS) -r -R -f $$(topdir)/make/Main.gmk \
-I $$(topdir)/make/common SPEC=$(strip $2) NO_RECIPES=true \
$$(MAKE_LOG_VARS) \
create-main-targets-include )
# Now include main-targets.gmk. This will define ALL_MAIN_TARGETS.
-include $$(main_targets_file)
endef
define PrintConfCheckFailed
@echo ' '
@echo "Please rerun configure! Easiest way to do this is by running"
@echo "'make reconfigure'."
@echo "This behavior may also be changed using CONF_CHECK=<ignore|auto>."
@echo ' '
endef
else # $(HAS_SPEC)=true
##############################################################################
# Helper functions for the 'main' target. These functions assume a single,
# proper and existing SPEC is included.
##############################################################################
include $(TOPDIR)/make/common/MakeBase.gmk
# Define basic logging setup
BUILD_LOG := $(OUTPUTDIR)/build.log
BUILD_PROFILE_LOG := $(OUTPUTDIR)/build-profile.log
BUILD_LOG_PIPE := > >($(TEE) -a $(BUILD_LOG)) 2> >($(TEE) -a $(BUILD_LOG) >&2) && wait
# Use this for simple echo/printf commands that are never expected to print
# to stderr.
BUILD_LOG_PIPE_SIMPLE := | $(TEE) -a $(BUILD_LOG)
ifneq ($(CUSTOM_ROOT), )
topdir=$(CUSTOM_ROOT)
else
topdir=$(TOPDIR)
endif
# Setup the build environment to match the requested specification on
# level of reproducible builds
define SetupReproducibleBuild
ifeq ($$(SOURCE_DATE), updated)
# For static values of SOURCE_DATE (not "updated"), these are set in spec.gmk
export SOURCE_DATE_EPOCH := $$(shell $$(DATE) +"%s")
export SOURCE_DATE_ISO_8601 := $$(call EpochToISO8601, $$(SOURCE_DATE_EPOCH))
endif
endef
# Parse COMPARE_BUILD into COMPARE_BUILD_*
# Syntax: COMPARE_BUILD=CONF=<configure options>:PATCH=<patch file>:
# MAKE=<make targets>:COMP_OPTS=<compare script options>:
# COMP_DIR=<compare script base dir>|<default>:
# FAIL=<bool>
# If neither CONF or PATCH is given, assume <default> means CONF if it
# begins with "--", otherwise assume it means PATCH.
# MAKE and COMP_OPTS can only be used with CONF and/or PATCH specified.
# If any value contains "+", it will be replaced by space.
# FAIL can be set to false to have the return value of compare be ignored.
define ParseCompareBuild
ifneq ($$(COMPARE_BUILD), )
COMPARE_BUILD_OUTPUTDIR := $(topdir)/build/compare-build/$(CONF_NAME)
COMPARE_BUILD_FAIL := true
ifneq ($$(findstring :, $$(COMPARE_BUILD)), )
$$(foreach part, $$(subst :, , $$(COMPARE_BUILD)), \
$$(if $$(filter PATCH=%, $$(part)), \
$$(eval COMPARE_BUILD_PATCH=$$(strip $$(patsubst PATCH=%, %, $$(part)))) \
) \
$$(if $$(filter CONF=%, $$(part)), \
$$(eval COMPARE_BUILD_CONF=$$(strip $$(subst +, , $$(patsubst CONF=%, %, $$(part))))) \
) \
$$(if $$(filter MAKE=%, $$(part)), \
$$(eval COMPARE_BUILD_MAKE=$$(strip $$(subst +, , $$(patsubst MAKE=%, %, $$(part))))) \
) \
$$(if $$(filter COMP_OPTS=%, $$(part)), \
$$(eval COMPARE_BUILD_COMP_OPTS=$$(strip $$(subst +, , $$(patsubst COMP_OPTS=%, %, $$(part))))) \
) \
$$(if $$(filter COMP_DIR=%, $$(part)), \
$$(eval COMPARE_BUILD_COMP_DIR=$$(strip $$(subst +, , $$(patsubst COMP_DIR=%, %, $$(part))))) \
) \
$$(if $$(filter FAIL=%, $$(part)), \
$$(eval COMPARE_BUILD_FAIL=$$(strip $$(subst +, , $$(patsubst FAIL=%, %, $$(part))))) \
) \
$$(if $$(filter NODRYRUN=%, $$(part)), \
$$(eval COMPARE_BUILD_NODRYRUN=$$(strip $$(subst +, , $$(patsubst NODRYRUN=%, %, $$(part))))) \
) \
)
else
# Separate handling for single field case, to allow for spaces in values.
ifneq ($$(filter PATCH=%, $$(COMPARE_BUILD)), )
COMPARE_BUILD_PATCH=$$(strip $$(patsubst PATCH=%, %, $$(COMPARE_BUILD)))
else ifneq ($$(filter CONF=%, $$(COMPARE_BUILD)), )
COMPARE_BUILD_CONF=$$(strip $$(subst +, , $$(patsubst CONF=%, %, $$(COMPARE_BUILD))))
else ifneq ($$(filter --%, $$(COMPARE_BUILD)), )
# Assume CONF if value begins with --
COMPARE_BUILD_CONF=$$(strip $$(subst +, , $$(COMPARE_BUILD)))
else
# Otherwise assume patch file
COMPARE_BUILD_PATCH=$$(strip $$(COMPARE_BUILD))
endif
endif
ifneq ($$(COMPARE_BUILD_PATCH), )
ifneq ($$(wildcard $$(topdir)/$$(COMPARE_BUILD_PATCH)), )
# Assume relative path, if file exists
COMPARE_BUILD_PATCH := $$(wildcard $$(topdir)/$$(COMPARE_BUILD_PATCH))
else ifeq ($$(wildcard $$(COMPARE_BUILD_PATCH)), )
$$(error Patch file $$(COMPARE_BUILD_PATCH) does not exist)
endif
ifneq ($$(COMPARE_BUILD_NODRYRUN), true)
PATCH_DRY_RUN := $$(shell cd $$(topdir) && $$(PATCH) --dry-run -p1 < $$(COMPARE_BUILD_PATCH) > /dev/null 2>&1 || $$(ECHO) FAILED)
ifeq ($$(PATCH_DRY_RUN), FAILED)
$$(error Patch file $$(COMPARE_BUILD_PATCH) does not apply cleanly)
endif
endif
endif
ifneq ($$(COMPARE_BUILD_FAIL), true)
COMPARE_BUILD_IGNORE_RESULT := || true
endif
endif
ifneq ($$(COMPARE_BUILD_FAIL), true)
COMPARE_BUILD_IGNORE_RESULT := || true
endif
endif
endef
endef
# Prepare for a comparison rebuild
define PrepareCompareBuild
# Prepare for a comparison rebuild
define PrepareCompareBuild
$(ECHO) "Preparing for comparison rebuild"
# Apply patch, if any
$(if $(COMPARE_BUILD_PATCH), cd $(WORKSPACE_ROOT) && $(PATCH) -p1 < $(COMPARE_BUILD_PATCH))
$(if $(COMPARE_BUILD_PATCH), cd $(topdir) && $(PATCH) -p1 < $(COMPARE_BUILD_PATCH))
# Move the first build away temporarily
$(RM) -r $(WORKSPACE_ROOT)/build/.compare-build-temp
$(MKDIR) -p $(WORKSPACE_ROOT)/build/.compare-build-temp
$(MV) $(OUTPUTDIR) $(WORKSPACE_ROOT)/build/.compare-build-temp
$(RM) -r $(topdir)/build/.compare-build-temp
$(MKDIR) -p $(topdir)/build/.compare-build-temp
$(MV) $(OUTPUTDIR) $(topdir)/build/.compare-build-temp
# Restore an old compare-build, or create a new compare-build directory.
if test -d $(COMPARE_BUILD_OUTPUTDIR); then \
$(MV) $(COMPARE_BUILD_OUTPUTDIR) $(OUTPUTDIR); \
@@ -140,23 +422,23 @@ define PrepareCompareBuild
# Re-run configure with the same arguments (and possibly some additional),
# must be done after patching.
( cd $(CONFIGURE_START_DIR) && PATH="$(ORIGINAL_PATH)" \
$(BASH) $(WORKSPACE_ROOT)/configure $(CONFIGURE_COMMAND_LINE) $(COMPARE_BUILD_CONF))
endef
$(BASH) $(topdir)/configure $(CONFIGURE_COMMAND_LINE) $(COMPARE_BUILD_CONF))
endef
# Cleanup after a compare build
define CleanupCompareBuild
# Cleanup after a compare build
define CleanupCompareBuild
# 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 $(WORKSPACE_ROOT) && $(PATCH) -R -p1 < $(COMPARE_BUILD_PATCH) || true)
$(if $(COMPARE_BUILD_PATCH), cd $(topdir) && $(PATCH) -R -p1 < $(COMPARE_BUILD_PATCH) || true)
# Move this build away and restore the original build
$(MKDIR) -p $(WORKSPACE_ROOT)/build/compare-build
$(MKDIR) -p $(topdir)/build/compare-build
$(MV) $(OUTPUTDIR) $(COMPARE_BUILD_OUTPUTDIR)
$(MV) $(WORKSPACE_ROOT)/build/.compare-build-temp/$(CONF_NAME) $(OUTPUTDIR)
$(RM) -r $(WORKSPACE_ROOT)/build/.compare-build-temp
endef
$(MV) $(topdir)/build/.compare-build-temp/$(CONF_NAME) $(OUTPUTDIR)
$(RM) -r $(topdir)/build/.compare-build-temp
endef
# Do the actual comparison of two builds
define CompareBuildDoComparison
# Do the actual comparison of two builds
define CompareBuildDoComparison
# 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), \
@@ -166,17 +448,16 @@ define CompareBuildDoComparison
+(cd $(COMPARE_BUILD_OUTPUTDIR) && ./compare.sh --diffs $(COMPARE_BUILD_COMP_OPTS) \
-o $(OUTPUTDIR) $(COMPARE_BUILD_IGNORE_RESULT)) \
)
endef
endef
define PrintFailureReports
define PrintFailureReports
$(if $(filter none, $(LOG_REPORT)), , \
$(RM) $(MAKESUPPORT_OUTPUTDIR)/failure-summary.log ; \
$(if $(wildcard $(MAKESUPPORT_OUTPUTDIR)/failure-logs/*.log), \
( \
$(ECHO) "" ; \
$(ECHO) "=== Output from failing command(s) repeated here ===" ; \
$(PRINTF) "\n=== Output from failing command(s) repeated here ===\n" ; \
$(foreach logfile, $(sort $(wildcard $(MAKESUPPORT_OUTPUTDIR)/failure-logs/*.log)), \
$(ECHO) "* For target $(notdir $(basename $(logfile))):" ; \
$(PRINTF) "* For target $(notdir $(basename $(logfile))):\n" ; \
$(if $(filter all, $(LOG_REPORT)), \
$(GREP) -v -e "^Note: including file:" < $(logfile) || true ; \
, \
@@ -186,120 +467,116 @@ define PrintFailureReports
fi ; \
) \
) \
$(ECHO) "" ; \
$(ECHO) "* All command lines available in $(MAKESUPPORT_OUTPUTDIR)/failure-logs." ; \
$(ECHO) "=== End of repeated output ===" ; \
$(PRINTF) "\n* All command lines available in $(MAKESUPPORT_OUTPUTDIR)/failure-logs.\n" ; \
$(PRINTF) "=== End of repeated output ===\n" ; \
) >> $(MAKESUPPORT_OUTPUTDIR)/failure-summary.log \
) \
)
endef
endef
define PrintBuildLogFailures
define PrintBuildLogFailures
$(if $(filter none, $(LOG_REPORT)), , \
if $(GREP) -q "recipe for target .* failed" $(BUILD_LOG) 2> /dev/null; then \
$(ECHO) "" ; \
$(ECHO) "=== Make failed targets repeated here ===" ; \
$(PRINTF) "\n=== Make failed targets repeated here ===\n" ; \
$(GREP) "recipe for target .* failed" $(BUILD_LOG) ; \
$(ECHO) "=== End of repeated output ===" ; \
$(ECHO) "" ; \
$(ECHO) "HELP: Try searching the build log for the name of the first failed target." ; \
$(PRINTF) "=== End of repeated output ===\n" ; \
$(PRINTF) "\nHELP: Try searching the build log for the name of the first failed target.\n" ; \
else \
$(ECHO) "" ; \
$(ECHO) "No indication of failed target found." ; \
$(ECHO) "HELP: Try searching the build log for '] Error'." ; \
$(PRINTF) "\nNo indication of failed target found.\n" ; \
$(PRINTF) "HELP: Try searching the build log for '] Error'.\n" ; \
fi >> $(MAKESUPPORT_OUTPUTDIR)/failure-summary.log ; \
$(CAT) $(MAKESUPPORT_OUTPUTDIR)/failure-summary.log \
)
endef
endef
define RotateLogFiles
define RotateLogFiles
$(RM) $(BUILD_LOG).old 2> /dev/null && \
$(MV) $(BUILD_LOG) $(BUILD_LOG).old 2> /dev/null || true
$(if $(findstring true, $(LOG_PROFILE_TIMES_FILE)), \
$(RM) $(BUILD_PROFILE_LOG).old 2> /dev/null && \
$(MV) $(BUILD_PROFILE_LOG) $(BUILD_PROFILE_LOG).old 2> /dev/null || true \
)
endef
endef
# Failure logs are only supported for "parallel" main targets, not the
# (trivial) sequential make targets (such as clean and reconfigure),
# since the failure-logs directory creation will conflict with clean.
# We also make sure the javatmp directory exists, which is needed if a java
# process (like javac) is using java.io.tmpdir.
define PrepareFailureLogs
# Failure logs are only supported for "parallel" main targets, not the
# (trivial) sequential make targets (such as clean and reconfigure),
# since the failure-logs directory creation will conflict with clean.
# We also make sure the javatmp directory exists, which is needed if a java
# process (like javac) is using java.io.tmpdir.
define PrepareFailureLogs
$(RM) -r $(MAKESUPPORT_OUTPUTDIR)/failure-logs 2> /dev/null && \
$(MKDIR) -p $(MAKESUPPORT_OUTPUTDIR)/failure-logs
$(MKDIR) -p $(JAVA_TMP_DIR)
$(RM) $(MAKESUPPORT_OUTPUTDIR)/exit-with-error 2> /dev/null
endef
endef
# Remove any javac server logs and port files. This
# prevents a new make run to reuse the previous servers.
define PrepareJavacServer
# Remove any javac server logs and port files. This
# prevents a new make run to reuse the previous servers.
define PrepareJavacServer
$(if $(JAVAC_SERVER_DIR), \
$(RM) -r $(JAVAC_SERVER_DIR) 2> /dev/null && \
$(MKDIR) -p $(JAVAC_SERVER_DIR) \
)
endef
endef
define CleanupJavacServer
define CleanupJavacServer
[ -f $(JAVAC_SERVER_DIR)/server.port ] && $(ECHO) Stopping javac server && \
$(TOUCH) $(JAVAC_SERVER_DIR)/server.port.stop; true
endef
endef
ifeq ($(call isBuildOs, windows), true)
# On windows we need to synchronize with the javac server to be able to
# move or remove the build output directory. Since we have no proper
# synchronization process, wait for a while and hope it helps. This is only
# used by build comparisons.
ifeq ($(call isBuildOs, windows), true)
# On windows we need to synchronize with the javac server to be able to
# move or remove the build output directory. Since we have no proper
# synchronization process, wait for a while and hope it helps. This is only
# used by build comparisons.
define WaitForJavacServerFinish
$(if $(JAVAC_SERVER_DIR), \
sleep 5 \
sleep 5\
)
endef
else
define WaitForJavacServerFinish
endef
endif
endef
else
define WaitForJavacServerFinish
endef
endif
##############################################################################
# Functions for timers
##############################################################################
##############################################################################
# Functions for timers
##############################################################################
# Store the build times in this directory.
BUILDTIMESDIR := $(OUTPUTDIR)/make-support/build-times
# Store the build times in this directory.
BUILDTIMESDIR=$(OUTPUTDIR)/make-support/build-times
# Record starting time for build of a sub repository.
define RecordStartTime
# 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
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
# 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
endef
define StartGlobalTimer
define StartGlobalTimer
$(RM) -r $(BUILDTIMESDIR) 2> /dev/null && \
$(MKDIR) -p $(BUILDTIMESDIR) && \
$(call RecordStartTime,TOTAL)
endef
endef
define StopGlobalTimer
define StopGlobalTimer
$(call RecordEndTime,TOTAL)
endef
endef
# Find all build_time_* files and print their contents in a list sorted
# on the name of the sub repository.
define ReportBuildTimes
# Find all build_time_* files and print their contents in a list sorted
# on the name of the sub repository.
define ReportBuildTimes
$(PRINTF) $(LOG_INFO) -- \
"----- Build times -------\nStart %s\nEnd %s\n%s\n%s\n-------------------------\n" \
"`$(CAT) $(BUILDTIMESDIR)/build_time_start_TOTAL_human_readable`" \
@@ -308,20 +585,119 @@ define ReportBuildTimes
$(XARGS) $(CAT) | $(SORT) -k 2`" \
"`$(CAT) $(BUILDTIMESDIR)/build_time_diff_TOTAL`" \
$(BUILD_LOG_PIPE_SIMPLE)
endef
define ReportProfileTimes
$(if $(findstring true, $(LOG_PROFILE_TIMES_LOG)), \
[ ! -f $(BUILD_PROFILE_LOG) ] || \
{ $(ECHO) Begin $(notdir $(BUILD_PROFILE_LOG)) && \
$(CAT) $(BUILD_PROFILE_LOG) && \
$(ECHO) End $(notdir $(BUILD_PROFILE_LOG)); \
} \
$(BUILD_LOG_PIPE_SIMPLE)
)
endef
endif # HAS_SPEC
# Look for a given option in the LOG variable, and if found, set a variable
# and remove the option from the LOG variable
# $1: The option to look for
# $2: The variable to set to "true" if the option is found
define ParseLogOption
ifneq ($$(findstring $1, $$(LOG)),)
override $2 := true
# First try to remove ",<option>" if it exists, otherwise just remove "<option>"
LOG_STRIPPED := $$(subst $1,, $$(subst $$(COMMA)$$(strip $1),, $$(LOG)))
# We might have ended up with a leading comma. Remove it. Need override
# since LOG is set from the command line.
override LOG := $$(strip $$(patsubst $$(COMMA)%, %, $$(LOG_STRIPPED)))
endif
endef
define ReportProfileTimes
$(if $(findstring true, $(LOG_PROFILE_TIMES_LOG)), \
[ ! -f $(BUILD_PROFILE_LOG) ] || \
{ $(ECHO) Begin $(notdir $(BUILD_PROFILE_LOG)) && \
$(CAT) $(BUILD_PROFILE_LOG) && \
$(ECHO) End $(notdir $(BUILD_PROFILE_LOG)); \
} \
$(BUILD_LOG_PIPE_SIMPLE)
)
# Look for a given option with an assignment in the LOG variable, and if found,
# set a variable to that value and remove the option from the LOG variable
# $1: The option to look for
# $2: The variable to set to the value of the option, if found
define ParseLogValue
ifneq ($$(findstring $1=, $$(LOG)),)
# Make words of out comma-separated list and find the one with opt=val
value := $$(strip $$(subst $$(strip $1)=,, $$(filter $$(strip $1)=%, $$(subst $$(COMMA), , $$(LOG)))))
override $2 := $$(value)
# First try to remove ",<option>" if it exists, otherwise just remove "<option>"
LOG_STRIPPED := $$(subst $$(strip $1)=$$(value),, \
$$(subst $$(COMMA)$$(strip $1)=$$(value),, $$(LOG)))
# We might have ended up with a leading comma. Remove it. Need override
# since LOG is set from the command line.
override LOG := $$(strip $$(patsubst $$(COMMA)%, %, $$(LOG_STRIPPED)))
endif
endef
################################################################################
endif # include guard
include MakeIncludeEnd.gmk
define ParseLogLevel
# Catch old-style VERBOSE= command lines.
ifneq ($$(origin VERBOSE), undefined)
$$(info Error: VERBOSE is deprecated. Use LOG=<warn|info|debug|trace> instead.)
$$(error Cannot continue)
endif
# Setup logging according to LOG
# If "nofile" is present, do not log to a file
$$(eval $$(call ParseLogOption, nofile, LOG_NOFILE))
# If "cmdline" is present, print all executes "important" command lines.
$$(eval $$(call ParseLogOption, cmdlines, LOG_CMDLINES))
# If "report" is present, use non-standard reporting options at build failure.
$$(eval $$(call ParseLogValue, report, LOG_REPORT))
ifneq ($$(LOG_REPORT), )
ifeq ($$(filter $$(LOG_REPORT), none all default), )
$$(info Error: LOG=report has invalid value: $$(LOG_REPORT).)
$$(info Valid values: LOG=report=<none>|<all>|<default>)
$$(error Cannot continue)
endif
endif
# If "profile-to-log" is present, write shell times in build log
$$(eval $$(call ParseLogOption, profile-to-log, LOG_PROFILE_TIMES_LOG))
# If "profile" is present, write shell times in separate log file
# IMPORTANT: $(ParseLogOption profile-to-log) should go first. Otherwise
# parsing of 'LOG=debug,profile-to-log,nofile' ends up in the following error:
# Error: LOG contains unknown option or log level: debug-to-log.
$$(eval $$(call ParseLogOption, profile, LOG_PROFILE_TIMES_FILE))
# Treat LOG=profile-to-log as if it were LOG=profile,profile-to-log
LOG_PROFILE_TIMES_FILE := $$(firstword $$(LOG_PROFILE_TIMES_FILE) $$(LOG_PROFILE_TIMES_LOG))
override LOG_LEVEL := $$(LOG)
ifeq ($$(LOG_LEVEL),)
# Set LOG to "warn" as default if not set
override LOG_LEVEL := warn
endif
ifeq ($$(LOG_LEVEL), warn)
override MAKE_LOG_FLAGS := -s
else ifeq ($$(LOG_LEVEL), info)
override MAKE_LOG_FLAGS := -s
else ifeq ($$(LOG_LEVEL), debug)
override MAKE_LOG_FLAGS :=
else ifeq ($$(LOG_LEVEL), trace)
override MAKE_LOG_FLAGS :=
else
$$(info Error: LOG contains unknown option or log level: $$(LOG).)
$$(info LOG can be <level>[,<opt>[...]] where <opt> is nofile | cmdlines | profile | profile-to-log)
$$(info and <level> is warn | info | debug | trace)
$$(error Cannot continue)
endif
endef
MAKE_LOG_VARS = $(foreach v, \
LOG_LEVEL LOG_NOFILE LOG_CMDLINES LOG_REPORT LOG_PROFILE_TIMES_LOG \
LOG_PROFILE_TIMES_FILE, \
$v=$($v) \
)
endif # _INITSUPPORT_GMK

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -23,16 +23,16 @@
# questions.
#
include MakeFileStart.gmk
default: all
################################################################################
include Execute.gmk
include $(SPEC)
include MakeBase.gmk
include Modules.gmk
################################################################################
INTERIM_JLINK_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/interim-image-jlink
# Use this file inside the image as target for make rule
JIMAGE_TARGET_FILE := bin/java$(EXECUTABLE_SUFFIX)
INTERIM_MODULES_LIST := $(call CommaList, $(INTERIM_IMAGE_MODULES))
@@ -42,19 +42,20 @@ JLINK_TOOL := $(JLINK) -J-Djlink.debug=true \
--module-path $(INTERIM_JMODS_DIR) \
--endian $(OPENJDK_BUILD_CPU_ENDIAN)
$(eval $(call SetupExecute, jlink_interim_image, \
WARN := Creating interim jimage, \
DEPS := $(JMODS) $(call DependOnVariable, INTERIM_MODULES_LIST), \
OUTPUT_DIR := $(INTERIM_IMAGE_DIR), \
SUPPORT_DIR := $(INTERIM_JLINK_SUPPORT_DIR), \
PRE_COMMAND := $(RM) -r $(INTERIM_IMAGE_DIR), \
COMMAND := $(JLINK_TOOL) --output $(INTERIM_IMAGE_DIR) \
--disable-plugin generate-jli-classes \
--add-modules $(INTERIM_MODULES_LIST), \
))
$(INTERIM_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(JMODS) \
$(call DependOnVariable, INTERIM_MODULES_LIST)
$(call LogWarn, Creating interim jimage)
$(RM) -r $(INTERIM_IMAGE_DIR)
$(JLINK_TOOL) \
--output $(INTERIM_IMAGE_DIR) \
--disable-plugin generate-jli-classes \
--add-modules $(INTERIM_MODULES_LIST)
$(TOUCH) $@
TARGETS += $(jlink_interim_image)
TARGETS += $(INTERIM_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)
################################################################################
include MakeFileEnd.gmk
all: $(TARGETS)
.PHONY: all

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 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
@@ -23,13 +23,14 @@
# questions.
#
include MakeFileStart.gmk
default: all
################################################################################
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk
include JarArchive.gmk
include JavaCompilation.gmk
include JarArchive.gmk
include TextFileProcessing.gmk
# This rule will be depended on due to the MANIFEST line
@@ -66,8 +67,7 @@ $(eval $(call SetupJavaCompilation, BUILD_JRTFS, \
$(eval $(call SetupCopyFiles, COPY_JIMAGE_SERVICE_PROVIDER, \
SRC := $(TOPDIR)/src/java.base/share/classes, \
DEST := $(SUPPORT_OUTPUTDIR)/jrtfs_classes, \
FILES := META-INF/services/java.nio.file.spi.FileSystemProvider, \
))
FILES := META-INF/services/java.nio.file.spi.FileSystemProvider))
$(eval $(call SetupJarArchive, BUILD_JRTFS_JAR, \
DEPENDENCIES := $(BUILD_JRTFS) $(COPY_JIMAGE_SERVICE_PROVIDER), \
@@ -77,7 +77,3 @@ $(eval $(call SetupJarArchive, BUILD_JRTFS_JAR, \
))
all: $(BUILD_JRTFS_JAR)
################################################################################
include MakeFileEnd.gmk

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2019, 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,9 +23,8 @@
# questions.
#
include MakeFileStart.gmk
################################################################################
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk
include TextFileProcessing.gmk
@@ -119,7 +118,3 @@ else # Not macosx
endif # macosx
.PHONY: jdk-bundle jre-bundle bundles
################################################################################
include MakeFileEnd.gmk

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 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
@@ -24,41 +24,44 @@
#
################################################################################
# This is the main makefile containing most actual top level targets.
# This is the main makefile containing most actual top level targets. It needs
# to be called with a SPEC file defined.
################################################################################
# Declare ALL_TARGETS as an immediate variable. This variable is a list of all
# valid top level targets. It's used to declare them all as PHONY and to
# generate the -only targets.
# Declare default target
default:
ALL_TARGETS :=
DEFAULT_TARGET := default-target
include MakeFileStart.gmk
################################################################################
include $(TOPDIR)/make/MainSupport.gmk
include FindTests.gmk
ifeq ($(UPDATE_MODULE_DEPS), true)
# Update module-deps.gmk if requested. This is read in Modules.gmk.
GENERATE_MODULE_DEPS_FILE := true
ifeq ($(wildcard $(SPEC)),)
$(error Main.gmk needs SPEC set to a proper spec.gmk)
endif
include Modules.gmk
# Now load the spec
include $(SPEC)
# Load the vital tools for all the makefiles.
include $(TOPDIR)/make/common/MakeBase.gmk
include $(TOPDIR)/make/common/Modules.gmk
include $(TOPDIR)/make/common/FindTests.gmk
include $(TOPDIR)/make/MainSupport.gmk
# Are we requested to ignore dependencies?
ifneq ($(findstring -only, $(MAKECMDGOALS)), )
DEPS := none
endif
# Declare ALL_TARGETS as an immediate variable. This variable is a list of all
# valid top level targets. It's used to declare them all as PHONY and to
# generate the -only targets.
ALL_TARGETS :=
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, Main.gmk))
# All modules for the current target platform.
ALL_MODULES := $(call FindAllModules)
################################################################################
################################################################################
#
# Recipes for all targets. Only recipes, dependencies are declared later.
@@ -275,18 +278,6 @@ $(eval $(call SetupTarget, eclipse-mixed-env, \
ARGS := --always-make, \
))
$(eval $(call SetupTarget, hotspot-xcode-project, \
MAKEFILE := ide/xcode/hotspot/CreateXcodeProject, \
TARGET := build, \
DEPS := hotspot compile-commands-hotspot jdk-image, \
))
$(eval $(call SetupTarget, open-hotspot-xcode-project, \
MAKEFILE := ide/xcode/hotspot/CreateXcodeProject, \
TARGET := open, \
DEPS := hotspot-xcode-project, \
))
ALL_TARGETS += $(HOTSPOT_VARIANT_TARGETS) $(HOTSPOT_VARIANT_GENSRC_TARGETS) \
$(HOTSPOT_VARIANT_LIBS_TARGETS) $(HOTSPOT_VARIANT_STATIC_LIBS_TARGETS)
@@ -353,14 +344,6 @@ $(eval $(call SetupTarget, vscode-project-ccls, \
DEPS := compile-commands, \
))
################################################################################
# IDEA IntelliJ projects
$(eval $(call SetupTarget, idea-gen-config, \
MAKEFILE := ide/idea/jdk/IdeaGenConfig, \
ARGS := IDEA_OUTPUT="$(IDEA_OUTPUT)" MODULES="$(MODULES)", \
))
################################################################################
# Build demos targets
@@ -417,14 +400,12 @@ $(eval $(call SetupTarget, create-source-revision-tracker, \
))
BOOTCYCLE_TARGET := product-images
BOOTCYCLE_SPEC := $(dir $(SPEC))bootcycle-spec.gmk
bootcycle-images:
ifneq ($(COMPILE_TYPE), cross)
$(call LogWarn, Boot cycle build step 2: Building a new JDK image using previously built image)
$(call MakeDir, $(OUTPUTDIR)/bootcycle-build)
+$(MAKE) $(MAKE_ARGS) -f $(TOPDIR)/make/Init.gmk PARALLEL_TARGETS=$(BOOTCYCLE_TARGET) \
LOG_PREFIX="[bootcycle] " JOBS= SPEC=$(BOOTCYCLE_SPEC) main
LOG_PREFIX="[bootcycle] " JOBS= SPEC=$(dir $(SPEC))bootcycle-spec.gmk main
else
$(call LogWarn, Boot cycle build disabled when cross compiling)
endif
@@ -461,18 +442,6 @@ $(eval $(call SetupTarget, symbols-image, \
TARGET := symbols, \
))
$(eval $(call SetupTarget, static-launcher, \
MAKEFILE := StaticLibs, \
TARGET := static-launcher, \
DEPS := hotspot-static-libs static-libs, \
))
$(eval $(call SetupTarget, static-jdk-image, \
MAKEFILE := StaticLibs, \
TARGET := static-jdk-image, \
DEPS := static-exploded-image jdk-image, \
))
$(eval $(call SetupTarget, static-libs-image, \
MAKEFILE := StaticLibsImage, \
TARGET := static-libs-image, \
@@ -587,10 +556,6 @@ $(eval $(call SetupTarget, update-build-docs, \
MAKEFILE := UpdateBuildDocs, \
))
$(eval $(call SetupTarget, update-sleef-source, \
MAKEFILE := UpdateSleefSource, \
))
$(eval $(call SetupTarget, update-x11wrappers, \
MAKEFILE := UpdateX11Wrappers, \
DEPS := java.base-copy buildtools-jdk, \
@@ -761,17 +726,6 @@ $(eval $(call SetupTarget, test-image-lib, \
DEPS := build-test-lib, \
))
$(eval $(call SetupTarget, build-test-setup-aot, \
MAKEFILE := test/BuildTestSetupAOT, \
DEPS := interim-langtools exploded-image, \
))
$(eval $(call SetupTarget, test-image-setup-aot, \
MAKEFILE := test/BuildTestSetupAOT, \
TARGET := images, \
DEPS := build-test-setup-aot, \
))
ifeq ($(BUILD_FAILURE_HANDLER), true)
# Builds the failure handler jtreg extension
$(eval $(call SetupTarget, build-test-failure-handler, \
@@ -815,13 +769,13 @@ $(eval $(call SetupTarget, build-microbenchmark, \
$(eval $(call SetupTarget, test, \
MAKEFILE := RunTests, \
ARGS := TEST="$(TEST)", \
DEPS := jdk-image test-image $(TEST_DEPS), \
DEPS := jdk-image test-image, \
))
$(eval $(call SetupTarget, exploded-test, \
MAKEFILE := RunTests, \
ARGS := TEST="$(TEST)" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR), \
DEPS := exploded-image test-image $(TEST_DEPS), \
DEPS := exploded-image test-image, \
))
ifeq ($(JCOV_ENABLED), true)
@@ -883,12 +837,6 @@ $(eval $(call SetupTarget, static-libs-graal-bundles, \
DEPS := static-libs-graal-image, \
))
$(eval $(call SetupTarget, static-jdk-bundles, \
MAKEFILE := Bundles, \
TARGET := static-jdk-bundles, \
DEPS := static-jdk-image, \
))
ifeq ($(JCOV_ENABLED), true)
$(eval $(call SetupTarget, jcov-bundles, \
MAKEFILE := Bundles, \
@@ -1014,7 +962,7 @@ else
else ifeq ($(EXTERNAL_BUILDJDK), false)
# When not cross compiling, the BUILD_JDK is the interim jdk image, and
# the javac launcher is needed.
jdk.compiler-gendata: jdk.compiler-launchers java.base-launchers
jdk.compiler-gendata: jdk.compiler-launchers
jdk.javadoc-gendata: jdk.compiler-launchers
endif
@@ -1122,9 +1070,9 @@ else
symbols-image: $(LIBS_TARGETS) $(LAUNCHER_TARGETS)
static-libs-image: hotspot-static-libs static-libs
static-libs-image: hotspot-static-libs $(STATIC_LIBS_TARGETS)
static-libs-graal-image: static-libs
static-libs-graal-image: $(STATIC_LIBS_TARGETS)
bootcycle-images: jdk-image
@@ -1146,8 +1094,8 @@ else
test-make-compile-commands: compile-commands
# Declare dependency for all generated test targets
$(foreach t, $(filter-out test-make%, $(ALL_TEST_TARGETS)), $(eval $t: jdk-image test-image $(TEST_DEPS)))
$(foreach t, $(ALL_EXPLODED_TEST_TARGETS), $(eval $t: exploded-image test-image $(TEST_DEPS)))
$(foreach t, $(filter-out test-make%, $(ALL_TEST_TARGETS)), $(eval $t: jdk-image test-image))
$(foreach t, $(ALL_EXPLODED_TEST_TARGETS), $(eval $t: exploded-image test-image))
interim-image: $(INTERIM_JMOD_TARGETS)
@@ -1290,8 +1238,6 @@ ifeq ($(call isTargetOs, macosx), true)
legacy-images: mac-legacy-jre-bundle
endif
static-exploded-image: static-launcher exploded-image
# These targets build the various documentation images
docs-jdk-image: docs-jdk
docs-javase-image: docs-javase
@@ -1306,8 +1252,7 @@ all-docs-bundles: docs-jdk-bundles docs-javase-bundles docs-reference-bundles
# This target builds the test image
test-image: prepare-test-image test-image-jdk-jtreg-native \
test-image-demos-jdk test-image-libtest-jtreg-native \
test-image-lib test-image-lib-native \
test-image-setup-aot
test-image-lib test-image-lib-native
ifneq ($(JVM_TEST_IMAGE_TARGETS), )
# If JVM_TEST_IMAGE_TARGETS is externally defined, use it instead of the
@@ -1335,7 +1280,7 @@ endif
################################################################################
# all-images builds all our deliverables as images.
all-images: product-images static-jdk-image test-image all-docs-images
all-images: product-images test-image all-docs-images
# all-bundles packages all our deliverables as tar.gz bundles.
all-bundles: product-bundles test-bundles docs-bundles static-libs-bundles
@@ -1348,7 +1293,7 @@ ALL_TARGETS += buildtools hotspot hotspot-libs hotspot-static-libs \
create-buildjdk docs-jdk-api docs-javase-api docs-reference-api docs-jdk \
docs-javase docs-reference docs-javadoc mac-bundles product-images legacy-images \
docs-image docs-javase-image docs-reference-image all-docs-images \
docs-bundles all-docs-bundles test-image all-images static-exploded-image \
docs-bundles all-docs-bundles test-image all-images \
all-bundles
################################################################################
@@ -1356,7 +1301,7 @@ ALL_TARGETS += buildtools hotspot hotspot-libs hotspot-static-libs \
# Traditional targets typically run by users.
# These can be considered aliases for the targets now named by a more
# "modern" naming scheme.
default-target: $(DEFAULT_MAKE_TARGET)
default: $(DEFAULT_MAKE_TARGET)
jdk: exploded-image
images: product-images
docs: docs-image
@@ -1383,14 +1328,11 @@ test-hotspot-jtreg-native: test-hotspot_native_sanity
test-hotspot-gtest: exploded-test-gtest
test-jdk-jtreg-native: test-jdk_native_sanity
# Set dependencies for doc tests
$(eval $(call AddTestDependency, docs_all, docs-jdk))
test-docs: test-docs_all
ALL_TARGETS += $(RUN_TEST_TARGETS) run-test exploded-run-test check \
test-hotspot-jtreg test-hotspot-jtreg-native test-hotspot-gtest \
test-jdk-jtreg-native test-docs
test-jdk-jtreg-native
################################################################################
################################################################################
#
# Clean targets
@@ -1407,7 +1349,7 @@ CLEAN_SUPPORT_DIRS += demos
CLEAN_SUPPORT_DIR_TARGETS := $(addprefix clean-, $(CLEAN_SUPPORT_DIRS))
CLEAN_TESTS += hotspot-jtreg-native jdk-jtreg-native lib
CLEAN_TEST_TARGETS += $(addprefix clean-test-, $(CLEAN_TESTS))
CLEAN_PHASES += gensrc java native include
CLEAN_PHASES := gensrc java native include
CLEAN_PHASE_TARGETS := $(addprefix clean-, $(CLEAN_PHASES))
CLEAN_MODULE_TARGETS := $(addprefix clean-, $(ALL_MODULES))
# Construct targets of the form clean-$module-$phase
@@ -1460,7 +1402,7 @@ dist-clean: clean
($(CD) $(OUTPUTDIR) && \
$(RM) -r *spec.gmk $(CONFIGURESUPPORT_OUTPUTDIR) Makefile compare.sh ide \
configure.log* build.log*)
$(if $(filter $(CONF_NAME), $(notdir $(OUTPUTDIR))), \
$(if $(filter $(CONF_NAME),$(notdir $(OUTPUTDIR))), \
if test "x`$(LS) $(OUTPUTDIR)`" != x; then \
$(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ; \
else \
@@ -1496,12 +1438,13 @@ print-tests:
create-main-targets-include:
$(call LogInfo, Generating main target list)
$(call MakeDir, $(MAKESUPPORT_OUTPUTDIR))
@$(ECHO) ALL_MAIN_TARGETS := $(sort $(ALL_TARGETS)) > \
$(MAKESUPPORT_OUTPUTDIR)/main-targets.gmk
################################################################################
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, Main-post.gmk))
.PHONY: $(ALL_TARGETS)
FRC: # Force target
include MakeFileEnd.gmk

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 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
@@ -23,13 +23,13 @@
# questions.
#
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################
# This file contains helper functions for Main.gmk.
################################################################################
ifndef _MAINSUPPORT_GMK
_MAINSUPPORT_GMK := 1
# Setup make rules for creating a top-level target.
# Parameter 1 is the name of the rule. This name is used as variable prefix.
#
@@ -58,76 +58,76 @@ endef
define CleanDocs
@$(PRINTF) "Cleaning docs ..."
@$(ECHO) "" $(LOG_DEBUG)
@$(PRINTF) "\n" $(LOG_DEBUG)
$(RM) -r $(SUPPORT_OUTPUTDIR)/docs
$(RM) -r $(SUPPORT_OUTPUTDIR)/javadoc
$(RM) -r $(IMAGES_OUTPUTDIR)/docs
@$(ECHO) " done"
@$(PRINTF) " done\n"
endef
# Cleans the dir given as $1
define CleanDir
@$(PRINTF) "Cleaning %s build artifacts ..." "$(strip $1)"
@$(ECHO) "" $(LOG_DEBUG)
@$(PRINTF) "Cleaning $(strip $1) build artifacts ..."
@$(PRINTF) "\n" $(LOG_DEBUG)
($(CD) $(OUTPUTDIR) && $(RM) -r $1)
@$(ECHO) " done"
@$(PRINTF) " done\n"
endef
define CleanSupportDir
@$(PRINTF) "Cleaning %s build artifacts ..." "$(strip $1)"
@$(ECHO) "" $(LOG_DEBUG)
@$(PRINTF) "Cleaning $(strip $1) build artifacts ..."
@$(PRINTF) "\n" $(LOG_DEBUG)
$(RM) -r $(SUPPORT_OUTPUTDIR)/$(strip $1)
@$(ECHO) " done"
@$(PRINTF) " done\n"
endef
define CleanMakeSupportDir
@$(PRINTF) "Cleaning %s make support artifacts ..." "$(strip $1)"
@$(ECHO) "" $(LOG_DEBUG)
@$(PRINTF) "Cleaning $(strip $1) make support artifacts ..."
@$(PRINTF) "\n" $(LOG_DEBUG)
$(RM) -r $(MAKESUPPORT_OUTPUTDIR)/$(strip $1)
@$(ECHO) " done"
@$(PRINTF) " done\n"
endef
define CleanTest
@$(PRINTF) "Cleaning test %s ..." "$(strip $1)"
@$(ECHO) "" $(LOG_DEBUG)
@$(PRINTF) "Cleaning test $(strip $1) ..."
@$(PRINTF) "\n" $(LOG_DEBUG)
$(RM) -r $(SUPPORT_OUTPUTDIR)/test/$(strip $(subst -,/,$1))
# Remove as much of the test directory structure as is empty
$(RMDIR) -p $(dir $(SUPPORT_OUTPUTDIR)/test/$(strip $(subst -,/,$1))) 2> /dev/null || true
@$(ECHO) " done"
@$(PRINTF) " done\n"
endef
define Clean-gensrc
@$(PRINTF) "Cleaning gensrc %s..." "$(if $1,for $(strip $1) )"
@$(ECHO) "" $(LOG_DEBUG)
@$(PRINTF) "Cleaning gensrc $(if $1,for $(strip $1) )..."
@$(PRINTF) "\n" $(LOG_DEBUG)
$(RM) -r $(SUPPORT_OUTPUTDIR)/gensrc/$(strip $1)
@$(ECHO) " done"
@$(PRINTF) " done\n"
endef
define Clean-java
@$(PRINTF) "Cleaning java %s..." "$(if $1,for $(strip $1) )"
@$(ECHO) "" $(LOG_DEBUG)
@$(PRINTF) "Cleaning java $(if $1,for $(strip $1) )..."
@$(PRINTF) "\n" $(LOG_DEBUG)
$(RM) -r $(JDK_OUTPUTDIR)/modules/$(strip $1)
$(RM) -r $(SUPPORT_OUTPUTDIR)/special_classes/$(strip $1)
$(ECHO) " done"
$(PRINTF) "Cleaning headers %s..." "$(if $1,for $(strip $1) )"
$(PRINTF) " done\n"
$(PRINTF) "Cleaning headers $(if $1,for $(strip $1)) ..."
$(RM) -r $(SUPPORT_OUTPUTDIR)/headers/$(strip $1)
@$(ECHO) " done"
@$(PRINTF) " done\n"
endef
define Clean-native
@$(PRINTF) "Cleaning native %s..." "$(if $1,for $(strip $1) )"
@$(ECHO) "" $(LOG_DEBUG)
@$(PRINTF) "Cleaning native $(if $1,for $(strip $1) )..."
@$(PRINTF) "\n" $(LOG_DEBUG)
$(RM) -r $(SUPPORT_OUTPUTDIR)/native/$(strip $1)
$(RM) -r $(SUPPORT_OUTPUTDIR)/modules_libs/$(strip $1)
$(RM) -r $(SUPPORT_OUTPUTDIR)/modules_cmds/$(strip $1)
@$(ECHO) " done"
@$(PRINTF) " done\n"
endef
define Clean-include
@$(PRINTF) "Cleaning include %s..." "$(if $1,for $(strip $1) )"
@$(ECHO) "" $(LOG_DEBUG)
@$(PRINTF) "Cleaning include $(if $1,for $(strip $1) )..."
@$(PRINTF) "\n" $(LOG_DEBUG)
$(RM) -r $(SUPPORT_OUTPUTDIR)/modules_include/$(strip $1)
@$(ECHO) " done"
@$(PRINTF) " done\n"
endef
define CleanModule
@@ -137,19 +137,10 @@ define CleanModule
$(call Clean-include, $1)
endef
define AddTestDependency
test-$(strip $1): $2
exploded-test-$(strip $1): $2
ifneq ($(filter $(TEST), $1), )
TEST_DEPS += $2
endif
endef
################################################################################
PHASE_MAKEDIRS += $(TOPDIR)/make
PHASE_MAKEDIRS := $(TOPDIR)/make
# Helper macro for DeclareRecipesForPhase
# Declare a recipe for calling the module and phase specific makefile.
@@ -184,7 +175,7 @@ define DeclareRecipesForPhaseAndModule
$$(foreach d, $$($1_$2_TOPDIRS), \
$$(eval $1 += $2-$$($1_TARGET_SUFFIX)-$$(notdir $$d)))
endif
ifeq ($(NO_RECIPES), )
ifeq ($(NO_RECIPES),)
$$(eval $$(call DeclareRecipeForModuleMakefile,$1,$2))
endif
$1 += $2-$$($1_TARGET_SUFFIX)
@@ -206,8 +197,8 @@ endef
# $1_MODULES : All modules that had rules generated
# $1_TARGETS : All targets generated
define DeclareRecipesForPhase
$(foreach i, 2 3 4 5 6 7 8, $(if $(strip $($i)),$(strip $1)_$(strip $($i)))$(NEWLINE))
$(if $(9), $(error Internal makefile error: Too many arguments to \
$(foreach i,2 3 4 5 6 7 8, $(if $(strip $($i)),$(strip $1)_$(strip $($i)))$(NEWLINE))
$(if $(9),$(error Internal makefile error: Too many arguments to \
DeclareRecipesForPhase, please update MakeHelper.gmk))
$$(foreach m, $$($(strip $1)_CHECK_MODULES), \
@@ -218,5 +209,4 @@ endef
################################################################################
endif # include guard
include MakeIncludeEnd.gmk
endif # _MAINSUPPORT_GMK

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,8 @@
# questions.
#
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################
ifndef _MODULE_TOOLS_GMK
_MODULE_TOOLS_GMK := 1
include JavaCompilation.gmk
@@ -51,7 +49,4 @@ TOOL_ADD_PACKAGES_ATTRIBUTE := $(BUILD_JAVA) $(JAVA_FLAGS_SMALL_BUILDJDK) \
--add-exports java.base/jdk.internal.module=ALL-UNNAMED \
build.tools.jigsaw.AddPackagesAttribute
################################################################################
endif # include guard
include MakeIncludeEnd.gmk
endif # _MODULE_TOOLS_GMK

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 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
@@ -23,51 +23,27 @@
# questions.
#
include MakeFileStart.gmk
################################################################################
# This makefile is called from Main.gmk, through a macro in MakeHelpers.gmk
# and wraps calls to makefiles for specific modules and build phases. Having
# this wrapper reduces the need for boilerplate code. It also provides
# opportunity for automatic copying of files to an interim exploded runnable
# image.
################################################################################
default: all
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk
include Modules.gmk
MODULE_SRC := $(TOPDIR)/src/$(MODULE)
################################################################################
# Include module specific build settings
# All makefiles should add the targets to be built to this variable.
TARGETS :=
THIS_SNIPPET := $(call GetModuleSnippetName, $(MAKEFILE_PREFIX))
ifneq ($(wildcard $(THIS_SNIPPET)), )
include MakeSnippetStart.gmk
# Include the file being wrapped.
include $(THIS_SNIPPET)
include MakeSnippetEnd.gmk
endif
ifeq ($(MAKEFILE_PREFIX), Lib)
# We need to keep track of what libraries are generated/needed by this
# module. This information is required when doing static linking, to know
# which static library files to include. The variable $(MODULE)_INCLUDED_LIBS is
# added to for each call to SetupJdkLibrary. The file module-included-libs.txt is then
# read in StaticLibs.gmk.
ifneq ($($(MODULE)_INCLUDED_LIBS), )
LIBLIST := $(SUPPORT_OUTPUTDIR)/modules_static-libs/$(MODULE)/module-included-libs.txt
$(LIBLIST): $(TARGETS)
$(call MakeDir, $(@D))
$(ECHO) $($(MODULE)_INCLUDED_LIBS) > $@
TARGETS += $(LIBLIST)
endif
endif
# Include the file being wrapped.
include $(MAKEFILE_PREFIX).gmk
# Setup copy rules from the modules directories to the jdk image directory.
ifeq ($(call isTargetOs, windows), true)
@@ -135,12 +111,8 @@ $(eval $(call SetupCopyFiles, COPY_CONF, \
))
ifeq ($(GENERATE_COMPILE_COMMANDS_ONLY), true)
TARGETS := $(filter $(MAKESUPPORT_OUTPUTDIR)/compile-commands/%, $(TARGETS))
all: $(filter $(MAKESUPPORT_OUTPUTDIR)/compile-commands/%, $(TARGETS))
else
TARGETS += $(COPY_LIBS_TO_BIN) $(COPY_LIBS_TO_LIB) \
all: $(TARGETS) $(COPY_LIBS_TO_BIN) $(COPY_LIBS_TO_LIB) \
$(COPY_INCLUDE) $(COPY_CMDS) $(COPY_MAN) $(COPY_CONF) $(LINK_LIBS_TO_LIB)
endif
################################################################################
include MakeFileEnd.gmk

View File

@@ -1,224 +0,0 @@
#
# Copyright (c) 2012, 2025, 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 is the earliest part of the build bootstrap process (not counting
# Makefile that includes it). Its main responsibility is to figure out what
# configuration to use and pick up the corresponding SPEC file. It will then
# call Init.gmk with this SPEC for further bootstrapping.
################################################################################
# This must be the first rule
default:
.PHONY: default
# Inclusion of this pseudo-target will cause make to execute this file
# serially, regardless of -j.
.NOTPARALLEL:
IS_PREINIT_ENV := true
# Include our helper functions.
include $(TOPDIR)/make/PreInitSupport.gmk
include $(TOPDIR)/make/common/LogUtils.gmk
# Here are "global" targets, i.e. targets that can be executed without having
# a configuration. This will define ALL_GLOBAL_TARGETS.
include $(TOPDIR)/make/Global.gmk
# Targets provided by Init.gmk.
ALL_INIT_TARGETS := print-modules print-targets print-configuration \
print-tests reconfigure pre-compare-build post-compare-build \
create-make-helpers
# CALLED_TARGETS is the list of targets that the user provided,
# or "default" if unspecified.
CALLED_TARGETS := $(if $(MAKECMDGOALS), $(MAKECMDGOALS), default)
# Extract non-global targets that require a spec file.
CALLED_SPEC_TARGETS := $(filter-out $(ALL_GLOBAL_TARGETS), $(CALLED_TARGETS))
# If we have only global targets, or if we are called with -qp (assuming an
# external part, e.g. bash completion, is trying to understand our targets),
# we will skip SPEC location and the sanity checks.
ifeq ($(CALLED_SPEC_TARGETS), )
SKIP_SPEC := true
endif
ifeq ($(findstring p, $(MAKEFLAGS))$(findstring q, $(MAKEFLAGS)), pq)
SKIP_SPEC := true
endif
ifneq ($(SKIP_SPEC), true)
############################################################################
# This is the common case: we have been called from the command line by the
# user with a target that should be delegated to Main.gmk, so we need to
# figure out a proper SPEC and call Init.gmk with it.
############################################################################
# Basic checks on environment and command line.
$(eval $(call CheckControlVariables))
$(eval $(call CheckInvalidMakeFlags))
# Check that CONF_CHECK is valid.
$(eval $(call ParseConfCheckOption))
# Check that the LOG given is valid, and set LOG_LEVEL, LOG_NOFILE,
# MAKE_LOG_VARS and MAKE_LOG_FLAGS.
$(eval $(call ParseLogLevel))
# After this SPECS contain 1..N spec files (otherwise ParseConfAndSpec fails).
$(eval $(call ParseConfAndSpec))
# Extract main targets from Main.gmk using the spec(s) provided. In theory,
# with multiple specs, we should find the intersection of targets provided
# by all specs, but we approximate this by an arbitrary spec from the list.
# This will setup ALL_MAIN_TARGETS.
$(eval $(call DefineMainTargets, FORCE, $(firstword $(SPECS))))
# Separate called targets depending on type.
INIT_TARGETS := $(filter $(ALL_INIT_TARGETS), $(CALLED_SPEC_TARGETS))
MAIN_TARGETS := $(filter $(ALL_MAIN_TARGETS), $(CALLED_SPEC_TARGETS))
SEQUENTIAL_TARGETS := $(filter dist-clean clean%, $(MAIN_TARGETS))
PARALLEL_TARGETS := $(filter-out $(SEQUENTIAL_TARGETS), $(MAIN_TARGETS))
MAKE_INIT_ARGS := $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -I $(TOPDIR)/make/common
# The spec files depend on the autoconf source code. This check makes sure
# the configuration is up to date after changes to configure.
$(SPECS): $(wildcard $(TOPDIR)/make/autoconf/*) \
$(if $(CUSTOM_CONFIG_DIR), $(wildcard $(CUSTOM_CONFIG_DIR)/*)) \
$(addprefix $(TOPDIR)/make/conf/, version-numbers.conf branding.conf) \
$(if $(CUSTOM_CONF_DIR), $(wildcard $(addprefix $(CUSTOM_CONF_DIR)/, \
version-numbers.conf branding.conf)))
ifeq ($(CONF_CHECK), fail)
@echo Error: The configuration is not up to date for \
"'$(lastword $(subst /, , $(dir $@)))'."
$(call PrintConfCheckFailed)
@exit 2
else ifeq ($(CONF_CHECK), auto)
@echo Note: The configuration is not up to date for \
"'$(lastword $(subst /, , $(dir $@)))'."
@( cd $(TOPDIR) && \
$(MAKE) $(MAKE_INIT_ARGS) -f $(TOPDIR)/make/Init.gmk SPEC=$@ \
reconfigure )
else ifeq ($(CONF_CHECK), ignore)
# Do nothing
endif
# Do not let make delete spec files even if aborted while doing a reconfigure
.PRECIOUS: $(SPECS)
# Unless reconfigure is explicitly called, let all main targets depend on
# the spec files to be up to date.
ifeq ($(findstring reconfigure, $(INIT_TARGETS)), )
$(MAIN_TARGETS): $(SPECS)
endif
make-info:
ifneq ($(findstring $(LOG_LEVEL), info debug trace), )
$(info Running make as '$(strip $(MAKE) $(MFLAGS) \
$(COMMAND_LINE_VARIABLES) $(MAKECMDGOALS))')
endif
MAKE_INIT_MAIN_TARGET_ARGS := \
USER_MAKE_VARS="$(USER_MAKE_VARS)" MAKE_LOG_FLAGS=$(MAKE_LOG_FLAGS) \
$(MAKE_LOG_VARS) \
INIT_TARGETS="$(INIT_TARGETS)" \
SEQUENTIAL_TARGETS="$(SEQUENTIAL_TARGETS)" \
PARALLEL_TARGETS="$(PARALLEL_TARGETS)"
# Now the init and main targets will be called, once for each SPEC. The
# recipe will be run once for every target specified, but we only want to
# execute the recipe a single time, hence the TARGET_DONE with a dummy
# command if true.
# The COMPARE_BUILD part implements special support for makefile development.
$(ALL_INIT_TARGETS) $(ALL_MAIN_TARGETS): make-info
@$(if $(TARGET_DONE), \
true \
, \
( cd $(TOPDIR) && \
$(foreach spec, $(SPECS), \
$(MAKE) $(MAKE_INIT_ARGS) -j 1 -f $(TOPDIR)/make/Init.gmk \
SPEC=$(spec) TOPDIR_ALT=$(TOPDIR) \
$(MAKE_INIT_MAIN_TARGET_ARGS) main && \
$(if $(and $(COMPARE_BUILD), $(PARALLEL_TARGETS)), \
$(MAKE) $(MAKE_INIT_ARGS) -f $(TOPDIR)/make/Init.gmk \
SPEC=$(spec) TOPDIR_ALT=$(TOPDIR) \
COMPARE_BUILD="$(COMPARE_BUILD)" \
pre-compare-build && \
$(MAKE) $(MAKE_INIT_ARGS) -j 1 -f $(TOPDIR)/make/Init.gmk \
SPEC=$(spec) TOPDIR_ALT=$(TOPDIR) \
COMPARE_BUILD="$(COMPARE_BUILD):NODRYRUN=true" \
$(MAKE_INIT_MAIN_TARGET_ARGS) main && \
$(MAKE) $(MAKE_INIT_ARGS) -f $(TOPDIR)/make/Init.gmk \
SPEC=$(spec) TOPDIR_ALT=$(TOPDIR) \
COMPARE_BUILD="$(COMPARE_BUILD):NODRYRUN=true" \
post-compare-build && \
) \
) true ) \
$(eval TARGET_DONE=true) \
)
.PHONY: $(ALL_MAIN_TARGETS) $(ALL_INIT_TARGETS)
else # SKIP_SPEC=true
############################################################################
# We have only global targets, or are called with -pq (from command
# completion). In this case we might not even have a configuration at all, but
# still need to handle the situation gracefully even if there is no SPEC file.
############################################################################
ifeq ($(wildcard $(SPEC)), )
# If we have no SPEC provided, we will just make a "best effort" target list.
# First try to grab any available pre-existing main-targets.gmk.
main_targets_file := $(firstword $(wildcard $(build_dir)/*/make-support/main-targets.gmk))
ifneq ($(main_targets_file), )
# Extract the SPEC that corresponds to this main-targets.gmk file.
SPEC := $(patsubst %/make-support/main-targets.gmk, %/spec.gmk, $(main_targets_file))
else
# None found, pick an arbitrary SPEC for which to generate a file
SPEC := $(firstword $(all_spec_files))
endif
endif
ifneq ($(wildcard $(SPEC)), )
$(eval $(call DefineMainTargets, LAZY, $(SPEC)))
else
# If we have no configurations we can not provide any main targets.
ALL_MAIN_TARGETS :=
endif
ALL_TARGETS := $(sort $(ALL_GLOBAL_TARGETS) $(ALL_MAIN_TARGETS) $(ALL_INIT_TARGETS))
# Just list all our targets.
$(ALL_TARGETS):
.PHONY: $(ALL_TARGETS)
endif # $(SKIP_SPEC)!=true
################################################################################

View File

@@ -1,292 +0,0 @@
#
# Copyright (c) 2011, 2025, 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.
#
################################################################################
# Helper functions for PreInit.gmk, the initial part of initialization before
# the SPEC file is loaded. Most of these functions provide parsing and setting
# up make options from the command-line.
################################################################################
# Include the corresponding closed file, if present.
ifneq ($(CUSTOM_MAKE_DIR), )
-include $(CUSTOM_MAKE_DIR)/PreInitSupport-pre.gmk
endif
# COMMA is defined in spec.gmk, but that is not included yet
COMMA := ,
# Essential control variables that are handled by PreInit.gmk or Init.gmk
INIT_CONTROL_VARIABLES := LOG CONF CONF_NAME SPEC JOBS CONF_CHECK ALLOW \
COMPARE_BUILD
# All known make control variables; these are handled in other makefiles
MAKE_CONTROL_VARIABLES += JDK_FILTER SPEC_FILTER \
TEST TEST_JOBS JTREG GTEST MICRO TEST_OPTS TEST_VM_OPTS TEST_DEPS
ALL_CONTROL_VARIABLES := $(INIT_CONTROL_VARIABLES) $(MAKE_CONTROL_VARIABLES)
# Define a simple reverse function.
# Should maybe move to MakeBase.gmk, but we can't include that file now.
reverse = \
$(if $(strip $(1)), $(call reverse, $(wordlist 2, $(words $(1)), $(1)))) \
$(firstword $(1))
# The variable MAKEOVERRIDES contains variable assignments from the command
# line, but in reverse order to what the user entered.
# The '§' <=> '\ 'dance is needed to keep values with space in them connected.
COMMAND_LINE_VARIABLES := $(subst §,\ , $(call reverse, $(subst \ ,§,$(MAKEOVERRIDES))))
# A list like FOO="val1" BAR="val2" containing all user-supplied make
# variables that we should propagate.
# The '§' <=> '\ 'dance is needed to keep values with space in them connected.
# This explicit propagation is needed to avoid problems with characters that needs
# escaping.
USER_MAKE_VARS := $(subst §,\ , $(filter-out $(addsuffix =%, $(ALL_CONTROL_VARIABLES)), \
$(subst \ ,§,$(MAKEOVERRIDES))))
# Setup information about available configurations, if any.
ifneq ($(CUSTOM_ROOT), )
build_dir := $(CUSTOM_ROOT)/build
else
build_dir := $(TOPDIR)/build
endif
all_spec_files := $(wildcard $(build_dir)/*/spec.gmk)
# Extract the configuration names from the path
all_confs := $(patsubst %/spec.gmk, %, $(patsubst $(build_dir)/%, %, $(all_spec_files)))
# Check for unknown command-line variables
define CheckControlVariables
command_line_variables := $$(strip $$(foreach var, \
$$(subst \ ,_,$$(MAKEOVERRIDES)), \
$$(firstword $$(subst =, , $$(var)))))
allowed_command_line_variables := $$(strip $$(subst $$(COMMA), , $$(ALLOW)))
unknown_command_line_variables := $$(strip \
$$(filter-out $$(ALL_CONTROL_VARIABLES) $$(allowed_command_line_variables), \
$$(command_line_variables)))
ifneq ($$(unknown_command_line_variables), )
$$(info Note: Command line contains non-control variables:)
$$(foreach var, $$(unknown_command_line_variables), $$(info * $$(var)=$$($$(var))))
$$(info Make sure it is not mistyped, and that you intend to override this variable.)
$$(info 'make help' will list known control variables.)
$$(info )
endif
endef
# Check for invalid make flags like -j
define CheckInvalidMakeFlags
# This is a trick to get this rule to execute before any other rules
# MAKEFLAGS only indicate -j if read in a recipe (!)
$$(TOPDIR)/make/PreInit.gmk: .FORCE
$$(if $$(findstring --jobserver, $$(MAKEFLAGS)), \
$$(info Error: 'make -jN' is not supported, use 'make JOBS=N') \
$$(error Cannot continue) \
)
.FORCE:
.PHONY: .FORCE
endef
# Check that the CONF_CHECK option is valid and set up handling
define ParseConfCheckOption
ifeq ($$(CONF_CHECK), )
# Default behavior is fail
CONF_CHECK := fail
else ifneq ($$(filter-out auto fail ignore, $$(CONF_CHECK)), )
$$(info Error: CONF_CHECK must be one of: auto, fail or ignore.)
$$(error Cannot continue)
endif
endef
define ParseConfAndSpec
ifneq ($$(origin SPEC), undefined)
# We have been given a SPEC, check that it works out properly
ifneq ($$(origin CONF), undefined)
# We also have a CONF argument. We can't have both.
$$(info Error: Cannot use CONF=$$(CONF) and SPEC=$$(SPEC) at the same time. Choose one.)
$$(error Cannot continue)
endif
ifneq ($$(origin CONF_NAME), undefined)
# We also have a CONF_NAME argument. We can't have both.
$$(info Error: Cannot use CONF_NAME=$$(CONF_NAME) and SPEC=$$(SPEC) at the same time. Choose one.)
$$(error Cannot continue)
endif
ifeq ($$(wildcard $$(SPEC)), )
$$(info Error: Cannot locate spec.gmk, given by SPEC=$$(SPEC).)
$$(error Cannot continue)
endif
ifeq ($$(filter /%, $$(SPEC)), )
# If given with relative path, make it absolute
SPECS := $$(CURDIR)/$$(strip $$(SPEC))
else
SPECS := $$(SPEC)
endif
# For now, unset this SPEC variable.
override SPEC :=
else
# Use spec.gmk files in the build output directory
ifeq ($$(all_spec_files), )
ifneq ($(CUSTOM_ROOT), )
$$(info Error: No configurations found for $$(CUSTOM_ROOT).)
else
$$(info Error: No configurations found for $$(TOPDIR).)
endif
$$(info Please run 'bash configure' to create a configuration.)
$$(info )
$$(error Cannot continue)
endif
ifneq ($$(origin CONF_NAME), undefined)
ifneq ($$(origin CONF), undefined)
# We also have a CONF argument. We can't have both.
$$(info Error: Cannot use CONF=$$(CONF) and CONF_NAME=$$(CONF_NAME) at the same time. Choose one.)
$$(error Cannot continue)
endif
matching_conf := $$(strip $$(filter $$(CONF_NAME), $$(all_confs)))
ifeq ($$(matching_conf), )
$$(info Error: No configurations found matching CONF_NAME=$$(CONF_NAME).)
$$(info Available configurations in $$(build_dir):)
$$(foreach var, $$(all_confs), $$(info * $$(var)))
$$(error Cannot continue)
else ifneq ($$(words $$(matching_conf)), 1)
$$(info Error: Matching more than one configuration CONF_NAME=$$(CONF_NAME).)
$$(info Available configurations in $$(build_dir):)
$$(foreach var, $$(all_confs), $$(info * $$(var)))
$$(error Cannot continue)
else
$$(info Building configuration '$$(matching_conf)' (matching CONF_NAME=$$(CONF_NAME)))
endif
# Create a SPEC definition. This will contain the path to exactly one spec file.
SPECS := $$(build_dir)/$$(matching_conf)/spec.gmk
else ifneq ($$(origin CONF), undefined)
# User have given a CONF= argument.
ifeq ($$(CONF), )
# If given CONF=, match all configurations
matching_confs := $$(strip $$(all_confs))
else
# Otherwise select those that contain the given CONF string
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)), )
ifneq ($$(word 2, $$(matching_confs)), )
# Don't repeat this output on make restarts caused by including
# generated files.
ifeq ($$(MAKE_RESTARTS), )
$$(info Using exact match for CONF=$$(CONF) (other matches are possible))
endif
endif
# If we found an exact match, use that
matching_confs := $$(CONF)
endif
endif
ifeq ($$(matching_confs), )
$$(info Error: No configurations found matching CONF=$$(CONF).)
$$(info Available configurations in $$(build_dir):)
$$(foreach var, $$(all_confs), $$(info * $$(var)))
$$(error Cannot continue)
else
# Don't repeat this output on make restarts caused by including
# generated files.
ifeq ($$(MAKE_RESTARTS), )
ifeq ($$(words $$(matching_confs)), 1)
ifneq ($$(findstring $$(LOG_LEVEL), info debug trace), )
$$(info Building configuration '$$(matching_confs)' (matching CONF=$$(CONF)))
endif
else
$$(info Building these configurations (matching CONF=$$(CONF)):)
$$(foreach var, $$(matching_confs), $$(info * $$(var)))
endif
endif
endif
# Create a SPEC definition. This will contain the path to one or more spec.gmk files.
SPECS := $$(addsuffix /spec.gmk, $$(addprefix $$(build_dir)/, $$(matching_confs)))
else
# No CONF or SPEC given, check the available configurations
ifneq ($$(words $$(all_spec_files)), 1)
$$(info Error: No CONF given, but more than one configuration found.)
$$(info Available configurations in $$(build_dir):)
$$(foreach var, $$(all_confs), $$(info * $$(var)))
$$(info Please retry building with CONF=<config pattern> (or SPEC=<spec file>).)
$$(info )
$$(error Cannot continue)
endif
# We found exactly one configuration, use it
SPECS := $$(strip $$(all_spec_files))
endif
endif
endef
# Extract main targets from Main.gmk using the spec provided in $2.
#
# Param 1: FORCE = force generation of main-targets.gmk or LAZY = do not force.
# Param 2: The SPEC file to use.
define DefineMainTargets
SPEC_FILE := $(strip $2)
# We will start by making sure the main-targets.gmk file is removed, if
# make has not been restarted. By the -include, we will trigger the
# rule for generating the file (which is never there since we removed it),
# thus generating it fresh, and make will restart, incrementing the restart
# count.
main_targets_file := $$(dir $$(SPEC_FILE))make-support/main-targets.gmk
ifeq ($$(MAKE_RESTARTS), )
# Only do this if make has not been restarted, and if we do not force it.
ifeq ($(strip $1), FORCE)
$$(shell rm -f $$(main_targets_file))
endif
endif
$$(main_targets_file):
@( cd $$(TOPDIR) && \
$$(MAKE) $$(MAKE_LOG_FLAGS) -s -r -R -f $$(TOPDIR)/make/GenerateFindTests.gmk \
-I $$(TOPDIR)/make/common SPEC=$$(SPEC_FILE) TOPDIR_ALT=$$(TOPDIR))
@( cd $$(TOPDIR) && \
$$(MAKE) $$(MAKE_LOG_FLAGS) -s -r -R -f $$(TOPDIR)/make/Main.gmk \
-I $$(TOPDIR)/make/common SPEC=$$(SPEC_FILE) TOPDIR_ALT=$$(TOPDIR) \
UPDATE_MODULE_DEPS=true NO_RECIPES=true \
$$(MAKE_LOG_VARS) \
create-main-targets-include )
# Now include main-targets.gmk. This will define ALL_MAIN_TARGETS.
-include $$(main_targets_file)
endef
define PrintConfCheckFailed
@echo ' '
@echo "Please rerun configure! Easiest way to do this is by running"
@echo "'make reconfigure'."
@echo "This behavior may also be changed using CONF_CHECK=<ignore|auto>."
@echo ' '
endef
################################################################################

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
# 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
@@ -23,12 +23,16 @@
# questions.
#
include MakeFileStart.gmk
default: all
include $(SPEC)
include MakeBase.gmk
################################################################################
# This makefile generates the "release" file into the exploded image. Jlink is
# then responsible for using this as the base for release files in each linked
# image.
#
################################################################################
BASE_RELEASE_FILE := $(JDK_OUTPUTDIR)/release
@@ -81,4 +85,10 @@ TARGETS += $(BASE_RELEASE_FILE)
################################################################################
include MakeFileEnd.gmk
$(eval $(call IncludeCustomExtension, ReleaseFile.gmk))
################################################################################
all: $(TARGETS)
.PHONY: all default

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
# 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
@@ -23,10 +23,10 @@
# questions.
#
include MakeFileStart.gmk
################################################################################
default: all
include $(SPEC)
include MakeBase.gmk
include FindTests.gmk
# We will always run multiple tests serially
@@ -45,7 +45,7 @@ ifneq ($(TEST_VM_OPTS), )
endif
$(eval $(call ParseKeywordVariable, TEST_OPTS, \
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR JCOV JCOV_DIFF_CHANGESET AOT_JDK, \
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR JCOV JCOV_DIFF_CHANGESET, \
STRING_KEYWORDS := VM_OPTIONS JAVA_OPTIONS, \
))
@@ -71,6 +71,9 @@ ifeq ($(call isTargetOs, windows), true)
endif
endif
################################################################################
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, RunTests.gmk))
################################################################################
# This is the JDK that we will test
@@ -101,12 +104,11 @@ ifneq ($(wildcard $(JTREG_FAILURE_HANDLER)), )
-observerDir:$(JTREG_FAILURE_HANDLER) \
-timeoutHandler:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler \
-observer:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver \
-timeoutHandlerTimeout:$(JTREG_FAILURE_HANDLER_TIMEOUT) \
#
-timeoutHandlerTimeout:$(JTREG_FAILURE_HANDLER_TIMEOUT)
endif
GTEST_LAUNCHER_DIRS := $(patsubst %/gtestLauncher$(EXECUTABLE_SUFFIX), %, \
$(wildcard $(TEST_IMAGE_DIR)/hotspot/gtest/*/gtestLauncher$(EXECUTABLE_SUFFIX)))
GTEST_LAUNCHER_DIRS := $(patsubst %/gtestLauncher, %, \
$(wildcard $(TEST_IMAGE_DIR)/hotspot/gtest/*/gtestLauncher))
GTEST_VARIANTS := $(strip $(patsubst $(TEST_IMAGE_DIR)/hotspot/gtest/%, %, \
$(GTEST_LAUNCHER_DIRS)))
@@ -115,7 +117,6 @@ JTREG_COV_OPTIONS :=
ifeq ($(TEST_OPTS_JCOV), true)
JCOV_OUTPUT_DIR := $(TEST_RESULTS_DIR)/jcov-output
JCOV_SUPPORT_DIR := $(TEST_SUPPORT_DIR)/jcov-support
JCOV_GRABBER_LOG := $(JCOV_OUTPUT_DIR)/grabber.log
JCOV_RESULT_FILE := $(JCOV_OUTPUT_DIR)/result.xml
JCOV_REPORT := $(JCOV_OUTPUT_DIR)/report
@@ -200,13 +201,11 @@ $(eval $(call SetTestOpt,JOBS,JTREG))
$(eval $(call SetTestOpt,TIMEOUT_FACTOR,JTREG))
$(eval $(call SetTestOpt,FAILURE_HANDLER_TIMEOUT,JTREG))
$(eval $(call SetTestOpt,REPORT,JTREG))
$(eval $(call SetTestOpt,AOT_JDK,JTREG))
$(eval $(call ParseKeywordVariable, JTREG, \
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR FAILURE_HANDLER_TIMEOUT \
TEST_MODE ASSERT VERBOSE RETAIN TEST_THREAD_FACTORY JVMTI_STRESS_AGENT \
MAX_MEM RUN_PROBLEM_LISTS RETRY_COUNT REPEAT_COUNT MAX_OUTPUT REPORT \
AOT_JDK $(CUSTOM_JTREG_SINGLE_KEYWORDS), \
TEST_MODE ASSERT VERBOSE RETAIN TEST_THREAD_FACTORY MAX_MEM RUN_PROBLEM_LISTS \
RETRY_COUNT REPEAT_COUNT MAX_OUTPUT REPORT $(CUSTOM_JTREG_SINGLE_KEYWORDS), \
STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS \
EXTRA_PROBLEM_LISTS LAUNCHER_OPTIONS \
$(CUSTOM_JTREG_STRING_KEYWORDS), \
@@ -264,7 +263,6 @@ jaxp_JTREG_PROBLEM_LIST += $(TOPDIR)/test/jaxp/ProblemList.txt
langtools_JTREG_PROBLEM_LIST += $(TOPDIR)/test/langtools/ProblemList.txt
hotspot_JTREG_PROBLEM_LIST += $(TOPDIR)/test/hotspot/jtreg/ProblemList.txt
lib-test_JTREG_PROBLEM_LIST += $(TOPDIR)/test/lib-test/ProblemList.txt
docs_JTREG_PROBLEM_LIST += $(TOPDIR)/test/docs/ProblemList.txt
################################################################################
# Parse test selection
@@ -502,7 +500,7 @@ define SetupRunGtestTestBody
endif
ifneq ($$(GTEST_REPEAT), )
$1_GTEST_REPEAT := --gtest_repeat=$$(GTEST_REPEAT)
$1_GTEST_REPEAT :=--gtest_repeat=$$(GTEST_REPEAT)
endif
run-test-$1: pre-run-test
@@ -529,33 +527,21 @@ define SetupRunGtestTestBody
$$(call LogWarn, Test report is stored in $$(strip \
$$(subst $$(TOPDIR)/, , $$($1_TEST_RESULTS_DIR))))
$$(if $$(wildcard $$($1_RESULT_FILE)), \
$$(eval $1_RUN := $$(shell $$(AWK) \
'/==========.* tests? from .* test (cases?|suites?) ran/ { print $$$$2 }' \
$$($1_RESULT_FILE))) \
$$(if $$($1_RUN), , $$(eval $1_RUN := 0)) \
$$(eval $1_TOTAL := $$(shell $$(AWK) '/==========.* tests? from .* \
test (cases?|suites?) ran/ { print $$$$2 }' $$($1_RESULT_FILE))) \
$$(if $$($1_TOTAL), , $$(eval $1_TOTAL := 0)) \
$$(eval $1_PASSED := $$(shell $$(AWK) '/\[ PASSED \] .* tests?./ \
{ print $$$$4 }' $$($1_RESULT_FILE))) \
$$(if $$($1_PASSED), , $$(eval $1_PASSED := 0)) \
$$(eval $1_GTEST_DISABLED := $$(shell $$(AWK) '/YOU HAVE .* DISABLED TEST/ \
{ print $$$$3 }' $$($1_RESULT_FILE))) \
$$(if $$($1_GTEST_DISABLED), , $$(eval $1_GTEST_DISABLED := 0)) \
$$(eval $1_GTEST_SKIPPED := $$(shell $$(AWK) '/\[ SKIPPED \] .* tests?.*/ \
{ print $$$$4 }' $$($1_RESULT_FILE))) \
$$(if $$($1_GTEST_SKIPPED), , $$(eval $1_GTEST_SKIPPED := 0)) \
$$(eval $1_SKIPPED := $$(shell \
$$(EXPR) $$($1_GTEST_DISABLED) + $$($1_GTEST_SKIPPED))) \
$$(eval $1_FAILED := $$(shell $$(AWK) '/\[ FAILED \] .* tests?, \
listed below/ { print $$$$4 }' $$($1_RESULT_FILE))) \
$$(if $$($1_FAILED), , $$(eval $1_FAILED := 0)) \
$$(eval $1_ERROR := $$(shell \
$$(EXPR) $$($1_RUN) - $$($1_PASSED) - $$($1_FAILED) - $$($1_GTEST_SKIPPED))) \
$$(eval $1_TOTAL := $$(shell \
$$(EXPR) $$($1_RUN) + $$($1_GTEST_DISABLED))) \
$$(EXPR) $$($1_TOTAL) - $$($1_PASSED) - $$($1_FAILED))) \
, \
$$(eval $1_PASSED := 0) \
$$(eval $1_FAILED := 0) \
$$(eval $1_ERROR := 1) \
$$(eval $1_SKIPPED := 0) \
$$(eval $1_TOTAL := 1) \
)
@@ -584,8 +570,6 @@ define SetMicroValue
else
ifneq ($3, )
$1_$2 := $3
else
$1_$2 :=
endif
endif
endef
@@ -618,7 +602,7 @@ define SetupRunMicroTestBody
$1_JMH_JVM_ARGS += $$(MICRO_VM_OPTIONS) $$(MICRO_JAVA_OPTIONS)
endif
$1_MICRO_VM_OPTIONS := -jvmArgsPrepend $(call ShellQuote,$$($1_JMH_JVM_ARGS))
$1_MICRO_VM_OPTIONS := -jvmArgs $(call ShellQuote,$$($1_JMH_JVM_ARGS))
ifneq ($$(MICRO_ITER), )
$1_MICRO_ITER := -i $$(MICRO_ITER)
@@ -681,7 +665,6 @@ define SetupRunMicroTestBody
$$(eval $1_ERROR := 1) \
$$(eval $1_TOTAL := 1) \
)
$$(eval $1_SKIPPED := 0)
$1: run-test-$1 parse-test-$1
@@ -712,87 +695,11 @@ define SetJtregValue
else
ifneq ($3, )
$1_$2 := $3
else
$1_$2 :=
endif
endif
endif
endef
################################################################################
# Helper function for creating a customized AOT cache for running tests
################################################################################
# Parameter 1 is the name of the rule.
#
# Remaining parameters are named arguments.
# TRAINING The AOT training mode: onestep or twostep
# VM_OPTIONS List of JVM arguments to use when creating AOT cache
#
# After calling this, the following variables are defined
# $1_AOT_TARGETS List of all targets that the test rule will need to depend on
# $1_AOT_JDK_CACHE The AOT cache file to be used to run the test with
#
SetupAOT = $(NamedParamsMacroTemplate)
define SetupAOTBody
$1_AOT_JDK_OUTPUT_DIR := $$($1_TEST_SUPPORT_DIR)/aot
$1_AOT_JDK_CONF := $$($1_AOT_JDK_OUTPUT_DIR)/jdk.aotconf
$1_AOT_JDK_CACHE := $$($1_AOT_JDK_OUTPUT_DIR)/jdk.aotcache
$1_AOT_JDK_LOG := $$($1_AOT_JDK_OUTPUT_DIR)/TestSetupAOT.log
# We execute the training run with the TestSetupAOT class from $(TEST_IMAGE_DIR)/setup_aot/TestSetupAOT.jar
# to touch a fair number of classes inside the JDK. Note that we can't specify a classpath,
# or else the AOT cache cannot be used with jtreg test cases that use a different value
# for their classpaths. Instead, we cd in the $$($1_AOT_JDK_OUTPUT_DIR) directory,
# extract the TestSetupAOT.jar there, and run in that directory without specifying a classpath.
# The "java" launcher will have an implicit classpath of ".", so it can pick up the TestSetupAOT
# class from the JVM's current directory.
#
# The TestSetupAOT class (or any other classes that are loaded from ".") will be excluded
# from the the AOT cache as "." is an unsupported location. As a result, the AOT cache will contain
# only classes from the JDK.
$$($1_AOT_JDK_CACHE): $$(JDK_IMAGE_DIR)/release
$$(call MakeDir, $$($1_AOT_JDK_OUTPUT_DIR))
ifeq ($$($1_TRAINING), onestep)
$$(call LogWarn, AOT: Create AOT cache $$($1_AOT_JDK_CACHE) in one step with flags: $$($1_VM_OPTIONS)) \
$$(call ExecuteWithLog, $$($1_AOT_JDK_OUTPUT_DIR), ( \
cd $$($1_AOT_JDK_OUTPUT_DIR); \
$(JAR) --extract --file $(TEST_IMAGE_DIR)/setup_aot/TestSetupAOT.jar; \
$$(FIXPATH) $(JDK_UNDER_TEST)/bin/java $$($1_VM_OPTIONS) \
-Xlog:class+load,aot,aot+class=debug:file=$$($1_AOT_JDK_CACHE).log -Xlog:cds*=error -Xlog:aot*=error \
-XX:AOTMode=record -XX:AOTCacheOutput=$$($1_AOT_JDK_CACHE) \
TestSetupAOT $$($1_AOT_JDK_OUTPUT_DIR) > $$($1_AOT_JDK_LOG) \
))
else
$$(call LogWarn, AOT: Create cache configuration) \
$$(call ExecuteWithLog, $$($1_AOT_JDK_OUTPUT_DIR), ( \
cd $$($1_AOT_JDK_OUTPUT_DIR); \
$(JAR) --extract --file $(TEST_IMAGE_DIR)/setup_aot/TestSetupAOT.jar; \
$$(FIXPATH) $(JDK_UNDER_TEST)/bin/java $$($1_VM_OPTIONS) \
-Xlog:class+load,aot,aot+class=debug:file=$$($1_AOT_JDK_CONF).log -Xlog:cds*=error -Xlog:aot*=error \
-XX:AOTMode=record -XX:AOTConfiguration=$$($1_AOT_JDK_CONF) \
TestSetupAOT $$($1_AOT_JDK_OUTPUT_DIR) > $$($1_AOT_JDK_LOG) \
))
$$(call LogWarn, AOT: Generate AOT cache $$($1_AOT_JDK_CACHE) with flags: $$($1_VM_OPTIONS))
$$(call ExecuteWithLog, $$($1_AOT_JDK_OUTPUT_DIR), ( \
$$(FIXPATH) $(JDK_UNDER_TEST)/bin/java \
$$($1_VM_OPTIONS) -Xlog:aot,aot+class=debug:file=$$($1_AOT_JDK_CACHE).log -Xlog:cds*=error -Xlog:aot*=error \
-XX:ExtraSharedClassListFile=$(JDK_UNDER_TEST)/lib/classlist \
-XX:AOTMode=create -XX:AOTConfiguration=$$($1_AOT_JDK_CONF) -XX:AOTCache=$$($1_AOT_JDK_CACHE) \
))
endif
$1_AOT_TARGETS += $$($1_AOT_JDK_CACHE)
endef
SetupRunJtregTest = $(NamedParamsMacroTemplate)
define SetupRunJtregTestBody
$1_TEST_RESULTS_DIR := $$(TEST_RESULTS_DIR)/$1
@@ -831,11 +738,6 @@ define SetupRunJtregTestBody
# Only the problem list for the current test root should be used.
$1_JTREG_PROBLEM_LIST := $$(filter $$($1_TEST_ROOT)%, $$($1_JTREG_PROBLEM_LIST))
# Pass along the path to the tidy html checker
ifneq ($$(TIDY), )
$1_JTREG_BASIC_OPTIONS += -Dtidy=$$(TIDY)
endif
ifneq ($(TEST_JOBS), 0)
$$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(TEST_JOBS)))
else
@@ -846,6 +748,8 @@ define SetupRunJtregTestBody
# we may end up with a lot of JVM's
$1_JTREG_MAX_RAM_PERCENTAGE := $$(shell $(AWK) 'BEGIN { print 25 / $$($1_JTREG_JOBS); }')
JTREG_TIMEOUT_FACTOR ?= 4
JTREG_VERBOSE ?= fail,error,summary
JTREG_RETAIN ?= fail,error
JTREG_TEST_THREAD_FACTORY ?=
@@ -853,7 +757,6 @@ define SetupRunJtregTestBody
JTREG_RETRY_COUNT ?= 0
JTREG_REPEAT_COUNT ?= 0
JTREG_REPORT ?= files
JTREG_AOT_JDK ?= none
ifneq ($$(JTREG_RETRY_COUNT), 0)
ifneq ($$(JTREG_REPEAT_COUNT), 0)
@@ -863,12 +766,6 @@ define SetupRunJtregTestBody
endif
endif
ifeq ($$(JTREG_RUN_PROBLEM_LISTS), true)
JTREG_PROBLEM_LIST_PREFIX := -match:
else
JTREG_PROBLEM_LIST_PREFIX := -exclude:
endif
ifneq ($$(JTREG_TEST_THREAD_FACTORY), )
$1_JTREG_BASIC_OPTIONS += -testThreadFactoryPath:$$(JTREG_TEST_THREAD_FACTORY_JAR)
$1_JTREG_BASIC_OPTIONS += -testThreadFactory:$$(JTREG_TEST_THREAD_FACTORY)
@@ -877,15 +774,6 @@ define SetupRunJtregTestBody
))
endif
ifneq ($$(JTREG_JVMTI_STRESS_AGENT), )
AGENT := $$(LIBRARY_PREFIX)JvmtiStressAgent$$(SHARED_LIBRARY_SUFFIX)=$$(JTREG_JVMTI_STRESS_AGENT)
$1_JTREG_BASIC_OPTIONS += -javaoption:'-agentpath:$(TEST_IMAGE_DIR)/hotspot/jtreg/native/$$(AGENT)'
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$(wildcard \
$$(addprefix $$($1_TEST_ROOT)/, ProblemList-jvmti-stress-agent.txt) \
))
endif
ifneq ($$(JTREG_LAUNCHER_OPTIONS), )
$1_JTREG_LAUNCHER_OPTIONS += $$(JTREG_LAUNCHER_OPTIONS)
endif
@@ -906,7 +794,7 @@ define SetupRunJtregTestBody
# version of the JDK.
$1_JTREG_BASIC_OPTIONS += -$$($1_JTREG_TEST_MODE) \
-verbose:$$(JTREG_VERBOSE) -retain:$$(JTREG_RETAIN) \
-concurrency:$$($1_JTREG_JOBS) \
-concurrency:$$($1_JTREG_JOBS) -timeoutFactor:$$(JTREG_TIMEOUT_FACTOR) \
-vmoption:-XX:MaxRAMPercentage=$$($1_JTREG_MAX_RAM_PERCENTAGE) \
-vmoption:-Dtest.boot.jdk="$$(BOOT_JDK)" \
-vmoption:-Djava.io.tmpdir="$$($1_TEST_TMP_DIR)"
@@ -939,33 +827,16 @@ define SetupRunJtregTestBody
$1_JTREG_BASIC_OPTIONS += -nativepath:$$($1_JTREG_NATIVEPATH)
endif
ifeq ($$(JTREG_RUN_PROBLEM_LISTS), true)
JTREG_PROBLEM_LIST_PREFIX := -match:
else
JTREG_PROBLEM_LIST_PREFIX := -exclude:
endif
ifneq ($$($1_JTREG_PROBLEM_LIST), )
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$($1_JTREG_PROBLEM_LIST))
endif
JTREG_ALL_OPTIONS := $$(JTREG_JAVA_OPTIONS) $$(JTREG_VM_OPTIONS)
JTREG_AUTO_PROBLEM_LISTS :=
JTREG_AUTO_TIMEOUT_FACTOR := 4
ifneq ($$(findstring -Xcomp, $$(JTREG_ALL_OPTIONS)), )
JTREG_AUTO_PROBLEM_LISTS += ProblemList-Xcomp.txt
JTREG_AUTO_TIMEOUT_FACTOR := 10
endif
ifneq ($$(findstring -XX:+UseZGC, $$(JTREG_ALL_OPTIONS)), )
JTREG_AUTO_PROBLEM_LISTS += ProblemList-zgc.txt
endif
ifneq ($$(findstring -XX:+UseShenandoahGC, $$(JTREG_ALL_OPTIONS)), )
JTREG_AUTO_PROBLEM_LISTS += ProblemList-shenandoah.txt
endif
ifneq ($$(findstring --enable-preview, $$(JTREG_ALL_OPTIONS)), )
JTREG_AUTO_PROBLEM_LISTS += ProblemList-enable-preview.txt
endif
ifneq ($$(JTREG_EXTRA_PROBLEM_LISTS), )
# Accept both absolute paths as well as relative to the current test root.
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$(wildcard \
@@ -978,15 +849,8 @@ define SetupRunJtregTestBody
$1_JTREG_BASIC_OPTIONS += -e:JIB_HOME=$$(JIB_HOME)
endif
ifneq ($$(JDK_FOR_COMPILE), )
# Allow overriding the JDK used for compilation from the command line
$1_JTREG_BASIC_OPTIONS += -compilejdk:$$(JDK_FOR_COMPILE)
endif
$1_JTREG_BASIC_OPTIONS += -e:TEST_IMAGE_DIR=$(TEST_IMAGE_DIR)
$1_JTREG_BASIC_OPTIONS += -e:DOCS_JDK_IMAGE_DIR=$$(DOCS_JDK_IMAGE_DIR)
ifneq ($$(JTREG_FAILURE_HANDLER_OPTIONS), )
$1_JTREG_LAUNCHER_OPTIONS += -Djava.library.path="$(JTREG_FAILURE_HANDLER_DIR)"
endif
@@ -1002,33 +866,9 @@ define SetupRunJtregTestBody
endif
endif
ifneq ($$(filter $$(JTREG_AOT_JDK), onestep twostep), )
$$(call LogWarn, Add AOT target for $1)
$$(eval $$(call SetupAOT, $1, \
TRAINING := $$(JTREG_AOT_JDK), \
VM_OPTIONS := $$(JTREG_ALL_OPTIONS) ))
$$(call LogWarn, AOT_JDK_CACHE=$$($1_AOT_JDK_CACHE))
$1_JTREG_BASIC_OPTIONS += -vmoption:-XX:AOTCache="$$($1_AOT_JDK_CACHE)"
endif
$$(eval $$(call SetupRunJtregTestCustom, $1))
# SetupRunJtregTestCustom might also adjust JTREG_AUTO_ variables
# so set the final results after setting values from custom setup
ifneq ($$(JTREG_AUTO_PROBLEM_LISTS), )
# Accept both absolute paths as well as relative to the current test root.
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$(wildcard \
$$(JTREG_AUTO_PROBLEM_LISTS) \
$$(addprefix $$($1_TEST_ROOT)/, $$(JTREG_AUTO_PROBLEM_LISTS)) \
))
endif
JTREG_TIMEOUT_FACTOR ?= $$(JTREG_AUTO_TIMEOUT_FACTOR)
$1_JTREG_BASIC_OPTIONS += -timeoutFactor:$$(JTREG_TIMEOUT_FACTOR)
clean-outputdirs-$1:
$$(call LogWarn, Clean up dirs for $1)
$$(RM) -r $$($1_TEST_SUPPORT_DIR)
$$(RM) -r $$($1_TEST_RESULTS_DIR)
@@ -1054,8 +894,7 @@ define SetupRunJtregTestBody
$1_COMMAND_LINE := \
for i in {0..$$(JTREG_RETRY_COUNT)}; do \
if [ "$$$$i" != 0 ]; then \
$$(ECHO) ""; \
$$(ECHO) "Retrying Jtreg run. Attempt: $$$$i"; \
$$(PRINTF) "\nRetrying Jtreg run. Attempt: $$$$i\n"; \
fi; \
$$($1_COMMAND_LINE); \
if [ "`$$(CAT) $$($1_EXITCODE)`" = "0" ]; then \
@@ -1068,18 +907,16 @@ define SetupRunJtregTestBody
ifneq ($$(JTREG_REPEAT_COUNT), 0)
$1_COMMAND_LINE := \
for i in {1..$$(JTREG_REPEAT_COUNT)}; do \
$$(ECHO) ""; \
$$(ECHO) "Repeating Jtreg run: $$$$i out of $$(JTREG_REPEAT_COUNT)"; \
$$(PRINTF) "\nRepeating Jtreg run: $$$$i out of $$(JTREG_REPEAT_COUNT)\n"; \
$$($1_COMMAND_LINE); \
if [ "`$$(CAT) $$($1_EXITCODE)`" != "0" ]; then \
$$(ECHO) ""; \
$$(ECHO) "Failures detected, no more repeats."; \
$$(PRINTF) "\nFailures detected, no more repeats.\n"; \
break; \
fi; \
done
endif
run-test-$1: clean-outputdirs-$1 pre-run-test $$($1_AOT_TARGETS)
run-test-$1: pre-run-test clean-outputdirs-$1
$$(call LogWarn)
$$(call LogWarn, Running test '$$($1_TEST)')
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR) \
@@ -1094,64 +931,23 @@ define SetupRunJtregTestBody
$$(call LogWarn, Finished running test '$$($1_TEST)')
$$(call LogWarn, Test report is stored in $$(strip \
$$(subst $$(TOPDIR)/, , $$($1_TEST_RESULTS_DIR))))
# Read jtreg documentation to learn on the test stats categories:
# https://github.com/openjdk/jtreg/blob/master/src/share/doc/javatest/regtest/faq.md#what-do-all-those-numbers-in-the-test-results-line-mean
# In jtreg, "skipped:" category accounts for tests that threw jtreg.SkippedException at runtime.
# At the same time these tests contribute to "passed:" tests.
# In here we don't want that and so we substract number of "skipped:" from "passed:".
$$(if $$(wildcard $$($1_RESULT_FILE)), \
$$(eval $1_PASSED_AND_RUNTIME_SKIPPED := $$(shell $$(AWK) '{ gsub(/[,;]/, ""); \
$$(eval $1_PASSED := $$(shell $$(AWK) '{ gsub(/[,;]/, ""); \
for (i=1; i<=NF; i++) { if ($$$$i == "passed:") \
print $$$$(i+1) } }' $$($1_RESULT_FILE))) \
$$(if $$($1_PASSED_AND_RUNTIME_SKIPPED), , $$(eval $1_PASSED_AND_RUNTIME_SKIPPED := 0)) \
$$(if $$($1_PASSED), , $$(eval $1_PASSED := 0)) \
$$(eval $1_FAILED := $$(shell $$(AWK) '{gsub(/[,;]/, ""); \
for (i=1; i<=NF; i++) { if ($$$$i == "failed:") \
print $$$$(i+1) } }' $$($1_RESULT_FILE))) \
$$(if $$($1_FAILED), , $$(eval $1_FAILED := 0)) \
$$(eval $1_RUNTIME_SKIPPED := $$(shell $$(AWK) '{gsub(/[,;]/, ""); \
for (i=1; i<=NF; i++) { if ($$$$i == "skipped:") \
print $$$$(i+1) } }' $$($1_RESULT_FILE))) \
$$(if $$($1_RUNTIME_SKIPPED), , $$(eval $1_RUNTIME_SKIPPED := 0)) \
$$(eval $1_SKIPPED := $$(shell \
$$(AWK) \
'BEGIN { \
overall_skipped = 0; \
patterns[1] = "skipped"; \
patterns[2] = "excluded"; \
patterns[3] = "not in match-list"; \
patterns[4] = "did not match keywords"; \
patterns[5] = "did not meet module requirements"; \
patterns[6] = "did not meet platform requirements"; \
patterns[7] = "did not match prior status"; \
patterns[8] = "did not meet time-limit requirements"; \
} { \
split($$$$0, arr, ";"); \
for (item in arr) { \
for (p in patterns) { \
if (match(arr[item], patterns[p] ": [0-9]+")) { \
overall_skipped += substr(arr[item], RSTART + length(patterns[p]) + 2, RLENGTH); \
} \
} \
} \
print overall_skipped; \
}' \
$$($1_RESULT_FILE) \
)) \
$$(eval $1_ERROR := $$(shell $$(AWK) '{gsub(/[,;]/, ""); \
for (i=1; i<=NF; i++) { if ($$$$i == "error:") \
print $$$$(i+1) } }' $$($1_RESULT_FILE))) \
$$(if $$($1_ERROR), , $$(eval $1_ERROR := 0)) \
\
$$(eval $1_PASSED := $$(shell \
$$(EXPR) $$($1_PASSED_AND_RUNTIME_SKIPPED) - $$($1_RUNTIME_SKIPPED))) \
$$(eval $1_TOTAL := $$(shell \
$$(EXPR) $$($1_PASSED) + $$($1_FAILED) + $$($1_ERROR) + $$($1_SKIPPED))) \
$$(EXPR) $$($1_PASSED) + $$($1_FAILED) + $$($1_ERROR))) \
, \
$$(eval $1_PASSED_AND_RUNTIME_SKIPPED := 0) \
$$(eval $1_RUNTIME_SKIPPED := 0) \
$$(eval $1_SKIPPED := 0) \
$$(eval $1_PASSED := 0) \
$$(eval $1_FAILED := 0) \
$$(eval $1_ERROR := 1) \
$$(eval $1_TOTAL := 1) \
@@ -1210,6 +1006,8 @@ define SetupRunSpecialTestBody
|| $$(ECHO) $$$$? > $$($1_EXITCODE) \
))
$1_RESULT_FILE := $$($1_TEST_RESULTS_DIR)/gtest.txt
# We can not parse the various "special" tests.
parse-test-$1: run-test-$1
$$(call LogWarn, Finished running test '$$($1_TEST)')
@@ -1219,7 +1017,6 @@ define SetupRunSpecialTestBody
$$(eval $1_PASSED := $$(shell \
if [ `$(CAT) $$($1_EXITCODE)` = "0" ]; then $(ECHO) 1; else $(ECHO) 0; fi \
))
$$(eval $1_SKIPPED := 0)
$$(eval $1_FAILED := $$(shell \
if [ `$(CAT) $$($1_EXITCODE)` = "0" ]; then $(ECHO) 0; else $(ECHO) 1; fi \
))
@@ -1253,7 +1050,7 @@ UseSpecialTestHandler = \
# Now process each test to run and setup a proper make rule
$(foreach test, $(TESTS_TO_RUN), \
$(eval TEST_ID := $(shell $(ECHO) $(strip $(test)) | \
$(TR) -cs '[a-z][A-Z][0-9]\n' '_')) \
$(TR) -cs '[a-z][A-Z][0-9]\n' '[_*1000]')) \
$(eval ALL_TEST_IDS += $(TEST_ID)) \
$(if $(call UseCustomTestHandler, $(test)), \
$(eval $(call SetupRunCustomTest, $(TEST_ID), \
@@ -1329,28 +1126,28 @@ run-test-report: post-run-test
$(ECHO) >> $(TEST_SUMMARY) ==============================
$(ECHO) >> $(TEST_SUMMARY) Test summary
$(ECHO) >> $(TEST_SUMMARY) ==============================
$(PRINTF) >> $(TEST_SUMMARY) "%2s %-49s %5s %5s %5s %5s %5s %2s\n" " " \
TEST TOTAL PASS FAIL ERROR SKIP " "
$(PRINTF) >> $(TEST_SUMMARY) "%2s %-49s %5s %5s %5s %5s %2s\n" " " \
TEST TOTAL PASS FAIL ERROR " "
$(foreach test, $(TESTS_TO_RUN), \
$(eval TEST_ID := $(shell $(ECHO) $(strip $(test)) | \
$(TR) -cs '[a-z][A-Z][0-9]\n' '_')) \
$(TR) -cs '[a-z][A-Z][0-9]\n' '[_*1000]')) \
$(ECHO) >> $(TEST_LAST_IDS) $(TEST_ID) $(NEWLINE) \
$(eval NAME_PATTERN := $(shell $(ECHO) $(test) | $(TR) -c '\n' '_')) \
$(eval NAME_PATTERN := $(shell $(ECHO) $(test) | $(TR) -c '\n' '[_*1000]')) \
$(if $(filter __________________________________________________%, $(NAME_PATTERN)), \
$(eval TEST_NAME := ) \
$(PRINTF) >> $(TEST_SUMMARY) "%2s %-49s\n" " " "$(test)" $(NEWLINE) \
, \
$(eval TEST_NAME := $(test)) \
) \
$(if $(filter-out 0, $($(TEST_ID)_FAILED) $($(TEST_ID)_ERROR)), \
$(PRINTF) >> $(TEST_SUMMARY) "%2s %-49s %5d %5d %5d %5d %5d %2s\n" \
">>" "$(TEST_NAME)" $($(TEST_ID)_TOTAL) $($(TEST_ID)_PASSED) \
$($(TEST_ID)_FAILED) $($(TEST_ID)_ERROR) $($(TEST_ID)_SKIPPED) "<<" $(NEWLINE) \
$(eval TEST_FAILURE := true) \
, \
$(PRINTF) >> $(TEST_SUMMARY) "%2s %-49s %5d %5d %5d %5d %5d %2s\n" \
$(if $(filter $($(TEST_ID)_PASSED), $($(TEST_ID)_TOTAL)), \
$(PRINTF) >> $(TEST_SUMMARY) "%2s %-49s %5d %5d %5d %5d %2s\n" \
" " "$(TEST_NAME)" $($(TEST_ID)_TOTAL) $($(TEST_ID)_PASSED) \
$($(TEST_ID)_FAILED) $($(TEST_ID)_ERROR) $($(TEST_ID)_SKIPPED) " " $(NEWLINE) \
$($(TEST_ID)_FAILED) $($(TEST_ID)_ERROR) " " $(NEWLINE) \
, \
$(PRINTF) >> $(TEST_SUMMARY) "%2s %-49s %5d %5d %5d %5d %2s\n" \
">>" "$(TEST_NAME)" $($(TEST_ID)_TOTAL) $($(TEST_ID)_PASSED) \
$($(TEST_ID)_FAILED) $($(TEST_ID)_ERROR) "<<" $(NEWLINE) \
$(eval TEST_FAILURE := true) \
) \
)
$(ECHO) >> $(TEST_SUMMARY) ==============================
@@ -1376,14 +1173,12 @@ TARGETS += run-all-tests pre-run-test post-run-test run-test-report run-test
ifeq ($(TEST_OPTS_JCOV), true)
JCOV_VM_OPTS := -Xmx4g -Djdk.xml.totalEntitySizeLimit=0 -Djdk.xml.maxGeneralEntitySizeLimit=0
jcov-do-start-grabber:
$(call MakeDir, $(JCOV_OUTPUT_DIR))
if $(JAVA) -jar $(JCOV_HOME)/lib/jcov.jar GrabberManager -status 1>/dev/null 2>&1 ; then \
$(JAVA) -jar $(JCOV_HOME)/lib/jcov.jar GrabberManager -stop -stoptimeout 3600 ; \
fi
$(JAVA) $(JCOV_VM_OPTS) -jar $(JCOV_HOME)/lib/jcov.jar Grabber -v -t \
$(JAVA) -Xmx4g -jar $(JCOV_HOME)/lib/jcov.jar Grabber -v -t \
$(JCOV_IMAGE_DIR)/template.xml -o $(JCOV_RESULT_FILE) \
1>$(JCOV_GRABBER_LOG) 2>&1 &
@@ -1396,10 +1191,6 @@ ifeq ($(TEST_OPTS_JCOV), true)
$(JAVA) -jar $(JCOV_HOME)/lib/jcov.jar GrabberManager -stop -stoptimeout 3600
JCOV_REPORT_TITLE := JDK code coverage report<br/>
ifneq ($(JCOV_MODULES), )
JCOV_MODULES_FILTER := $(foreach m, $(JCOV_MODULES), -include_module $m)
JCOV_REPORT_TITLE += Included modules: $(JCOV_MODULES)<br>
endif
ifneq ($(JCOV_FILTERS), )
JCOV_REPORT_TITLE += Code filters: $(JCOV_FILTERS)<br>
endif
@@ -1407,12 +1198,11 @@ ifeq ($(TEST_OPTS_JCOV), true)
jcov-gen-report: jcov-stop-grabber
$(call LogWarn, Generating JCov report ...)
$(call ExecuteWithLog, $(JCOV_SUPPORT_DIR)/run-jcov-repgen, \
$(JAVA) $(JCOV_VM_OPTS) -jar $(JCOV_HOME)/lib/jcov.jar RepGen -sourcepath \
$(JAVA) -Xmx4g -jar $(JCOV_HOME)/lib/jcov.jar RepGen -sourcepath \
`$(ECHO) $(TOPDIR)/src/*/share/classes/ | $(TR) ' ' ':'` -fmt html \
$(JCOV_MODULES_FILTER) $(JCOV_FILTERS) \
$(JCOV_FILTERS) \
-mainReportTitle "$(JCOV_REPORT_TITLE)" \
-o $(JCOV_REPORT) $(JCOV_RESULT_FILE))
-o $(JCOV_REPORT) $(JCOV_RESULT_FILE)
TARGETS += jcov-do-start-grabber jcov-start-grabber jcov-stop-grabber \
jcov-gen-report
@@ -1432,7 +1222,7 @@ ifeq ($(TEST_OPTS_JCOV), true)
jcov-gen-diffcoverage: jcov-stop-grabber
$(call LogWarn, Generating diff coverage with changeset $(TEST_OPTS_JCOV_DIFF_CHANGESET) ... )
$(DIFF_COMMAND)
$(JAVA) $(JCOV_VM_OPTS) -jar $(JCOV_HOME)/lib/jcov.jar \
$(JAVA) -Xmx4g -jar $(JCOV_HOME)/lib/jcov.jar \
DiffCoverage -replaceDiff "src/.*/classes/:" -all \
$(JCOV_RESULT_FILE) $(JCOV_SOURCE_DIFF) > \
$(JCOV_DIFF_COVERAGE_REPORT)
@@ -1460,8 +1250,4 @@ endif
all: run-test
.PHONY: $(TARGETS)
################################################################################
include MakeFileEnd.gmk
.PHONY: default all $(TARGETS)

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2017, 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
@@ -24,11 +24,9 @@
#
################################################################################
# Initial bootstrapping, copied and stripped down from Makefile and PreInit.gmk.
# Initial bootstrapping, copied and stripped down from Makefile and Init.gmk
################################################################################
IS_PREINIT_ENV := true
# In Cygwin, the MAKE variable gets prepended with the current directory if the
# make executable is called using a Windows mixed path (c:/cygwin/bin/make.exe).
ifneq ($(findstring :, $(MAKE)), )
@@ -36,7 +34,7 @@ ifneq ($(findstring :, $(MAKE)), )
endif
# Locate this Makefile
ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))), )
ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))),)
makefile_path := $(CURDIR)/$(strip $(lastword $(MAKEFILE_LIST)))
else
makefile_path := $(lastword $(MAKEFILE_LIST))
@@ -59,7 +57,7 @@ TOPDIR := $(strip $(patsubst %/make/, %, $(dir $(makefile_path))))
define SetupVariable
ifeq ($$($1), )
ifeq ($2, )
$$(info Error: Prebuilt variable $1 is missing, needed for test-prebuilt)
$$(info Error: Prebuilt variable $1 is missing, needed for run-tests-prebuilt)
$$(error Cannot continue.)
else ifeq ($2, OPTIONAL)
ifneq ($$(findstring $$(LOG), info debug trace), )
@@ -69,7 +67,7 @@ define SetupVariable
ifneq ($$(findstring $$(LOG), info debug trace), )
$$(info Prebuilt variable $1=$2 (default value))
endif
$1 := $2
$1:=$2
endif
else
ifneq ($$(findstring $$(LOG), info debug trace), )
@@ -137,9 +135,10 @@ $(eval $(call SetupVariable,JIB_JAR,OPTIONAL))
# can include the prebuilt spec file ourselves, without an ephemeral spec
# wrapper. This is required so we can include MakeBase which is needed for
# CreateNewSpec.
include $(TOPDIR)/make/PreInitSupport.gmk
include $(TOPDIR)/make/common/LogUtils.gmk
HAS_SPEC :=
include $(TOPDIR)/make/InitSupport.gmk
$(eval $(call CheckDeprecatedEnvironment))
$(eval $(call CheckInvalidMakeFlags))
$(eval $(call ParseLogLevel))
@@ -164,7 +163,7 @@ else ifeq ($(UNAME_OS), MINGW64)
OPENJDK_TARGET_OS_TYPE := windows
OPENJDK_TARGET_OS_ENV := windows.msys2
else
OPENJDK_TARGET_OS_TYPE := unix
OPENJDK_TARGET_OS_TYPE:=unix
ifeq ($(UNAME_OS), Linux)
OPENJDK_TARGET_OS := linux
else ifeq ($(UNAME_OS), Darwin)
@@ -217,9 +216,9 @@ else ifeq ($(OPENJDK_TARGET_OS), macosx)
else ifeq ($(OPENJDK_TARGET_OS), windows)
NUM_CORES := $(NUMBER_OF_PROCESSORS)
MEMORY_SIZE := $(shell \
$(EXPR) `powershell -Command \
"(Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory" \
| $(SED) 's/\\r//g' ` / 1024 / 1024 \
$(EXPR) `wmic computersystem get totalphysicalmemory -value \
| $(GREP) = | $(SED) 's/\\r//g' \
| $(CUT) -d "=" -f 2-` / 1024 / 1024 \
)
endif
ifeq ($(NUM_CORES), )
@@ -246,7 +245,7 @@ endif
# Now we can include additional custom support.
# This might define CUSTOM_NEW_SPEC_LINE
ifneq ($(CUSTOM_MAKE_DIR), )
include $(CUSTOM_MAKE_DIR)/RunTestsPrebuilt-pre.gmk
include $(CUSTOM_MAKE_DIR)/RunTestsPrebuilt.gmk
endif
NEW_SPEC := $(OUTPUTDIR)/run-test-spec.gmk
@@ -296,10 +295,13 @@ test-prebuilt:
# is unfortunately not available at this point.
$(call MakeDir, $(MAKESUPPORT_OUTPUTDIR)/failure-logs)
@$(RM) -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error
# We need to fill the FindTest cache before entering RunTests.gmk.
@cd $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) SPEC=$(SPEC) \
-f GenerateFindTests.gmk
@cd $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test \
# The lazy initialization of the cache file in FindTests.gmk does not
# always work with RunTests.gmk. To guarantee that the jtreg test groups
# are always found and parsed, call FindTests.gmk stand alone once
# before calling RunTests.gmk.
@cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/common/FindTests.gmk \
SPEC=$(SPEC) FINDTESTS_STAND_ALONE=true
@cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/RunTests.gmk run-test \
TEST="$(TEST)"
test-prebuilt-with-exit-code: test-prebuilt

View File

@@ -63,16 +63,16 @@ TEST_JOBS ?= 0
# Use hard-coded values for java flags (one size, fits all!)
JAVA_FLAGS := -Duser.language=en -Duser.country=US
JAVA_FLAGS_BIG := -Xms64M -Xmx2048M
JAVA_FLAGS_BIG := -Xms64M -Xmx1600M
JAVA_FLAGS_SMALL := -XX:+UseSerialGC -Xms32M -Xmx512M -XX:TieredStopAtLevel=1
BUILDJDK_JAVA_FLAGS_SMALL := -Xms32M -Xmx512M -XX:TieredStopAtLevel=1
BUILD_JAVA_FLAGS := $(JAVA_FLAGS_BIG)
################################################################################
# Hard-coded values copied from spec.gmk.in.
X :=
SPACE := $(X) $(X)
COMMA := ,
X:=
SPACE:=$(X) $(X)
COMMA:=,
MAKE_ARGS = $(MAKE_LOG_FLAGS) -r -R -I $(TOPDIR)/make/common SPEC=$(SPEC) \
MAKE_LOG_FLAGS="$(MAKE_LOG_FLAGS)" LOG_LEVEL=$(LOG_LEVEL)
BASH_ARGS := -o pipefail -e
@@ -176,19 +176,3 @@ ULIMIT := ulimit
ifeq ($(OPENJDK_BUILD_OS), windows)
PATHTOOL := cygpath
endif
# These settings are needed to run testing with jvmti agent
ifeq ($(OPENJDK_BUILD_OS), linux)
LIBRARY_PREFIX := lib
SHARED_LIBRARY_SUFFIX := .so
endif
ifeq ($(OPENJDK_BUILD_OS), windows)
LIBRARY_PREFIX :=
SHARED_LIBRARY_SUFFIX := .dll
endif
ifeq ($(OPENJDK_BUILD_OS), macosx)
LIBRARY_PREFIX := lib
SHARED_LIBRARY_SUFFIX := .dylib
endif

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2025, 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
@@ -23,7 +23,10 @@
# questions.
#
include MakeFileStart.gmk
include $(SPEC)
include MakeBase.gmk
$(eval $(call IncludeCustomExtension, SourceRevision-pre.gmk))
################################################################################
# Keep track of what source revision is used to create the build, by creating
@@ -35,7 +38,6 @@ include MakeFileStart.gmk
# bundle. As a part of creating this source bundle, the current SCM revisions of
# all repos will be stored in a file in the top dir, which is then used when
# creating the tracker file.
################################################################################
STORED_SOURCE_REVISION := $(TOPDIR)/.src-rev
@@ -55,14 +57,14 @@ ifneq ($(and $(GIT), $(wildcard $(TOPDIR)/.git)), )
SCM_DIR := .git
ID_COMMAND := $(PRINTF) "git:%s%s\n" \
"$$($(GIT) log -n1 --format=%H | cut -c1-12)" \
"$$(if test -n "$$($(GIT) status --porcelain)"; then $(PRINTF) '+'; fi)"
"$$(if test -n "$$($(GIT) status --porcelain)"; then printf '+'; fi)"
endif
ifeq ($(USE_SCM), true)
# Verify that the entire forest is consistent
$(foreach repo, $(call FindAllReposRel), \
$(if $(wildcard $(TOPDIR)/$(repo)/$(SCM_DIR)), , \
$(if $(wildcard $(TOPDIR)/$(repo)/$(SCM_DIR)),, \
$(error Inconsistent revision control: $(repo) is missing $(SCM_DIR) directory)) \
)
@@ -70,7 +72,7 @@ ifeq ($(USE_SCM), true)
MakeFilenameFromRepo = \
$(strip $(subst .,top, $(subst /,-, $1)))
##############################################################################
################################################################################
# SetupGetRevisionForRepo defines a make rule for creating a file containing
# the name of the repository and the output of the scm command for that
# repository.
@@ -154,6 +156,10 @@ endif
################################################################################
$(eval $(call IncludeCustomExtension, SourceRevision-post.gmk))
################################################################################
store-source-revision: $(STORE_SOURCE_REVISION_TARGET)
create-source-revision-tracker: $(CREATE_SOURCE_REVISION_TRACKER_TARGET)
@@ -161,7 +167,3 @@ create-source-revision-tracker: $(CREATE_SOURCE_REVISION_TRACKER_TARGET)
FRC: # Force target
.PHONY: store-source-revision create-source-revision-tracker
################################################################################
include MakeFileEnd.gmk

View File

@@ -1,211 +0,0 @@
#
# Copyright (c) 2024, 2025, 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.
#
include MakeFileStart.gmk
################################################################################
include CopyFiles.gmk
include DebugInfoUtils.gmk
include Modules.gmk
include modules/LauncherCommon.gmk
include Execute.gmk
################################################################################
#
# Create the static java launcher
#
################################################################################
STATIC_JDK_IMAGE_DIR := $(IMAGES_OUTPUTDIR)/static-jdk
STATIC_LAUNCHER_OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/static-native/launcher
HOTSPOT_STATIC_LIB_PATH := $(HOTSPOT_OUTPUTDIR)/*/libjvm/objs/static
ifneq ($(word 2, $(wildcard $(HOTSPOT_STATIC_LIB_PATH))), )
$(error Cannot perform static linking when building more than one JVM library)
endif
# Find all modules with static libraries
STATIC_LIB_MODULES := $(patsubst $(SUPPORT_OUTPUTDIR)/modules_static-libs/%, \
%, $(wildcard $(SUPPORT_OUTPUTDIR)/modules_static-libs/*))
# Filter out known broken libraries. This is a temporary measure until
# proper support for these libraries can be provided.
ifeq ($(call isTargetOs, linux), true)
# libsplashscreen has a name conflict with libawt in the function
# BitmapToYXBandedRectangles, so we exclude it for now.
BROKEN_STATIC_LIBS += splashscreen
else ifeq ($(call isTargetOs, macosx), true)
# libosxsecurity has a name conflict with libosxapp in the function
# JavaStringToNSString, so we exclude it for now.
BROKEN_STATIC_LIBS += osxsecurity
else ifeq ($(call isTargetOs, windows), true)
# libsplashscreen has a name conflict with libawt in the function
# BitmapToYXBandedRectangles, so we exclude it for now.
BROKEN_STATIC_LIBS += splashscreen
# libsspi_bridge has name conflicts with sunmscapi
BROKEN_STATIC_LIBS += sspi_bridge
# dt_shmem define jdwpTransport_OnLoad which conflict with dt_socket
BROKEN_STATIC_LIBS += dt_shmem
else ifeq ($(call isTargetOs, aix), true)
# libsplashscreen has a name conflict with libawt in the function
# BitmapToYXBandedRectangles, so we exclude it for now.
BROKEN_STATIC_LIBS += splashscreen
endif
$(foreach module, $(STATIC_LIB_MODULES), \
$(eval LIBS_$(module) := $(filter-out $(BROKEN_STATIC_LIBS), $(shell cat \
$(SUPPORT_OUTPUTDIR)/modules_static-libs/$(module)/module-included-libs.txt))) \
)
STATIC_LIB_FILES := $(foreach module, $(STATIC_LIB_MODULES), \
$(foreach lib, $(LIBS_$(module)), \
$(SUPPORT_OUTPUTDIR)/native/$(module)/lib$(lib)/static/$(LIBRARY_PREFIX)$(lib)$(STATIC_LIBRARY_SUFFIX)))
# Add Hotspot
STATIC_LIB_FILES += $(wildcard $(HOTSPOT_STATIC_LIB_PATH)/$(LIBRARY_PREFIX)jvm$(STATIC_LIBRARY_SUFFIX))
# Figure out what external libraries are required to link these static JDK
# libraries.
LIB_FLAGS_FILES := $(addsuffix .lib-flags.txt, $(STATIC_LIB_FILES))
# Gather the lib flags from all individual libraries. There are many duplicates,
# so sort and just keep unique instances. On macOS, a common pattern is
# "-framework FooFramework", so we must make sure we keep the two words together.
EXTERNAL_LIBS := $(strip $(shell $(CAT) $(LIB_FLAGS_FILES) | \
$(SED) -e 's/-framework /-framework_/g' | $(TR) ' ' '\n' | $(SORT) -u | \
$(SED) -e 's/-framework_/-framework /g'))
ifeq ($(call isTargetOs, macosx), true)
STATIC_LIBS := $(addprefix -force_load$(SPACE), $(STATIC_LIB_FILES))
else ifeq ($(call isTargetOs, linux), true)
STATIC_LIBS := -Wl,--export-dynamic -Wl,--whole-archive $(STATIC_LIB_FILES) -Wl,--no-whole-archive
else ifeq ($(call isTargetOs, windows), true)
STATIC_LIBS := $(addprefix -wholearchive:, $(STATIC_LIB_FILES))
else ifeq ($(call isTargetOs, aix), true)
# on AIX we have to generate export files for all static libs, because we have no whole-archive linker flag
$(foreach lib, $(STATIC_LIB_FILES), \
$(eval $(call SetupExecute, generate_export_list_$(notdir $(lib)), \
INFO := Generating export list for $(notdir $(lib)), \
DEPS := $(lib), \
OUTPUT_FILE := $(lib).exp, \
COMMAND := ( $(AR) $(ARFLAGS) -w $(lib) | $(GREP) -v '^\.' | $(AWK) '{print $$1}' | $(SORT) -u > $(lib).exp ), \
)) \
$(eval STATIC_LIB_EXPORT_FILES += $(lib).exp) \
)
STATIC_LIBS := -Wl,-bexpfull $(STATIC_LIB_FILES) $(addprefix -Wl$(COMMA)-bE:, $(STATIC_LIB_EXPORT_FILES))
else
$(error Unsupported platform)
endif
$(eval $(call SetupBuildLauncher, java, \
ENABLE_ARG_FILES := true, \
EXPAND_CLASSPATH_WILDCARDS := true, \
EXTRA_RCFLAGS := $(JAVA_RCFLAGS), \
VERSION_INFO_RESOURCE := $(JAVA_VERSION_INFO_RESOURCE), \
OPTIMIZATION := HIGH, \
STATIC_LAUNCHER := true, \
LDFLAGS := $(LDFLAGS_STATIC_JDK), \
LIBS := $(STATIC_LIBS) $(EXTERNAL_LIBS), \
LINK_TYPE := C++, \
OUTPUT_DIR := $(STATIC_LAUNCHER_OUTPUT_DIR), \
OBJECT_DIR := $(STATIC_LAUNCHER_OUTPUT_DIR), \
))
$(java): $(STATIC_LIB_FILES)
ifeq ($(call isTargetOs, aix), true)
$(java): $(STATIC_LIB_EXPORT_FILES)
endif
TARGETS += $(java)
JAVA_LAUNCHER := $(BUILD_LAUNCHER_java_TARGET)
static-launcher: $(java)
################################################################################
#
# Create the static-jdk image with the statically built java launcher
#
################################################################################
# Until we get proper support in jlink for generating an image with static
# builds, we need to create the image ourselves. We base it on a normal
# dynamically linked JDK image.
# All these files/dirs should be copied as-is
JDK_IMAGE_COPY_FILES := $(addprefix $(JDK_IMAGE_DIR)/, conf demo include jmods \
legal man/man1/java.1 release README)
# We need to copy some files from lib, but not the dynamic libraries themselves
ALL_LIB_FILES := $(call FindFiles, $(JDK_IMAGE_DIR)/lib)
# Remove all dynamic libraries from the list
JDK_IMAGE_COPY_LIB_FILES := $(filter-out %$(SHARED_LIBRARY_SUFFIX), $(ALL_LIB_FILES))
# Remove all debug files from the list
ifeq ($(call isTargetOs, macosx), true)
JDK_IMAGE_COPY_LIB_FILES := $(call not-containing, .dSYM, $(JDK_IMAGE_COPY_LIB_FILES))
else
JDK_IMAGE_COPY_LIB_FILES := $(filter-out %.debuginfo %.pdb %.map, $(JDK_IMAGE_COPY_LIB_FILES))
endif
static-jdk-info:
$(call LogWarn, Creating static-jdk image)
$(eval $(call SetupCopyFiles, copy-from-jdk-image, \
SRC := $(JDK_IMAGE_DIR), \
DEST := $(STATIC_JDK_IMAGE_DIR), \
FILES := $(call FindFiles, $(JDK_IMAGE_COPY_FILES)) \
$(JDK_IMAGE_COPY_LIB_FILES), \
))
TARGETS += $(copy-from-jdk-image)
$(copy-from-jdk-image): | static-jdk-info
$(eval $(call SetupCopyFiles, copy-static-launcher, \
FILES := $(JAVA_LAUNCHER), \
DEST := $(STATIC_JDK_IMAGE_DIR)/bin, \
))
TARGETS += $(copy-static-launcher)
$(eval $(call SetupCopyFiles, copy-static-launcher-debuginfo, \
SRC := $(STATIC_LAUNCHER_OUTPUT_DIR), \
DEST := $(STATIC_JDK_IMAGE_DIR)/bin, \
FILES := $(call FindDebuginfoFiles, $(STATIC_LAUNCHER_OUTPUT_DIR)), \
))
TARGETS += $(copy-static-launcher-debuginfo)
static-jdk-image: $(copy-from-jdk-image) $(copy-static-launcher) $(copy-static-launcher-debuginfo)
TARGETS += static-jdk-image
.PHONY: static-launcher static-jdk-image
################################################################################
include MakeFileEnd.gmk

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2019, 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
@@ -23,12 +23,13 @@
# questions.
#
include MakeFileStart.gmk
################################################################################
# This makefile creates an image of the optional static versions of certain JDK
# libraries.
################################################################################
default: all
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk
include Modules.gmk
@@ -37,10 +38,12 @@ ALL_MODULES = $(call FindAllModules)
################################################################################
TARGETS :=
ifneq ($(filter static-libs-image, $(MAKECMDGOALS)), )
IMAGE_DEST_DIR = $(STATIC_LIBS_IMAGE_DIR)/lib
IMAGE_DEST_DIR=$(STATIC_LIBS_IMAGE_DIR)/lib
else ifneq ($(filter static-libs-graal-image, $(MAKECMDGOALS)), )
IMAGE_DEST_DIR = $(STATIC_LIBS_GRAAL_IMAGE_DIR)/lib
IMAGE_DEST_DIR=$(STATIC_LIBS_GRAAL_IMAGE_DIR)/lib
endif
# Copy JDK static libs to the image.
@@ -69,9 +72,11 @@ ifneq ($(filter static-libs-image, $(MAKECMDGOALS)), )
)
endif
################################################################################
static-libs-image: $(HOTSPOT_VARIANT_STATIC_LIBS_TARGETS) $(STATIC_LIBS_TARGETS)
static-libs-graal-image: $(STATIC_LIBS_TARGETS)
################################################################################
all: $(TARGETS)
include MakeFileEnd.gmk
.PHONY: all

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,15 @@
# questions.
#
include MakeFileStart.gmk
default: all
################################################################################
include $(SPEC)
include MakeBase.gmk
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, TestImage-pre.gmk))
############################################################################
BUILD_INFO_PROPERTIES := $(TEST_IMAGE_DIR)/build-info.properties
@@ -48,8 +54,4 @@ TARGETS += $(BUILD_INFO_PROPERTIES) $(README)
prepare-test-image: $(TARGETS)
all: prepare-test-image
.PHONY: prepare-test-image
################################################################################
include MakeFileEnd.gmk
.PHONY: default all prepare-test-image

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,8 @@
# questions.
#
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################
ifndef _TOOLS_HOTSPOT_GMK
_TOOLS_HOTSPOT_GMK := 1
include JavaCompilation.gmk
@@ -44,7 +42,6 @@ BUILD_TOOLS_HOTSPOT := $(call SetupJavaCompilationCompileTarget, \
TOOL_JFR_GEN := $(JAVA_SMALL) -cp $(HOTSPOT_TOOLS_OUTPUTDIR) \
build.tools.jfr.GenerateJfrFiles
################################################################################
##########################################################################################
endif # include guard
include MakeIncludeEnd.gmk
endif # _TOOLS_HOTSPOT_GMK

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 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
@@ -23,13 +23,14 @@
# questions.
#
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################
ifndef _TOOLS_GMK
_TOOLS_GMK := 1
include JavaCompilation.gmk
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, Tools.gmk))
################################################################################
# To avoid reevaluating the compilation setup for the tools each time this file
# is included, the actual compilation is handled by CompileTools.gmk. The
@@ -78,9 +79,6 @@ TOOL_GENERATECACERTS = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_class
TOOL_GENERATEEXTRAPROPERTIES = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
build.tools.generateextraproperties.GenerateExtraProperties
TOOL_GENERATECASEFOLDING = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
build.tools.generatecharacter.CaseFolding
TOOL_MAKEZIPREPRODUCIBLE = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
build.tools.makezipreproducible.MakeZipReproducible
@@ -130,14 +128,16 @@ TOOL_PUBLICSUFFIXLIST = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_clas
TOOL_FIXUPPANDOC = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
build.tools.fixuppandoc.Main
################################################################################
##########################################################################################
# Executable javascript filter for man page generation using pandoc.
PANDOC_TROFF_MANPAGE_FILTER := $(BUILDTOOLS_OUTPUTDIR)/manpages/pandoc-troff-manpage-filter
PANDOC_HTML_MANPAGE_FILTER := $(BUILDTOOLS_OUTPUTDIR)/manpages/pandoc-html-manpage-filter
################################################################################
##########################################################################################
endif # include guard
include MakeIncludeEnd.gmk
# Hook to include the corresponding custom post file, if present.
$(eval $(call IncludeCustomExtension, ToolsJdk-post.gmk))
endif # _TOOLS_GMK

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,11 @@
# questions.
#
include MakeFileStart.gmk
################################################################################
# This must be the first rule
default: all
include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
################################################################################
@@ -36,13 +37,9 @@ $(eval $(call SetupJavaCompilation, BUILD_TOOLS_LANGTOOLS, \
COMPILER := bootjdk, \
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
SRC := $(TOPDIR)/make/langtools/tools, \
INCLUDES := compileproperties flagsgenerator propertiesparser, \
INCLUDES := compileproperties propertiesparser, \
COPY := .properties, \
BIN := $(BUILDTOOLS_OUTPUTDIR)/langtools_tools_classes, \
))
all: $(BUILD_TOOLS_LANGTOOLS)
################################################################################
include MakeFileEnd.gmk

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2017, 2019, 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,14 +23,17 @@
# questions.
#
include MakeFileStart.gmk
default: all
include $(SPEC)
include MakeBase.gmk
include ProcessMarkdown.gmk
################################################################################
# This makefile updates the generated build html documentation.
#
################################################################################
include ProcessMarkdown.gmk
ifeq ($(ENABLE_PANDOC), false)
$(info No pandoc executable was detected by configure)
$(error Cannot continue)
@@ -52,4 +55,10 @@ TARGETS += $(md_docs)
################################################################################
include MakeFileEnd.gmk
$(eval $(call IncludeCustomExtension, UpdateBuildDocs.gmk))
################################################################################
all: $(TARGETS)
.PHONY: all default

View File

@@ -1,146 +0,0 @@
#
# Copyright (c) 2024, 2025, 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.
#
include MakeFileStart.gmk
################################################################################
# This file is responsible for updating the generated sleef source code files
# that are checked in to the JDK repo, and that are actually used when building.
# This target needs to be re-run every time the source code of libsleef is
# updated from upstream.
################################################################################
include CopyFiles.gmk
include Execute.gmk
ifneq ($(COMPILE_TYPE), cross)
$(error Only cross-compilation of libsleef is currently supported)
endif
ifeq ($(CMAKE), )
$(error CMake not found. Please install cmake and rerun configure)
endif
ifneq ($(OPENJDK_BUILD_OS), linux)
$(error This target is only supported on linux)
endif
SLEEF_SUPPORT_DIR := $(MAKESUPPORT_OUTPUTDIR)/sleef
SLEEF_SOURCE_BASE_DIR := $(TOPDIR)/src/jdk.incubator.vector/linux/native/libsleef
SLEEF_SOURCE_DIR := $(SLEEF_SOURCE_BASE_DIR)/upstream
SLEEF_TARGET_DIR := $(SLEEF_SOURCE_BASE_DIR)/generated
SLEEF_NATIVE_BUILD_DIR := $(SLEEF_SUPPORT_DIR)/native
SLEEF_CROSS_BUILD_DIR := $(SLEEF_SUPPORT_DIR)/cross
ifeq ($(OPENJDK_TARGET_CPU), aarch64)
CROSS_COMPILATION_FILENAMES := sleefinline_advsimd.h sleefinline_sve.h
EXTRA_CROSS_OPTIONS := -DSLEEF_ENFORCE_SVE=TRUE
else ifeq ($(OPENJDK_TARGET_CPU), riscv64)
CROSS_COMPILATION_FILENAMES := sleefinline_rvvm1.h
EXTRA_CROSS_OPTIONS := -DSLEEF_ENFORCE_RVVM1=TRUE
else
$(error Unsupported platform)
endif
CROSS_COMPILATION_SRC_FILES := $(addprefix $(SLEEF_CROSS_BUILD_DIR)/include/, \
$(CROSS_COMPILATION_FILENAMES))
ifeq ($(TOOLCHAIN_TYPE), clang)
SLEEF_TOOLCHAIN_TYPE := llvm
else
SLEEF_TOOLCHAIN_TYPE := $(TOOLCHAIN_TYPE)
endif
SLEEF_CMAKE_FILE := toolchains/$(OPENJDK_TARGET_CPU)-$(SLEEF_TOOLCHAIN_TYPE).cmake
# We need to run CMake twice, first using it to configure the build, and then
# to actually build; and we need to do this twice, once for a native build
# and once for the cross-compilation build.
$(eval $(call SetupExecute, sleef_native_config, \
INFO := Configuring native sleef build, \
OUTPUT_DIR := $(SLEEF_NATIVE_BUILD_DIR), \
COMMAND := cd $(SLEEF_SOURCE_DIR) && $(CMAKE) -S . -B \
$(SLEEF_NATIVE_BUILD_DIR), \
))
TARGETS := $(sleef_native_config)
$(eval $(call SetupExecute, sleef_native_build, \
INFO := Building native sleef, \
DEPS := $(sleef_native_config), \
OUTPUT_DIR := $(SLEEF_NATIVE_BUILD_DIR), \
COMMAND := cd $(SLEEF_SOURCE_DIR) && $(CMAKE) --build \
$(SLEEF_NATIVE_BUILD_DIR) -j, \
))
TARGETS := $(sleef_native_build)
$(eval $(call SetupExecute, sleef_cross_config, \
INFO := Configuring cross-compiling sleef build, \
DEPS := $(sleef_native_build), \
OUTPUT_DIR := $(SLEEF_CROSS_BUILD_DIR), \
COMMAND := cd $(SLEEF_SOURCE_DIR) && $(CMAKE) -S . -B \
$(SLEEF_CROSS_BUILD_DIR) \
-DCMAKE_C_COMPILER=$(CC) \
-DCMAKE_TOOLCHAIN_FILE=$(SLEEF_CMAKE_FILE) \
-DNATIVE_BUILD_DIR=$(SLEEF_NATIVE_BUILD_DIR) \
-DSLEEF_BUILD_INLINE_HEADERS=TRUE \
$(EXTRA_CROSS_OPTIONS), \
))
TARGETS := $(sleef_cross_config)
$(eval $(call SetupExecute, sleef_cross_build, \
INFO := Building cross-compiling sleef, \
DEPS := $(sleef_cross_config), \
OUTPUT_DIR := $(SLEEF_NATIVE_BUILD_DIR), \
COMMAND := cd $(SLEEF_SOURCE_DIR) && $(CMAKE) --build \
$(SLEEF_CROSS_BUILD_DIR) -j, \
))
TARGETS := $(sleef_cross_build)
$(CROSS_COMPILATION_SRC_FILES): $(sleef_cross_build)
# Finally, copy the generated files (and one needed static file) into our
# target directory.
$(eval $(call SetupCopyFiles, copy_static_sleef_source, \
FILES := $(SLEEF_SOURCE_DIR)/src/common/misc.h, \
DEST := $(SLEEF_TARGET_DIR), \
))
TARGETS := $(copy_static_sleef_source)
$(eval $(call SetupCopyFiles, copy_generated_sleef_source, \
FILES := $(CROSS_COMPILATION_SRC_FILES), \
DEST := $(SLEEF_TARGET_DIR), \
))
TARGETS := $(copy_generated_sleef_source)
################################################################################
include MakeFileEnd.gmk

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2012, 2025, 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
@@ -23,7 +23,15 @@
# questions.
#
include MakeFileStart.gmk
################################################################################
default: all
include $(SPEC)
include MakeBase.gmk
include Execute.gmk
include JdkNativeCompilation.gmk
include ToolsJdk.gmk
################################################################################
# This file is responsible for extracting the x11 native struct offsets to
@@ -35,10 +43,6 @@ include MakeFileStart.gmk
# GensrcX11Wrappers.gmk to generate the Java code during the build.
################################################################################
include Execute.gmk
include JdkNativeCompilation.gmk
include $(TOPDIR)/make/ToolsJdk.gmk
ifeq ($(COMPILE_TYPE), cross)
$(error It is not possible to update the x11wrappers when cross-compiling)
endif
@@ -104,4 +108,6 @@ TARGETS += $(run_wrappergen) wrapper-information
################################################################################
include MakeFileEnd.gmk
all: $(TARGETS)
.PHONY: all default

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 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
@@ -23,17 +23,17 @@
# questions.
#
include MakeFileStart.gmk
default: all
################################################################################
include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
include ZipArchive.gmk
################################################################################
##########################################################################################
#
# sec-bin.zip is used by builds where the corresponding sources are not available
#
$(eval $(call SetupZipArchive, BUILD_SEC_BIN_ZIP, \
$(eval $(call SetupZipArchive,BUILD_SEC_BIN_ZIP, \
SRC := $(JDK_OUTPUTDIR), \
INCLUDES := \
modules/java.base/javax/crypto \
@@ -60,22 +60,20 @@ $(eval $(call SetupZipArchive, BUILD_SEC_BIN_ZIP, \
modules/java.security.jgss/sun/security/krb5/internal/util, \
INCLUDE_FILES := modules/java.security.jgss/sun/security/jgss/spi/GSSContextSpi.class, \
EXCLUDES := modules/java.security.jgss/sun/security/krb5/internal/tools, \
ZIP := $(IMAGES_OUTPUTDIR)/sec-bin.zip, \
))
ZIP := $(IMAGES_OUTPUTDIR)/sec-bin.zip))
TARGETS += $(IMAGES_OUTPUTDIR)/sec-bin.zip
################################################################################
##########################################################################################
#
# Windows specific binary security packages.
#
ifeq ($(call isTargetOs, windows), true)
# sec-windows-bin.zip is used by builds where the corresponding sources are not available
$(eval $(call SetupZipArchive, BUILD_SEC_WINDOWS_BIN_ZIP, \
$(eval $(call SetupZipArchive,BUILD_SEC_WINDOWS_BIN_ZIP, \
SRC := $(JDK_OUTPUTDIR), \
INCLUDES := modules/java.security.jgss/sun/security/krb5/internal/tools, \
ZIP := $(IMAGES_OUTPUTDIR)/sec-windows-bin.zip, \
))
ZIP := $(IMAGES_OUTPUTDIR)/sec-windows-bin.zip))
TARGETS += $(IMAGES_OUTPUTDIR)/sec-windows-bin.zip
@@ -86,18 +84,19 @@ ifeq ($(call isTargetOs, windows), true)
JGSS_ZIP_NAME = jgss-windows-i586-bin.zip
endif
$(eval $(call SetupZipArchive, BUILD_JGSS_BIN_ZIP, \
$(eval $(call SetupZipArchive,BUILD_JGSS_BIN_ZIP, \
SRC := $(SUPPORT_OUTPUTDIR), \
INCLUDE_FILES := modules_libs/java.security.jgss/w2k_lsa_auth.dll \
modules_libs/java.security.jgss/w2k_lsa_auth.dll.diz \
modules_libs/java.security.jgss/w2k_lsa_auth.dll.map \
modules_libs/java.security.jgss/w2k_lsa_auth.dll.pdb, \
ZIP := $(IMAGES_OUTPUTDIR)/$(JGSS_ZIP_NAME), \
))
ZIP := $(IMAGES_OUTPUTDIR)/$(JGSS_ZIP_NAME)))
TARGETS += $(IMAGES_OUTPUTDIR)/$(JGSS_ZIP_NAME)
endif
################################################################################
##########################################################################################
include MakeFileEnd.gmk
all: $(TARGETS)
.PHONY: default all

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 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
@@ -23,16 +23,19 @@
# questions.
#
include MakeFileStart.gmk
################################################################################
default: all
include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
include Modules.gmk
include ZipArchive.gmk
SRC_ZIP_WORK_DIR := $(SUPPORT_OUTPUTDIR)/src
$(if $(filter $(TOPDIR)/%, $(SUPPORT_OUTPUTDIR)), $(eval SRC_ZIP_BASE := $(TOPDIR)), $(eval SRC_ZIP_BASE := $(SUPPORT_OUTPUTDIR)))
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, ZipSource.gmk))
################################################################################
# Create the directory structure for src.zip using symlinks.
# <module>/<package>/<file>.java
@@ -92,8 +95,8 @@ zip: $(SRC_ZIP_SRCS)
TARGETS += zip
.PHONY: zip
################################################################################
include MakeFileEnd.gmk
all: $(TARGETS)
.PHONY: default all zip

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2014, 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,5 +23,5 @@
# This Makefile was generated by configure @DATE_WHEN_CONFIGURED@
# GENERATED FILE, DO NOT EDIT
SPEC := @OUTPUTDIR@/spec.gmk
SPEC:=@OUTPUTDIR@/spec.gmk
include @WORKSPACE_ROOT@/Makefile

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2025, 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
@@ -26,7 +26,7 @@
m4_include([basic_tools.m4])
m4_include([basic_windows.m4])
################################################################################
###############################################################################
AC_DEFUN_ONCE([BASIC_INIT],
[
# Save the original command line. This is passed to us by the wrapper configure script.
@@ -46,7 +46,7 @@ AC_DEFUN_ONCE([BASIC_INIT],
AC_MSG_NOTICE([Configuration created at $DATE_WHEN_CONFIGURED.])
])
################################################################################
###############################################################################
# Check that there are no unprocessed overridden variables left.
# If so, they are an incorrect argument and we will exit with an error.
AC_DEFUN([BASIC_CHECK_LEFTOVER_OVERRIDDEN],
@@ -58,7 +58,7 @@ AC_DEFUN([BASIC_CHECK_LEFTOVER_OVERRIDDEN],
fi
])
################################################################################
###############################################################################
# Setup basic configuration paths, and platform-specific stuff related to PATHs.
# Make sure to only use tools set up in BASIC_SETUP_FUNDAMENTAL_TOOLS.
AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
@@ -75,25 +75,15 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
AC_MSG_NOTICE([Rewriting ORIGINAL_PATH to $REWRITTEN_PATH])
fi
if test "x$OPENJDK_TARGET_CPU" = xx86 && test "x$with_jvm_variants" != xzero; then
AC_MSG_ERROR([32-bit x86 builds are not supported])
fi
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
BASIC_SETUP_PATHS_WINDOWS
fi
# We get the top-level directory from the supporting wrappers.
BASIC_WINDOWS_VERIFY_DIR($TOPDIR, source)
orig_topdir="$TOPDIR"
UTIL_FIXUP_PATH(TOPDIR)
AC_MSG_CHECKING([for top-level directory])
AC_MSG_RESULT([$TOPDIR])
if test "x$TOPDIR" != "x$orig_topdir"; then
AC_MSG_WARN([Your top dir was originally represented as $orig_topdir,])
AC_MSG_WARN([but after rewriting it became $TOPDIR.])
AC_MSG_WARN([This typically means you have characters like space in the path, which can cause all kind of trouble.])
fi
AC_SUBST(TOPDIR)
if test "x$CUSTOM_ROOT" != x; then
@@ -112,7 +102,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
AUTOCONF_DIR=$TOPDIR/make/autoconf
])
################################################################################
###############################################################################
# Setup what kind of build environment type we have (CI or local developer)
AC_DEFUN_ONCE([BASIC_SETUP_BUILD_ENV],
[
@@ -134,40 +124,24 @@ AC_DEFUN_ONCE([BASIC_SETUP_BUILD_ENV],
)
AC_SUBST(BUILD_ENV)
AC_MSG_CHECKING([for locale to use])
if test "x$LOCALE" != x; then
# Check if we actually have C.UTF-8; if so, use it
if $LOCALE -a | $GREP -q -E "^C\.(utf8|UTF-8)$"; then
LOCALE_USED=C.UTF-8
AC_MSG_RESULT([C.UTF-8 (recommended)])
elif $LOCALE -a | $GREP -q -E "^en_US\.(utf8|UTF-8)$"; then
LOCALE_USED=en_US.UTF-8
AC_MSG_RESULT([en_US.UTF-8 (acceptable fallback)])
else
# As a fallback, check if users locale is UTF-8. USER_LOCALE was saved
# by the wrapper configure script before autconf messed up LC_ALL.
if $ECHO $USER_LOCALE | $GREP -q -E "\.(utf8|UTF-8)$"; then
LOCALE_USED=$USER_LOCALE
AC_MSG_RESULT([$USER_LOCALE (untested fallback)])
AC_MSG_WARN([Could not find C.UTF-8 or en_US.UTF-8 locale. This is not supported, and the build might fail unexpectedly.])
else
AC_MSG_RESULT([no UTF-8 locale found])
AC_MSG_WARN([No UTF-8 locale found. This is not supported. Proceeding with the C locale, but the build might fail unexpectedly.])
LOCALE_USED=C
fi
AC_MSG_NOTICE([The recommended locale is C.UTF-8, but en_US.UTF-8 is also accepted.])
AC_MSG_WARN([C.UTF-8 locale not found, using C locale])
LOCALE_USED=C
fi
else
LOCALE_USED=C.UTF-8
AC_MSG_RESULT([C.UTF-8 (default)])
AC_MSG_WARN([locale command not not found, using C.UTF-8 locale])
AC_MSG_WARN([locale command not not found, using C locale])
LOCALE_USED=C
fi
export LC_ALL=$LOCALE_USED
AC_SUBST(LOCALE_USED)
])
################################################################################
###############################################################################
# Evaluates platform specific overrides for devkit variables.
# $1: Name of variable
AC_DEFUN([BASIC_EVAL_DEVKIT_VARIABLE],
@@ -177,7 +151,7 @@ AC_DEFUN([BASIC_EVAL_DEVKIT_VARIABLE],
fi
])
################################################################################
###############################################################################
# Evaluates platform specific overrides for build devkit variables.
# $1: Name of variable
AC_DEFUN([BASIC_EVAL_BUILD_DEVKIT_VARIABLE],
@@ -187,7 +161,7 @@ AC_DEFUN([BASIC_EVAL_BUILD_DEVKIT_VARIABLE],
fi
])
################################################################################
###############################################################################
AC_DEFUN([BASIC_SETUP_XCODE_SYSROOT],
[
AC_MSG_CHECKING([for sdk name])
@@ -272,7 +246,7 @@ AC_DEFUN([BASIC_SETUP_XCODE_SYSROOT],
fi
])
################################################################################
###############################################################################
AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
[
AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit],
@@ -406,7 +380,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
AC_MSG_RESULT([$EXTRA_PATH])
])
################################################################################
###############################################################################
AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
[
@@ -415,21 +389,11 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
[ CONF_NAME=${with_conf_name} ])
# Test from where we are running configure, in or outside of src root.
if test "x$OPENJDK_BUILD_OS" = xwindows || test "x$OPENJDK_BUILD_OS" = "xmacosx"; then
# These systems have case insensitive paths, so convert them to lower case.
[ cmp_configure_start_dir=`$ECHO $CONFIGURE_START_DIR | $TR '[:upper:]' '[:lower:]'` ]
[ cmp_topdir=`$ECHO $TOPDIR | $TR '[:upper:]' '[:lower:]'` ]
[ cmp_custom_root=`$ECHO $CUSTOM_ROOT | $TR '[:upper:]' '[:lower:]'` ]
else
cmp_configure_start_dir="$CONFIGURE_START_DIR"
cmp_topdir="$TOPDIR"
cmp_custom_root="$CUSTOM_ROOT"
fi
AC_MSG_CHECKING([where to store configuration])
if test "x$cmp_configure_start_dir" = "x$cmp_topdir" \
|| test "x$cmp_configure_start_dir" = "x$cmp_custom_root" \
|| test "x$cmp_configure_start_dir" = "x$cmp_topdir/make/autoconf" \
|| test "x$cmp_configure_start_dir" = "x$cmp_topdir/make" ; then
if test "x$CONFIGURE_START_DIR" = "x$TOPDIR" \
|| test "x$CONFIGURE_START_DIR" = "x$CUSTOM_ROOT" \
|| test "x$CONFIGURE_START_DIR" = "x$TOPDIR/make/autoconf" \
|| test "x$CONFIGURE_START_DIR" = "x$TOPDIR/make" ; then
# We are running configure from the src root.
# Create a default ./build/target-variant-debuglevel output root.
if test "x${CONF_NAME}" = x; then
@@ -450,12 +414,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
# If configuration is situated in normal build directory, just use the build
# directory name as configuration name, otherwise use the complete path.
if test "x${CONF_NAME}" = x; then
[ if [[ "$cmp_configure_start_dir" =~ ^${cmp_topdir}/build/[^/]+$ ||
"$cmp_configure_start_dir" =~ ^${cmp_custom_root}/build/[^/]+$ ]]; then ]
CONF_NAME="${CONFIGURE_START_DIR##*/}"
else
CONF_NAME="$CONFIGURE_START_DIR"
fi
CONF_NAME=`$ECHO $CONFIGURE_START_DIR | $SED -e "s!^${TOPDIR}/build/!!"`
fi
OUTPUTDIR="$CONFIGURE_START_DIR"
AC_MSG_RESULT([in current directory])
@@ -518,7 +477,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
AC_CONFIG_FILES([$OUTPUTDIR/Makefile:$AUTOCONF_DIR/Makefile.template])
])
################################################################################
###############################################################################
# Check if build directory is on local disk. If not possible to determine,
# we prefer to claim it's local.
# Argument 1: directory to test
@@ -555,7 +514,7 @@ AC_DEFUN([BASIC_CHECK_DIR_ON_LOCAL_DISK],
fi
])
################################################################################
###############################################################################
# Check that source files have basic read permissions set. This might
# not be the case in cygwin in certain conditions.
AC_DEFUN_ONCE([BASIC_CHECK_SRC_PERMS],
@@ -570,7 +529,7 @@ AC_DEFUN_ONCE([BASIC_CHECK_SRC_PERMS],
fi
])
################################################################################
###############################################################################
AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES],
[
AC_MSG_CHECKING([if build directory is on local disk])
@@ -581,6 +540,9 @@ AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES],
BASIC_CHECK_SRC_PERMS
# Check if the user has any old-style ALT_ variables set.
FOUND_ALT_VARIABLES=`env | grep ^ALT_`
# Before generating output files, test if they exist. If they do, this is a reconfigure.
# Since we can't properly handle the dependencies for this, warn the user about the situation
if test -e $OUTPUTDIR/spec.gmk; then
@@ -610,7 +572,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_DEFAULT_MAKE_TARGET],
AC_SUBST(DEFAULT_MAKE_TARGET)
])
################################################################################
###############################################################################
# Setup the default value for LOG=
#
AC_DEFUN_ONCE([BASIC_SETUP_DEFAULT_LOG],
@@ -629,7 +591,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_DEFAULT_LOG],
AC_SUBST(DEFAULT_LOG)
])
################################################################################
###############################################################################
# Code to run after AC_OUTPUT
AC_DEFUN_ONCE([BASIC_POST_CONFIG_OUTPUT],
[

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2025, 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,12 +23,12 @@
# questions.
#
################################################################################
###############################################################################
# It is recommended to use exactly this version of pandoc, especially for
# re-generating checked in html files
RECOMMENDED_PANDOC_VERSION=2.19.2
################################################################################
###############################################################################
# Setup the most fundamental tools, used for setting up build platform and
# path handling.
AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
@@ -57,10 +57,9 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
UTIL_LOOKUP_PROGS(LOCALE, locale)
UTIL_LOOKUP_PROGS(PATHTOOL, cygpath wslpath)
UTIL_LOOKUP_PROGS(CMD, cmd.exe, $PATH:/cygdrive/c/windows/system32:/mnt/c/windows/system32:/c/windows/system32)
UTIL_LOOKUP_PROGS(LSB_RELEASE, lsb_release)
])
################################################################################
###############################################################################
# Setup further tools that should be resolved early but after setting up
# build platform and path handling.
AC_DEFUN_ONCE([BASIC_SETUP_TOOLS],
@@ -100,13 +99,15 @@ AC_DEFUN_ONCE([BASIC_SETUP_TOOLS],
UTIL_REQUIRE_SPECIAL(FGREP, [AC_PROG_FGREP])
# Optional tools, we can do without them
UTIL_LOOKUP_PROGS(CMAKE, cmake)
UTIL_LOOKUP_PROGS(DF, df)
UTIL_LOOKUP_PROGS(GIT, git)
UTIL_LOOKUP_PROGS(NICE, nice)
UTIL_LOOKUP_PROGS(READLINK, greadlink readlink)
UTIL_LOOKUP_PROGS(WHOAMI, whoami)
# Tools only needed on some platforms
UTIL_LOOKUP_PROGS(LSB_RELEASE, lsb_release)
# For compare.sh only
UTIL_LOOKUP_PROGS(CMP, cmp)
UTIL_LOOKUP_PROGS(UNIQ, uniq)
@@ -115,7 +116,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_TOOLS],
RM="$RM -f"
])
################################################################################
###############################################################################
# Check if we have found a usable version of make
# $1: the path to a potential make binary (or empty)
# $2: the description on how we found this
@@ -128,7 +129,7 @@ AC_DEFUN([BASIC_CHECK_MAKE_VERSION],
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
MAKE_VERSION_EXPR="-e 4\."
MAKE_REQUIRED_VERSION="4.0"
else
else
MAKE_VERSION_EXPR="-e 3\.8[[12]] -e 4\."
MAKE_REQUIRED_VERSION="3.81"
fi
@@ -175,7 +176,7 @@ AC_DEFUN([BASIC_CHECK_MAKE_VERSION],
fi
])
################################################################################
###############################################################################
AC_DEFUN([BASIC_CHECK_MAKE_OUTPUT_SYNC],
[
# Check if make supports the output sync option and if so, setup using it.
@@ -200,7 +201,7 @@ AC_DEFUN([BASIC_CHECK_MAKE_OUTPUT_SYNC],
AC_SUBST(OUTPUT_SYNC)
])
################################################################################
###############################################################################
# Goes looking for a usable version of GNU make.
AC_DEFUN([BASIC_CHECK_GNU_MAKE],
[
@@ -248,7 +249,7 @@ AC_DEFUN([BASIC_CHECK_GNU_MAKE],
BASIC_CHECK_MAKE_OUTPUT_SYNC
])
################################################################################
###############################################################################
AC_DEFUN([BASIC_CHECK_FIND_DELETE],
[
# Test if find supports -delete
@@ -277,7 +278,7 @@ AC_DEFUN([BASIC_CHECK_FIND_DELETE],
AC_SUBST(FIND_DELETE)
])
################################################################################
###############################################################################
AC_DEFUN([BASIC_CHECK_TAR],
[
# Test which kind of tar was found
@@ -315,7 +316,7 @@ AC_DEFUN([BASIC_CHECK_TAR],
AC_SUBST(TAR_SUPPORTS_TRANSFORM)
])
################################################################################
###############################################################################
AC_DEFUN([BASIC_CHECK_GREP],
[
# Test that grep supports -Fx with a list of pattern which includes null pattern.
@@ -339,7 +340,7 @@ AC_DEFUN([BASIC_CHECK_GREP],
fi
])
################################################################################
###############################################################################
AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
[
BASIC_CHECK_GNU_MAKE
@@ -411,7 +412,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
fi
])
################################################################################
###############################################################################
# Check for support for specific options in bash
AC_DEFUN_ONCE([BASIC_CHECK_BASH_OPTIONS],
[
@@ -468,15 +469,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_PANDOC],
AC_MSG_CHECKING([if the pandoc smart extension needs to be disabled for markdown])
if $PANDOC --list-extensions | $GREP -q '+smart'; then
AC_MSG_RESULT([yes])
PANDOC_MARKDOWN_FLAG="$PANDOC_MARKDOWN_FLAG-smart"
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([if the pandoc tex_math_dollars extension needs to be disabled for markdown])
if $PANDOC --list-extensions | $GREP -q '+tex_math_dollars'; then
AC_MSG_RESULT([yes])
PANDOC_MARKDOWN_FLAG="$PANDOC_MARKDOWN_FLAG-tex_math_dollars"
PANDOC_MARKDOWN_FLAG="markdown-smart"
else
AC_MSG_RESULT([no])
fi

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 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
@@ -159,7 +159,7 @@ AC_DEFUN([BASIC_SETUP_PATHS_WINDOWS],
else
WINENV_PREFIX_ARG="$WINENV_PREFIX"
fi
FIXPATH_ARGS="-e $PATHTOOL -p $WINENV_PREFIX_ARG -r ${WINENV_ROOT//\\/\\\\} -t $WINENV_TEMP_DIR -c $CMD"
FIXPATH_ARGS="-e $PATHTOOL -p $WINENV_PREFIX_ARG -r ${WINENV_ROOT//\\/\\\\} -t $WINENV_TEMP_DIR -c $CMD -q"
FIXPATH_BASE="$BASH $FIXPATH_DIR/fixpath.sh $FIXPATH_ARGS"
FIXPATH="$FIXPATH_BASE exec"
@@ -215,7 +215,7 @@ AC_DEFUN([BASIC_WINDOWS_FINALIZE_FIXPATH],
if test "x$OPENJDK_BUILD_OS" = xwindows; then
FIXPATH_CMDLINE=". $TOPDIR/make/scripts/fixpath.sh -e $PATHTOOL \
-p $WINENV_PREFIX_ARG -r ${WINENV_ROOT//\\/\\\\} -t $WINENV_TEMP_DIR \
-c $CMD"
-c $CMD -q"
$ECHO > $OUTPUTDIR/fixpath '#!/bin/bash'
$ECHO >> $OUTPUTDIR/fixpath export PATH='"[$]PATH:'$PATH'"'
$ECHO >> $OUTPUTDIR/fixpath $FIXPATH_CMDLINE '"[$]@"'

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 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
@@ -23,7 +23,7 @@
# questions.
#
################################################################################
########################################################################
# This file handles detection of the Boot JDK. The Boot JDK detection
# process has been developed as a response to solve a complex real-world
# problem. Initially, it was simple, but it has grown as platform after
@@ -49,7 +49,7 @@
# JDK, and if one is found, check if it is acceptable. If not, we print
# our reasons for rejecting it (useful when debugging non-working
# configure situations) and continue checking the next one.
################################################################################
########################################################################
# Execute the check given as argument, and verify the result
# If the Boot JDK was previously found, do nothing
@@ -180,13 +180,11 @@ AC_DEFUN([BOOTJDK_CHECK_JAVA_HOME],
# Test: Is there a java or javac in the PATH, which is a symlink to the JDK?
AC_DEFUN([BOOTJDK_CHECK_JAVA_IN_PATH_IS_SYMLINK],
[
UTIL_LOOKUP_PROGS(JAVAC_CHECK, javac)
UTIL_GET_EXECUTABLE(JAVAC_CHECK) # Will setup JAVAC_CHECK_EXECUTABLE
UTIL_LOOKUP_PROGS(JAVA_CHECK, java)
UTIL_GET_EXECUTABLE(JAVA_CHECK) # Will setup JAVA_CHECK_EXECUTABLE
BINARY="$JAVAC_CHECK_EXECUTABLE"
if test "x$JAVAC_CHECK_EXECUTABLE" = x; then
BINARY="$JAVA_CHECK_EXECUTABLE"
UTIL_LOOKUP_PROGS(JAVAC_CHECK, javac, , NOFIXPATH)
UTIL_LOOKUP_PROGS(JAVA_CHECK, java, , NOFIXPATH)
BINARY="$JAVAC_CHECK"
if test "x$JAVAC_CHECK" = x; then
BINARY="$JAVA_CHECK"
fi
if test "x$BINARY" != x; then
# So there is a java(c) binary, it might be part of a JDK.
@@ -324,7 +322,7 @@ AC_DEFUN([BOOTJDK_SETUP_CLASSPATH],
AC_SUBST(CLASSPATH)
])
################################################################################
###############################################################################
#
# We need a Boot JDK to bootstrap the build.
#
@@ -395,9 +393,11 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK],
# When compiling code to be executed by the Boot JDK, force compatibility with the
# oldest supported bootjdk.
OLDEST_BOOT_JDK_VERSION=`$ECHO $DEFAULT_ACCEPTABLE_BOOT_VERSIONS \
OLDEST_BOOT_JDK=`$ECHO $DEFAULT_ACCEPTABLE_BOOT_VERSIONS \
| $TR " " "\n" | $SORT -n | $HEAD -n1`
AC_SUBST(OLDEST_BOOT_JDK_VERSION)
# -Xlint:-options is added to avoid "warning: [options] system modules path not set in conjunction with -source"
BOOT_JDK_SOURCETARGET="-source $OLDEST_BOOT_JDK -target $OLDEST_BOOT_JDK -Xlint:-options"
AC_SUBST(BOOT_JDK_SOURCETARGET)
# Check if the boot jdk is 32 or 64 bit
if $JAVA -version 2>&1 | $GREP -q "64-Bit"; then
@@ -470,7 +470,7 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
# Maximum amount of heap memory.
JVM_HEAP_LIMIT_32="768"
# Running a 64 bit JVM allows for and requires a bigger heap
JVM_HEAP_LIMIT_64="2048"
JVM_HEAP_LIMIT_64="1600"
JVM_HEAP_LIMIT_GLOBAL=`expr $MEMORY_SIZE / 2`
if test "$JVM_HEAP_LIMIT_GLOBAL" -lt "$JVM_HEAP_LIMIT_32"; then
JVM_HEAP_LIMIT_32=$JVM_HEAP_LIMIT_GLOBAL
@@ -602,12 +602,11 @@ AC_DEFUN([BOOTJDK_SETUP_BUILD_JDK],
BUILD_JDK_FOUND="no"
if test "x$with_build_jdk" != "x"; then
BOOTJDK_CHECK_BUILD_JDK([
if test "x$with_build_jdk" != x; then
BUILD_JDK=$with_build_jdk
BUILD_JDK_FOUND=maybe
AC_MSG_NOTICE([Found potential Build JDK using configure arguments])
fi
])
if test "x$with_build_jdk" != x; then
BUILD_JDK=$with_build_jdk
BUILD_JDK_FOUND=maybe
AC_MSG_NOTICE([Found potential Build JDK using configure arguments])
fi])
EXTERNAL_BUILDJDK=true
else
if test "x$COMPILE_TYPE" = "xcross"; then

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -34,10 +34,10 @@ include @SPEC@
BOOT_JDK := $(JDK_IMAGE_DIR)
# The bootcycle build has a different output directory
OLD_OUTPUTDIR := @OUTPUTDIR@
OUTPUTDIR := $(OLD_OUTPUTDIR)/bootcycle-build
OLD_OUTPUTDIR:=@OUTPUTDIR@
OUTPUTDIR:=$(OLD_OUTPUTDIR)/bootcycle-build
# No spaces in patsubst to avoid leading space in variable
JAVAC_SERVER_DIR := $(patsubst $(OLD_OUTPUTDIR)%,$(OUTPUTDIR)%,$(JAVAC_SERVER_DIR))
JAVAC_SERVER_DIR:=$(patsubst $(OLD_OUTPUTDIR)%,$(OUTPUTDIR)%,$(JAVAC_SERVER_DIR))
JAVA_CMD := $(FIXPATH) $(BOOT_JDK)/bin/java
JAVAC_CMD := $(FIXPATH) $(BOOT_JDK)/bin/javac
@@ -48,3 +48,4 @@ JAVA_FLAGS_BIG := @BOOTCYCLE_JVM_ARGS_BIG@
# By filtering out those JVM args, the bootcycle JVM will use its default
# settings for CDS.
JAVA_FLAGS := $(filter-out -XX:SharedArchiveFile% -Xshare%, $(JAVA_FLAGS))

View File

@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
@@ -53,10 +53,10 @@ if [ "x$OUT" = x ]; then
fi
fi
# Test and fix cygwin/msys CPUs
echo $OUT | grep -e "-pc-cygwin" > /dev/null 2> /dev/null
# Test and fix cygwin on x86_64
echo $OUT | grep 86-pc-cygwin > /dev/null 2> /dev/null
if test $? != 0; then
echo $OUT | grep -e "-pc-mingw" > /dev/null 2> /dev/null
echo $OUT | grep 86-pc-mingw > /dev/null 2> /dev/null
fi
if test $? = 0; then
case `echo $PROCESSOR_IDENTIFIER | cut -f1 -d' '` in
@@ -64,10 +64,6 @@ if test $? = 0; then
REAL_CPU=x86_64
OUT=$REAL_CPU`echo $OUT | sed -e 's/[^-]*//'`
;;
ARMv8)
REAL_CPU=aarch64
OUT=$REAL_CPU`echo $OUT | sed -e 's/[^-]*//'`
;;
esac
fi

View File

@@ -1,7 +1,7 @@
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
#
# Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2025, 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
@@ -75,8 +75,7 @@ AC_DEFUN([BPERF_CHECK_MEMORY_SIZE],
FOUND_MEM=yes
elif test "x$OPENJDK_BUILD_OS" = xwindows; then
# Windows, but without cygwin
MEMORY_SIZE=`powershell -Command \
"(Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory" | $SED 's/\\r//g' `
MEMORY_SIZE=`wmic computersystem get totalphysicalmemory -value | grep = | cut -d "=" -f 2-`
MEMORY_SIZE=`expr $MEMORY_SIZE / 1024 / 1024`
FOUND_MEM=yes
fi

View File

@@ -26,7 +26,7 @@
# the root of the build directory.
################################################################################
##########################################################################################
# Substitutions from autoconf
export LEGACY_BUILD_DIR=@OPENJDK_TARGET_OS@-@OPENJDK_TARGET_CPU_LEGACY@

Some files were not shown because too many files have changed in this diff Show More