Use xaero's openjdk ebuilds.

This commit is contained in:
Andrius Štikonas 2020-11-13 21:17:12 +00:00
parent eb5434af3d
commit c58b1c343c
71 changed files with 7511 additions and 930 deletions

View File

@ -1,39 +1,99 @@
AUX bootcycle_jobs.patch 1273 BLAKE2B 4ff4b9f629167230aa0800da4559b1d31028924971850e9067edb35c506ae4e3eeb0fe8a2d593550c49ff0136641b3c9aebad21bb622eafd41244154474ce5b0 SHA512 6f033c2ab8ef5acb516fcd46dd94ba1021b9f3f3f844595341d2984e67dcbfe442af6918041d1d00922d647e2c31e75820835f9f1eeb163abb0f3ab804e4b864
AUX generate-cacerts.pl 11051 BLAKE2B e6d54319153735bd4b445581dfbd2b78e2e27a19f3b8a78d2fe6912efa207d133fa550652295648bc0bd1370956f71374d4b42de71776fa253f44d4e9dff2527 SHA512 22d1be675362c09ed61af4dc3ece14cab81e9514937d588ff5d324e61b7eba7d3dd99b26bc5ec0953365de56d099f708b2afdb13cca37bc4ff07fd8ce31fbe97
AUX icedtea8-hotspot-noagent-musl.patch 3334 BLAKE2B 6595d4a2a245aea05f39c3ccbd7267249f0d0e8d0564569adf637e75c9ae7a7dfd4aa871d5bd8e924ec706570368e7e0168c4f592236c1e1f2d12e324944b872 SHA512 1545bcd15d47fb77e07cbed955d5757d96b99c659ca833db701f8711f123ccef6538a2c1fedd87d3c75f1e309ed840c4c74611f6840369c12ef30633adbdb523
AUX bootcycle_jobs.patch 1274 BLAKE2B 4d44d1ab97fae90c00ac13e00e5a4caf71ec8961d7645957b1732ea8a55822b870131e154065bcebd44b27f7cbc11f07b2a030723486a8159845481b635916dc SHA512 abcf97b658661c05fe7ddbb26707061ddefb30a8133d295fd10b34540d32401b6812d07083feb73a7521be13faeaddf0c3bf3e40cc2e7c3f15f70ed3e43667b9
AUX musl/10/aarch64.patch 278 BLAKE2B efe0e23db53c8bfc6bb7c54268428729cfbe2968615ff1ea1d918f357ab3d6000dab0dfd9670a66005f158525ea5a679cb7ad26fd5cf096fae0b23538d79232a SHA512 479d0183aece1ca3f41d4eb9e9bf69d3d0fc2668e32d8b826ae3bd117da5d83241868e8b0cab6773cb87bd7403f17d519cc190c530a783b51f28a6aee0272bea
AUX musl/10/build.patch 19515 BLAKE2B 5fa8b50bf86771f1b20023cb850081e05e73942552cd17520829593fcbe376e43257182ca339f24c7375b21ecb17490ee28155d9d63e806825802198704c0034 SHA512 792dd959f98bd81250b568ea1972374431963cec16d8a9955e1aece71a0a4a06446cd7cf879273760eddee65561d0cf6c54cb25824bec389657e7fe05335896b
AUX musl/10/fix-bootjdk-check.patch 25760 BLAKE2B 91bf753a207cc4dd9aae821be000f4eacd87ee8048db3e2f5968903ffb408dc618fb6d3ce056df60348a8e7391a91caca2b14364bfe5087e1dcac1485bc60f24 SHA512 b683d61a5d586c2557834816410b58f27067ce8fe71d68df6d492bf4f730a21bf913cade4bbaf368be16fc6b3b76d8309012a4735fe0431b2abc95c4d8f059da
AUX musl/10/make-4.3.patch 741 BLAKE2B 6dab3601e6a6260f9813fab663211d8afe7fc08ff1af243bbd8ad90f8c58df5c713aec5cea7788eeabee9fce17e0aec5cf9b6f19becd5baf37a772773a445b36 SHA512 7d6ada121fbd7a4b29459b000fca225b3fb7d95d855459d43749d6ece60b8282418bd349cf235ccd41b86ac36b158e81f3184884883a551c240cb30dfe66fccd
AUX musl/10/ppc64le.patch 6466 BLAKE2B 528ab05c6ac6101e250f4a5ff2ca065e07f560898bdceeb9c681152eb959e0030afe8e000bb06285f51294e052e50781ca99bf58af3fb1e316b34db8c70a77ee SHA512 25a91b821fa4d08d3b2c0c1fb4ecfc8aaf611837517fbaed7d90be2fdb1892b55a0ef44553dc543dccb2e104a14bc42434f9a393a72f3e66abc26db30916ce60
AUX musl/11/aarch64.patch 462 BLAKE2B 6f73eaf1b07417fcd9d980cc3ab7612e1863c2120e7913a5d70dbaf29ce282476ad5e5b59f5796a6ec475c62d44e7c78ed54b21525a5f9974459ed4ec7ce9f9a SHA512 7233c538cfab3eabe01dd4ba3ed59ddc8b60270274230f2e63ddabefd870236289589546cb1a889e03875425702a7c53c8a729c464e8e9b7ce1e8da3458498c2
AUX musl/11/build.patch 19836 BLAKE2B b5349e5dadd19ca4c844dd549f356f2717305416e829ef93909a125288813cda33a0c6b930396f00b08df0a03ac49224303d8cdc47a4833d2ba4897326bfd9eb SHA512 af9a6b367182880bb31bf4828d8f8fbede384b10a29f9f4aeb6e9e0ff6740745f2027ce52cf548884891ea85c455fe3453ae4e9835af4d52fad94b049ad2f932
AUX musl/11/fix-bootjdk-check.patch 847 BLAKE2B c843f2258f92fbbf78466f7fa64584b1918452dd4e81073f87f83e376523ae0de98cf18fe657fb2920ad9661e915328c6d101bb4acd02ae12581b69777184c34 SHA512 9b656b0deb8e8012b26339259eadf4237785d4d3b4238a6556ee48a0f1935d831dc8109528b22a5ca8af8df7a25b8c52bc62e899aeffe7e1bd5c120efc70058b
AUX musl/11/ppc64le.patch 8951 BLAKE2B 27ac988f2cd9af6045fd0945296832f9f6ef012e1457a75a20225c03651ca8140322f7467975f49a7e09077657509fa35c19bb7b9b937ef6e654b7d55ebfcc9f SHA512 f6f475e1ad2d431142aee0e7dd3259949b757162235d0ee23a2715f4e612be5853ca6164bff89ed410a91febcbad153e448a1011f1d7e4d838a75ceb2fe801b4
AUX musl/12/aarch64.patch 279 BLAKE2B a32e40c9b8b3be35b0fe35c4435a9f3a97070a2b84c8f8b47f124f9535244c92600c20914c5b9ee5b07938b0f1802fe9dd90b625b6b766b5e3da2c24a45056ba SHA512 15735b0a54e918a1b52df47d96024ef2b649b5773578885273d985acc2f0abfb17b70656d2e5c492458ddb8733a2a825fd6153bf051127d8faf67f1fe1e872ca
AUX musl/12/build.patch 18767 BLAKE2B 3040195142dc0b74022ab59483b009b7f1a9bfd87a53efc5aac5ff5c6430473027bab5eb33db2f6dd0e04533898e10082dab202b45226c5fa50c7b5e730c5340 SHA512 55b98c25d01278addd212bb6e5954a219272c34b555786fc27ff61a1d73ad0991a59fe64bbe25f9d476ca64b6697ca77da345b42f70bca940640bb77086c52d3
AUX musl/12/fix-bootjdk-check.patch 953 BLAKE2B c0f5a527491616a6272edd420615f754d2eaf07f761a6f95c5744dd0fff4dba897bee1eedb62075bfd5d3661f744ab13b099b3d07c1eca5739b15033321d3d86 SHA512 1892a87b6b9fc66a15bdb38fa6ee6c673a78a1f402d6eda0b2d2d621cb75914dfcc41b1407a1673421e9ef0f6ec3da66988cd7c4fff82725c1d341be3f30c0cb
AUX musl/12/make-4.3.patch 740 BLAKE2B 973e21bfbfae8ead6184179f62594cfadecd14f9fa2fd0bce7c063899c4233bba2c36388284cc7adaaf2176391257543fe0df09560979f882d0c61916f12c9ed SHA512 ee8ba62ab5909648dccc1d5e1d12b4f35e813320a7919476bc1ff35bc2ef51030df3426616e0f636dd64a8b07021201f7bcb477253bb33a97cd0db8a6684137c
AUX musl/12/ppc64le.patch 7546 BLAKE2B d44084d93aedfc7ab775e0380c40c6b02c0b50bdca9b5e2cbd501f186a11142971eb5598925495aad65b1254218957ab2867a7da1b76c415ad95703addd0081a SHA512 fe96fd76dff9b44757c1410574b0ed32a96ea02a7bfee947fcf88ef6ac8b375fd910afe39915e3e1449014df9c08817c6903769c0dbfcc2289368fabf075e014
AUX musl/13/aarch64.patch 344 BLAKE2B aef628f7605a1bd94fe1c95fb646ea9bc1f9160c0ce3b36afdfb4eab1955c8e0c1fce8217b13cc164a23b6469fbb642f2759f55273232dee9bbe00eb1786567c SHA512 1ce3e4ae2c8b93573f35a17836ffda8e36055ac947e7c472ae159141e2adf7134afc756f784bc2f7010ac7c31a8a2418aae964e913d8c84833053072e10aca07
AUX musl/13/build.patch 18898 BLAKE2B 4b86bb0ef5986dfe2d1706524c8311fbe9d6ce57e5906a527d3a3109bcd58ef14a7975383deb821dd45f535216a76e551f21db9522caeeb9e55cc5650377f72e SHA512 d082d47232e343d3bb7e491286ce4cdcebeca996c1006749c70311a71a03baf76375f507832dbf4abeae1d7b83e1a51e3b997ef23dba48df30bf347aa7842c9e
AUX musl/13/fix-bootjdk-check.patch 974 BLAKE2B f611caf1f769b172d04aeda2d39cad9001db98ca30b1359c9f487668d019669794fb29c6970db25f1b2eede07df93f4082efa7b965d1e919c11a34443080998e SHA512 e54c69db6e97c9d7057275f6749565a748f42dadb397b2f3975d99608c4037ad93c84cf828c7e2955b1b4f1899dcc25069c8c6d675f1e963adf3f1223a47d56c
AUX musl/13/ppc64le.patch 8896 BLAKE2B 88793e8e03bc7003ffcb29bcb623d690dc86d6ff7b003e2cc30e08c30def86e7810a36f13e60085ad99fda00f001cf5aabbaf3d311db882a2072207089b01bfa SHA512 f220385a9d70dcc4bd965c936ff51899f62022fc283e7524465c49cdcae09f8ef6908a0cf7055092a29158420cd1eba08232b112db58d425c154e70f4606fc73
AUX musl/14/aarch64.patch 338 BLAKE2B a3f15bb468465139433faf2a59d82a36c57b68e3de85825f524504a94acec325f2ae3870af2d5d680b81d096dea05e16b0c96c1834df44baf1998295bb0b54ef SHA512 030bb63bcf48d17544b4ac0a2bdc38ed38d9280089efc30fee009cbb0473845b46380829f21be78e02ca798d7255a4859e6152baa12863c30650269f6a87443e
AUX musl/14/build.patch 18470 BLAKE2B b1e21ebf02f2c33e7e3905414c5fff7d0a7cd12addf85d57352badb688e40078e7583b05b0ef23f269f269f6c1cbe467656d6ee7511f26a1b9b50040c8c7160c SHA512 b318051390a546b13bbe8e143c5dbb5cfaed55f20de3a3ec3fec21c59dc6686bf65f9029d6b0ee954a840e2b44926d8e42c315d1a76af699c88aa651eea6e4cc
AUX musl/14/fix-bootjdk-check.patch 974 BLAKE2B f611caf1f769b172d04aeda2d39cad9001db98ca30b1359c9f487668d019669794fb29c6970db25f1b2eede07df93f4082efa7b965d1e919c11a34443080998e SHA512 e54c69db6e97c9d7057275f6749565a748f42dadb397b2f3975d99608c4037ad93c84cf828c7e2955b1b4f1899dcc25069c8c6d675f1e963adf3f1223a47d56c
AUX musl/14/ppc64le.patch 8830 BLAKE2B a0862beceb0c67531f42b2ffd570a869d187de843ab6d255e7af0ee83a9de6b7a71209510c4133d14b61b1e8f21eb3b9a0545961a1b74612dd8e7ffb5121f526 SHA512 20e41cab2eefcf820c468c60a891021c226fd0a01b5b322d682405e0e65e1ffe7c15bd0dc7858bd4628570e5c7ab01058ae8065647d07e8954cdea41b6419951
AUX musl/15/aarch64.patch 337 BLAKE2B b47df7c6e5b84a3f151b345816caa4c19b39d6af9591f4d3e89223acffe69a5e4afc698c9efa04cfa4ccb985b6ceb024b8746934599ef8f101dd0d8973b71be2 SHA512 e765351f9a9eb9ed6aa08643ffa14277b90e2a2309bbabc22d2ef9a2c856a00464f360084bfac15acf2ac57e22043d1438eb91594dccd040a511e9fa738249c4
AUX musl/15/build.patch 18573 BLAKE2B 01e856c7d2f516916d7dc86eae124e4667d9319061e2980682db8c4f15ab0c215bdceca79b73f6812dd6a1f32e90890cade997b9f02d742bd56dfc14a45c01c7 SHA512 a020757e748ef74e3ddeedff8da6f783dd89517335fc720bb8035a5f20b78c95e1362bb6675395109c36a0b1a7585eadcbc8d90f89a4b359bf060d036035269c
AUX musl/15/ppc64le.patch 8857 BLAKE2B 4ef4ea1f32fc188ff80128685be03943594be31cc0ffab3ddd8895b8c7aae7efb76c4bb8a9406ebbfc2924b0d1bdd1ca32bd8138ad73db8361f2085c45ee097d SHA512 0cd8b11afcc1abd2eccde4d5ad29c6540b3688d122619a87a78aa6afb8bee0c9bfa4388f836678cf7920a762840ce0f67458251b2815e464106cacfaf574739f
AUX musl/7/cpio.patch 696 BLAKE2B fd915459e7ac41f5b13316ca07caa0562fcaf8da7ad9e4e7b7ea1062cf36a68c98ac07c76c5012cb0b5bbb5440a0144b84e35442dec2debc2f62edf26f4eed6c SHA512 d2b065ff1c712331015a1287fff766d19483cde61a1c3ec1125b4ef5026cd2936e9bfac908dc5e9fea4c3da76d2560fb77226cac3925232d2b9acd60ac4dcdd2
AUX musl/7/hotspot-musl-ppc.patch 6596 BLAKE2B 594eeffed454457bcc760cf345bee2e73118d35b12636bba3f1336ee0b4785ce2b3938a83a0bbd940f6765a5f474e7a846ed1c0a85e2df0a30c802af745ffd4c SHA512 5ae18e783b84f7ab1d270fe448acaee00dec67fce8d3f9caa9a4bf43ad94b3f0155eb456d91249d9238431d921c2d6fb8c780be984e1e8cb932b6f064b142375
AUX musl/7/hotspot-musl.patch 2764 BLAKE2B 2517a188c6b24da76d863765a107a1a552dbb737d47e47e78e06f5cafde1f5d7cb9d7ad9ed335ac5d4d5b59484e7f8312ad8600d21828d80f28fb57458a864fb SHA512 4c61368a8995470237c49c51bd4d039d9507f4075d2990d9ac4b3be0a6521b33a86fefbb750c78a7e844e777d6f420bb927538e1abfe99976f1fdb68318f3968
AUX musl/7/hotspot-noagent-musl.patch 2498 BLAKE2B 527a629271b035e1a970ba0038631e334688f1cd280487bd6ad9982cca75a84c7f8804b5750f42d20d147583ca1a88e89d9e42a871800af0d4a1fded73d5b16a SHA512 6ca11bc78e6315f1533167b773d6a0270750fd975c9afdeddca194836245862b99608f2e1876edda0b7a1419fbc29396a94132d87871b69b2bdca73ef2afd7a4
AUX musl/7/hotspot-uclibc-fixes.patch 3367 BLAKE2B 5d9181dbef1aa54fed3adc8b37037b8e3c2827ffe3c7350e82c44f59d211e73433c359fd5ad6fcf264cc17c1af57f73c81186061463fbb51e8123c21d7ad90fd SHA512 0ba53d8fda3cb3ecf72a6bcd455de9d8cc21f2a1ba0c8465a17cb96565c5ae44a3e829a799b7723fbd93f81322969dff332887908696cc4ab83a6a506c527b94
AUX musl/7/jdk-execinfo.patch 1502 BLAKE2B 29c723abfd73a58aad96effad11510e2a3b020db1a2acbf672208cebb48235b4ff78565fb405c9ac0cf921c601b3be06e9f9287df658b8c29a171d50fda45cea SHA512 b1df56953e6daeec68861e7bf70960287b715e6a8e454fd10234666496f09ba2360993d7cf85c528adada98d7b1e51a237696131b3b93063685747c2a3855b73
AUX musl/7/jdk-fix-build.patch 1851 BLAKE2B ecfaf947d58afddc48e637ac6a40714c94ba19284da01906058a030c505d9caa1430ff7fd366336c84f8b16e3b05b55254992ba95c4a0657d45a833ed1a3bf09 SHA512 e58ecd15168294a244c78485d11ab9cd0856a0f9a55fee8ceac3156a17745b2476aa88456113aca956127a788cc3be521b0a419d4b5ff28ca69df927b2f788b3
AUX musl/7/jdk-fix-ipv6-init.patch 1574 BLAKE2B e0e7e5a61513690cf70996de171982e610c41658461af58cb47c2c47c7c51bd9adf2fc674e86e412455ba56c6d85efa8af2d9a8198487d233fee4a9495d0a59e SHA512 840927860b479efb90d0b5a61dc4331213d0b7bc7d3e88f589ab46a2308fb4d8e48871dfe5e2adc222083f02eed6b4a215ea75f1e7b73fe15ee43a636b46e539
AUX musl/7/jdk-musl.patch 5217 BLAKE2B 3bd2e879f54c4d5404ca41c0926637af2663b4adfb4e248bd60bced568941d93d6ede8d5f54baa760ca8781d0c43e64e2e3867d7eccc892f6ee49ef2f9af70f6 SHA512 ad35d66294b0f519aada36780d08e087c357663ffc781e4a3d2003ce203b94bb2a956f637929e5736e9faf18fb59b97698ba8e1d995e993c97c62b7741836761
AUX musl/7/jdk-no-soname.patch 571 BLAKE2B ea083473b38ea7f55bf52b714acc32f66193f17a36d15202c7791d49a3e86ee28df6507a9dbdc952136740935adea755e162a4b4a66b97e79e079589ae3366ac SHA512 d747a18965a1c115d19eb6f5fcb6c3b199295ba6dfe4384158c5d07ee8533da8751f28ea8433d622acdcc0d082e870c02e807da1e12f9edf082c7a94658cc254
AUX musl/8/0001_musl_hotspot.patch 5209 BLAKE2B 46d1081a020772280ae6ed3a360563e1f7e2ee145493d3288875c385ed40e1c2909f7884e76f8161cf3ab14766e4dc0442bfd0da9e8b276a30adda2acea31892 SHA512 6d05b00088d7182b91cc8517208de6391b757e4ecfe07492bbdfcccd597d5430d2ff2cf9e5d9c83a376fa475d9094deb2f393d2d15cb54eb6e5667e6bbaf867d
AUX musl/8/0002_musl_hotspot_ppc.patch 1198 BLAKE2B dea0aec583a5afde5897f8d530df578b6a7cfa161d2f2290b785145e05c540522dbe0314a4d0141e289d605ffe5af2541d67204616c53603ea5bfff5b1a35f56 SHA512 a17e0d099452f9d50814fa2229d19b5323571ee4c4f6ce7ee99bd2e024cd90dbc3ec385b02eaf8d9d8871007e91234e2919a781c0ebf1cd8ddc7e73bf130ab46
AUX musl/8/0003_musl_hotspot_aarch64.patch 581 BLAKE2B 64cceb113d8f3f15df6408a880713bdee297a53834a830fa921dd94d6b8a74e20d247b34d103c2add3f23a97ea08ea6a0f670e99d2a02ae021b656c22ed15f6f SHA512 0dd2295f8637f23ae4d006bda4c9a83e5208c2b1209d076894d3aa81a8f009d0890fd269ed2be6640ca1a84a25753301300427aea5a99fc48a1a15667dbcc35c
AUX musl/8/0004_musl_hotspot_noagent.patch 3541 BLAKE2B a71553a5b3b1739a70146cf9bee821f1e177b4d985ebe0b2ef6e94a5c99c965f5a7ee99484d8fa778c5c37949b3e66754db89c00a1f682bbffbbd6feabff1b0d SHA512 09500457fa654fb95f779d0ebfc64bbdb3cac4776e06518771774456dc3c79ac859558d9af9172de639cc1b3ed2496462310c5b46389fd1ee625a4c93238b56b
AUX musl/8/0005_musl_fix_libjvm_load.patch 556 BLAKE2B ab1b89112723c3dd51567e6fee67f03439d2a0a3c537e2386c1d8f797f08e4bdaae99fb8592e907f535c6d5e5c21a9eb8838e0c1d5718c5e7968bbaac81e544d SHA512 4fe1d43db2371bc5e4f1552ef071529842f2ba8efa1c8cbd5cb3286cad74f46b67858cd4efe3e48d66e8a143488bef5a0f249410b037e9b84ac77d1e618de10b
AUX musl/8/0006_musl_jdk.patch 3750 BLAKE2B 04a01a6ad41d1c84270f5451bc2f0758d02fca6437567509c008cd557a4dcb2dbde91dc7ed3f48b9f56a0fabaf8fd2c206342a9739904049effb4462beb31e1c SHA512 e5bc79a646e531d3e43d28d66cf75691df59819988809675d45f114ee2792aec11fda7972653a0068c432f5e4952ab1f550ef3376088e6e675c7fd3fc1e63378
AUX musl/8/0007_musl_jdk_includes.patch 6391 BLAKE2B 1e1ddb5a073b1dc5586d1f59dba31f9d4291faa4a4f2cf01ba82b586229178412104e252270c6c37a84f2e7caea02fd37c820b352fface5fbe99344f36373de8 SHA512 1f4b15d17edc784014d24d72a1dfe0b9af63b048a1196852f513d519020262fb83dc3a4d0b88f8de3de0a3424555683417f8fc35150fdf57f43f6a2cf6131f9a
AUX musl/8/0008_musl_jdk_execinfo.patch 733 BLAKE2B f30811d1b32582de336c0ce535462be2c773a5f0c434ea8b02bd5361eeee41eec303e37308e76ca4b0e2e53df5e7e50c7c6b386e113b147e80f7a2807e51f25a SHA512 73b954035444100a87bd3509b0c6fa782324d1af42812bb203d950228cacc8356456da855a825fd5a1cce0aab05def384b0d60382c1ef0b89354a6049143d081
AUX musl/8/0009_fix_jdk_ipv6_init.patch 1585 BLAKE2B 3536c6875c317e15e855d09b146e101170373fbf34f195fb98168741350a0432940d99a3e87ae48e9803be9996489d8e4128f6b8356bfb5731a9efad385ce20f SHA512 69159f1dd2e56fc9457232cc8734078f87c83d327774b7f0daeb2f880077054f2241787343a6d9f6ad07ca737b50a7165c8ae31f71f94992f6395b867cb83b2d
AUX musl/8/0010_fix_jdk_close_fds.patch 3026 BLAKE2B d417e2d18bbdeed1ba21842cf7b345e4098dce6e3d933bfae8f10d3c925b52c8b8bbd59d9331f9cd1afec8de8b767f309a56ad1f2ff1a6dad6772ab05e92e1df SHA512 547f445208c5fc49e94e29c7d54f2f65a13c23fbd9a76f462deef6c6c1b4fc8930cf76d17a629bf956ee2fd683af7c8fa12bbe9e2a849cca239655a02b9d0e54
AUX musl/9/aarch64.patch 285 BLAKE2B fbd5fc18e648d28f61605c5c31fc714dafb6cc3899b19beaba66a2a11e6aee97426844f0b0912f28f1cbc7d19272b3632975ad6d529395f0335a46bb64c19005 SHA512 4019e5c8a4a6e171d79a2c92a11d671dabd46690cfcb07161cb23e351e158207ff9a0d2d111b68816383a74301510de7caed6e51772231746d499f895ad8ed3f
AUX musl/9/build.patch 19356 BLAKE2B d92f6fcd921b5440c355cf2e941e133139af5aafbabd664bd91f02d01b610e0a0584f4c4f230c0f447e21a08427b07d28e8f748139f18bd2c32a255fb94950b4 SHA512 605ba644b96ef0d9eaa1531cfa47330a718f8fe72d1676709f49016b8b245319e5700cec9ef03f7c32a77ec133cc98ab806a3fc264c21cfe59f0881554ecf9d5
AUX musl/9/fix-bootjdk-check.patch 801 BLAKE2B 50ea3218bcceacd35cf6fefe0c4e6adda476e83ec3247ac136f053688149aa1c5420620bd8f5b6c90fbc9c0aed18c37a79b3ce0df957fa0e510be6ac4b31cfb2 SHA512 a132df211c86aed5af8564cb584b4ee69ce07f3186f5f6ca4b5c1af4355c47f060534d0fd65e9415b0082de2c4912de63a776fff63241b8f3b20951fb45f9f73
AUX musl/9/make-4.3.patch 740 BLAKE2B c155e808f69221c6720841c6ce9bb2fb58b413ad2864fd5b5b3e661e57796d75ac5740d2873d9222174045015c8ad96e6b3b966b3361a3a7cd164ad0968552e0 SHA512 8460dde4d40d57254f14e995090bc4255ee7662d18c19f127d56a1d12d53ec56731574a784ed5d68e89aef1133da760f30ae0982389cf1512ccab1d5f62c4b75
AUX musl/9/ppc64le.patch 5969 BLAKE2B 42836db6e27bbb6781e319fdccfe99ebb2a0e68b17be6737ffc2bbb84e5c25c14d5527d150a00367279e31e05cd482b7a29f5440696b0d47f508d0b79cb16c64 SHA512 61bbb9a0d91faef9dc085726dad8242312cf3e819ed69ca8dce873ff152d02366fab78a7d6d587b9ca5bc233660056076827ec4b6b521af552e40d3e938c9d4d
AUX openjdk-10.env.sh 537 BLAKE2B 404aeaf3d4df54b66193b8e09521ad2e55a23dc0603beea9911e4c91ab96e30c0f4aa4a0e96b1982874e055af3b9923689657b58dc02b37f91163659343ed2f9 SHA512 f4a41891b0187048a21b1af43053375e62de249e3ba210c3cfd59178c9f4c667ff83f10ee85f9ae37db097e862ff7233f5136569d0cb1399dbf48cea075cfc6e
AUX openjdk-11.env.sh 537 BLAKE2B 404aeaf3d4df54b66193b8e09521ad2e55a23dc0603beea9911e4c91ab96e30c0f4aa4a0e96b1982874e055af3b9923689657b58dc02b37f91163659343ed2f9 SHA512 f4a41891b0187048a21b1af43053375e62de249e3ba210c3cfd59178c9f4c667ff83f10ee85f9ae37db097e862ff7233f5136569d0cb1399dbf48cea075cfc6e
AUX openjdk-12.env.sh 537 BLAKE2B 404aeaf3d4df54b66193b8e09521ad2e55a23dc0603beea9911e4c91ab96e30c0f4aa4a0e96b1982874e055af3b9923689657b58dc02b37f91163659343ed2f9 SHA512 f4a41891b0187048a21b1af43053375e62de249e3ba210c3cfd59178c9f4c667ff83f10ee85f9ae37db097e862ff7233f5136569d0cb1399dbf48cea075cfc6e
AUX openjdk-13.env.sh 537 BLAKE2B 404aeaf3d4df54b66193b8e09521ad2e55a23dc0603beea9911e4c91ab96e30c0f4aa4a0e96b1982874e055af3b9923689657b58dc02b37f91163659343ed2f9 SHA512 f4a41891b0187048a21b1af43053375e62de249e3ba210c3cfd59178c9f4c667ff83f10ee85f9ae37db097e862ff7233f5136569d0cb1399dbf48cea075cfc6e
AUX openjdk-14.env.sh 537 BLAKE2B 404aeaf3d4df54b66193b8e09521ad2e55a23dc0603beea9911e4c91ab96e30c0f4aa4a0e96b1982874e055af3b9923689657b58dc02b37f91163659343ed2f9 SHA512 f4a41891b0187048a21b1af43053375e62de249e3ba210c3cfd59178c9f4c667ff83f10ee85f9ae37db097e862ff7233f5136569d0cb1399dbf48cea075cfc6e
AUX openjdk-15.env.sh 537 BLAKE2B 404aeaf3d4df54b66193b8e09521ad2e55a23dc0603beea9911e4c91ab96e30c0f4aa4a0e96b1982874e055af3b9923689657b58dc02b37f91163659343ed2f9 SHA512 f4a41891b0187048a21b1af43053375e62de249e3ba210c3cfd59178c9f4c667ff83f10ee85f9ae37db097e862ff7233f5136569d0cb1399dbf48cea075cfc6e
AUX openjdk-7.env.sh 746 BLAKE2B b8a18bb5e2dd3c4722b78531428d4291236a6295973fdcd65c64469b3a49a520686ff8d884c0b3d5dd9017ff4027d2fc1d78d57f062a4cf8910e0bab3ed444cc SHA512 2c65d1875406deabbfadb798501de15850775a4a049f073cdfda684ca1bff4b531b93596ee91a7caf77ff6c377457093f72c7bde4b995bce9ffbc4a8fcceb6dd
AUX openjdk-8.env.sh 746 BLAKE2B b8a18bb5e2dd3c4722b78531428d4291236a6295973fdcd65c64469b3a49a520686ff8d884c0b3d5dd9017ff4027d2fc1d78d57f062a4cf8910e0bab3ed444cc SHA512 2c65d1875406deabbfadb798501de15850775a4a049f073cdfda684ca1bff4b531b93596ee91a7caf77ff6c377457093f72c7bde4b995bce9ffbc4a8fcceb6dd
AUX openjdk-9.env.sh 537 BLAKE2B 404aeaf3d4df54b66193b8e09521ad2e55a23dc0603beea9911e4c91ab96e30c0f4aa4a0e96b1982874e055af3b9923689657b58dc02b37f91163659343ed2f9 SHA512 f4a41891b0187048a21b1af43053375e62de249e3ba210c3cfd59178c9f4c667ff83f10ee85f9ae37db097e862ff7233f5136569d0cb1399dbf48cea075cfc6e
AUX openjdk9-hotspot-musl.patch 5858 BLAKE2B 5947aa74f25bf0152719e12cfcc5e784a9ce6bee9db5773e9d7f55889ce3de8136206d28d2420c5845d979192afcf1559c8bd59438809b67063a16c1bb024b62 SHA512 3ff2048bf4bbc8da03e56bedcff5e86fb1d9e2546860b893b792d0689da0db72f064a177ec65c9a96f49bd3f88609100c3da56299630e4efa340732dce89655b
AUX openjdk9-hotspot-rlim_t.patch 1661 BLAKE2B 8e18033baf5e2600ffa1a6072391e73ad32f110d16e648d31f6acd09e679fae05a1e495241cfe522c2387bab627e72afcc85ce8c719cbd43491c9ad184e55e66 SHA512 cbca3be62ac17814370f31d8513c5199c738893a6b2e498d3b864986e88380472c34ead92afbd8865f5f9312d5a2bcd1ee0cdede571b51e31745978826d98cb5
AUX openjdk9-hotspot-stop-using-obsolete-isnanf.patch 1859 BLAKE2B 6fd452271c60a7ade483045487378eca51f2320ac48dd5391780ab92cae396de89f94ff53599038c7a34073d19f36d17b9673f6f9df59360577cdf32bf2bb0fe SHA512 f7c2d49be1b8b5fd8000a9587e2e913067fc3f5be561556e004edd361dbe07ea03b0b1725632cbd5205bd2a7d40ff7a8d6fd6ba3e1be8a9c96fbbed695315470
AUX openjdk9-jdk-execinfo.patch 703 BLAKE2B 35e24a550b425acf352deecdecaa0ae955b2be67739464836424ffc6e38e87eba6a54cd6185b9ebb8124298789a62c2f76e58fecc15a39e31972e6f20af38c4c SHA512 0aad66dbdb8f6668cb4a6499316e32a0d3d76823446f92b945d74af7075bfb726ad90fffe56c12185ede43a1fc028e2a3d5313d22e273621b3d773447add19ab
AUX openjdk9-jdk-musl-build-fix-use-SIGRTMAX-rather-than-__SIGRTM.patch 2750 BLAKE2B 3e27a45155e79a182e70838da826643a2e410f943bd123e7a341f9f0d8874d067f02781c6f16a613188b096cb7fbab127b31005aec0b6e0ec33980231433ede8 SHA512 5316b0c1886b94ae527ef957a35c577d9051cd3781138214d32c94baa78bb008f6378cba7cc2bace8b249c04ee877418e2d9f22dfc673a2abfb6bb0dbf1535a9
AUX openjdk9-musl-fix-libjvm-load-on-musl.patch 1383 BLAKE2B 10ec0c12de0f5fc2c4a4dd0ee79aa6f17c309d57c8aa0ef4b2caebe5b99c0e5691aa540a500427d0806de4aa5c3f8f666c56497b86d588e44b1f89d327ed1575 SHA512 319706346f1a349b7c093cad5b4c7c13ff255826bc0b333bb7a63e6b3ad52fc942d85d30375128d4e0c00734f89060eb85171beeef2415a6225d97a3cbc80fc3
AUX openjdk9-os_linux-remove-glibc-dependencies.patch 1308 BLAKE2B 72c1466783d2196b66cbef8493416928f8428ca2ee0152bd3190508c28c48ac2ddb224d6b87dd33dbec999b8ac94ddc50bdc7261518b35212d48bc0dbc90eb6f SHA512 a55e5a13554d1c06b9900d16541785769a09d22c495d11c8b914fe18e12e33f6a3f7a56189c0277f66243d8986e79233ca7583812509bc947fb2c3932e5a4700
DIST jdk-10.0.2+13.tar.bz2 88365048 BLAKE2B f898a0976cff12cca439ccdba2bf7eff7fcbc5f00709fa41302fd781819a44165fa864d5e551023c507ad18dc957abd24b15744fc6dc5304ee1a26bd4cb8cb86 SHA512 7491da11d5e0013db75d33e09be7a91ac0dbcde6282541a39fe471fd5368d49b15403bc7508b330ca60210b3ca02730743ba280657283a231853f6882a3ca74d
DIST jdk-11.0.5+10.tar.bz2 90613232 BLAKE2B 0a3cba851ac967d84f97ae1e7972d3ab593dbc76fb20664c4e7950380ad91acee7e263a2989930b45346cd170da71c500db9d8a0a6ac88982d77607089b95513 SHA512 0d52c78e217b79756be0fc6b3f9204bae254ec7b9ae10b6c3114463a9c028143807f4422711f0c02b81a034ae6e88fa2efc6bed85022720807344230a8aa12a6
DIST openjdk-12.0.2_p1.tar.bz2 83912905 BLAKE2B cf81872dc9a68758bd46a0c486893321461323872d204028b84c36fdd8f9de54c88bb70d4f0c50b7370f589a424852e74a383dea71e17c227ac740283dd933e4 SHA512 53c66ae9bdc6aa47b05f57845d696edf55c5e5eeb6c7dd6cd46b9a0cfad9864db846ac88e00aefbc86ff9ffa77ab9bcf9cf3c73b7f3b797ad68d9e8609438dd9
DIST openjdk-13.0.4_p1.tar.bz2 83507118 BLAKE2B 500985c9b406ec62fdbacf8f1c5350c48dbd029384313a5a95632f860ba20191e1f9be79fe860c3f9a6d8461ed2207be97f03fb8b740cbd7ae1f04242691c05f SHA512 2f2f30e3450ed2f73b56ad722784d8d01b3bddf46c55b1f2bd283920c7eb51c94816048021d68e8d9ab524a1db4979f2926684c6441c49fe092c1778ced346d5
DIST openjdk-14.0.2_p1.tar.gz 109297285 BLAKE2B be60397242955b3479bfee9cc1b43e2c5ddc404c20e310ece294fa9cbd3b9cb32e198bd4d241c3731efc92cb17e36efbd8b30fa618bd4cbec9ec139283e82518 SHA512 e76b7908e7b1375029564d39386c86b640fcb61c7152bdda7249a6455516792830f17e987c98790ae5983087b928be6f5d572b8b10f3e2318d2d993f5f22ed62
DIST jdk-10.0.2+13.tar.bz2 1865415 BLAKE2B 46d2f743e2eab0ab1db0714123d4315b417c1970b2cca57ff83acd58ac6dcfca03350136d3aa20c2c8f45c7a50906a648dc581f1bd1dd7723b32bbee3c3c6ea8 SHA512 fd84be24a1b0e0d05ee41518d48443f17baa7a5e0ef7404bb1f9e9e88e6ae90bcd7e36c3d4facada72c952b9a68c5cef14f63e60b6de14ba47e70f9e6bdcc7db
DIST openjdk-11.0.9_p11.tar.bz2 91638327 BLAKE2B a04b7fb5ebde3b6c024e5f3931a2efe796e08ad66c0190cddfa4268d5181f46f24685d9d51ae328547916e8ece723967bf653feeac87347ee14ecbe213ad657a SHA512 a0a6726d5adbe95904b78d8b4319bc4386c594a563f80f63d59072cf72d00928b451163b91258b44193a80851400ce8b8d142fecfd2bd902ff7a5e47cb4a9976
DIST openjdk-12.0.2_p01.tar.bz2 1658584 BLAKE2B fe241cd84044d4722c097ecc0e721b97c601754c6b56d893873bba21020c12e5cae848228b76eeaf2ffe15cb0eeeddb84970a5927181d1062a6c23ba1ff51f23 SHA512 c3ef3c3326ff31380142502771c078303f229b79f4fa9748a401a35a7e5843d07e937eba23ec8d87fe4d20545f4a3011731c7612a77be2cef66a1a03043cb2bd
DIST openjdk-13.0.4_p01.tar.gz 1664699 BLAKE2B c34d51e4153ee63ac145a5d7ceb1534c119a6bf5dcbc1012ec16b182639333a8ba17480e5a09b76179884c1da9c21ef873d86c63d4e6813ca56a2d8225e3af0e SHA512 0941e3d363483edf497e37b23c90ecf31cecfb2881d6596ceb7212a660b556aa65c0dfd73f0bd2c6c38d8bd17f2c945067e662e7e0fea19bfc13575390f69bf3
DIST openjdk-14.0.2_p01.tar.bz2 1730264 BLAKE2B 7553d6df43936de7fafb402d3b6d276f5331da8c5883dac52f118b34d820e3260626b73f0edc19358eda6451d33f64f8c9ae1a57873460e0db5e1d4c8523100f SHA512 b01be476ba51e64a5034ed2471e431f288a95ccd45acafca0b3bb96075955ad6cfc32e01c1004e51dc8afd8910ed6b895b758972bc24db30591d55070e13491c
DIST openjdk-15.0.0_p36.tar.gz 101812870 BLAKE2B 1028ab04825941452b603998f05e2a7e419931979a19855f6ea6c1578c331704ac19ae77043a4f44b2f5d9d481b9a9eaad6c3e3eec9154789d54980ba0295bb7 SHA512 c08d2818de06569278b67954556221ed7c6ab6848ffc57823b789f370ebdd332d2803979a5a254e8f9f669ea161bb479f66ad4e1490b37889d38233b6cca4357
DIST openjdk-8.272_p10.tar.bz2 457222 BLAKE2B 51e487d36c1922c5fc04d8922f1000a776e4872142517933ef5e8d5fd825f221fa02325bd755bf3f48f7f3221a2da3ca182301fb303675cb7d712d7b2f1c7751 SHA512 488b7fa0ed725936d483efd54242dbf4409752c685f29277023fb47c4375b5700b34e743d819d7d7c2406a2f8845d1c3d4fc548c156b6c7c30e43574c1b51527
DIST openjdk-9.0.4_p12.tar.bz2 823756 BLAKE2B f1b457655520b983597b15254323abdb0c39feaff78ce36d88ef556a086d9f9333ceddec63d945ca28bb06f4a06c2bc1344051ac2c1df55a01728016ff7255c1 SHA512 cef3655ae7db657e6c81aa86587e451e58896bb6ee786495f6d757096334435b6a4de26ec3ec927da2487e135f09ce26414f8d6b9b9c508a28d3087be286b1ec
DIST openjdk-aarch64-shenandoah-8.272_p10.tar.bz2 462755 BLAKE2B abeabf704d2135da9df6746545209f5a658ec547be5852041bb9bd1dfc4546cef143541df61b4705b6d2181ae7ec91a8c64e2b27347c24d146da49bbf8c228ef SHA512 7cae0cf80e09e1d2ad3eef8bf6740942788d0af4d3c9821bb0785ea42d4b38319d0ec57a8d21add25a40eebdc5ecba8234c9f04e6922e87c80480f71b04e2e3d
DIST openjdk-aarch64-shenandoah-corba-8.272_p10.tar.bz2 1052989 BLAKE2B 8d6f79758ccf1719396fb56fd47c258c2440beea79516025b4911027a59b6cf4b5826c5eb01ba3a4c45847915531989c74665cbedf6349541df38732e7b828de SHA512 12547c8b5f1fe4efcc58f5b148977d519c954b964e814fc3fce717bd6d6221c2e7eda98a0e1e8157ed2f509f3b89e1e7b529da81cd1ee768daf4ad6369c57e8b
DIST openjdk-aarch64-shenandoah-hotspot-8.272_p10.tar.bz2 8767088 BLAKE2B 85b2dcbd696c58db72a7aeb4dc9a4752d742ed90bfd2e06ce5ddd8ed4ec5c63ab2de40a41aab5747fa120d8865c1d57f02a99b27a6ebf7c68c0891e19f5a7f27 SHA512 7866495487b271228f1a2d95cecfa6b76bb912d8c1c63d3d92e7b2cda88dd151b3b6c4c3bc717e37a0bd972762620ae7fb456c1aee281772a145a1dd1b11758b
DIST openjdk-aarch64-shenandoah-jaxp-8.272_p10.tar.bz2 2718084 BLAKE2B 1e6cc999d84a49c03731a2a2ca73dfe684940509a64199ad52571ef51b3da035e41b41bf262ea88af9f77418c7b1b5721724d86f67a5f737e53eaf3673f4eab8 SHA512 a73e5a4628c936cf9b19082ad49ed2134984d15a1165c45206c74dff45118c50922fd0a668efe93a46c3839775ec567d56eee19cd0e3a9f90e7995d1b6a42f11
DIST openjdk-aarch64-shenandoah-jaxws-8.272_p10.tar.bz2 2558262 BLAKE2B 3b00ca162f3b758ee65090011551f074f7675f499f179ae0d4c8c62b1d70c942d7d2082d48e84cece6cd2be7ea319c1707fc6239e82fd5e79297f796838688e4 SHA512 d64a15cf35df014c4dca2edddea2015905bafe252d3d2bdfd1bc8f72683ac827e5d0347e36d5d94cda354b31a6b0782017b1cea6571443e073caf9f26c7bebda
DIST openjdk-aarch64-shenandoah-jdk-8.272_p10.tar.bz2 48370921 BLAKE2B 98026a28463ce3f520feab2b146830bf91acdccac5aa28488ffdbe4328b9a2cbbc17e95eeb36a60364cab470eeb26efcfa06a588e1bebcb6e978821459536feb SHA512 1bc5baa799282a2d7c0014d2cf55b350c7d99dbd129643d2cfeadebd467b2f6f9a8b8a97d34f66c656103db3ee3d5a57d6ff57dc45bc655258dd5093506d89b5
DIST openjdk-aarch64-shenandoah-langtools-8.272_p10.tar.bz2 2397200 BLAKE2B 1d985e852f07ab69e0af01a17cc3874cf903b1e3e2c4a909b7403087b3243beaf57a1e9b7792b52469a80764c7db614e3bb6ec4b43527d022219f3e79af21457 SHA512 76118b6c56481bcd3a6a709006d0d114faeef2b2a3c353e4a5ef2af5f03429dddd78d2d5951e9245fb5e41443e871e43634921825c0dbae8907f3f49fb3dea0c
DIST openjdk-aarch64-shenandoah-nashorn-jdk8.272_p10.tar.bz2 2838876 BLAKE2B 40d011a11122b2dd19349282468c756a58afbc1ff2a33424d6c4e82cde1f664e3317eb1616533b0d2bc24604c68ffd0b1b92d3271dd633f3a39aad22c84ca781 SHA512 1f50c2c1a6a5d271d63906cb1cf3e87d7b6fe61e92c90cf2974ec40e956be0e8388c2694d189c85ec7072abfd21566671498b8652c2ae9cb2021c6ec4d548f66
DIST openjdk-corba-8.272_p10.tar.bz2 1033649 BLAKE2B db9d72dabe4b1727dbbe1de01e46f62676c48668e7ec960e10643c19374a2553dee3c2b5b576f85d09b541b570756b20980e1307fc614e4b4bee9789affc650e SHA512 1426b3ce6983429fe6399da77fb102fb5d54ebf65ab83ad4e3c0ee789e33e2a0afc1bbfb7b8f942334ff9b03be0696494919c374ce1b793b179ecc43e2c4384a
DIST openjdk-corba-9.0.4_p12.tar.bz2 1002503 BLAKE2B 789664686432cee36e7e165aa4ac6e9a2ed1a1a85a961cd362d9bbdf59d7c7077b71bd2fc59e03f3e3a8cdbc4443a7e359fbfbbbaebfe29bbd220e3cafc3a298 SHA512 455998437a9e3ff538b921025d57e19e6fb5148b3f124c9c427c3604689884d81b3ce5c9dbd93d88de26bf1b43ce76d75f75afd95e473a94973a668575e41748
DIST openjdk-hotspot-9.0.4_p12.tar.bz2 11411231 BLAKE2B a21a5003266f6d8f60adaf78b109d496e46058841d0ab2c8f17256a503124b36e18908240f04fdbb16c056a1f68608f891fed1dbb9c9a0b2bb2326a303a32a4f SHA512 49d93764b13085a5626bec1c3d4e790f8748c24577a4e990e76bd1006721a5b8b9a256c40bf6419df4dda6f6390e457485f90c1b1101c010476a04d9056e9f16
DIST openjdk-jaxp-9.0.4_p12.tar.bz2 3215994 BLAKE2B 57061280601277706ef263e19a8a8ff7eadeaa8d60edc9fe195d15669b554684f5b4132d4899d9031888f3140a6acbab8b0d7ba950d304d7e83b1e3f74253259 SHA512 82f28586fd576cc01062e2ff37a917987775838910e4a5ecdfd096abec1c8d23028b77bfc87a38ada53bc30d71d89bde7408c1ae572a43c87a71ced64fd08d3a
DIST openjdk-jaxws-9.0.4_p12.tar.bz2 2517916 BLAKE2B 650fbaf93349ce12ba7426e626a6c6e3468183a44f65abb16c139a4b09a2a0d91aed0f9fdfbb7fe779a335a66a003da001229e5504a60396023504ad6c1e3b90 SHA512 459978a5e3ca21910781daed848229e043eea5bd82dcd20e9249934ec97a2a982126c6e37aac1a36719e3b73a5e6c8a92a50b63033149913614d8f3edfc0846e
DIST openjdk-jdk-9.0.4_p12.tar.bz2 55469786 BLAKE2B 92f6b30c4c23d99492ff85f61099dcbb4dd1adfc4f4a297801d26e5b0c44be76fb40d482ad0752ac3abdf1d9db0e940a2dd5ba2c5f37d658689147c8eacca26d SHA512 259228d3f439dde239e38cdebb8c3bbb83804ab141d87a9c236310707de9c58cd78cd80ceb4c17755cc1048071f24462839988112c2698f7ec1453a8810610f2
DIST openjdk-langtools-9.0.4_p12.tar.bz2 4497608 BLAKE2B 382bfa6119345f1983cf5a168fa0d2e523a6dad5ad35f446cd11d6f6f24bb5850e65d1d0aab7fe8298ba7a2d7fe3ebb8a472c567a46577dff17ab80ea32abae9 SHA512 ef3c70be906a4b0dd9c9195c88da045909ee3ef144941fb7b4495ed66b4162f481095cad87626d2bd38e5a62134b440223cd008dd6123b6b43c00e338610a692
DIST openjdk-nashorn-9.0.4_p12.tar.bz2 8961760 BLAKE2B 2ff03adf87a0e0561d52529cf95b8fb827e75773462be7ecddd60dc966e1a229b897eb65a0301a531dfcaff884122e612f1a24b5d5fbc8f0352a8d84218423d7 SHA512 848c6ece418e250561572ad704baeb565580098cfc5f849d4e1a3b41b916aae3487eb4d8d0b319f3a503d122ec064ed4de0678d06821c9a2bdb09c990e589c97
EBUILD openjdk-10.0.2_p13.ebuild 7530 BLAKE2B e3d307b1af2c32f19cfe001a0009634aa377429bea882dd51a2a4fb714bc6934d9b700b1d3c2a8db25901f93f02bb8990a5016315b810dce7b1b10c986c424de SHA512 434b71216129c6a42c89b01d37d6b21205549a9caadd0e075771f5e514557d392d7f4b00dbe2a86cdbec6fa17648da952b356d667ac6bd594aa0a07c1ce762c8
EBUILD openjdk-11.0.5_p10.ebuild 7663 BLAKE2B 71e3d5259823f5a1944dda4b2394265799b007fe79057bc5e22a7aba550d8b6c4de52f1f2b0fa7b7d4288fa6d4247537012e1209215a4872361c9557e1d0e8f0 SHA512 f6323118aa9dabb339b48b98e7219043b700471e4652e9d0b4fca1b20baa55d0ffcd989e02bf7ea8b5cfe88865eaf5e863b5dc1729f706bcf7b2e5d67fc16fbd
EBUILD openjdk-12.0.2_p1.ebuild 7781 BLAKE2B 9ac75843354349bc67d28277933a6ea6a5307db8bea5390d9e798414e02a7ffb483011caccd0b7b409ddb98443e0045dda0bb0d57fc192e00884e70326d5f50e SHA512 d99c2bf7cc4997219a043fabbde56e2d7f821933e308085fb666027fbe2548102d55a55f84f639b3ce787782b8d6558ec01695103691de5ebb8ab53bd0718ddc
EBUILD openjdk-13.0.4_p1.ebuild 7781 BLAKE2B 9ac75843354349bc67d28277933a6ea6a5307db8bea5390d9e798414e02a7ffb483011caccd0b7b409ddb98443e0045dda0bb0d57fc192e00884e70326d5f50e SHA512 d99c2bf7cc4997219a043fabbde56e2d7f821933e308085fb666027fbe2548102d55a55f84f639b3ce787782b8d6558ec01695103691de5ebb8ab53bd0718ddc
EBUILD openjdk-14.0.2_p1.ebuild 8298 BLAKE2B 8dc89c9353b7233b06099f8a171efc579a0e0df7d07e1d62f823124158eaccd464e2389dec87eb84b7818a5e13d7b1581e9c204adcd695bec381efba8bc0c738 SHA512 b98ec119c4e7e61a8490544833b1649655b1f03e5694e64ba739396698294da106306cea70241e689144912bccef2d334841c73d3e22d5653d96e043c37304c5
EBUILD openjdk-15.0.0_p36.ebuild 8298 BLAKE2B 8dc89c9353b7233b06099f8a171efc579a0e0df7d07e1d62f823124158eaccd464e2389dec87eb84b7818a5e13d7b1581e9c204adcd695bec381efba8bc0c738 SHA512 b98ec119c4e7e61a8490544833b1649655b1f03e5694e64ba739396698294da106306cea70241e689144912bccef2d334841c73d3e22d5653d96e043c37304c5
EBUILD openjdk-9.0.4_p12.ebuild 7705 BLAKE2B 28c15dff232b54bd6b261544fb898cc4f5b4948c633c742162dda67ec5a4aab159c7d90482239e8e118c28c641f94cf4e36053c709d35bad07c9d40f797fadb3 SHA512 17c8b6b44c0e7df558ea36d48b2901c4e6c9653bbf4bc87a83eaaab6cec0dbc450b46d3334b2bbfb0b8087f7aa559653d4b38e52193e144280e3577f54ea63b4
MISC metadata.xml 1398 BLAKE2B 7b99e080f6dc261c94314c7f7a0314ee25b48752ca494dd23d1534c5e8e3f930601262a0316ed674786c5fd960dfbc25dd6c6768cd06325ef45c0b41f920eafc SHA512 1747f484c6f784cb551f0969aab9ca1e6c42509c06b6187b72f3e16861ce3e2e71e131deb1ae6ebe2eda1c768276794cd5a0db7918eb419b9502a3c45bf78959
DIST openjdk-hotspot-8.272_p10.tar.bz2 8206390 BLAKE2B 6822635a29f919696c7a260bf7db20a749ec8598e6c751a8a5e3973c780c17f3ff16a1ed64eb44353be72136fd1ea945dc6620f18d0d876a5773c897bca8705f SHA512 48444d86bacaef503303fb160dca538546e74f7bd71fd34fc2b9faa4e0b1cf7710a6262e9ead161c1b0e8e02e8f96e56a6407d442bbfb01ff8ab835cd840d834
DIST openjdk-hotspot-9.0.4_p12.tar.bz2 1685660 BLAKE2B 580efa34ecb4235630c609dae788115b343ead060d36d3b7939601a6e673dbefb428ef6e7043b3345b944cf080b7b7c6b34f9b094c4e0aa2455be80d8f5ea110 SHA512 2ddde2504951ee09e625987e6773a9c1e0b8c2b8c367e5a7ebf72dc94f2979172ea6ea7482eee16df2c9500a6b32cd90950d0f370242e97562e47b49610a8a92
DIST openjdk-jaxp-8.272_p10.tar.bz2 2692905 BLAKE2B e8fa9e6a7fd4c4ebeba82a3c55b17e4eba9cb03660baa8d478a8cfced1ab9673465faa1a0f690ebbe2634b2cf2741d7321f2c20c748339237eba7b772a2cea14 SHA512 15efb3db0dc28fd375d769037f248b3527e40d2c190fed57ca1d6a09e59aa79465c0e6516d2a122f6c7ee55f7cfeadaa76669884f74fa34b11ccfdfd76e71f6d
DIST openjdk-jaxp-9.0.4_p12.tar.bz2 1750744 BLAKE2B 387225c5a464f5a59ba698a2151aa28cea98c12e17ae49b7a86d5a4bcd80e293ffa9ec1d6485ca1934bee4011b636de1b2cf863ed1eaf6e28a5022a15c5b9124 SHA512 af5255637395c826d5fdc5cc510d1cda39b1b67a3647b7cb99f1c380e71c777a985e1ef196530bf2792d49c54d1a382af5ca1d508fbd6ea4f897fd338748cfa5
DIST openjdk-jaxws-8.272_p10.tar.bz2 2543199 BLAKE2B 3deae4cef17a5f3d513c1a748a72b50bacb3a0d9b6fb33e5ded121f4d209cc2eb2d59d7b7c182015811426e49eb3e2b463279fa201992c51a5c4a94a184931c9 SHA512 51c0ee76a7e0587ac9c2533d62717f24224ec8bc643df6af2e2fac89cd79cc4f228c7c57427e43f354a594568d16bb5bbf3295af9ce52717339c35b56d6c375a
DIST openjdk-jaxws-9.0.4_p12.tar.bz2 1884346 BLAKE2B e3682e046cabefeea3b747635452ff687bca97c3883454b6bafba434fbf4ddbd1e4ea6cc7255d30968198a645039f38f8c42a25604fa17b9b67e1bea63195bfb SHA512 d4cf9bda8c437f0c7427ac0d65877fe97939243d0ecd6392e5d1b2f7fdfe902d3cc2062d0d12b1e758307bd226e08286ff83549c3f0d12e106f23e54d4120e77
DIST openjdk-jdk-8.272_p10.tar.bz2 48273590 BLAKE2B 80717a644df7d9741e5786708c816483f4fea1cfeb02438df17fb4183c0702fe6e3fcbeaefcee84a4f847d5cbafb0a9e80af63b56cf0c6381e0fbeb535d2f147 SHA512 85d20763f6cda66f2eac3b2a1e672e6b828c437386575d16a1c70b27a56c718fc0f44c712e6261eb89f6dd273fd2c21a2c4baa3f562cafa2911a5e2467d7ba13
DIST openjdk-jdk-9.0.4_p12.tar.bz2 1648344 BLAKE2B aa7f79939981fd2ecd777d35fe6fcfed4cd52a88e47178de94cffb33880cef2916d55c3edcd8402d13e1248376d66234ee85eb80ef34c365502c3d98f5d5363a SHA512 f7c02476711d7e10c0fb24a4a8e19124a4c2c6267ee8284903f6806b422b6a1e31fea9f60f4f207c7c524c330a89c2e9ee2062bf11f4c63132ff7037caac9d5c
DIST openjdk-langtools-8.272_p10.tar.bz2 2399755 BLAKE2B 34ffa30993fa9f42ed2fa96ae658c3c43ecbc54750c3b854cc90efdbd3c4d5abdda012d55c4e81d4ab805d9184b5ea7429fba5927bf3192fcce2a17d9ef11744 SHA512 54698e8a74119f39971024ee165707fa9e27cd0008b59801f05a194362d723ba67269b1f34c181e2a0b1ce9cd36f52cf3ad3ad980c4670f7cfa476a0fa78fec8
DIST openjdk-langtools-9.0.4_p12.tar.bz2 1709784 BLAKE2B 846e0e527f3a6ead8217b745172991f3de7158567b2e1dc87469d5c0eed1aeb524a22671685212f70283c337087266dabadaa3cd8b0661f7b72590acf3cde940 SHA512 a4361389129570c47d9b7f88437a726035b16e224fde9eb349fa396f7a18d1e15c6f79546caf260776d007013490ea5564ba742aa628ad50d5996e6d410b1b32
DIST openjdk-nashorn-8.272_p10.tar.bz2 2850055 BLAKE2B 2348c0f45916101d9fcb4aaa283d2c03be5b28decf12248ec930b9d726e346d0884dd64a22627e2f2fd8260c8755d0bc46a1cf6fecf691a30a7f4b54f6a293a9 SHA512 754fcdca5e0ce523d73cbdfbdcaaa13677ed8c2b72c5ae04ff1cc77fd73469f3366e51add68b13bac3c43800fecfcbb93bf4fcf7469258c4adc57e414b105ef5
DIST openjdk-nashorn-9.0.4_p12.tar.bz2 1668824 BLAKE2B 6c445ccafdc5615a6e7aea7202aff3f46b2ee55b634b482592f0a798f12b8a148c6969811370ce782024e76f1390245faceb2886238d163634b25900d7a40b79 SHA512 e7c1dc2c16730966b7b23e860c51d1b76f6c98487aabfebbd738554d6a092b584adde6b2acfafd244ef4e4d0c8e758273070f1bb741b5950727c988541744424
EBUILD openjdk-10.0.2_p13.ebuild 8231 BLAKE2B 85fe259b435cd0492fcdb59ae7d0d1b1ccdb95484414a53ba00bf03b157209c3a8b3c22dde52bf17a8bcdfe63aea6ba2e9fe463d48b3a445a85429ff4a495b00 SHA512 0607b994918b2d2c6e87aeb3675b81598c3b96d2241eb56799b5a9cfa90ae9c2938be2295fa400263fd49edefd043c8901aafadb5c31a5760d530c988054c0e1
EBUILD openjdk-11.0.9_p11.ebuild 8269 BLAKE2B 0f732f6e074260b7da9c648fc2681ee7a9a609f98ae9aea364a529969be75116d32b4ae4389a8d9a27448cede7a4f01220052dadc41f82fcd75ac040fcedcec9 SHA512 8ce0fe355d3e922c51d8dabd664878496a70e5b03072f7495d2f016f25a6057daf1ec90a0f5d52934d822119ac4b574c57f59516590cda248c13fb52a109f21e
EBUILD openjdk-12.0.2_p01.ebuild 8436 BLAKE2B dfe25378ceff511abb9fbff5a7753315137ae1878b05f4d5f1581861515719dea8c0c814330413ba6b2bf54062c90b59cf86e7218e5ce179195be2db2845fd4c SHA512 76fbc83bf49e239c611d8f14653abe17d1a416b83d87e9083105bbc5d914b14604bcad2c439aaa17c8819ad07ec438c87b3223e7e6345a7cc728d16dade3af40
EBUILD openjdk-13.0.4_p01.ebuild 8417 BLAKE2B 521f065801713eec3290d6fca3ae224f8fae56c026dedcc9e609d9ad92bf2c21ba195d785b8936a1099bb69109fc744132e8876f8e15dcd85f8304cbf1771c4e SHA512 5c08b3a707929881bdac4b8759851f4f0b80482245890568149adadded1e597a8260e707264cf85ea082f610a1f290ca9a00961f78af38466e433f867bd8a8c9
EBUILD openjdk-14.0.2_p01.ebuild 8419 BLAKE2B cdf793ba4d051f57c89027fca2a42666227974d2d1dc9191d9ef21f18110fa302fa6dfbe0a1daf3a6609e1458319f2a6150c1c07180096f1ccd66206160e77fd SHA512 d18978808c7ee2c530eabe1d749681ad50314366590d7683b39854dee9b07f6a609b115ecfc58e021bda493c0eec8e17ff0178fe3b8261675feaf152b9c97f4a
EBUILD openjdk-15.0.0_p36.ebuild 8645 BLAKE2B 8a4516e98f32bb038b6a5b0123bba4615842c6d19ed1fc1416c71f789d5ca6e366d8a71501d650c3a77304d80f3140a1e437b98b3045186ee538a81307d5f457 SHA512 7e637fae9f756c290479602175f8c9ca5d31a5d75fe69b21fb54e0aba2b559d4329e03f20935b8109a946bcf6063996f6f42a25693c3f2ad62590ff6bbb1a379
EBUILD openjdk-8.272_p10.ebuild 8024 BLAKE2B dfb1d42eaad81e5942cacf16a28286c571c673aa47b3c951a9a42e94bc443e77c2a0b2f8099542e0eff7f8e0b11cca2413efdbd388555d2a0830d859f659dffa SHA512 af55ddfe5a2c39468590ca70216d64e3b211890a662f9bbd064fcec7f61f8e0d151c594653c27554ce49403c8ef0cea7c76e5c635a95121978cda4e7de11aa03
EBUILD openjdk-9.0.4_p12.ebuild 8182 BLAKE2B 745a457dcf08103e498da991501464ccb2de906145e5d8d45442ddf9bdd9bc50dc761d5fb6b489fa5c17419476fb36fe380f6ef880642ff68e9b1a66bb99940f SHA512 8239c6a2060ba559e4c319b528b8eeb7aa9fe6e77111ccd265d713bd4a613d90c2f1cc724085c667034e88901530d90a9e0a4413091150a4d0dd19f159f60a2f
MISC metadata.xml 1432 BLAKE2B 36a11642c99127a5f97fc0b095a142705c6b4e077ed24604f1886e4d1beaa47b4fa30359600797d5e6a085befd11a2851196fe97a75a0f0907461679946b4cbf SHA512 ecc66015da3a0fc616b91dd5aaffb5b050c9f66e936cad02ec12fb56dd7c6b3b3c331d8856402c0deee16c415ea083e088cce7414703f9d659f551883b055ff0

View File

@ -23,3 +23,4 @@ diff -r 21b063d75b3e make/Main.gmk
else
$(call LogWarn, Boot cycle build disabled when cross compiling)
endif

View File

@ -1,358 +0,0 @@
#!/usr/bin/perl
# Copyright (C) 2007, 2008 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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 for more details.
# generate-cacerts.pl generates a JKS keystore named 'cacerts' from
# OpenSSL's certificate bundle using OpenJDK's keytool.
# First extract each of OpenSSL's bundled certificates into its own
# aliased filename.
# Downloaded from http://cvs.fedoraproject.org/viewvc/rpms/ca-certificates/F-12/generate-cacerts.pl?revision=1.2
# Check and prevention of duplicate aliases added by Vlastimil Babka <caster@gentoo.org>
$file = $ARGV[1];
open(CERTS, $file);
@certs = <CERTS>;
close(CERTS);
$pem_file_count = 0;
$in_cert_block = 0;
$write_current_cert = 1;
foreach $cert (@certs)
{
if ($cert =~ /Issuer: /)
{
$_ = $cert;
if ($cert =~ /personal-freemail/)
{
$cert_alias = "thawtepersonalfreemailca";
}
elsif ($cert =~ /personal-basic/)
{
$cert_alias = "thawtepersonalbasicca";
}
elsif ($cert =~ /personal-premium/)
{
$cert_alias = "thawtepersonalpremiumca";
}
elsif ($cert =~ /server-certs/)
{
$cert_alias = "thawteserverca";
}
elsif ($cert =~ /premium-server/)
{
$cert_alias = "thawtepremiumserverca";
}
elsif ($cert =~ /Class 1 Public Primary Certification Authority$/)
{
$cert_alias = "verisignclass1ca";
}
elsif ($cert =~ /Class 1 Public Primary Certification Authority - G2/)
{
$cert_alias = "verisignclass1g2ca";
}
elsif ($cert =~
/VeriSign Class 1 Public Primary Certification Authority - G3/)
{
$cert_alias = "verisignclass1g3ca";
}
elsif ($cert =~ /Class 2 Public Primary Certification Authority$/)
{
$cert_alias = "verisignclass2ca";
}
elsif ($cert =~ /Class 2 Public Primary Certification Authority - G2/)
{
$cert_alias = "verisignclass2g2ca";
}
elsif ($cert =~
/VeriSign Class 2 Public Primary Certification Authority - G3/)
{
$cert_alias = "verisignclass2g3ca";
}
elsif ($cert =~ /Class 3 Public Primary Certification Authority$/)
{
$cert_alias = "verisignclass3ca";
}
# Version 1 of Class 3 Public Primary Certification Authority
# - G2 is added. Version 3 is excluded. See below.
elsif ($cert =~
/VeriSign Class 3 Public Primary Certification Authority - G3/)
{
$cert_alias = "verisignclass3g3ca";
}
elsif ($cert =~
/RSA Data Security.*Secure Server Certification Authority/)
{
$cert_alias = "verisignserverca";
}
elsif ($cert =~ /GTE CyberTrust Global Root/)
{
$cert_alias = "gtecybertrustglobalca";
}
elsif ($cert =~ /Baltimore CyberTrust Root/)
{
$cert_alias = "baltimorecybertrustca";
}
elsif ($cert =~ /www.entrust.net\/Client_CA_Info\/CPS/)
{
$cert_alias = "entrustclientca";
}
elsif ($cert =~ /www.entrust.net\/GCCA_CPS/)
{
$cert_alias = "entrustglobalclientca";
}
elsif ($cert =~ /www.entrust.net\/CPS_2048/)
{
$cert_alias = "entrust2048ca";
}
elsif ($cert =~ /www.entrust.net\/CPS /)
{
$cert_alias = "entrustsslca";
}
elsif ($cert =~ /www.entrust.net\/SSL_CPS/)
{
$cert_alias = "entrustgsslca";
}
elsif ($cert =~ /The Go Daddy Group/)
{
$cert_alias = "godaddyclass2ca";
}
elsif ($cert =~ /Starfield Class 2 Certification Authority/)
{
$cert_alias = "starfieldclass2ca";
}
elsif ($cert =~ /ValiCert Class 2 Policy Validation Authority/)
{
$cert_alias = "valicertclass2ca";
}
elsif ($cert =~ /GeoTrust Global CA$/)
{
$cert_alias = "geotrustglobalca";
}
elsif ($cert =~ /Equifax Secure Certificate Authority/)
{
$cert_alias = "equifaxsecureca";
}
elsif ($cert =~ /Equifax Secure eBusiness CA-1/)
{
$cert_alias = "equifaxsecureebusinessca1";
}
elsif ($cert =~ /Equifax Secure eBusiness CA-2/)
{
$cert_alias = "equifaxsecureebusinessca2";
}
elsif ($cert =~ /Equifax Secure Global eBusiness CA-1/)
{
$cert_alias = "equifaxsecureglobalebusinessca1";
}
elsif ($cert =~ /Sonera Class1 CA/)
{
$cert_alias = "soneraclass1ca";
}
elsif ($cert =~ /Sonera Class2 CA/)
{
$cert_alias = "soneraclass2ca";
}
elsif ($cert =~ /AAA Certificate Services/)
{
$cert_alias = "comodoaaaca";
}
elsif ($cert =~ /AddTrust Class 1 CA Root/)
{
$cert_alias = "addtrustclass1ca";
}
elsif ($cert =~ /AddTrust External CA Root/)
{
$cert_alias = "addtrustexternalca";
}
elsif ($cert =~ /AddTrust Qualified CA Root/)
{
$cert_alias = "addtrustqualifiedca";
}
elsif ($cert =~ /UTN-USERFirst-Hardware/)
{
$cert_alias = "utnuserfirsthardwareca";
}
elsif ($cert =~ /UTN-USERFirst-Client Authentication and Email/)
{
$cert_alias = "utnuserfirstclientauthemailca";
}
elsif ($cert =~ /UTN - DATACorp SGC/)
{
$cert_alias = "utndatacorpsgcca";
}
elsif ($cert =~ /UTN-USERFirst-Object/)
{
$cert_alias = "utnuserfirstobjectca";
}
elsif ($cert =~ /America Online Root Certification Authority 1/)
{
$cert_alias = "aolrootca1";
}
elsif ($cert =~ /DigiCert Assured ID Root CA/)
{
$cert_alias = "digicertassuredidrootca";
}
elsif ($cert =~ /DigiCert Global Root CA/)
{
$cert_alias = "digicertglobalrootca";
}
elsif ($cert =~ /DigiCert High Assurance EV Root CA/)
{
$cert_alias = "digicerthighassuranceevrootca";
}
elsif ($cert =~ /GlobalSign Root CA$/)
{
$cert_alias = "globalsignca";
}
elsif ($cert =~ /GlobalSign Root CA - R2/)
{
$cert_alias = "globalsignr2ca";
}
elsif ($cert =~ /Elektronik.*Kas.*2005/)
{
$cert_alias = "extra-elektronikkas2005";
}
elsif ($cert =~ /Elektronik/)
{
$cert_alias = "extra-elektronik2005";
}
# Mozilla does not provide these certificates:
# baltimorecodesigningca
# gtecybertrust5ca
# trustcenterclass2caii
# trustcenterclass4caii
# trustcenteruniversalcai
else
{
# Generate an alias using the OU and CN attributes of the
# Issuer field if both are present, otherwise use only the
# CN attribute. The Issuer field must have either the OU
# or the CN attribute.
$_ = $cert;
if ($cert =~ /OU=/)
{
s/Issuer:.*?OU=//;
# Remove other occurrences of OU=.
s/OU=.*CN=//;
# Remove CN= if there were not other occurrences of OU=.
s/CN=//;
s/\/emailAddress.*//;
s/Certificate Authority/ca/g;
s/Certification Authority/ca/g;
}
elsif ($cert =~ /CN=/)
{
s/Issuer:.*CN=//;
s/\/emailAddress.*//;
s/Certificate Authority/ca/g;
s/Certification Authority/ca/g;
}
s/\W//g;
tr/A-Z/a-z/;
$cert_alias = "extra-$_";
}
while (-e "$cert_alias.pem")
{
$cert_alias = "$cert_alias" . "_";
}
}
# When it attempts to parse:
#
# Class 3 Public Primary Certification Authority - G2, Version 3
#
# keytool says:
#
# #2: ObjectId: 1.3.6.1.5.5.7.1.1 Criticality=false
# Unparseable AuthorityInfoAccess extension due to
# java.io.IOException: Invalid encoding of URI
#
# If we do not exclude this file
# openjdk/jdk/test/lib/security/cacerts/VerifyCACerts.java fails
# on this cert, printing:
#
# Couldn't verify: java.security.SignatureException: Signature
# does not match.
#
elsif ($cert =~
/A6:0F:34:C8:62:6C:81:F6:8B:F7:7D:A9:F6:67:58:8A:90:3F:7D:36/)
{
$write_current_cert = 0;
$pem_file_count--;
}
elsif ($cert eq "-----BEGIN CERTIFICATE-----\n")
{
if ($in_cert_block != 0)
{
die "$file is malformed.";
}
$in_cert_block = 1;
if ($write_current_cert == 1)
{
$pem_file_count++;
if (-e "$cert_alias.pem")
{
print "$cert_alias";
die "already exists"
}
open(PEM, ">$cert_alias.pem");
print PEM $cert;
}
}
elsif ($cert eq "-----END CERTIFICATE-----\n")
{
$in_cert_block = 0;
if ($write_current_cert == 1)
{
print PEM $cert;
close(PEM);
}
$write_current_cert = 1
}
else
{
if ($in_cert_block == 1 && $write_current_cert == 1)
{
print PEM $cert;
}
}
}
# Check that the correct number of .pem files were produced.
@pem_files = <*.pem>;
if (@pem_files != $pem_file_count)
{
print "$pem_file_count";
die "Number of .pem files produced does not match".
" number of certs read from $file.";
}
# Now store each cert in the 'cacerts' file using keytool.
$certs_written_count = 0;
foreach $pem_file (@pem_files)
{
system "$ARGV[0] -noprompt -import".
" -alias `basename $pem_file .pem`".
" -keystore cacerts -storepass 'changeit' -file $pem_file";
unlink($pem_file);
$certs_written_count++;
}
# Check that the correct number of certs were added to the keystore.
if ($certs_written_count != $pem_file_count)
{
die "Number of certs added to keystore does not match".
" number of certs read from $file.";
}

View File

@ -0,0 +1,10 @@
--- old/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
+++ new/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
@@ -76,7 +76,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-# include <fpu_control.h>
#ifdef BUILTIN_SIM
#define REG_SP REG_RSP

View File

@ -0,0 +1,538 @@
--- old/make/ReleaseFile.gmk
+++ new/make/ReleaseFile.gmk
@@ -53,6 +53,7 @@
$(call info-file-item, "JAVA_VERSION_DATE", "$(VERSION_DATE)")
$(call info-file-item, "OS_NAME", "$(RELEASE_FILE_OS_NAME)")
$(call info-file-item, "OS_ARCH", "$(RELEASE_FILE_OS_ARCH)")
+ $(call info-file-item, "LIBC", "musl")
endef
# Param 1 - The file containing the MODULES list
--- old/make/autoconf/build-aux/config.guess
+++ new/make/autoconf/build-aux/config.guess
@@ -30,6 +30,17 @@
DIR=`dirname $0`
OUT=`. $DIR/autoconf-config.guess`
+# config.guess doesn't identify systems running the musl C library, and will
+# instead return a string with a -gnu suffix. This block detects musl and
+# modifies the string to have a -musl suffix instead.
+echo $OUT | grep -- -linux- > /dev/null 2> /dev/null
+if test $? = 0; then
+ ldd_version=`ldd --version 2>&1 | head -1 | cut -f1 -d' '`
+ if [ x"${ldd_version}" = x"musl" ]; then
+ OUT=`echo $OUT | sed 's/-gnu/-musl/'`
+ fi
+fi
+
# Test and fix solaris on x86_64
echo $OUT | grep i386-pc-solaris > /dev/null 2> /dev/null
if test $? = 0; then
--- old/make/hotspot/lib/CompileJvm.gmk
+++ new/make/hotspot/lib/CompileJvm.gmk
@@ -140,6 +140,7 @@
-DHOTSPOT_BUILD_USER='"$(USERNAME)"' \
-DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"' \
-DCPU='"$(OPENJDK_TARGET_CPU_VM_VERSION)"' \
+ -DLIBC='"musl"' \
#
# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
--- old/make/lib/CoreLibraries.gmk
+++ new/make/lib/CoreLibraries.gmk
@@ -340,6 +340,7 @@
endif
LIBJLI_CFLAGS += $(addprefix -I, $(LIBJLI_SRC_DIRS))
+LIBJLI_CFLAGS += -DLIBC=\"musl\"
ifneq ($(USE_EXTERNAL_LIBZ), true)
LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS)
--- old/src/hotspot/os/linux/os_linux.cpp
+++ new/src/hotspot/os/linux/os_linux.cpp
@@ -100,7 +100,6 @@
# include <string.h>
# include <syscall.h>
# include <sys/sysinfo.h>
-# include <gnu/libc-version.h>
# include <sys/ipc.h>
# include <sys/shm.h>
# include <link.h>
@@ -524,6 +523,11 @@
// detecting pthread library
void os::Linux::libpthread_init() {
+#if !defined(__GLIBC__) && !defined(__UCLIBC__)
+ // Hard code Alpine Linux supported musl compatible settings
+ os::Linux::set_glibc_version("glibc 2.9");
+ os::Linux::set_libpthread_version("NPTL");
+#else
// Save glibc and pthread version strings.
#if !defined(_CS_GNU_LIBC_VERSION) || \
!defined(_CS_GNU_LIBPTHREAD_VERSION)
@@ -541,6 +545,7 @@
str = (char *)malloc(n, mtInternal);
confstr(_CS_GNU_LIBPTHREAD_VERSION, str, n);
os::Linux::set_libpthread_version(str);
+#endif
}
/////////////////////////////////////////////////////////////////////////////
@@ -2897,20 +2902,36 @@
extern "C" JNIEXPORT void numa_warn(int number, char *where, ...) { }
extern "C" JNIEXPORT void numa_error(char *where) { }
+static void* dlvsym_if_available(void* handle, const char* name, const char* version) {
+ typedef void* (*dlvsym_func_type)(void* handle, const char* name, const char* version);
+ static dlvsym_func_type dlvsym_func;
+ static bool initialized = false;
+
+ if (!initialized) {
+ dlvsym_func = (dlvsym_func_type)dlsym(RTLD_NEXT, "dlvsym");
+ initialized = true;
+ }
+
+ if (dlvsym_func != NULL) {
+ void *f = dlvsym_func(handle, name, version);
+ if (f != NULL) {
+ return f;
+ }
+ }
+
+ return dlsym(handle, name);
+}
+
// Handle request to load libnuma symbol version 1.1 (API v1). If it fails
// load symbol from base version instead.
void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
- void *f = dlvsym(handle, name, "libnuma_1.1");
- if (f == NULL) {
- f = dlsym(handle, name);
- }
- return f;
+ return dlvsym_if_available(handle, name, "libnuma_1.1");;
}
// Handle request to load libnuma symbol version 1.2 (API v2) only.
// Return NULL if the symbol is not defined in this particular version.
void* os::Linux::libnuma_v2_dlsym(void* handle, const char* name) {
- return dlvsym(handle, name, "libnuma_1.2");
+ return dlvsym_if_available(handle, name, "libnuma_1.2");
}
bool os::Linux::libnuma_init() {
--- old/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
+++ new/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
@@ -73,9 +73,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-#ifndef AMD64
-# include <fpu_control.h>
-#endif
#ifdef AMD64
#define REG_SP REG_RSP
--- old/src/hotspot/share/gc/shared/genCollectedHeap.cpp
+++ new/src/hotspot/share/gc/shared/genCollectedHeap.cpp
@@ -898,7 +898,7 @@
static ScratchBlock *removeSmallestScratch(ScratchBlock **prev_ptr) {
bool first = true;
size_t min_size = 0; // "first" makes this conceptually infinite.
- ScratchBlock **smallest_ptr, *smallest;
+ ScratchBlock **smallest_ptr = NULL, *smallest;
ScratchBlock *cur = *prev_ptr;
while (cur) {
assert(*prev_ptr == cur, "just checking");
--- old/src/hotspot/share/runtime/vm_version.cpp
+++ new/src/hotspot/share/runtime/vm_version.cpp
@@ -260,7 +260,7 @@
#endif
#define INTERNAL_VERSION_SUFFIX VM_RELEASE ")" \
- " for " OS "-" CPU FLOAT_ARCH_STR \
+ " for " OS "-" CPU FLOAT_ARCH_STR LIBC \
" JRE (" VERSION_STRING "), built on " __DATE__ " " __TIME__ \
" by " XSTR(HOTSPOT_BUILD_USER) " with " HOTSPOT_BUILD_COMPILER
--- old/src/hotspot/share/utilities/globalDefinitions_gcc.hpp
+++ new/src/hotspot/share/utilities/globalDefinitions_gcc.hpp
@@ -204,7 +204,7 @@
#elif defined(__APPLE__)
inline int g_isnan(double f) { return isnan(f); }
#elif defined(LINUX) || defined(_ALLBSD_SOURCE)
-inline int g_isnan(float f) { return isnanf(f); }
+inline int g_isnan(float f) { return isnan(f); }
inline int g_isnan(double f) { return isnan(f); }
#else
#error "missing platform-specific definition here"
--- old/src/java.base/linux/native/libnet/linux_close.c
+++ new/src/java.base/linux/native/libnet/linux_close.c
@@ -60,7 +60,7 @@
/*
* Signal to unblock thread
*/
-static int sigWakeup = (__SIGRTMAX - 2);
+static int sigWakeup;
/*
* fdTable holds one entry per file descriptor, up to a certain
@@ -149,6 +149,7 @@
/*
* Setup the signal handler
*/
+ sigWakeup = SIGRTMAX - 2;
sa.sa_handler = sig_wakeup;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
--- old/src/java.base/unix/native/libjava/childproc.c
+++ new/src/java.base/unix/native/libjava/childproc.c
@@ -237,7 +237,13 @@
{
if (envp == NULL || (char **) envp == environ) {
execvp(file, (char **) argv);
- return;
+ // ENOEXEC indicates that the file header was not recognized. The musl C
+ // library does not implement the fallback to /bin/sh for that case, so fall
+ // through to the code below which implements that fallback using
+ // execve_with_shell_fallback.
+ if (errno != ENOEXEC) {
+ return;
+ }
}
if (*file == '\0') {
--- old/src/java.base/unix/native/libjava/jdk_util_md.h
+++ new/src/java.base/unix/native/libjava/jdk_util_md.h
@@ -37,7 +37,7 @@
#define ISNAND(d) isnan(d)
#elif defined(__linux__) || defined(_ALLBSD_SOURCE)
#include <math.h>
-#define ISNANF(f) isnanf(f)
+#define ISNANF(f) isnan(f)
#define ISNAND(d) isnan(d)
#elif defined(_AIX)
#include <math.h>
--- old/src/java.base/unix/native/libjli/java_md_solinux.c
+++ new/src/java.base/unix/native/libjli/java_md_solinux.c
@@ -235,6 +235,39 @@
char *dmllp = NULL;
char *p; /* a utility pointer */
+#ifdef __linux
+#ifndef LIBC
+#error "LIBC not set"
+#endif
+
+ if (strcmp(LIBC, "musl") == 0) {
+ /*
+ * The musl library loader requires LD_LIBRARY_PATH to be set in
+ * order to correctly resolve the dependency libjava.so has on libjvm.so.
+ *
+ * Specifically, it differs from glibc in the sense that even if
+ * libjvm.so has already been loaded it will not be considered a
+ * candidate for resolving the dependency unless the *full* path
+ * of the already loaded library matches the dependency being loaded.
+ *
+ * libjvm.so is being loaded by the launcher using a long path to
+ * dlopen, not just the basename of the library. Typically this
+ * is something like "../lib/server/libjvm.so". However, if/when
+ * libjvm.so later tries to dlopen libjava.so (which it does in
+ * order to get access to a few functions implemented in
+ * libjava.so) the musl loader will, as part of loading
+ * dependent libraries, try to load libjvm.so using only its
+ * basename "libjvm.so". Since this does not match the longer
+ * path path it was first loaded with, the already loaded
+ * library is not considered a candidate, and the loader will
+ * instead look for libjvm.so elsewhere. If it's not in
+ * LD_LIBRARY_PATH the dependency load will fail, and libjava.so
+ * will therefore fail as well.
+ */
+ return JNI_TRUE;
+ }
+#endif
+
#ifdef AIX
/* We always have to set the LIBPATH on AIX because ld doesn't support $ORIGIN. */
return JNI_TRUE;
--- old/src/java.base/unix/native/libnio/ch/NativeThread.c
+++ new/src/java.base/unix/native/libnio/ch/NativeThread.c
@@ -36,7 +36,7 @@
#ifdef __linux__
#include <pthread.h>
/* Also defined in net/linux_close.c */
- #define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
+ #define INTERRUPT_SIGNAL (SIGRTMAX - 2)
#elif _AIX
#include <pthread.h>
/* Also defined in net/aix_close.c */
--- old/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c
+++ new/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c
@@ -27,9 +27,6 @@
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/Xatom.h>
-#ifdef __linux__
-#include <execinfo.h>
-#endif
#include <jvm.h>
#include <jni.h>
@@ -786,26 +783,6 @@
}
return ret;
}
-
-#ifdef __linux__
-void print_stack(void)
-{
- void *array[10];
- size_t size;
- char **strings;
- size_t i;
-
- size = backtrace (array, 10);
- strings = backtrace_symbols (array, size);
-
- fprintf (stderr, "Obtained %zd stack frames.\n", size);
-
- for (i = 0; i < size; i++)
- fprintf (stderr, "%s\n", strings[i]);
-
- free (strings);
-}
-#endif
Window get_xawt_root_shell(JNIEnv *env) {
static jclass classXRootWindow = NULL;
--- old/src/jdk.jdwp.agent/share/native/libjdwp/util.h
+++ new/src/jdk.jdwp.agent/share/native/libjdwp/util.h
@@ -35,15 +35,15 @@
#ifdef DEBUG
/* Just to make sure these interfaces are not used here. */
#undef free
- #define free(p) Do not use this interface.
+ #define free do_not_use_this_interface_free
#undef malloc
- #define malloc(p) Do not use this interface.
+ #define malloc do_not_use_this_interface_malloc
#undef calloc
- #define calloc(p) Do not use this interface.
+ #define calloc do_not_use_this_interface_calloc
#undef realloc
- #define realloc(p) Do not use this interface.
+ #define realloc do_not_use_this_interface_realloc
#undef strdup
- #define strdup(p) Do not use this interface.
+ #define strdup do_not_use_this_interface_strdup
#endif
#include "log_messages.h"
--- old/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
+++ new/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
@@ -33,6 +33,7 @@
#include <assert.h>
#include <jni.h>
+#include <jvm.h>
#include <alloca.h>
#include <signal.h>
#include <string.h>
@@ -91,6 +92,20 @@
}
}
+int get_java_stacksize () {
+ size_t stacksize;
+ pthread_attr_t attr;
+ JDK1_1InitArgs jdk_args;
+
+ jdk_args.version = JNI_VERSION_1_1;
+ JNI_GetDefaultJavaVMInitArgs(&jdk_args);
+ if (jdk_args.javaStackSize <= 0) {
+ fprintf(stderr, "Test ERROR. Can't get a valid value for the default stacksize.\n");
+ exit(7);
+ }
+ return jdk_args.javaStackSize;
+}
+
void *run_java_overflow (void *p) {
JNIEnv *env;
jclass class_id;
@@ -254,13 +269,19 @@
exit(7);
}
+ int stack_size = get_java_stacksize();
pthread_t thr;
+ pthread_attr_t thread_attr;
+ pthread_attr_init(&thread_attr);
+ pthread_attr_setstacksize(&thread_attr, stack_size);
+
if (argc > 1 && strcmp(argv[1], "test_java_overflow") == 0) {
printf("\nTesting JAVA_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_java_overflow, NULL);
+
+ pthread_create (&thr, &thread_attr, run_java_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
@@ -273,7 +294,7 @@
printf("\nTesting NATIVE_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_native_overflow, NULL);
+ pthread_create (&thr, &thread_attr, run_native_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
--- old/test/jdk/java/lang/ProcessBuilder/Basic.java
+++ new/test/jdk/java/lang/ProcessBuilder/Basic.java
@@ -389,8 +389,8 @@
if (failed != 0) throw new Error("null PATH");
} else if (action.equals("PATH search algorithm")) {
equal(System.getenv("PATH"), "dir1:dir2:");
- check(new File("/bin/true").exists());
- check(new File("/bin/false").exists());
+ check(new File(TrueExe.path()).exists());
+ check(new File(FalseExe.path()).exists());
String[] cmd = {"prog"};
ProcessBuilder pb1 = new ProcessBuilder(cmd);
ProcessBuilder pb2 = new ProcessBuilder(cmd);
@@ -431,13 +431,13 @@
checkPermissionDenied(pb);
// continue searching if EACCES
- copy("/bin/true", "dir2/prog");
+ copy(TrueExe.path(), "dir2/prog");
equal(run(pb).exitValue(), True.exitValue());
new File("dir1/prog").delete();
new File("dir2/prog").delete();
new File("dir2/prog").mkdirs();
- copy("/bin/true", "dir1/prog");
+ copy(TrueExe.path(), "dir1/prog");
equal(run(pb).exitValue(), True.exitValue());
// Check empty PATH component means current directory.
@@ -453,10 +453,10 @@
pb.command(command);
File prog = new File("./prog");
// "Normal" binaries
- copy("/bin/true", "./prog");
+ copy(TrueExe.path(), "./prog");
equal(run(pb).exitValue(),
True.exitValue());
- copy("/bin/false", "./prog");
+ copy(FalseExe.path(), "./prog");
equal(run(pb).exitValue(),
False.exitValue());
prog.delete();
@@ -511,12 +511,12 @@
new File("dir2/prog").delete();
new File("prog").delete();
new File("dir3").mkdirs();
- copy("/bin/true", "dir1/prog");
- copy("/bin/false", "dir3/prog");
+ copy(TrueExe.path(), "dir1/prog");
+ copy(FalseExe.path(), "dir3/prog");
pb.environment().put("PATH","dir3");
equal(run(pb).exitValue(), True.exitValue());
- copy("/bin/true", "dir3/prog");
- copy("/bin/false", "dir1/prog");
+ copy(TrueExe.path(), "dir3/prog");
+ copy(FalseExe.path(), "dir1/prog");
equal(run(pb).exitValue(), False.exitValue());
} finally {
@@ -613,6 +613,13 @@
new File("/bin/false").exists());
}
+ static class BusyBox {
+ public static boolean is() { return is; }
+ private static final boolean is =
+ (! Windows.is() &&
+ new File("/bin/busybox").exists());
+ }
+
static class UnicodeOS {
public static boolean is() { return is; }
private static final String osName = System.getProperty("os.name");
@@ -651,6 +658,45 @@
}
}
+ // On alpine linux, /bin/true and /bin/false are just links to /bin/busybox.
+ // Some tests copy /bin/true and /bin/false to files with a different filename.
+ // However, copying the busbox executable into a file with a different name
+ // won't result in the expected return codes. As workaround, we create
+ // executable files that can be copied and produce the exepected return
+ // values. We use this workaround, if we find the busybox executable.
+
+ private static class TrueExe {
+ public static String path() { return path; }
+ private static final String path = path0();
+ private static String path0(){
+ if (!BusyBox.is()) {
+ return "/bin/true";
+ }
+ else {
+ File trueExe = new File("true");
+ setFileContents(trueExe, "#!/bin/true\n");
+ trueExe.setExecutable(true);
+ return trueExe.getAbsolutePath();
+ }
+ }
+ }
+
+ private static class FalseExe {
+ public static String path() { return path; }
+ private static final String path = path0();
+ private static String path0(){
+ if (!BusyBox.is()) {
+ return "/bin/false";
+ }
+ else {
+ File falseExe = new File("false");
+ setFileContents(falseExe, "#!/bin/false\n");
+ falseExe.setExecutable(true);
+ return falseExe.getAbsolutePath();
+ }
+ }
+ }
+
static class EnglishUnix {
private static final Boolean is =
(! Windows.is() && isEnglish("LANG") && isEnglish("LC_ALL"));
@@ -1954,7 +2000,7 @@
//----------------------------------------------------------------
try {
new File("suBdiR").mkdirs();
- copy("/bin/true", "suBdiR/unliKely");
+ copy(TrueExe.path(), "suBdiR/unliKely");
final ProcessBuilder pb =
new ProcessBuilder(new String[]{"unliKely"});
pb.environment().put("PATH", "suBdiR");
--- old/test/jdk/java/lang/ProcessHandle/InfoTest.java
+++ new/test/jdk/java/lang/ProcessHandle/InfoTest.java
@@ -298,7 +298,14 @@
}
if (info.command().isPresent()) {
String command = info.command().get();
- String expected = Platform.isWindows() ? "sleep.exe" : "sleep";
+ String expected = "sleep";
+ if (Platform.isWindows()) {
+ expected = "sleep.exe";
+ } else if (new File("/bin/busybox").exists()) {
+ // With busybox sleep is just a sym link to busybox.
+ // The busbox executable is seen as ProcessHandle.Info command.
+ expected = "busybox";
+ }
Assert.assertTrue(command.endsWith(expected), "Command: expected: \'" +
expected + "\', actual: " + command);

View File

@ -0,0 +1,360 @@
The alpine builders print out a warning about sched_getaffinity() not working.
This causes the version check for the boot jdk to fail.
Patch the command to determine the version number to ignore any errors and warnings.
--- old/make/autoconf/boot-jdk.m4
+++ new/make/autoconf/boot-jdk.m4
@@ -74,10 +74,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- [FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`]
+ [FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`]
if test "x$FOUND_CORRECT_VERSION" = x; then
AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring])
AC_MSG_NOTICE([(Your Boot JDK must be version 9 or 10)])
--- old/make/autoconf/generated-configure.sh
+++ new/make/autoconf/generated-configure.sh
@@ -25595,10 +25595,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -25797,10 +25797,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -25987,10 +25987,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -26176,10 +26176,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -26365,10 +26365,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -26545,10 +26545,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -26876,10 +26876,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -27207,10 +27207,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -27425,10 +27425,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -27608,10 +27608,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -27819,10 +27819,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -28002,10 +28002,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -28213,10 +28213,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -28396,10 +28396,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -28607,10 +28607,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -28790,10 +28790,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -28988,10 +28988,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -29169,10 +29169,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -29368,10 +29368,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -29549,10 +29549,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -29747,10 +29747,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -29928,10 +29928,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -30127,10 +30127,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -30308,10 +30308,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -30488,10 +30488,10 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '10([\.+-].*)?|9([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
@@ -31490,10 +31490,10 @@
BUILD_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BUILD_JDK_VERSION=`"$BUILD_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BUILD_JDK_VERSION=`"$BUILD_JDK/bin/java" -version 2>&1 | $EGREP -v warning | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BUILD_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"'`
+ FOUND_CORRECT_VERSION=`echo $BUILD_JDK_VERSION | $EGREP '10([\.+-].*)?'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Build JDK found at $BUILD_JDK is incorrect JDK version ($BUILD_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Build JDK found at $BUILD_JDK is incorrect JDK version ($BUILD_JDK_VERSION); ignoring" >&6;}

View File

@ -0,0 +1,18 @@
upstream report: https://bugs.openjdk.java.net/browse/JDK-8237879.
diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk
index 170c3ed..697f9d2 100644
--- a/make/common/MakeBase.gmk
+++ b/make/common/MakeBase.gmk
@@ -967,7 +967,9 @@ DependOnVariableHelper = \
$(info NewVariable $1: >$(strip $($1))<) \
$(info OldVariable $1: >$(strip $($1_old))<)) \
$(call WriteFile, $1_old:=$(call DoubleDollar,$(call EscapeHash,$($1))), \
- $(call DependOnVariableFileName, $1, $2))) \
+ $(call DependOnVariableFileName, $1, $2)) \
+ $(eval $(call DependOnVariableFileName, $1, $2): ) \
+ ) \
$(call DependOnVariableFileName, $1, $2) \
)

View File

@ -0,0 +1,162 @@
--- old/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
+++ new/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
@@ -1294,7 +1294,11 @@
// the safepoing polling page.
ucontext_t* uc = (ucontext_t*) ucontext;
// Set polling address.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address addr = (address)uc->uc_mcontext.regs->gpr[ra] + (ssize_t)ds;
+#else // Musl
+ address addr = (address)uc->uc_mcontext.gp_regs[ra] + (ssize_t) ds;
+#endif
if (polling_address_ptr != NULL) {
*polling_address_ptr = addr;
}
@@ -1315,15 +1319,24 @@
int rb = inv_rb_field(instruction);
// look up content of ra and rb in ucontext
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address ra_val=(address)uc->uc_mcontext.regs->gpr[ra];
long rb_val=(long)uc->uc_mcontext.regs->gpr[rb];
+#else // Musl
+ address ra_val=(address)uc->uc_mcontext.gp_regs[ra];
+ long rb_val=(long)uc->uc_mcontext.gp_regs[rb];
+#endif
return os::is_memory_serialize_page(thread, ra_val+rb_val);
} else if (is_stw(instruction) || is_stwu(instruction)) {
int ra = inv_ra_field(instruction);
int d1 = inv_d1_field(instruction);
// look up content of ra in ucontext
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address ra_val=(address)uc->uc_mcontext.regs->gpr[ra];
+#else // Musl
+ address ra_val=(address)uc->uc_mcontext.gp_regs[ra];
+#endif
return os::is_memory_serialize_page(thread, ra_val+d1);
} else {
return false;
@@ -1386,11 +1399,20 @@
|| (is_stdu(instruction) && rs == 1)) {
int ds = inv_ds_field(instruction);
// return banged address
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return ds+(address)uc->uc_mcontext.regs->gpr[ra];
+#else // Musl
+ return ds+(address)uc->uc_mcontext.gp_regs[ra];
+#endif
} else if (is_stdux(instruction) && rs == 1) {
int rb = inv_rb_field(instruction);
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address sp = (address)uc->uc_mcontext.regs->gpr[1];
long rb_val = (long)uc->uc_mcontext.regs->gpr[rb];
+#else // Musl
+ address sp = (address)uc->uc_mcontext.gp_regs[1];
+ long rb_val = (long)uc->uc_mcontext.gp_regs[rb];
+#endif
return ra != 1 || rb_val >= 0 ? NULL // not a stack bang
: sp + rb_val; // banged address
}
--- old/src/hotspot/cpu/ppc/vm_version_ppc.cpp
+++ new/src/hotspot/cpu/ppc/vm_version_ppc.cpp
@@ -745,7 +745,7 @@
unsigned long auxv = getauxval(AT_HWCAP2);
if (auxv & PPC_FEATURE2_HTM_NOSC) {
- if (auxv & PPC_FEATURE2_HAS_HTM) {
+ if (auxv & PPC_FEATURE2_HTM) {
// TM on POWER8 and POWER9 in compat mode (VM) is supported by the JVM.
// TM on POWER9 DD2.1 NV (baremetal) is not supported by the JVM (TM on
// POWER9 DD2.1 NV has a few issues that need a couple of firmware
--- old/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
+++ new/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
@@ -109,20 +109,34 @@
// - if uc was filled by getcontext(), it is undefined - getcontext() does not fill
// it because the volatile registers are not needed to make setcontext() work.
// Hopefully it was zero'd out beforehand.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
guarantee(uc->uc_mcontext.regs != NULL, "only use ucontext_get_pc in sigaction context");
return (address)uc->uc_mcontext.regs->nip;
+#else // Musl
+ guarantee(uc->uc_mcontext.gp_regs != NULL, "only use ucontext_get_pc in sigaction context");
+ return (address)uc->uc_mcontext.gp_regs[32];
+#endif
}
// modify PC in ucontext.
// Note: Only use this for an ucontext handed down to a signal handler. See comment
// in ucontext_get_pc.
void os::Linux::ucontext_set_pc(ucontext_t * uc, address pc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
guarantee(uc->uc_mcontext.regs != NULL, "only use ucontext_set_pc in sigaction context");
uc->uc_mcontext.regs->nip = (unsigned long)pc;
+#else // Musl
+ guarantee(uc->uc_mcontext.gp_regs != NULL, "only use ucontext_set_pc in sigaction context");
+ uc->uc_mcontext.gp_regs[32] = (unsigned long)pc;
+#endif
}
intptr_t* os::Linux::ucontext_get_sp(const ucontext_t * uc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return (intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/];
+#else // Musl
+ return (intptr_t*)uc->uc_mcontext.gp_regs[1/*REG_SP*/];
+#endif
}
intptr_t* os::Linux::ucontext_get_fp(const ucontext_t * uc) {
@@ -252,7 +266,13 @@
// 3.2.1 "Machine State Register"), however note that ISA notation for bit
// numbering is MSB 0, so for normal bit numbering (LSB 0) they come to be
// bits 33 and 34. It's not related to endianness, just a notation matter.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
if (second_uc->uc_mcontext.regs->msr & 0x600000000) {
+#else // Musl
+ // why 33?
+ // see comment for glibc NGREG: "r0-r31, nip, msr, lr, etc."
+ if (second_uc->uc_mcontext.gp_regs[33] & 0x600000000) {
+#endif
if (TraceTraps) {
tty->print_cr("caught signal in transaction, "
"ignoring to jump to abort handler");
@@ -558,6 +578,7 @@
const ucontext_t* uc = (const ucontext_t*)context;
st->print_cr("Registers:");
+#if defined(__GLIBC__) || defined(__UCLIBC__)
st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->nip);
st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->link);
st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.regs->ctr);
@@ -566,8 +587,18 @@
st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.regs->gpr[i]);
if (i % 3 == 2) st->cr();
}
+#else // Musl
+ st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[32]);
+ st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[36]);
+ st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[35]);
st->cr();
+ for (int i = 0; i < 32; i++) {
+ st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.gp_regs[i]);
+ if (i % 3 == 2) st->cr();
+ }
+#endif
st->cr();
+ st->cr();
intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);
st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", p2i(sp));
@@ -594,7 +625,11 @@
// this is only for the "general purpose" registers
for (int i = 0; i < 32; i++) {
st->print("r%-2d=", i);
+#if defined(__GLIBC__) || defined(__UCLIBC__)
print_location(st, uc->uc_mcontext.regs->gpr[i]);
+#else // Musl
+ print_location(st, uc->uc_mcontext.gp_regs[i]);
+#endif
}
st->cr();
}

View File

@ -0,0 +1,15 @@
Author: Simon Frankenberger <simon-alpine@fraho.eu>
Upstream: no
Reason: This file is not present when building on aarch64 alpine.
Furthermore, the build runs just fine without it.
--- old/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
+++ new/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
@@ -74,7 +74,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-# include <fpu_control.h>
#define REG_FP 29
#define REG_LR 30

View File

@ -0,0 +1,545 @@
Author: The portola team at https://openjdk.java.net/projects/portola/
With modifications by Simon Frankenberger <simon-alpine@fraho.eu>
Upstream: somewhat
Reason: This giant patch makes it possible to compile openjdk with musl libc.
The base was taken from a diff with the portola project and adjusted
for latest musl libc.
--- old/make/ReleaseFile.gmk
+++ new/make/ReleaseFile.gmk
@@ -53,6 +53,7 @@
$(call info-file-item, "JAVA_VERSION_DATE", "$(VERSION_DATE)")
$(call info-file-item, "OS_NAME", "$(RELEASE_FILE_OS_NAME)")
$(call info-file-item, "OS_ARCH", "$(RELEASE_FILE_OS_ARCH)")
+ $(call info-file-item, "LIBC", "musl")
endef
# Param 1 - The file containing the MODULES list
--- old/make/autoconf/build-aux/config.guess
+++ new/make/autoconf/build-aux/config.guess
@@ -30,6 +30,17 @@
DIR=`dirname $0`
OUT=`. $DIR/autoconf-config.guess`
+# config.guess doesn't identify systems running the musl C library, and will
+# instead return a string with a -gnu suffix. This block detects musl and
+# modifies the string to have a -musl suffix instead.
+echo $OUT | grep -- -linux- > /dev/null 2> /dev/null
+if test $? = 0; then
+ ldd_version=`ldd --version 2>&1 | head -1 | cut -f1 -d' '`
+ if [ x"${ldd_version}" = x"musl" ]; then
+ OUT=`echo $OUT | sed 's/-gnu/-musl/'`
+ fi
+fi
+
# Test and fix solaris on x86_64
echo $OUT | grep i386-pc-solaris > /dev/null 2> /dev/null
if test $? = 0; then
--- old/make/hotspot/lib/CompileJvm.gmk
+++ new/make/hotspot/lib/CompileJvm.gmk
@@ -79,6 +79,7 @@
-DHOTSPOT_BUILD_USER='"$(USERNAME)"' \
-DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"' \
-DCPU='"$(OPENJDK_TARGET_CPU_VM_VERSION)"' \
+ -DLIBC='"musl"' \
#
################################################################################
--- old/make/lib/CoreLibraries.gmk
+++ new/make/lib/CoreLibraries.gmk
@@ -219,6 +219,7 @@
endif
LIBJLI_CFLAGS += $(LIBZ_CFLAGS)
+LIBJLI_CFLAGS += -DLIBC=\"musl\"
ifneq ($(USE_EXTERNAL_LIBZ), true)
LIBJLI_EXTRA_FILES += \
--- old/src/hotspot/os/linux/os_linux.cpp
+++ new/src/hotspot/os/linux/os_linux.cpp
@@ -101,7 +101,6 @@
# include <string.h>
# include <syscall.h>
# include <sys/sysinfo.h>
-# include <gnu/libc-version.h>
# include <sys/ipc.h>
# include <sys/shm.h>
# include <link.h>
@@ -594,6 +593,11 @@
// detecting pthread library
void os::Linux::libpthread_init() {
+#if !defined(__GLIBC__) && !defined(__UCLIBC__)
+ // Hard code Alpine Linux supported musl compatible settings
+ os::Linux::set_glibc_version("glibc 2.9");
+ os::Linux::set_libpthread_version("NPTL");
+#else
// Save glibc and pthread version strings.
#if !defined(_CS_GNU_LIBC_VERSION) || \
!defined(_CS_GNU_LIBPTHREAD_VERSION)
@@ -611,6 +615,7 @@
str = (char *)malloc(n, mtInternal);
confstr(_CS_GNU_LIBPTHREAD_VERSION, str, n);
os::Linux::set_libpthread_version(str);
+#endif
}
/////////////////////////////////////////////////////////////////////////////
@@ -3053,20 +3058,36 @@
extern "C" JNIEXPORT void numa_warn(int number, char *where, ...) { }
extern "C" JNIEXPORT void numa_error(char *where) { }
+static void* dlvsym_if_available(void* handle, const char* name, const char* version) {
+ typedef void* (*dlvsym_func_type)(void* handle, const char* name, const char* version);
+ static dlvsym_func_type dlvsym_func;
+ static bool initialized = false;
+
+ if (!initialized) {
+ dlvsym_func = (dlvsym_func_type)dlsym(RTLD_NEXT, "dlvsym");
+ initialized = true;
+ }
+
+ if (dlvsym_func != NULL) {
+ void *f = dlvsym_func(handle, name, version);
+ if (f != NULL) {
+ return f;
+ }
+ }
+
+ return dlsym(handle, name);
+}
+
// Handle request to load libnuma symbol version 1.1 (API v1). If it fails
// load symbol from base version instead.
void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
- void *f = dlvsym(handle, name, "libnuma_1.1");
- if (f == NULL) {
- f = dlsym(handle, name);
- }
- return f;
+ return dlvsym_if_available(handle, name, "libnuma_1.1");
}
// Handle request to load libnuma symbol version 1.2 (API v2) only.
// Return NULL if the symbol is not defined in this particular version.
void* os::Linux::libnuma_v2_dlsym(void* handle, const char* name) {
- return dlvsym(handle, name, "libnuma_1.2");
+ return dlvsym_if_available(handle, name, "libnuma_1.2");
}
bool os::Linux::libnuma_init() {
--- old/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
+++ new/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
@@ -75,9 +75,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-#ifndef AMD64
-# include <fpu_control.h>
-#endif
#ifdef AMD64
#define REG_SP REG_RSP
--- old/src/hotspot/share/gc/shared/genCollectedHeap.cpp
+++ new/src/hotspot/share/gc/shared/genCollectedHeap.cpp
@@ -1144,7 +1144,7 @@
static ScratchBlock *removeSmallestScratch(ScratchBlock **prev_ptr) {
bool first = true;
size_t min_size = 0; // "first" makes this conceptually infinite.
- ScratchBlock **smallest_ptr, *smallest;
+ ScratchBlock **smallest_ptr = NULL, *smallest;
ScratchBlock *cur = *prev_ptr;
while (cur) {
assert(*prev_ptr == cur, "just checking");
--- old/src/hotspot/share/runtime/vm_version.cpp
+++ new/src/hotspot/share/runtime/vm_version.cpp
@@ -284,7 +284,7 @@
#endif
#define INTERNAL_VERSION_SUFFIX VM_RELEASE ")" \
- " for " OS "-" CPU FLOAT_ARCH_STR \
+ " for " OS "-" CPU FLOAT_ARCH_STR LIBC \
" JRE (" VERSION_STRING "), built on " __DATE__ " " __TIME__ \
" by " XSTR(HOTSPOT_BUILD_USER) " with " HOTSPOT_BUILD_COMPILER
--- old/src/hotspot/share/utilities/globalDefinitions_gcc.hpp
+++ new/src/hotspot/share/utilities/globalDefinitions_gcc.hpp
@@ -204,7 +204,7 @@
#elif defined(__APPLE__)
inline int g_isnan(double f) { return isnan(f); }
#elif defined(LINUX) || defined(_ALLBSD_SOURCE)
-inline int g_isnan(float f) { return isnanf(f); }
+inline int g_isnan(float f) { return isnan(f); }
inline int g_isnan(double f) { return isnan(f); }
#else
#error "missing platform-specific definition here"
--- old/src/java.base/linux/native/libnet/linux_close.c
+++ new/src/java.base/linux/native/libnet/linux_close.c
@@ -60,7 +60,7 @@
/*
* Signal to unblock thread
*/
-static int sigWakeup = (__SIGRTMAX - 2);
+static int sigWakeup;
/*
* fdTable holds one entry per file descriptor, up to a certain
@@ -149,6 +149,7 @@
/*
* Setup the signal handler
*/
+ sigWakeup = SIGRTMAX - 2;
sa.sa_handler = sig_wakeup;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
--- old/src/java.base/unix/native/libjava/childproc.c
+++ new/src/java.base/unix/native/libjava/childproc.c
@@ -237,7 +237,13 @@
{
if (envp == NULL || (char **) envp == environ) {
execvp(file, (char **) argv);
- return;
+ // ENOEXEC indicates that the file header was not recognized. The musl C
+ // library does not implement the fallback to /bin/sh for that case, so fall
+ // through to the code below which implements that fallback using
+ // execve_with_shell_fallback.
+ if (errno != ENOEXEC) {
+ return;
+ }
}
if (*file == '\0') {
--- old/src/java.base/unix/native/libjava/jdk_util_md.h
+++ new/src/java.base/unix/native/libjava/jdk_util_md.h
@@ -37,7 +37,7 @@
#define ISNAND(d) isnan(d)
#elif defined(__linux__) || defined(_ALLBSD_SOURCE)
#include <math.h>
-#define ISNANF(f) isnanf(f)
+#define ISNANF(f) isnan(f)
#define ISNAND(d) isnan(d)
#elif defined(_AIX)
#include <math.h>
--- old/src/java.base/unix/native/libjli/java_md_solinux.c
+++ new/src/java.base/unix/native/libjli/java_md_solinux.c
@@ -236,6 +236,39 @@
char *dmllp = NULL;
char *p; /* a utility pointer */
+#ifdef __linux
+#ifndef LIBC
+#error "LIBC not set"
+#endif
+
+ if (strcmp(LIBC, "musl") == 0) {
+ /*
+ * The musl library loader requires LD_LIBRARY_PATH to be set in
+ * order to correctly resolve the dependency libjava.so has on libjvm.so.
+ *
+ * Specifically, it differs from glibc in the sense that even if
+ * libjvm.so has already been loaded it will not be considered a
+ * candidate for resolving the dependency unless the *full* path
+ * of the already loaded library matches the dependency being loaded.
+ *
+ * libjvm.so is being loaded by the launcher using a long path to
+ * dlopen, not just the basename of the library. Typically this
+ * is something like "../lib/server/libjvm.so". However, if/when
+ * libjvm.so later tries to dlopen libjava.so (which it does in
+ * order to get access to a few functions implemented in
+ * libjava.so) the musl loader will, as part of loading
+ * dependent libraries, try to load libjvm.so using only its
+ * basename "libjvm.so". Since this does not match the longer
+ * path path it was first loaded with, the already loaded
+ * library is not considered a candidate, and the loader will
+ * instead look for libjvm.so elsewhere. If it's not in
+ * LD_LIBRARY_PATH the dependency load will fail, and libjava.so
+ * will therefore fail as well.
+ */
+ return JNI_TRUE;
+ }
+#endif
+
#ifdef AIX
/* We always have to set the LIBPATH on AIX because ld doesn't support $ORIGIN. */
return JNI_TRUE;
--- old/src/java.base/unix/native/libnio/ch/NativeThread.c
+++ new/src/java.base/unix/native/libnio/ch/NativeThread.c
@@ -36,7 +36,7 @@
#ifdef __linux__
#include <pthread.h>
/* Also defined in net/linux_close.c */
- #define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
+ #define INTERRUPT_SIGNAL (SIGRTMAX - 2)
#elif _AIX
#include <pthread.h>
/* Also defined in net/aix_close.c */
--- old/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c
+++ new/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c
@@ -27,9 +27,6 @@
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/Xatom.h>
-#ifdef __linux__
-#include <execinfo.h>
-#endif
#include <jvm.h>
#include <jni.h>
@@ -790,26 +787,6 @@
}
return ret;
}
-
-#ifdef __linux__
-void print_stack(void)
-{
- void *array[10];
- size_t size;
- char **strings;
- size_t i;
-
- size = backtrace (array, 10);
- strings = backtrace_symbols (array, size);
-
- fprintf (stderr, "Obtained %zd stack frames.\n", size);
-
- for (i = 0; i < size; i++)
- fprintf (stderr, "%s\n", strings[i]);
-
- free (strings);
-}
-#endif
Window get_xawt_root_shell(JNIEnv *env) {
static jclass classXRootWindow = NULL;
--- old/src/jdk.jdwp.agent/share/native/libjdwp/util.h
+++ new/src/jdk.jdwp.agent/share/native/libjdwp/util.h
@@ -35,15 +35,15 @@
#ifdef DEBUG
/* Just to make sure these interfaces are not used here. */
#undef free
- #define free(p) Do not use this interface.
+ #define free do_not_use_this_interface_free
#undef malloc
- #define malloc(p) Do not use this interface.
+ #define malloc do_not_use_this_interface_malloc
#undef calloc
- #define calloc(p) Do not use this interface.
+ #define calloc do_not_use_this_interface_calloc
#undef realloc
- #define realloc(p) Do not use this interface.
+ #define realloc do_not_use_this_interface_realloc
#undef strdup
- #define strdup(p) Do not use this interface.
+ #define strdup do_not_use_this_interface_strdup
#endif
#include "log_messages.h"
--- old/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
+++ new/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
@@ -33,6 +33,7 @@
#include <assert.h>
#include <jni.h>
+#include <jvm.h>
#include <alloca.h>
#include <signal.h>
#include <string.h>
@@ -91,6 +92,20 @@
}
}
+int get_java_stacksize () {
+ size_t stacksize;
+ pthread_attr_t attr;
+ JDK1_1InitArgs jdk_args;
+
+ jdk_args.version = JNI_VERSION_1_1;
+ JNI_GetDefaultJavaVMInitArgs(&jdk_args);
+ if (jdk_args.javaStackSize <= 0) {
+ fprintf(stderr, "Test ERROR. Can't get a valid value for the default stacksize.\n");
+ exit(7);
+ }
+ return jdk_args.javaStackSize;
+}
+
void *run_java_overflow (void *p) {
JNIEnv *env;
jclass class_id;
@@ -258,13 +273,19 @@
exit(7);
}
+ int stack_size = get_java_stacksize();
pthread_t thr;
+ pthread_attr_t thread_attr;
+ pthread_attr_init(&thread_attr);
+ pthread_attr_setstacksize(&thread_attr, stack_size);
+
if (argc > 1 && strcmp(argv[1], "test_java_overflow") == 0) {
printf("\nTesting JAVA_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_java_overflow, NULL);
+
+ pthread_create (&thr, &thread_attr, run_java_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
@@ -277,7 +298,7 @@
printf("\nTesting NATIVE_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_native_overflow, NULL);
+ pthread_create (&thr, &thread_attr, run_native_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
--- old/test/jdk/java/lang/ProcessBuilder/Basic.java
+++ new/test/jdk/java/lang/ProcessBuilder/Basic.java
@@ -396,8 +396,8 @@
if (failed != 0) throw new Error("null PATH");
} else if (action.equals("PATH search algorithm")) {
equal(System.getenv("PATH"), "dir1:dir2:");
- check(new File("/bin/true").exists());
- check(new File("/bin/false").exists());
+ check(new File(TrueExe.path()).exists());
+ check(new File(FalseExe.path()).exists());
String[] cmd = {"prog"};
ProcessBuilder pb1 = new ProcessBuilder(cmd);
ProcessBuilder pb2 = new ProcessBuilder(cmd);
@@ -438,13 +438,13 @@
checkPermissionDenied(pb);
// continue searching if EACCES
- copy("/bin/true", "dir2/prog");
+ copy(TrueExe.path(), "dir2/prog");
equal(run(pb).exitValue(), True.exitValue());
new File("dir1/prog").delete();
new File("dir2/prog").delete();
new File("dir2/prog").mkdirs();
- copy("/bin/true", "dir1/prog");
+ copy(TrueExe.path(), "dir1/prog");
equal(run(pb).exitValue(), True.exitValue());
// Check empty PATH component means current directory.
@@ -460,10 +460,10 @@
pb.command(command);
File prog = new File("./prog");
// "Normal" binaries
- copy("/bin/true", "./prog");
+ copy(TrueExe.path(), "./prog");
equal(run(pb).exitValue(),
True.exitValue());
- copy("/bin/false", "./prog");
+ copy(FalseExe.path(), "./prog");
equal(run(pb).exitValue(),
False.exitValue());
prog.delete();
@@ -518,12 +518,12 @@
new File("dir2/prog").delete();
new File("prog").delete();
new File("dir3").mkdirs();
- copy("/bin/true", "dir1/prog");
- copy("/bin/false", "dir3/prog");
+ copy(TrueExe.path(), "dir1/prog");
+ copy(FalseExe.path(), "dir3/prog");
pb.environment().put("PATH","dir3");
equal(run(pb).exitValue(), True.exitValue());
- copy("/bin/true", "dir3/prog");
- copy("/bin/false", "dir1/prog");
+ copy(TrueExe.path(), "dir3/prog");
+ copy(FalseExe.path(), "dir1/prog");
equal(run(pb).exitValue(), False.exitValue());
} finally {
@@ -620,6 +620,13 @@
new File("/bin/false").exists());
}
+ static class BusyBox {
+ public static boolean is() { return is; }
+ private static final boolean is =
+ (! Windows.is() &&
+ new File("/bin/busybox").exists());
+ }
+
static class UnicodeOS {
public static boolean is() { return is; }
private static final String osName = System.getProperty("os.name");
@@ -658,6 +665,45 @@
}
}
+ // On alpine linux, /bin/true and /bin/false are just links to /bin/busybox.
+ // Some tests copy /bin/true and /bin/false to files with a different filename.
+ // However, copying the busbox executable into a file with a different name
+ // won't result in the expected return codes. As workaround, we create
+ // executable files that can be copied and produce the exepected return
+ // values. We use this workaround, if we find the busybox executable.
+
+ private static class TrueExe {
+ public static String path() { return path; }
+ private static final String path = path0();
+ private static String path0(){
+ if (!BusyBox.is()) {
+ return "/bin/true";
+ }
+ else {
+ File trueExe = new File("true");
+ setFileContents(trueExe, "#!/bin/true\n");
+ trueExe.setExecutable(true);
+ return trueExe.getAbsolutePath();
+ }
+ }
+ }
+
+ private static class FalseExe {
+ public static String path() { return path; }
+ private static final String path = path0();
+ private static String path0(){
+ if (!BusyBox.is()) {
+ return "/bin/false";
+ }
+ else {
+ File falseExe = new File("false");
+ setFileContents(falseExe, "#!/bin/false\n");
+ falseExe.setExecutable(true);
+ return falseExe.getAbsolutePath();
+ }
+ }
+ }
+
static class EnglishUnix {
private static final Boolean is =
(! Windows.is() && isEnglish("LANG") && isEnglish("LC_ALL"));
@@ -1961,7 +2007,7 @@
//----------------------------------------------------------------
try {
new File("suBdiR").mkdirs();
- copy("/bin/true", "suBdiR/unliKely");
+ copy(TrueExe.path(), "suBdiR/unliKely");
final ProcessBuilder pb =
new ProcessBuilder(new String[]{"unliKely"});
pb.environment().put("PATH", "suBdiR");
--- old/test/jdk/java/lang/ProcessHandle/InfoTest.java
+++ new/test/jdk/java/lang/ProcessHandle/InfoTest.java
@@ -298,7 +298,14 @@
}
if (info.command().isPresent()) {
String command = info.command().get();
- String expected = Platform.isWindows() ? "sleep.exe" : "sleep";
+ String expected = "sleep";
+ if (Platform.isWindows()) {
+ expected = "sleep.exe";
+ } else if (new File("/bin/busybox").exists()) {
+ // With busybox sleep is just a sym link to busybox.
+ // The busbox executable is seen as ProcessHandle.Info command.
+ expected = "busybox";
+ }
Assert.assertTrue(command.endsWith(expected), "Command: expected: \'" +
expected + "\', actual: " + command);

View File

@ -0,0 +1,18 @@
Author: Simon Frankenberger <simon-alpine@fraho.eu>
Upstream: no
Reason: The alpine builders print out a warning about sched_getaffinity() not working.
This causes the version check for the boot jdk to fail.
Patch the command to determine the version number to ignore any errors and warnings.
--- old/make/autoconf/boot-jdk.m4
+++ new/make/autoconf/boot-jdk.m4
@@ -74,7 +74,7 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $GREP version | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
[FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION \

View File

@ -0,0 +1,226 @@
Author: Simon Frankenberger <simon-alpine@fraho.eu>
Upstream: no
Reason: Musl libc offers a different structure for context_t*,
so we need a patch to access the structure fields correctly.
--- old/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
+++ new/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
@@ -1290,7 +1290,11 @@
// the safepoing polling page.
ucontext_t* uc = (ucontext_t*) ucontext;
// Set polling address.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address addr = (address)uc->uc_mcontext.regs->gpr[ra] + (ssize_t)ds;
+#else // Musl
+ address addr = (address)uc->uc_mcontext.gp_regs[ra] + (ssize_t) ds;
+#endif
if (polling_address_ptr != NULL) {
*polling_address_ptr = addr;
}
@@ -1311,15 +1315,24 @@
int rb = inv_rb_field(instruction);
// look up content of ra and rb in ucontext
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address ra_val=(address)uc->uc_mcontext.regs->gpr[ra];
long rb_val=(long)uc->uc_mcontext.regs->gpr[rb];
+#else // Musl
+ address ra_val=(address)uc->uc_mcontext.gp_regs[ra];
+ long rb_val=(long)uc->uc_mcontext.gp_regs[rb];
+#endif
return os::is_memory_serialize_page(thread, ra_val+rb_val);
} else if (is_stw(instruction) || is_stwu(instruction)) {
int ra = inv_ra_field(instruction);
int d1 = inv_d1_field(instruction);
// look up content of ra in ucontext
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address ra_val=(address)uc->uc_mcontext.regs->gpr[ra];
+#else // Musl
+ address ra_val=(address)uc->uc_mcontext.gp_regs[ra];
+#endif
return os::is_memory_serialize_page(thread, ra_val+d1);
} else {
return false;
@@ -1382,11 +1395,20 @@
|| (is_stdu(instruction) && rs == 1)) {
int ds = inv_ds_field(instruction);
// return banged address
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return ds+(address)uc->uc_mcontext.regs->gpr[ra];
+#else // Musl
+ return ds+(address)uc->uc_mcontext.gp_regs[ra];
+#endif
} else if (is_stdux(instruction) && rs == 1) {
int rb = inv_rb_field(instruction);
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address sp = (address)uc->uc_mcontext.regs->gpr[1];
long rb_val = (long)uc->uc_mcontext.regs->gpr[rb];
+#else // Musl
+ address sp = (address)uc->uc_mcontext.gp_regs[1];
+ long rb_val = (long)uc->uc_mcontext.gp_regs[rb];
+#endif
return ra != 1 || rb_val >= 0 ? NULL // not a stack bang
: sp + rb_val; // banged address
}
--- old/src/hotspot/cpu/ppc/vm_version_ppc.cpp
+++ new/src/hotspot/cpu/ppc/vm_version_ppc.cpp
@@ -893,7 +893,7 @@
unsigned long auxv = getauxval(AT_HWCAP2);
if (auxv & PPC_FEATURE2_HTM_NOSC) {
- if (auxv & PPC_FEATURE2_HAS_HTM) {
+ if (auxv & PPC_FEATURE2_HTM) {
// TM on POWER8 and POWER9 in compat mode (VM) is supported by the JVM.
// TM on POWER9 DD2.1 NV (baremetal) is not supported by the JVM (TM on
// POWER9 DD2.1 NV has a few issues that need a couple of firmware
--- old/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
+++ new/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
@@ -108,24 +108,42 @@
// - if uc was filled by getcontext(), it is undefined - getcontext() does not fill
// it because the volatile registers are not needed to make setcontext() work.
// Hopefully it was zero'd out beforehand.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
guarantee(uc->uc_mcontext.regs != NULL, "only use ucontext_get_pc in sigaction context");
return (address)uc->uc_mcontext.regs->nip;
+#else // Musl
+ guarantee(uc->uc_mcontext.gp_regs != NULL, "only use ucontext_get_pc in sigaction context");
+ return (address)uc->uc_mcontext.gp_regs[32];
+#endif
}
// modify PC in ucontext.
// Note: Only use this for an ucontext handed down to a signal handler. See comment
// in ucontext_get_pc.
void os::Linux::ucontext_set_pc(ucontext_t * uc, address pc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
guarantee(uc->uc_mcontext.regs != NULL, "only use ucontext_set_pc in sigaction context");
uc->uc_mcontext.regs->nip = (unsigned long)pc;
+#else // Musl
+ guarantee(uc->uc_mcontext.gp_regs != NULL, "only use ucontext_set_pc in sigaction context");
+ uc->uc_mcontext.gp_regs[32] = (unsigned long)pc;
+#endif
}
static address ucontext_get_lr(const ucontext_t * uc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return (address)uc->uc_mcontext.regs->link;
+#else // Musl
+ return (address)uc->uc_mcontext.gp_regs[36];
+#endif
}
intptr_t* os::Linux::ucontext_get_sp(const ucontext_t * uc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return (intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/];
+#else // Musl
+ return (intptr_t*)uc->uc_mcontext.gp_regs[1/*REG_SP*/];
+#endif
}
intptr_t* os::Linux::ucontext_get_fp(const ucontext_t * uc) {
@@ -133,7 +151,11 @@
}
static unsigned long ucontext_get_trap(const ucontext_t * uc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return uc->uc_mcontext.regs->trap;
+#else // Musl
+ return uc->uc_mcontext.gp_regs[40];
+#endif
}
ExtendedPC os::fetch_frame_from_context(const void* ucVoid,
@@ -259,7 +281,13 @@
// 3.2.1 "Machine State Register"), however note that ISA notation for bit
// numbering is MSB 0, so for normal bit numbering (LSB 0) they come to be
// bits 33 and 34. It's not related to endianness, just a notation matter.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
if (second_uc->uc_mcontext.regs->msr & 0x600000000) {
+#else // Musl
+ // why 33?
+ // see comment for glibc NGREG: "r0-r31, nip, msr, lr, etc."
+ if (second_uc->uc_mcontext.gp_regs[33] & 0x600000000) {
+#endif
if (TraceTraps) {
tty->print_cr("caught signal in transaction, "
"ignoring to jump to abort handler");
@@ -586,6 +614,7 @@
const ucontext_t* uc = (const ucontext_t*)context;
st->print_cr("Registers:");
+#if defined(__GLIBC__) || defined(__UCLIBC__)
st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->nip);
st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->link);
st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.regs->ctr);
@@ -594,8 +623,18 @@
st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.regs->gpr[i]);
if (i % 3 == 2) st->cr();
}
+#else // Musl
+ st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[32]);
+ st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[36]);
+ st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[35]);
st->cr();
+ for (int i = 0; i < 32; i++) {
+ st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.gp_regs[i]);
+ if (i % 3 == 2) st->cr();
+ }
+#endif
st->cr();
+ st->cr();
intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);
st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", p2i(sp));
@@ -618,12 +657,22 @@
st->print_cr("Register to memory mapping:");
st->cr();
+#if defined(__GLIBC__) || defined(__UCLIBC__)
st->print("pc ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->nip);
st->print("lr ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->link);
st->print("ctr ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->ctr);
+#else // Musl
+ st->print("pc ="); print_location(st, (intptr_t)uc->uc_mcontext.gp_regs[32]);
+ st->print("lr ="); print_location(st, (intptr_t)uc->uc_mcontext.gp_regs[36]);
+ st->print("ctr ="); print_location(st, (intptr_t)uc->uc_mcontext.gp_regs[35]);
+#endif
for (int i = 0; i < 32; i++) {
st->print("r%-2d=", i);
+#if defined(__GLIBC__) || defined(__UCLIBC__)
print_location(st, uc->uc_mcontext.regs->gpr[i]);
+#else // Musl
+ print_location(st, uc->uc_mcontext.gp_regs[i]);
+#endif
}
st->cr();
}
--- old/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp
+++ new/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp
@@ -56,8 +56,13 @@
// if we were running Java code when SIGPROF came in.
if (isInJava) {
ucontext_t* uc = (ucontext_t*) ucontext;
+#if defined(__GLIBC__) || defined(__UCLIBC__)
frame ret_frame((intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/],
(address)uc->uc_mcontext.regs->nip);
+#else // Musl
+ frame ret_frame((intptr_t*)uc->uc_mcontext.gp_regs[1/*REG_SP*/],
+ (address)uc->uc_mcontext.gp_regs[32]);
+#endif
if (ret_frame.pc() == NULL) {
// ucontext wasn't useful
@@ -70,7 +75,11 @@
if (m == NULL || !m->is_valid_method()) return false;
if (!Metaspace::contains((const void*)m->constMethod())) return false;
+#if defined(__GLIBC__) || defined(__UCLIBC__)
uint64_t reg_bcp = uc->uc_mcontext.regs->gpr[14/*R14_bcp*/];
+#else // Musl
+ uint64_t reg_bcp = uc->uc_mcontext.gp_regs[14/*R14_bcp*/];
+#endif
uint64_t istate_bcp = istate->bcp;
uint64_t code_start = (uint64_t)(m->code_base());
uint64_t code_end = (uint64_t)(m->code_base() + m->code_size());

View File

@ -0,0 +1,11 @@
--- old/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
+++ new/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
@@ -77,7 +77,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-# include <fpu_control.h>
#ifdef BUILTIN_SIM
#define REG_SP REG_RSP

View File

@ -0,0 +1,518 @@
--- old/make/ReleaseFile.gmk
+++ new/make/ReleaseFile.gmk
@@ -53,6 +53,7 @@
$(call info-file-item, "JAVA_VERSION_DATE", "$(VERSION_DATE)")
$(call info-file-item, "OS_NAME", "$(RELEASE_FILE_OS_NAME)")
$(call info-file-item, "OS_ARCH", "$(RELEASE_FILE_OS_ARCH)")
+ $(call info-file-item, "LIBC", "musl")
endef
# Param 1 - The file containing the MODULES list
--- old/make/hotspot/lib/CompileJvm.gmk
+++ new/make/hotspot/lib/CompileJvm.gmk
@@ -71,6 +71,7 @@
-DHOTSPOT_BUILD_USER='"$(USERNAME)"' \
-DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"' \
-DCPU='"$(OPENJDK_TARGET_CPU_VM_VERSION)"' \
+ -DLIBC='"musl"' \
#
################################################################################
--- old/make/lib/CoreLibraries.gmk
+++ new/make/lib/CoreLibraries.gmk
@@ -194,6 +194,7 @@
endif
LIBJLI_CFLAGS += $(LIBZ_CFLAGS)
+LIBJLI_CFLAGS += -DLIBC=\"musl\"
ifneq ($(USE_EXTERNAL_LIBZ), true)
LIBJLI_EXTRA_FILES += \
--- old/src/hotspot/os/linux/os_linux.cpp
+++ new/src/hotspot/os/linux/os_linux.cpp
@@ -99,7 +99,6 @@
# include <string.h>
# include <syscall.h>
# include <sys/sysinfo.h>
-# include <gnu/libc-version.h>
# include <sys/ipc.h>
# include <sys/shm.h>
# include <link.h>
@@ -519,6 +518,11 @@
// detecting pthread library
void os::Linux::libpthread_init() {
+#if !defined(__GLIBC__) && !defined(__UCLIBC__)
+ // Hard code Alpine Linux supported musl compatible settings
+ os::Linux::set_glibc_version("glibc 2.9");
+ os::Linux::set_libpthread_version("NPTL");
+#else
// Save glibc and pthread version strings.
#if !defined(_CS_GNU_LIBC_VERSION) || \
!defined(_CS_GNU_LIBPTHREAD_VERSION)
@@ -536,6 +540,7 @@
str = (char *)malloc(n, mtInternal);
confstr(_CS_GNU_LIBPTHREAD_VERSION, str, n);
os::Linux::set_libpthread_version(str);
+#endif
}
/////////////////////////////////////////////////////////////////////////////
@@ -2855,20 +2860,36 @@
extern "C" JNIEXPORT void numa_warn(int number, char *where, ...) { }
extern "C" JNIEXPORT void numa_error(char *where) { }
+static void* dlvsym_if_available(void* handle, const char* name, const char* version) {
+ typedef void* (*dlvsym_func_type)(void* handle, const char* name, const char* version);
+ static dlvsym_func_type dlvsym_func;
+ static bool initialized = false;
+
+ if (!initialized) {
+ dlvsym_func = (dlvsym_func_type)dlsym(RTLD_NEXT, "dlvsym");
+ initialized = true;
+ }
+
+ if (dlvsym_func != NULL) {
+ void *f = dlvsym_func(handle, name, version);
+ if (f != NULL) {
+ return f;
+ }
+ }
+
+ return dlsym(handle, name);
+}
+
// Handle request to load libnuma symbol version 1.1 (API v1). If it fails
// load symbol from base version instead.
void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
- void *f = dlvsym(handle, name, "libnuma_1.1");
- if (f == NULL) {
- f = dlsym(handle, name);
- }
- return f;
+ return dlvsym_if_available(handle, name, "libnuma_1.1");
}
// Handle request to load libnuma symbol version 1.2 (API v2) only.
// Return NULL if the symbol is not defined in this particular version.
void* os::Linux::libnuma_v2_dlsym(void* handle, const char* name) {
- return dlvsym(handle, name, "libnuma_1.2");
+ return dlvsym_if_available(handle, name, "libnuma_1.2");
}
bool os::Linux::libnuma_init() {
--- old/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
+++ new/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
@@ -75,9 +75,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-#ifndef AMD64
-# include <fpu_control.h>
-#endif
#ifdef AMD64
#define REG_SP REG_RSP
--- old/src/hotspot/share/gc/shared/genCollectedHeap.cpp
+++ new/src/hotspot/share/gc/shared/genCollectedHeap.cpp
@@ -1148,7 +1148,7 @@
static ScratchBlock *removeSmallestScratch(ScratchBlock **prev_ptr) {
bool first = true;
size_t min_size = 0; // "first" makes this conceptually infinite.
- ScratchBlock **smallest_ptr, *smallest;
+ ScratchBlock **smallest_ptr = NULL, *smallest;
ScratchBlock *cur = *prev_ptr;
while (cur) {
assert(*prev_ptr == cur, "just checking");
--- old/src/hotspot/share/runtime/vm_version.cpp
+++ new/src/hotspot/share/runtime/vm_version.cpp
@@ -270,7 +270,7 @@
#endif
#define INTERNAL_VERSION_SUFFIX VM_RELEASE ")" \
- " for " OS "-" CPU FLOAT_ARCH_STR \
+ " for " OS "-" CPU FLOAT_ARCH_STR LIBC \
" JRE (" VERSION_STRING "), built on " __DATE__ " " __TIME__ \
" by " XSTR(HOTSPOT_BUILD_USER) " with " HOTSPOT_BUILD_COMPILER
--- old/src/hotspot/share/utilities/globalDefinitions_gcc.hpp
+++ new/src/hotspot/share/utilities/globalDefinitions_gcc.hpp
@@ -204,7 +204,7 @@
#elif defined(__APPLE__)
inline int g_isnan(double f) { return isnan(f); }
#elif defined(LINUX) || defined(_ALLBSD_SOURCE)
-inline int g_isnan(float f) { return isnanf(f); }
+inline int g_isnan(float f) { return isnan(f); }
inline int g_isnan(double f) { return isnan(f); }
#else
#error "missing platform-specific definition here"
--- old/src/java.base/linux/native/libnet/linux_close.c
+++ new/src/java.base/linux/native/libnet/linux_close.c
@@ -60,7 +60,7 @@
/*
* Signal to unblock thread
*/
-static int sigWakeup = (__SIGRTMAX - 2);
+static int sigWakeup;
/*
* fdTable holds one entry per file descriptor, up to a certain
@@ -149,6 +149,7 @@
/*
* Setup the signal handler
*/
+ sigWakeup = SIGRTMAX - 2;
sa.sa_handler = sig_wakeup;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
--- old/src/java.base/unix/native/libjava/childproc.c
+++ new/src/java.base/unix/native/libjava/childproc.c
@@ -234,7 +234,13 @@
{
if (envp == NULL || (char **) envp == environ) {
execvp(file, (char **) argv);
- return;
+ // ENOEXEC indicates that the file header was not recognized. The musl C
+ // library does not implement the fallback to /bin/sh for that case, so fall
+ // through to the code below which implements that fallback using
+ // execve_with_shell_fallback.
+ if (errno != ENOEXEC) {
+ return;
+ }
}
if (*file == '\0') {
--- old/src/java.base/unix/native/libjava/jdk_util_md.h
+++ new/src/java.base/unix/native/libjava/jdk_util_md.h
@@ -37,7 +37,7 @@
#define ISNAND(d) isnan(d)
#elif defined(__linux__) || defined(_ALLBSD_SOURCE)
#include <math.h>
-#define ISNANF(f) isnanf(f)
+#define ISNANF(f) isnan(f)
#define ISNAND(d) isnan(d)
#elif defined(_AIX)
#include <math.h>
--- old/src/java.base/unix/native/libjli/java_md_solinux.c
+++ new/src/java.base/unix/native/libjli/java_md_solinux.c
@@ -235,6 +235,39 @@
char *dmllp = NULL;
char *p; /* a utility pointer */
+#ifdef __linux
+#ifndef LIBC
+#error "LIBC not set"
+#endif
+
+ if (strcmp(LIBC, "musl") == 0) {
+ /*
+ * The musl library loader requires LD_LIBRARY_PATH to be set in
+ * order to correctly resolve the dependency libjava.so has on libjvm.so.
+ *
+ * Specifically, it differs from glibc in the sense that even if
+ * libjvm.so has already been loaded it will not be considered a
+ * candidate for resolving the dependency unless the *full* path
+ * of the already loaded library matches the dependency being loaded.
+ *
+ * libjvm.so is being loaded by the launcher using a long path to
+ * dlopen, not just the basename of the library. Typically this
+ * is something like "../lib/server/libjvm.so". However, if/when
+ * libjvm.so later tries to dlopen libjava.so (which it does in
+ * order to get access to a few functions implemented in
+ * libjava.so) the musl loader will, as part of loading
+ * dependent libraries, try to load libjvm.so using only its
+ * basename "libjvm.so". Since this does not match the longer
+ * path path it was first loaded with, the already loaded
+ * library is not considered a candidate, and the loader will
+ * instead look for libjvm.so elsewhere. If it's not in
+ * LD_LIBRARY_PATH the dependency load will fail, and libjava.so
+ * will therefore fail as well.
+ */
+ return JNI_TRUE;
+ }
+#endif
+
#ifdef AIX
/* We always have to set the LIBPATH on AIX because ld doesn't support $ORIGIN. */
return JNI_TRUE;
--- old/src/java.base/unix/native/libnio/ch/NativeThread.c
+++ new/src/java.base/unix/native/libnio/ch/NativeThread.c
@@ -36,7 +36,7 @@
#ifdef __linux__
#include <pthread.h>
/* Also defined in net/linux_close.c */
- #define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
+ #define INTERRUPT_SIGNAL (SIGRTMAX - 2)
#elif defined(_AIX)
#include <pthread.h>
/* Also defined in net/aix_close.c */
--- old/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c
+++ new/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c
@@ -27,9 +27,6 @@
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/Xatom.h>
-#ifdef __linux__
-#include <execinfo.h>
-#endif
#include <jvm.h>
#include <jni.h>
@@ -790,26 +787,6 @@
}
return ret;
}
-
-#ifdef __linux__
-void print_stack(void)
-{
- void *array[10];
- size_t size;
- char **strings;
- size_t i;
-
- size = backtrace (array, 10);
- strings = backtrace_symbols (array, size);
-
- fprintf (stderr, "Obtained %zd stack frames.\n", size);
-
- for (i = 0; i < size; i++)
- fprintf (stderr, "%s\n", strings[i]);
-
- free (strings);
-}
-#endif
Window get_xawt_root_shell(JNIEnv *env) {
static jclass classXRootWindow = NULL;
--- old/src/jdk.jdwp.agent/share/native/libjdwp/util.h
+++ new/src/jdk.jdwp.agent/share/native/libjdwp/util.h
@@ -35,15 +35,15 @@
#ifdef DEBUG
/* Just to make sure these interfaces are not used here. */
#undef free
- #define free(p) Do not use this interface.
+ #define free do_not_use_this_interface_free
#undef malloc
- #define malloc(p) Do not use this interface.
+ #define malloc do_not_use_this_interface_malloc
#undef calloc
- #define calloc(p) Do not use this interface.
+ #define calloc do_not_use_this_interface_calloc
#undef realloc
- #define realloc(p) Do not use this interface.
+ #define realloc do_not_use_this_interface_realloc
#undef strdup
- #define strdup(p) Do not use this interface.
+ #define strdup do_not_use_this_interface_strdup
#endif
#include "log_messages.h"
--- old/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
+++ new/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
@@ -33,6 +33,7 @@
#include <assert.h>
#include <jni.h>
+#include <jvm.h>
#include <alloca.h>
#include <signal.h>
#include <string.h>
@@ -91,6 +92,20 @@
}
}
+int get_java_stacksize () {
+ size_t stacksize;
+ pthread_attr_t attr;
+ JDK1_1InitArgs jdk_args;
+
+ jdk_args.version = JNI_VERSION_1_1;
+ JNI_GetDefaultJavaVMInitArgs(&jdk_args);
+ if (jdk_args.javaStackSize <= 0) {
+ fprintf(stderr, "Test ERROR. Can't get a valid value for the default stacksize.\n");
+ exit(7);
+ }
+ return jdk_args.javaStackSize;
+}
+
void *run_java_overflow (void *p) {
JNIEnv *env;
jclass class_id;
@@ -254,13 +269,19 @@
exit(7);
}
+ int stack_size = get_java_stacksize();
pthread_t thr;
+ pthread_attr_t thread_attr;
+ pthread_attr_init(&thread_attr);
+ pthread_attr_setstacksize(&thread_attr, stack_size);
+
if (argc > 1 && strcmp(argv[1], "test_java_overflow") == 0) {
printf("\nTesting JAVA_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_java_overflow, NULL);
+
+ pthread_create (&thr, &thread_attr, run_java_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
@@ -273,7 +294,7 @@
printf("\nTesting NATIVE_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_native_overflow, NULL);
+ pthread_create (&thr, &thread_attr, run_native_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
--- old/test/jdk/java/lang/ProcessBuilder/Basic.java
+++ new/test/jdk/java/lang/ProcessBuilder/Basic.java
@@ -396,8 +396,8 @@
if (failed != 0) throw new Error("null PATH");
} else if (action.equals("PATH search algorithm")) {
equal(System.getenv("PATH"), "dir1:dir2:");
- check(new File("/bin/true").exists());
- check(new File("/bin/false").exists());
+ check(new File(TrueExe.path()).exists());
+ check(new File(FalseExe.path()).exists());
String[] cmd = {"prog"};
ProcessBuilder pb1 = new ProcessBuilder(cmd);
ProcessBuilder pb2 = new ProcessBuilder(cmd);
@@ -438,13 +438,13 @@
checkPermissionDenied(pb);
// continue searching if EACCES
- copy("/bin/true", "dir2/prog");
+ copy(TrueExe.path(), "dir2/prog");
equal(run(pb).exitValue(), True.exitValue());
new File("dir1/prog").delete();
new File("dir2/prog").delete();
new File("dir2/prog").mkdirs();
- copy("/bin/true", "dir1/prog");
+ copy(TrueExe.path(), "dir1/prog");
equal(run(pb).exitValue(), True.exitValue());
// Check empty PATH component means current directory.
@@ -460,10 +460,10 @@
pb.command(command);
File prog = new File("./prog");
// "Normal" binaries
- copy("/bin/true", "./prog");
+ copy(TrueExe.path(), "./prog");
equal(run(pb).exitValue(),
True.exitValue());
- copy("/bin/false", "./prog");
+ copy(FalseExe.path(), "./prog");
equal(run(pb).exitValue(),
False.exitValue());
prog.delete();
@@ -518,12 +518,12 @@
new File("dir2/prog").delete();
new File("prog").delete();
new File("dir3").mkdirs();
- copy("/bin/true", "dir1/prog");
- copy("/bin/false", "dir3/prog");
+ copy(TrueExe.path(), "dir1/prog");
+ copy(FalseExe.path(), "dir3/prog");
pb.environment().put("PATH","dir3");
equal(run(pb).exitValue(), True.exitValue());
- copy("/bin/true", "dir3/prog");
- copy("/bin/false", "dir1/prog");
+ copy(TrueExe.path(), "dir3/prog");
+ copy(FalseExe.path(), "dir1/prog");
equal(run(pb).exitValue(), False.exitValue());
} finally {
@@ -620,6 +620,13 @@
new File("/bin/false").exists());
}
+ static class BusyBox {
+ public static boolean is() { return is; }
+ private static final boolean is =
+ (! Windows.is() &&
+ new File("/bin/busybox").exists());
+ }
+
static class UnicodeOS {
public static boolean is() { return is; }
private static final String osName = System.getProperty("os.name");
@@ -658,6 +665,45 @@
}
}
+ // On alpine linux, /bin/true and /bin/false are just links to /bin/busybox.
+ // Some tests copy /bin/true and /bin/false to files with a different filename.
+ // However, copying the busbox executable into a file with a different name
+ // won't result in the expected return codes. As workaround, we create
+ // executable files that can be copied and produce the exepected return
+ // values. We use this workaround, if we find the busybox executable.
+
+ private static class TrueExe {
+ public static String path() { return path; }
+ private static final String path = path0();
+ private static String path0(){
+ if (!BusyBox.is()) {
+ return "/bin/true";
+ }
+ else {
+ File trueExe = new File("true");
+ setFileContents(trueExe, "#!/bin/true\n");
+ trueExe.setExecutable(true);
+ return trueExe.getAbsolutePath();
+ }
+ }
+ }
+
+ private static class FalseExe {
+ public static String path() { return path; }
+ private static final String path = path0();
+ private static String path0(){
+ if (!BusyBox.is()) {
+ return "/bin/false";
+ }
+ else {
+ File falseExe = new File("false");
+ setFileContents(falseExe, "#!/bin/false\n");
+ falseExe.setExecutable(true);
+ return falseExe.getAbsolutePath();
+ }
+ }
+ }
+
static class EnglishUnix {
private static final Boolean is =
(! Windows.is() && isEnglish("LANG") && isEnglish("LC_ALL"));
@@ -1961,7 +2007,7 @@
//----------------------------------------------------------------
try {
new File("suBdiR").mkdirs();
- copy("/bin/true", "suBdiR/unliKely");
+ copy(TrueExe.path(), "suBdiR/unliKely");
final ProcessBuilder pb =
new ProcessBuilder(new String[]{"unliKely"});
pb.environment().put("PATH", "suBdiR");
--- old/test/jdk/java/lang/ProcessHandle/InfoTest.java
+++ new/test/jdk/java/lang/ProcessHandle/InfoTest.java
@@ -298,7 +298,14 @@
}
if (info.command().isPresent()) {
String command = info.command().get();
- String expected = Platform.isWindows() ? "sleep.exe" : "sleep";
+ String expected = "sleep";
+ if (Platform.isWindows()) {
+ expected = "sleep.exe";
+ } else if (new File("/bin/busybox").exists()) {
+ // With busybox sleep is just a sym link to busybox.
+ // The busbox executable is seen as ProcessHandle.Info command.
+ expected = "busybox";
+ }
Assert.assertTrue(command.endsWith(expected), "Command: expected: \'" +
expected + "\', actual: " + command);

View File

@ -0,0 +1,16 @@
The alpine builders print out a warning about sched_getaffinity() not working.
This causes the version check for the boot jdk to fail.
Patch the command to determine the version number to ignore any errors and warnings.
--- old/make/autoconf/boot-jdk.m4
+++ new/make/autoconf/boot-jdk.m4
@@ -74,7 +74,7 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" $USER_BOOT_JDK_OPTIONS -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" $USER_BOOT_JDK_OPTIONS -version 2>&1 | $GREP version | $HEAD -n 1`
if [ [[ "$BOOT_JDK_VERSION" =~ "Picked up" ]] ]; then
AC_MSG_NOTICE([You have _JAVA_OPTIONS or JAVA_TOOL_OPTIONS set. This can mess up the build. Please use --with-boot-jdk-jvmargs instead.])
AC_MSG_NOTICE([Java reports: "$BOOT_JDK_VERSION".])

View File

@ -0,0 +1,17 @@
upstream report: https://bugs.openjdk.java.net/browse/JDK-8237879.
diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk
index 170c3ed..697f9d2 100644
--- a/make/common/MakeBase.gmk
+++ b/make/common/MakeBase.gmk
@@ -984,7 +984,9 @@ DependOnVariableHelper = \
$(info NewVariable $1: >$(strip $($1))<) \
$(info OldVariable $1: >$(strip $($1_old))<)) \
$(call WriteFile, $1_old:=$(call DoubleDollar,$(call EscapeHash,$($1))), \
- $(call DependOnVariableFileName, $1, $2))) \
+ $(call DependOnVariableFileName, $1, $2)) \
+ $(eval $(call DependOnVariableFileName, $1, $2): ) \
+ ) \
$(call DependOnVariableFileName, $1, $2) \
)

View File

@ -0,0 +1,184 @@
--- old/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
+++ new/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
@@ -1290,7 +1290,11 @@
// the safepoing polling page.
ucontext_t* uc = (ucontext_t*) ucontext;
// Set polling address.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address addr = (address)uc->uc_mcontext.regs->gpr[ra] + (ssize_t)ds;
+#else // Musl
+ address addr = (address)uc->uc_mcontext.gp_regs[ra] + (ssize_t) ds;
+#endif
if (polling_address_ptr != NULL) {
*polling_address_ptr = addr;
}
@@ -1353,11 +1357,20 @@
|| (is_stdu(instruction) && rs == 1)) {
int ds = inv_ds_field(instruction);
// return banged address
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return ds+(address)uc->uc_mcontext.regs->gpr[ra];
+#else // Musl
+ return ds+(address)uc->uc_mcontext.gp_regs[ra];
+#endif
} else if (is_stdux(instruction) && rs == 1) {
int rb = inv_rb_field(instruction);
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address sp = (address)uc->uc_mcontext.regs->gpr[1];
long rb_val = (long)uc->uc_mcontext.regs->gpr[rb];
+#else // Musl
+ address sp = (address)uc->uc_mcontext.gp_regs[1];
+ long rb_val = (long)uc->uc_mcontext.gp_regs[rb];
+#endif
return ra != 1 || rb_val >= 0 ? NULL // not a stack bang
: sp + rb_val; // banged address
}
--- old/src/hotspot/cpu/ppc/vm_version_ppc.cpp
+++ new/src/hotspot/cpu/ppc/vm_version_ppc.cpp
@@ -768,7 +768,7 @@
unsigned long auxv = getauxval(AT_HWCAP2);
if (auxv & PPC_FEATURE2_HTM_NOSC) {
- if (auxv & PPC_FEATURE2_HAS_HTM) {
+ if (auxv & PPC_FEATURE2_HTM) {
// TM on POWER8 and POWER9 in compat mode (VM) is supported by the JVM.
// TM on POWER9 DD2.1 NV (baremetal) is not supported by the JVM (TM on
// POWER9 DD2.1 NV has a few issues that need a couple of firmware
--- old/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
+++ new/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
@@ -108,24 +108,42 @@
// - if uc was filled by getcontext(), it is undefined - getcontext() does not fill
// it because the volatile registers are not needed to make setcontext() work.
// Hopefully it was zero'd out beforehand.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
guarantee(uc->uc_mcontext.regs != NULL, "only use ucontext_get_pc in sigaction context");
return (address)uc->uc_mcontext.regs->nip;
+#else // Musl
+ guarantee(uc->uc_mcontext.gp_regs != NULL, "only use ucontext_get_pc in sigaction context");
+ return (address)uc->uc_mcontext.gp_regs[32];
+#endif
}
// modify PC in ucontext.
// Note: Only use this for an ucontext handed down to a signal handler. See comment
// in ucontext_get_pc.
void os::Linux::ucontext_set_pc(ucontext_t * uc, address pc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
guarantee(uc->uc_mcontext.regs != NULL, "only use ucontext_set_pc in sigaction context");
uc->uc_mcontext.regs->nip = (unsigned long)pc;
+#else // Musl
+ guarantee(uc->uc_mcontext.gp_regs != NULL, "only use ucontext_set_pc in sigaction context");
+ uc->uc_mcontext.gp_regs[32] = (unsigned long)pc;
+#endif
}
static address ucontext_get_lr(const ucontext_t * uc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return (address)uc->uc_mcontext.regs->link;
+#else // Musl
+ return (address)uc->uc_mcontext.gp_regs[36];
+#endif
}
intptr_t* os::Linux::ucontext_get_sp(const ucontext_t * uc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return (intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/];
+#else // Musl
+ return (intptr_t*)uc->uc_mcontext.gp_regs[1/*REG_SP*/];
+#endif
}
intptr_t* os::Linux::ucontext_get_fp(const ucontext_t * uc) {
@@ -255,7 +273,13 @@
// 3.2.1 "Machine State Register"), however note that ISA notation for bit
// numbering is MSB 0, so for normal bit numbering (LSB 0) they come to be
// bits 33 and 34. It's not related to endianness, just a notation matter.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
if (second_uc->uc_mcontext.regs->msr & 0x600000000) {
+#else // Musl
+ // why 33?
+ // see comment for glibc NGREG: "r0-r31, nip, msr, lr, etc."
+ if (second_uc->uc_mcontext.gp_regs[33] & 0x600000000) {
+#endif
if (TraceTraps) {
tty->print_cr("caught signal in transaction, "
"ignoring to jump to abort handler");
@@ -554,6 +578,7 @@
const ucontext_t* uc = (const ucontext_t*)context;
st->print_cr("Registers:");
+#if defined(__GLIBC__) || defined(__UCLIBC__)
st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->nip);
st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->link);
st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.regs->ctr);
@@ -562,8 +587,18 @@
st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.regs->gpr[i]);
if (i % 3 == 2) st->cr();
}
+#else // Musl
+ st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[32]);
+ st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[36]);
+ st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[35]);
st->cr();
+ for (int i = 0; i < 32; i++) {
+ st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.gp_regs[i]);
+ if (i % 3 == 2) st->cr();
+ }
+#endif
st->cr();
+ st->cr();
intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);
st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", p2i(sp));
@@ -587,12 +622,22 @@
st->print_cr("Register to memory mapping:");
st->cr();
+#if defined(__GLIBC__) || defined(__UCLIBC__)
st->print("pc ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->nip);
st->print("lr ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->link);
st->print("ctr ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->ctr);
+#else // Musl
+ st->print("pc ="); print_location(st, (intptr_t)uc->uc_mcontext.gp_regs[32]);
+ st->print("lr ="); print_location(st, (intptr_t)uc->uc_mcontext.gp_regs[36]);
+ st->print("ctr ="); print_location(st, (intptr_t)uc->uc_mcontext.gp_regs[35]);
+#endif
for (int i = 0; i < 32; i++) {
st->print("r%-2d=", i);
+#if defined(__GLIBC__) || defined(__UCLIBC__)
print_location(st, uc->uc_mcontext.regs->gpr[i]);
+#else // Musl
+ print_location(st, uc->uc_mcontext.gp_regs[i]);
+#endif
}
st->cr();
}
--- old/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp
+++ new/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp
@@ -56,8 +56,13 @@
// if we were running Java code when SIGPROF came in.
if (isInJava) {
ucontext_t* uc = (ucontext_t*) ucontext;
+#if defined(__GLIBC__) || defined(__UCLIBC__)
frame ret_frame((intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/],
(address)uc->uc_mcontext.regs->nip);
+#else // Musl
+ frame ret_frame((intptr_t*)uc->uc_mcontext.gp_regs[1/*REG_SP*/],
+ (address)uc->uc_mcontext.gp_regs[32]);
+#endif
if (ret_frame.pc() == NULL) {
// ucontext wasn't useful
@@ -69,7 +74,11 @@
if (!((Method*)(istate->method))->is_metaspace_object()) {
return false;
}
+#if defined(__GLIBC__) || defined(__UCLIBC__)
uint64_t reg_bcp = uc->uc_mcontext.regs->gpr[14/*R14_bcp*/];
+#else // Musl
+ uint64_t reg_bcp = uc->uc_mcontext.gp_regs[14/*R14_bcp*/];
+#endif
uint64_t istate_bcp = istate->bcp;
uint64_t code_start = (uint64_t)(((Method*)(istate->method))->code_base());
uint64_t code_end = (uint64_t)(((Method*)istate->method)->code_base() + ((Method*)istate->method)->code_size());

View File

@ -0,0 +1,13 @@
The header is not present with musl and including is not needed
--- old/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
+++ new/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
@@ -77,7 +77,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-# include <fpu_control.h>
#ifdef BUILTIN_SIM
#define REG_SP REG_RSP

View File

@ -0,0 +1,521 @@
This patch contains mainly code from the portola project.
Adopted, enhanced and fixed so that it actually compiles with alpine.
--- old/make/ReleaseFile.gmk
+++ new/make/ReleaseFile.gmk
@@ -53,6 +53,7 @@
$(call info-file-item, "JAVA_VERSION_DATE", "$(VERSION_DATE)")
$(call info-file-item, "OS_NAME", "$(RELEASE_FILE_OS_NAME)")
$(call info-file-item, "OS_ARCH", "$(RELEASE_FILE_OS_ARCH)")
+ $(call info-file-item, "LIBC", "musl")
endef
# Param 1 - The file containing the MODULES list
--- old/make/hotspot/lib/CompileJvm.gmk
+++ new/make/hotspot/lib/CompileJvm.gmk
@@ -71,6 +71,7 @@
-DHOTSPOT_BUILD_USER='"$(USERNAME)"' \
-DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"' \
-DCPU='"$(OPENJDK_TARGET_CPU_VM_VERSION)"' \
+ -DLIBC='"musl"' \
#
################################################################################
--- old/make/lib/CoreLibraries.gmk
+++ new/make/lib/CoreLibraries.gmk
@@ -192,6 +192,7 @@
endif
LIBJLI_CFLAGS += $(LIBZ_CFLAGS)
+LIBJLI_CFLAGS += -DLIBC=\"musl\"
ifneq ($(USE_EXTERNAL_LIBZ), true)
LIBJLI_EXTRA_FILES += \
--- old/src/hotspot/os/linux/os_linux.cpp
+++ new/src/hotspot/os/linux/os_linux.cpp
@@ -102,7 +102,6 @@
# include <string.h>
# include <syscall.h>
# include <sys/sysinfo.h>
-# include <gnu/libc-version.h>
# include <sys/ipc.h>
# include <sys/shm.h>
# include <link.h>
@@ -599,6 +598,11 @@
// detecting pthread library
void os::Linux::libpthread_init() {
+#if !defined(__GLIBC__) && !defined(__UCLIBC__)
+ // Hard code Alpine Linux supported musl compatible settings
+ os::Linux::set_glibc_version("glibc 2.9");
+ os::Linux::set_libpthread_version("NPTL");
+#else
// Save glibc and pthread version strings.
#if !defined(_CS_GNU_LIBC_VERSION) || \
!defined(_CS_GNU_LIBPTHREAD_VERSION)
@@ -616,6 +620,7 @@
str = (char *)malloc(n, mtInternal);
confstr(_CS_GNU_LIBPTHREAD_VERSION, str, n);
os::Linux::set_libpthread_version(str);
+#endif
}
/////////////////////////////////////////////////////////////////////////////
@@ -3001,20 +3006,36 @@
extern "C" JNIEXPORT void numa_warn(int number, char *where, ...) { }
extern "C" JNIEXPORT void numa_error(char *where) { }
+static void* dlvsym_if_available(void* handle, const char* name, const char* version) {
+ typedef void* (*dlvsym_func_type)(void* handle, const char* name, const char* version);
+ static dlvsym_func_type dlvsym_func;
+ static bool initialized = false;
+
+ if (!initialized) {
+ dlvsym_func = (dlvsym_func_type)dlsym(RTLD_NEXT, "dlvsym");
+ initialized = true;
+ }
+
+ if (dlvsym_func != NULL) {
+ void *f = dlvsym_func(handle, name, version);
+ if (f != NULL) {
+ return f;
+ }
+ }
+
+ return dlsym(handle, name);
+}
+
// Handle request to load libnuma symbol version 1.1 (API v1). If it fails
// load symbol from base version instead.
void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
- void *f = dlvsym(handle, name, "libnuma_1.1");
- if (f == NULL) {
- f = dlsym(handle, name);
- }
- return f;
+ return dlvsym_if_available(handle, name, "libnuma_1.1");
}
// Handle request to load libnuma symbol version 1.2 (API v2) only.
// Return NULL if the symbol is not defined in this particular version.
void* os::Linux::libnuma_v2_dlsym(void* handle, const char* name) {
- return dlvsym(handle, name, "libnuma_1.2");
+ return dlvsym_if_available(handle, name, "libnuma_1.2");
}
bool os::Linux::libnuma_init() {
--- old/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
+++ new/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
@@ -75,9 +75,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-#ifndef AMD64
-# include <fpu_control.h>
-#endif
#ifdef AMD64
#define REG_SP REG_RSP
--- old/src/hotspot/share/gc/shared/genCollectedHeap.cpp
+++ new/src/hotspot/share/gc/shared/genCollectedHeap.cpp
@@ -1153,7 +1153,7 @@
static ScratchBlock *removeSmallestScratch(ScratchBlock **prev_ptr) {
bool first = true;
size_t min_size = 0; // "first" makes this conceptually infinite.
- ScratchBlock **smallest_ptr, *smallest;
+ ScratchBlock **smallest_ptr = NULL, *smallest;
ScratchBlock *cur = *prev_ptr;
while (cur) {
assert(*prev_ptr == cur, "just checking");
--- old/src/hotspot/share/runtime/vm_version.cpp
+++ new/src/hotspot/share/runtime/vm_version.cpp
@@ -267,7 +267,7 @@
#endif
#define INTERNAL_VERSION_SUFFIX VM_RELEASE ")" \
- " for " OS "-" CPU FLOAT_ARCH_STR \
+ " for " OS "-" CPU FLOAT_ARCH_STR LIBC \
" JRE (" VERSION_STRING "), built on " __DATE__ " " __TIME__ \
" by " XSTR(HOTSPOT_BUILD_USER) " with " HOTSPOT_BUILD_COMPILER
--- old/src/hotspot/share/utilities/globalDefinitions_gcc.hpp
+++ new/src/hotspot/share/utilities/globalDefinitions_gcc.hpp
@@ -204,7 +204,7 @@
#elif defined(__APPLE__)
inline int g_isnan(double f) { return isnan(f); }
#elif defined(LINUX) || defined(_ALLBSD_SOURCE)
-inline int g_isnan(float f) { return isnanf(f); }
+inline int g_isnan(float f) { return isnan(f); }
inline int g_isnan(double f) { return isnan(f); }
#else
#error "missing platform-specific definition here"
--- old/src/java.base/linux/native/libnet/linux_close.c
+++ new/src/java.base/linux/native/libnet/linux_close.c
@@ -60,7 +60,7 @@
/*
* Signal to unblock thread
*/
-static int sigWakeup = (__SIGRTMAX - 2);
+static int sigWakeup;
/*
* fdTable holds one entry per file descriptor, up to a certain
@@ -149,6 +149,7 @@
/*
* Setup the signal handler
*/
+ sigWakeup = SIGRTMAX - 2;
sa.sa_handler = sig_wakeup;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
--- old/src/java.base/unix/native/libjava/childproc.c
+++ new/src/java.base/unix/native/libjava/childproc.c
@@ -234,7 +234,13 @@
{
if (envp == NULL || (char **) envp == environ) {
execvp(file, (char **) argv);
- return;
+ // ENOEXEC indicates that the file header was not recognized. The musl C
+ // library does not implement the fallback to /bin/sh for that case, so fall
+ // through to the code below which implements that fallback using
+ // execve_with_shell_fallback.
+ if (errno != ENOEXEC) {
+ return;
+ }
}
if (*file == '\0') {
--- old/src/java.base/unix/native/libjava/jdk_util_md.h
+++ new/src/java.base/unix/native/libjava/jdk_util_md.h
@@ -37,7 +37,7 @@
#define ISNAND(d) isnan(d)
#elif defined(__linux__) || defined(_ALLBSD_SOURCE)
#include <math.h>
-#define ISNANF(f) isnanf(f)
+#define ISNANF(f) isnan(f)
#define ISNAND(d) isnan(d)
#elif defined(_AIX)
#include <math.h>
--- old/src/java.base/unix/native/libjli/java_md_solinux.c
+++ new/src/java.base/unix/native/libjli/java_md_solinux.c
@@ -235,6 +235,39 @@
char *dmllp = NULL;
char *p; /* a utility pointer */
+#ifdef __linux
+#ifndef LIBC
+#error "LIBC not set"
+#endif
+
+ if (strcmp(LIBC, "musl") == 0) {
+ /*
+ * The musl library loader requires LD_LIBRARY_PATH to be set in
+ * order to correctly resolve the dependency libjava.so has on libjvm.so.
+ *
+ * Specifically, it differs from glibc in the sense that even if
+ * libjvm.so has already been loaded it will not be considered a
+ * candidate for resolving the dependency unless the *full* path
+ * of the already loaded library matches the dependency being loaded.
+ *
+ * libjvm.so is being loaded by the launcher using a long path to
+ * dlopen, not just the basename of the library. Typically this
+ * is something like "../lib/server/libjvm.so". However, if/when
+ * libjvm.so later tries to dlopen libjava.so (which it does in
+ * order to get access to a few functions implemented in
+ * libjava.so) the musl loader will, as part of loading
+ * dependent libraries, try to load libjvm.so using only its
+ * basename "libjvm.so". Since this does not match the longer
+ * path path it was first loaded with, the already loaded
+ * library is not considered a candidate, and the loader will
+ * instead look for libjvm.so elsewhere. If it's not in
+ * LD_LIBRARY_PATH the dependency load will fail, and libjava.so
+ * will therefore fail as well.
+ */
+ return JNI_TRUE;
+ }
+#endif
+
#ifdef AIX
/* We always have to set the LIBPATH on AIX because ld doesn't support $ORIGIN. */
return JNI_TRUE;
--- old/src/java.base/unix/native/libnio/ch/NativeThread.c
+++ new/src/java.base/unix/native/libnio/ch/NativeThread.c
@@ -36,7 +36,7 @@
#ifdef __linux__
#include <pthread.h>
/* Also defined in net/linux_close.c */
- #define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
+ #define INTERRUPT_SIGNAL (SIGRTMAX - 2)
#elif defined(_AIX)
#include <pthread.h>
/* Also defined in net/aix_close.c */
--- old/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c
+++ new/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c
@@ -27,9 +27,6 @@
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/Xatom.h>
-#ifdef __linux__
-#include <execinfo.h>
-#endif
#include <jvm.h>
#include <jni.h>
@@ -790,26 +787,6 @@
}
return ret;
}
-
-#ifdef __linux__
-void print_stack(void)
-{
- void *array[10];
- size_t size;
- char **strings;
- size_t i;
-
- size = backtrace (array, 10);
- strings = backtrace_symbols (array, size);
-
- fprintf (stderr, "Obtained %zd stack frames.\n", size);
-
- for (i = 0; i < size; i++)
- fprintf (stderr, "%s\n", strings[i]);
-
- free (strings);
-}
-#endif
Window get_xawt_root_shell(JNIEnv *env) {
static jclass classXRootWindow = NULL;
--- old/src/jdk.jdwp.agent/share/native/libjdwp/util.h
+++ new/src/jdk.jdwp.agent/share/native/libjdwp/util.h
@@ -35,15 +35,15 @@
#ifdef DEBUG
/* Just to make sure these interfaces are not used here. */
#undef free
- #define free(p) Do not use this interface.
+ #define free do_not_use_this_interface_free
#undef malloc
- #define malloc(p) Do not use this interface.
+ #define malloc do_not_use_this_interface_malloc
#undef calloc
- #define calloc(p) Do not use this interface.
+ #define calloc do_not_use_this_interface_calloc
#undef realloc
- #define realloc(p) Do not use this interface.
+ #define realloc do_not_use_this_interface_realloc
#undef strdup
- #define strdup(p) Do not use this interface.
+ #define strdup do_not_use_this_interface_strdup
#endif
#include "log_messages.h"
--- old/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
+++ new/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
@@ -33,6 +33,7 @@
#include <assert.h>
#include <jni.h>
+#include <jvm.h>
#include <alloca.h>
#include <signal.h>
#include <string.h>
@@ -91,6 +92,20 @@
}
}
+int get_java_stacksize () {
+ size_t stacksize;
+ pthread_attr_t attr;
+ JDK1_1InitArgs jdk_args;
+
+ jdk_args.version = JNI_VERSION_1_1;
+ JNI_GetDefaultJavaVMInitArgs(&jdk_args);
+ if (jdk_args.javaStackSize <= 0) {
+ fprintf(stderr, "Test ERROR. Can't get a valid value for the default stacksize.\n");
+ exit(7);
+ }
+ return jdk_args.javaStackSize;
+}
+
void *run_java_overflow (void *p) {
JNIEnv *env;
jclass class_id;
@@ -254,13 +269,19 @@
exit(7);
}
+ int stack_size = get_java_stacksize();
pthread_t thr;
+ pthread_attr_t thread_attr;
+ pthread_attr_init(&thread_attr);
+ pthread_attr_setstacksize(&thread_attr, stack_size);
+
if (argc > 1 && strcmp(argv[1], "test_java_overflow") == 0) {
printf("\nTesting JAVA_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_java_overflow, NULL);
+
+ pthread_create (&thr, &thread_attr, run_java_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
@@ -273,7 +294,7 @@
printf("\nTesting NATIVE_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_native_overflow, NULL);
+ pthread_create (&thr, &thread_attr, run_native_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
--- old/test/jdk/java/lang/ProcessBuilder/Basic.java
+++ new/test/jdk/java/lang/ProcessBuilder/Basic.java
@@ -396,8 +396,8 @@
if (failed != 0) throw new Error("null PATH");
} else if (action.equals("PATH search algorithm")) {
equal(System.getenv("PATH"), "dir1:dir2:");
- check(new File("/bin/true").exists());
- check(new File("/bin/false").exists());
+ check(new File(TrueExe.path()).exists());
+ check(new File(FalseExe.path()).exists());
String[] cmd = {"prog"};
ProcessBuilder pb1 = new ProcessBuilder(cmd);
ProcessBuilder pb2 = new ProcessBuilder(cmd);
@@ -438,13 +438,13 @@
checkPermissionDenied(pb);
// continue searching if EACCES
- copy("/bin/true", "dir2/prog");
+ copy(TrueExe.path(), "dir2/prog");
equal(run(pb).exitValue(), True.exitValue());
new File("dir1/prog").delete();
new File("dir2/prog").delete();
new File("dir2/prog").mkdirs();
- copy("/bin/true", "dir1/prog");
+ copy(TrueExe.path(), "dir1/prog");
equal(run(pb).exitValue(), True.exitValue());
// Check empty PATH component means current directory.
@@ -460,10 +460,10 @@
pb.command(command);
File prog = new File("./prog");
// "Normal" binaries
- copy("/bin/true", "./prog");
+ copy(TrueExe.path(), "./prog");
equal(run(pb).exitValue(),
True.exitValue());
- copy("/bin/false", "./prog");
+ copy(FalseExe.path(), "./prog");
equal(run(pb).exitValue(),
False.exitValue());
prog.delete();
@@ -518,12 +518,12 @@
new File("dir2/prog").delete();
new File("prog").delete();
new File("dir3").mkdirs();
- copy("/bin/true", "dir1/prog");
- copy("/bin/false", "dir3/prog");
+ copy(TrueExe.path(), "dir1/prog");
+ copy(FalseExe.path(), "dir3/prog");
pb.environment().put("PATH","dir3");
equal(run(pb).exitValue(), True.exitValue());
- copy("/bin/true", "dir3/prog");
- copy("/bin/false", "dir1/prog");
+ copy(TrueExe.path(), "dir3/prog");
+ copy(FalseExe.path(), "dir1/prog");
equal(run(pb).exitValue(), False.exitValue());
} finally {
@@ -620,6 +620,13 @@
new File("/bin/false").exists());
}
+ static class BusyBox {
+ public static boolean is() { return is; }
+ private static final boolean is =
+ (! Windows.is() &&
+ new File("/bin/busybox").exists());
+ }
+
static class UnicodeOS {
public static boolean is() { return is; }
private static final String osName = System.getProperty("os.name");
@@ -658,6 +665,45 @@
}
}
+ // On alpine linux, /bin/true and /bin/false are just links to /bin/busybox.
+ // Some tests copy /bin/true and /bin/false to files with a different filename.
+ // However, copying the busbox executable into a file with a different name
+ // won't result in the expected return codes. As workaround, we create
+ // executable files that can be copied and produce the exepected return
+ // values. We use this workaround, if we find the busybox executable.
+
+ private static class TrueExe {
+ public static String path() { return path; }
+ private static final String path = path0();
+ private static String path0(){
+ if (!BusyBox.is()) {
+ return "/bin/true";
+ }
+ else {
+ File trueExe = new File("true");
+ setFileContents(trueExe, "#!/bin/true\n");
+ trueExe.setExecutable(true);
+ return trueExe.getAbsolutePath();
+ }
+ }
+ }
+
+ private static class FalseExe {
+ public static String path() { return path; }
+ private static final String path = path0();
+ private static String path0(){
+ if (!BusyBox.is()) {
+ return "/bin/false";
+ }
+ else {
+ File falseExe = new File("false");
+ setFileContents(falseExe, "#!/bin/false\n");
+ falseExe.setExecutable(true);
+ return falseExe.getAbsolutePath();
+ }
+ }
+ }
+
static class EnglishUnix {
private static final Boolean is =
(! Windows.is() && isEnglish("LANG") && isEnglish("LC_ALL"));
@@ -1961,7 +2007,7 @@
//----------------------------------------------------------------
try {
new File("suBdiR").mkdirs();
- copy("/bin/true", "suBdiR/unliKely");
+ copy(TrueExe.path(), "suBdiR/unliKely");
final ProcessBuilder pb =
new ProcessBuilder(new String[]{"unliKely"});
pb.environment().put("PATH", "suBdiR");
--- old/test/jdk/java/lang/ProcessHandle/InfoTest.java
+++ new/test/jdk/java/lang/ProcessHandle/InfoTest.java
@@ -298,7 +298,14 @@
}
if (info.command().isPresent()) {
String command = info.command().get();
- String expected = Platform.isWindows() ? "sleep.exe" : "sleep";
+ String expected = "sleep";
+ if (Platform.isWindows()) {
+ expected = "sleep.exe";
+ } else if (new File("/bin/busybox").exists()) {
+ // With busybox sleep is just a sym link to busybox.
+ // The busbox executable is seen as ProcessHandle.Info command.
+ expected = "busybox";
+ }
Assert.assertTrue(command.endsWith(expected), "Command: expected: \'" +
expected + "\', actual: " + command);

View File

@ -0,0 +1,15 @@
The alpine builders print out a warning about sched_getaffinity() not working.
This causes the version check for the boot jdk to fail.
Patch the command to determine the version number to ignore any errors and warnings.
--- old/make/autoconf/boot-jdk.m4
+++ new/make/autoconf/boot-jdk.m4
@@ -74,7 +74,7 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java$EXE_SUFFIX" $USER_BOOT_JDK_OPTIONS -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java$EXE_SUFFIX" $USER_BOOT_JDK_OPTIONS -version 2>&1 | $GREP version | $HEAD -n 1`
if [ [[ "$BOOT_JDK_VERSION" =~ "Picked up" ]] ]; then
AC_MSG_NOTICE([You have _JAVA_OPTIONS or JAVA_TOOL_OPTIONS set. This can mess up the build. Please use --with-boot-jdk-jvmargs instead.])
AC_MSG_NOTICE([Java reports: "$BOOT_JDK_VERSION".])

View File

@ -0,0 +1,242 @@
The ucontext_t-Type is somewhat different with musl libc.
Add some precompiler conditions to use the right fields from the struct.
--- old/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
+++ new/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
@@ -47,6 +47,10 @@
#include "opto/intrinsicnode.hpp"
#endif
+#if ! (defined(__GLIBC__) || defined(__UCLIBC__))
+#include <asm/ptrace.h>
+#endif
+
#ifdef PRODUCT
#define BLOCK_COMMENT(str) // nothing
#else
@@ -1290,7 +1294,11 @@
// the safepoing polling page.
ucontext_t* uc = (ucontext_t*) ucontext;
// Set polling address.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address addr = (address)uc->uc_mcontext.regs->gpr[ra] + (ssize_t)ds;
+#else // Musl
+ address addr = (address)uc->uc_mcontext.gp_regs[ra] + (ssize_t) ds;
+#endif
if (polling_address_ptr != NULL) {
*polling_address_ptr = addr;
}
@@ -1353,11 +1361,20 @@
|| (is_stdu(instruction) && rs == 1)) {
int ds = inv_ds_field(instruction);
// return banged address
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return ds+(address)uc->uc_mcontext.regs->gpr[ra];
+#else // Musl
+ return ds+(address)uc->uc_mcontext.gp_regs[ra];
+#endif
} else if (is_stdux(instruction) && rs == 1) {
int rb = inv_rb_field(instruction);
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address sp = (address)uc->uc_mcontext.regs->gpr[1];
long rb_val = (long)uc->uc_mcontext.regs->gpr[rb];
+#else // Musl
+ address sp = (address)uc->uc_mcontext.gp_regs[1];
+ long rb_val = (long)uc->uc_mcontext.gp_regs[rb];
+#endif
return ra != 1 || rb_val >= 0 ? NULL // not a stack bang
: sp + rb_val; // banged address
}
--- old/src/hotspot/cpu/ppc/vm_version_ppc.cpp
+++ new/src/hotspot/cpu/ppc/vm_version_ppc.cpp
@@ -50,6 +50,10 @@
#endif
#endif
+#if ! (defined(__GLIBC__) || defined(__UCLIBC__))
+#include <asm/ptrace.h>
+#endif
+
bool VM_Version::_is_determine_features_test_running = false;
uint64_t VM_Version::_dscr_val = 0;
@@ -892,7 +896,7 @@
unsigned long auxv = getauxval(AT_HWCAP2);
if (auxv & PPC_FEATURE2_HTM_NOSC) {
- if (auxv & PPC_FEATURE2_HAS_HTM) {
+ if (auxv & PPC_FEATURE2_HTM) {
// TM on POWER8 and POWER9 in compat mode (VM) is supported by the JVM.
// TM on POWER9 DD2.1 NV (baremetal) is not supported by the JVM (TM on
// POWER9 DD2.1 NV has a few issues that need a couple of firmware
--- old/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
+++ new/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
@@ -76,7 +76,11 @@
# include <poll.h>
# include <ucontext.h>
+#if ! (defined(__GLIBC__) || defined(__UCLIBC__))
+#include <asm/ptrace.h>
+#endif
+
address os::current_stack_pointer() {
intptr_t* csp;
@@ -108,24 +112,42 @@
// - if uc was filled by getcontext(), it is undefined - getcontext() does not fill
// it because the volatile registers are not needed to make setcontext() work.
// Hopefully it was zero'd out beforehand.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
guarantee(uc->uc_mcontext.regs != NULL, "only use ucontext_get_pc in sigaction context");
return (address)uc->uc_mcontext.regs->nip;
+#else // Musl
+ guarantee(uc->uc_mcontext.gp_regs != NULL, "only use ucontext_get_pc in sigaction context");
+ return (address)uc->uc_mcontext.gp_regs[PT_NIP];
+#endif
}
// modify PC in ucontext.
// Note: Only use this for an ucontext handed down to a signal handler. See comment
// in ucontext_get_pc.
void os::Linux::ucontext_set_pc(ucontext_t * uc, address pc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
guarantee(uc->uc_mcontext.regs != NULL, "only use ucontext_set_pc in sigaction context");
uc->uc_mcontext.regs->nip = (unsigned long)pc;
+#else // Musl
+ guarantee(uc->uc_mcontext.gp_regs != NULL, "only use ucontext_set_pc in sigaction context");
+ uc->uc_mcontext.gp_regs[PT_NIP] = (unsigned long)pc;
+#endif
}
static address ucontext_get_lr(const ucontext_t * uc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return (address)uc->uc_mcontext.regs->link;
+#else // Musl
+ return (address)uc->uc_mcontext.gp_regs[PT_LNK];
+#endif
}
intptr_t* os::Linux::ucontext_get_sp(const ucontext_t * uc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return (intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/];
+#else // Musl
+ return (intptr_t*)uc->uc_mcontext.gp_regs[1/*REG_SP*/];
+#endif
}
intptr_t* os::Linux::ucontext_get_fp(const ucontext_t * uc) {
@@ -133,7 +155,11 @@
}
static unsigned long ucontext_get_trap(const ucontext_t * uc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return uc->uc_mcontext.regs->trap;
+#else // Musl
+ return uc->uc_mcontext.gp_regs[PT_TRAP];
+#endif
}
ExtendedPC os::fetch_frame_from_context(const void* ucVoid,
@@ -259,7 +285,11 @@
// 3.2.1 "Machine State Register"), however note that ISA notation for bit
// numbering is MSB 0, so for normal bit numbering (LSB 0) they come to be
// bits 33 and 34. It's not related to endianness, just a notation matter.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
if (second_uc->uc_mcontext.regs->msr & 0x600000000) {
+#else // Musl
+ if (second_uc->uc_mcontext.gp_regs[PT_MSR] & 0x600000000) {
+#endif
if (TraceTraps) {
tty->print_cr("caught signal in transaction, "
"ignoring to jump to abort handler");
@@ -570,6 +600,7 @@
const ucontext_t* uc = (const ucontext_t*)context;
st->print_cr("Registers:");
+#if defined(__GLIBC__) || defined(__UCLIBC__)
st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->nip);
st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->link);
st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.regs->ctr);
@@ -578,8 +609,18 @@
st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.regs->gpr[i]);
if (i % 3 == 2) st->cr();
}
+#else // Musl
+ st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[PT_NIP]);
+ st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[PT_LNK]);
+ st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[PT_CTR]);
st->cr();
+ for (int i = 0; i < 32; i++) {
+ st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.gp_regs[i]);
+ if (i % 3 == 2) st->cr();
+ }
+#endif
st->cr();
+ st->cr();
intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);
st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", p2i(sp));
@@ -602,12 +643,22 @@
st->print_cr("Register to memory mapping:");
st->cr();
+#if defined(__GLIBC__) || defined(__UCLIBC__)
st->print("pc ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->nip);
st->print("lr ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->link);
st->print("ctr ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->ctr);
+#else // Musl
+ st->print("pc ="); print_location(st, (intptr_t)uc->uc_mcontext.gp_regs[PT_NIP]);
+ st->print("lr ="); print_location(st, (intptr_t)uc->uc_mcontext.gp_regs[PT_LNK]);
+ st->print("ctr ="); print_location(st, (intptr_t)uc->uc_mcontext.gp_regs[PT_CTR]);
+#endif
for (int i = 0; i < 32; i++) {
st->print("r%-2d=", i);
+#if defined(__GLIBC__) || defined(__UCLIBC__)
print_location(st, uc->uc_mcontext.regs->gpr[i]);
+#else // Musl
+ print_location(st, uc->uc_mcontext.gp_regs[i]);
+#endif
}
st->cr();
}
--- old/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp
+++ new/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp
@@ -27,6 +27,10 @@
#include "runtime/frame.inline.hpp"
#include "runtime/thread.hpp"
+#if ! (defined(__GLIBC__) || defined(__UCLIBC__))
+#include <asm/ptrace.h>
+#endif
+
frame JavaThread::pd_last_frame() {
assert(has_last_Java_frame(), "must have last_Java_sp() when suspended");
@@ -56,8 +60,13 @@
// if we were running Java code when SIGPROF came in.
if (isInJava) {
ucontext_t* uc = (ucontext_t*) ucontext;
+#if defined(__GLIBC__) || defined(__UCLIBC__)
frame ret_frame((intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/],
(address)uc->uc_mcontext.regs->nip);
+#else // Musl
+ frame ret_frame((intptr_t*)uc->uc_mcontext.gp_regs[1/*REG_SP*/],
+ (address)uc->uc_mcontext.gp_regs[PT_NIP]);
+#endif
if (ret_frame.pc() == NULL) {
// ucontext wasn't useful
@@ -69,7 +78,11 @@
if (MetaspaceObj::is_valid((Method*)(istate->method)) == false) {
return false;
}
+#if defined(__GLIBC__) || defined(__UCLIBC__)
uint64_t reg_bcp = uc->uc_mcontext.regs->gpr[14/*R14_bcp*/];
+#else // Musl
+ uint64_t reg_bcp = uc->uc_mcontext.gp_regs[14/*R14_bcp*/];
+#endif
uint64_t istate_bcp = istate->bcp;
uint64_t code_start = (uint64_t)(((Method*)(istate->method))->code_base());
uint64_t code_end = (uint64_t)(((Method*)istate->method)->code_base() + ((Method*)istate->method)->code_size());

View File

@ -0,0 +1,13 @@
The header is not present with musl and including is not needed
--- old/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
+++ new/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
@@ -74,7 +74,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-# include <fpu_control.h>
#define REG_FP 29
#define REG_LR 30

View File

@ -0,0 +1,510 @@
This patch contains mainly code from the portola project.
Adopted, enhanced and fixed so that it actually compiles with alpine.
--- old/make/ReleaseFile.gmk
+++ new/make/ReleaseFile.gmk
@@ -53,6 +53,7 @@
$(call info-file-item, "JAVA_VERSION_DATE", "$(VERSION_DATE)")
$(call info-file-item, "OS_NAME", "$(RELEASE_FILE_OS_NAME)")
$(call info-file-item, "OS_ARCH", "$(RELEASE_FILE_OS_ARCH)")
+ $(call info-file-item, "LIBC", "musl")
endef
# Param 1 - The file containing the MODULES list
--- old/make/hotspot/lib/CompileJvm.gmk
+++ new/make/hotspot/lib/CompileJvm.gmk
@@ -73,6 +73,7 @@
-DHOTSPOT_BUILD_USER='"$(USERNAME)"' \
-DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"' \
-DCPU='"$(OPENJDK_TARGET_CPU_VM_VERSION)"' \
+ -DLIBC='"musl"' \
#
################################################################################
--- old/make/lib/CoreLibraries.gmk
+++ new/make/lib/CoreLibraries.gmk
@@ -190,6 +190,7 @@
endif
LIBJLI_CFLAGS += $(LIBZ_CFLAGS)
+LIBJLI_CFLAGS += -DLIBC=\"musl\"
ifneq ($(USE_EXTERNAL_LIBZ), true)
LIBJLI_EXTRA_FILES += \
--- old/src/hotspot/os/linux/os_linux.cpp
+++ new/src/hotspot/os/linux/os_linux.cpp
@@ -102,7 +102,6 @@
# include <string.h>
# include <syscall.h>
# include <sys/sysinfo.h>
-# include <gnu/libc-version.h>
# include <sys/ipc.h>
# include <sys/shm.h>
# include <link.h>
@@ -597,6 +596,11 @@
// detecting pthread library
void os::Linux::libpthread_init() {
+#if !defined(__GLIBC__) && !defined(__UCLIBC__)
+ // Hard code Alpine Linux supported musl compatible settings
+ os::Linux::set_glibc_version("glibc 2.9");
+ os::Linux::set_libpthread_version("NPTL");
+#else
// Save glibc and pthread version strings.
#if !defined(_CS_GNU_LIBC_VERSION) || \
!defined(_CS_GNU_LIBPTHREAD_VERSION)
@@ -614,6 +618,7 @@
str = (char *)malloc(n, mtInternal);
confstr(_CS_GNU_LIBPTHREAD_VERSION, str, n);
os::Linux::set_libpthread_version(str);
+#endif
}
/////////////////////////////////////////////////////////////////////////////
@@ -3117,20 +3122,36 @@
extern "C" JNIEXPORT void numa_warn(int number, char *where, ...) { }
extern "C" JNIEXPORT void numa_error(char *where) { }
+static void* dlvsym_if_available(void* handle, const char* name, const char* version) {
+ typedef void* (*dlvsym_func_type)(void* handle, const char* name, const char* version);
+ static dlvsym_func_type dlvsym_func;
+ static bool initialized = false;
+
+ if (!initialized) {
+ dlvsym_func = (dlvsym_func_type)dlsym(RTLD_NEXT, "dlvsym");
+ initialized = true;
+ }
+
+ if (dlvsym_func != NULL) {
+ void *f = dlvsym_func(handle, name, version);
+ if (f != NULL) {
+ return f;
+ }
+ }
+
+ return dlsym(handle, name);
+}
+
// Handle request to load libnuma symbol version 1.1 (API v1). If it fails
// load symbol from base version instead.
void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
- void *f = dlvsym(handle, name, "libnuma_1.1");
- if (f == NULL) {
- f = dlsym(handle, name);
- }
- return f;
+ return dlvsym_if_available(handle, name, "libnuma_1.1");
}
// Handle request to load libnuma symbol version 1.2 (API v2) only.
// Return NULL if the symbol is not defined in this particular version.
void* os::Linux::libnuma_v2_dlsym(void* handle, const char* name) {
- return dlvsym(handle, name, "libnuma_1.2");
+ return dlvsym_if_available(handle, name, "libnuma_1.2");
}
bool os::Linux::libnuma_init() {
--- old/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
+++ new/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
@@ -75,9 +75,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-#ifndef AMD64
-# include <fpu_control.h>
-#endif
#ifdef AMD64
#define REG_SP REG_RSP
--- old/src/hotspot/share/gc/shared/genCollectedHeap.cpp
+++ new/src/hotspot/share/gc/shared/genCollectedHeap.cpp
@@ -1116,7 +1116,7 @@
static ScratchBlock *removeSmallestScratch(ScratchBlock **prev_ptr) {
bool first = true;
size_t min_size = 0; // "first" makes this conceptually infinite.
- ScratchBlock **smallest_ptr, *smallest;
+ ScratchBlock **smallest_ptr = NULL, *smallest;
ScratchBlock *cur = *prev_ptr;
while (cur) {
assert(*prev_ptr == cur, "just checking");
--- old/src/hotspot/share/utilities/globalDefinitions_gcc.hpp
+++ new/src/hotspot/share/utilities/globalDefinitions_gcc.hpp
@@ -204,7 +204,7 @@
#elif defined(__APPLE__)
inline int g_isnan(double f) { return isnan(f); }
#elif defined(LINUX) || defined(_ALLBSD_SOURCE)
-inline int g_isnan(float f) { return isnanf(f); }
+inline int g_isnan(float f) { return isnan(f); }
inline int g_isnan(double f) { return isnan(f); }
#else
#error "missing platform-specific definition here"
--- old/src/java.base/linux/native/libnet/linux_close.c
+++ new/src/java.base/linux/native/libnet/linux_close.c
@@ -60,7 +60,7 @@
/*
* Signal to unblock thread
*/
-static int sigWakeup = (__SIGRTMAX - 2);
+static int sigWakeup;
/*
* fdTable holds one entry per file descriptor, up to a certain
@@ -149,6 +149,7 @@
/*
* Setup the signal handler
*/
+ sigWakeup = SIGRTMAX - 2;
sa.sa_handler = sig_wakeup;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
--- old/src/java.base/unix/native/libjava/childproc.c
+++ new/src/java.base/unix/native/libjava/childproc.c
@@ -235,7 +235,13 @@
{
if (envp == NULL || (char **) envp == environ) {
execvp(file, (char **) argv);
- return;
+ // ENOEXEC indicates that the file header was not recognized. The musl C
+ // library does not implement the fallback to /bin/sh for that case, so fall
+ // through to the code below which implements that fallback using
+ // execve_with_shell_fallback.
+ if (errno != ENOEXEC) {
+ return;
+ }
}
if (*file == '\0') {
--- old/src/java.base/unix/native/libjava/jdk_util_md.h
+++ new/src/java.base/unix/native/libjava/jdk_util_md.h
@@ -37,7 +37,7 @@
#define ISNAND(d) isnan(d)
#elif defined(__linux__) || defined(_ALLBSD_SOURCE)
#include <math.h>
-#define ISNANF(f) isnanf(f)
+#define ISNANF(f) isnan(f)
#define ISNAND(d) isnan(d)
#elif defined(_AIX)
#include <math.h>
--- old/src/java.base/unix/native/libjli/java_md_solinux.c
+++ new/src/java.base/unix/native/libjli/java_md_solinux.c
@@ -236,6 +236,39 @@
char *dmllp = NULL;
char *p; /* a utility pointer */
+#ifdef __linux
+#ifndef LIBC
+#error "LIBC not set"
+#endif
+
+ if (strcmp(LIBC, "musl") == 0) {
+ /*
+ * The musl library loader requires LD_LIBRARY_PATH to be set in
+ * order to correctly resolve the dependency libjava.so has on libjvm.so.
+ *
+ * Specifically, it differs from glibc in the sense that even if
+ * libjvm.so has already been loaded it will not be considered a
+ * candidate for resolving the dependency unless the *full* path
+ * of the already loaded library matches the dependency being loaded.
+ *
+ * libjvm.so is being loaded by the launcher using a long path to
+ * dlopen, not just the basename of the library. Typically this
+ * is something like "../lib/server/libjvm.so". However, if/when
+ * libjvm.so later tries to dlopen libjava.so (which it does in
+ * order to get access to a few functions implemented in
+ * libjava.so) the musl loader will, as part of loading
+ * dependent libraries, try to load libjvm.so using only its
+ * basename "libjvm.so". Since this does not match the longer
+ * path path it was first loaded with, the already loaded
+ * library is not considered a candidate, and the loader will
+ * instead look for libjvm.so elsewhere. If it's not in
+ * LD_LIBRARY_PATH the dependency load will fail, and libjava.so
+ * will therefore fail as well.
+ */
+ return JNI_TRUE;
+ }
+#endif
+
#ifdef AIX
/* We always have to set the LIBPATH on AIX because ld doesn't support $ORIGIN. */
return JNI_TRUE;
--- old/src/java.base/unix/native/libnio/ch/NativeThread.c
+++ new/src/java.base/unix/native/libnio/ch/NativeThread.c
@@ -36,7 +36,7 @@
#ifdef __linux__
#include <pthread.h>
/* Also defined in net/linux_close.c */
- #define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
+ #define INTERRUPT_SIGNAL (SIGRTMAX - 2)
#elif defined(_AIX)
#include <pthread.h>
/* Also defined in net/aix_close.c */
--- old/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c
+++ new/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c
@@ -27,9 +27,6 @@
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/Xatom.h>
-#ifdef __linux__
-#include <execinfo.h>
-#endif
#include <jvm.h>
#include <jni.h>
@@ -779,26 +776,6 @@
}
return ret;
}
-
-#ifdef __linux__
-void print_stack(void)
-{
- void *array[10];
- size_t size;
- char **strings;
- size_t i;
-
- size = backtrace (array, 10);
- strings = backtrace_symbols (array, size);
-
- fprintf (stderr, "Obtained %zd stack frames.\n", size);
-
- for (i = 0; i < size; i++)
- fprintf (stderr, "%s\n", strings[i]);
-
- free (strings);
-}
-#endif
Window get_xawt_root_shell(JNIEnv *env) {
static jclass classXRootWindow = NULL;
--- old/src/jdk.jdwp.agent/share/native/libjdwp/util.h
+++ new/src/jdk.jdwp.agent/share/native/libjdwp/util.h
@@ -35,15 +35,15 @@
#ifdef DEBUG
/* Just to make sure these interfaces are not used here. */
#undef free
- #define free(p) Do not use this interface.
+ #define free do_not_use_this_interface_free
#undef malloc
- #define malloc(p) Do not use this interface.
+ #define malloc do_not_use_this_interface_malloc
#undef calloc
- #define calloc(p) Do not use this interface.
+ #define calloc do_not_use_this_interface_calloc
#undef realloc
- #define realloc(p) Do not use this interface.
+ #define realloc do_not_use_this_interface_realloc
#undef strdup
- #define strdup(p) Do not use this interface.
+ #define strdup do_not_use_this_interface_strdup
#endif
#include "log_messages.h"
--- old/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
+++ new/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
@@ -33,6 +33,7 @@
#include <assert.h>
#include <jni.h>
+#include <jvm.h>
#include <alloca.h>
#include <signal.h>
#include <string.h>
@@ -91,6 +92,20 @@
}
}
+int get_java_stacksize () {
+ size_t stacksize;
+ pthread_attr_t attr;
+ JDK1_1InitArgs jdk_args;
+
+ jdk_args.version = JNI_VERSION_1_1;
+ JNI_GetDefaultJavaVMInitArgs(&jdk_args);
+ if (jdk_args.javaStackSize <= 0) {
+ fprintf(stderr, "Test ERROR. Can't get a valid value for the default stacksize.\n");
+ exit(7);
+ }
+ return jdk_args.javaStackSize;
+}
+
void *run_java_overflow (void *p) {
JNIEnv *env;
jclass class_id;
@@ -254,13 +269,19 @@
exit(7);
}
+ int stack_size = get_java_stacksize();
pthread_t thr;
+ pthread_attr_t thread_attr;
+ pthread_attr_init(&thread_attr);
+ pthread_attr_setstacksize(&thread_attr, stack_size);
+
if (argc > 1 && strcmp(argv[1], "test_java_overflow") == 0) {
printf("\nTesting JAVA_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_java_overflow, NULL);
+
+ pthread_create (&thr, &thread_attr, run_java_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
@@ -273,7 +294,7 @@
printf("\nTesting NATIVE_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_native_overflow, NULL);
+ pthread_create (&thr, &thread_attr, run_native_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
--- old/test/jdk/java/lang/ProcessBuilder/Basic.java
+++ new/test/jdk/java/lang/ProcessBuilder/Basic.java
@@ -396,8 +396,8 @@
if (failed != 0) throw new Error("null PATH");
} else if (action.equals("PATH search algorithm")) {
equal(System.getenv("PATH"), "dir1:dir2:");
- check(new File("/bin/true").exists());
- check(new File("/bin/false").exists());
+ check(new File(TrueExe.path()).exists());
+ check(new File(FalseExe.path()).exists());
String[] cmd = {"prog"};
ProcessBuilder pb1 = new ProcessBuilder(cmd);
ProcessBuilder pb2 = new ProcessBuilder(cmd);
@@ -438,13 +438,13 @@
checkPermissionDenied(pb);
// continue searching if EACCES
- copy("/bin/true", "dir2/prog");
+ copy(TrueExe.path(), "dir2/prog");
equal(run(pb).exitValue(), True.exitValue());
new File("dir1/prog").delete();
new File("dir2/prog").delete();
new File("dir2/prog").mkdirs();
- copy("/bin/true", "dir1/prog");
+ copy(TrueExe.path(), "dir1/prog");
equal(run(pb).exitValue(), True.exitValue());
// Check empty PATH component means current directory.
@@ -460,10 +460,10 @@
pb.command(command);
File prog = new File("./prog");
// "Normal" binaries
- copy("/bin/true", "./prog");
+ copy(TrueExe.path(), "./prog");
equal(run(pb).exitValue(),
True.exitValue());
- copy("/bin/false", "./prog");
+ copy(FalseExe.path(), "./prog");
equal(run(pb).exitValue(),
False.exitValue());
prog.delete();
@@ -518,12 +518,12 @@
new File("dir2/prog").delete();
new File("prog").delete();
new File("dir3").mkdirs();
- copy("/bin/true", "dir1/prog");
- copy("/bin/false", "dir3/prog");
+ copy(TrueExe.path(), "dir1/prog");
+ copy(FalseExe.path(), "dir3/prog");
pb.environment().put("PATH","dir3");
equal(run(pb).exitValue(), True.exitValue());
- copy("/bin/true", "dir3/prog");
- copy("/bin/false", "dir1/prog");
+ copy(TrueExe.path(), "dir3/prog");
+ copy(FalseExe.path(), "dir1/prog");
equal(run(pb).exitValue(), False.exitValue());
} finally {
@@ -620,6 +620,13 @@
new File("/bin/false").exists());
}
+ static class BusyBox {
+ public static boolean is() { return is; }
+ private static final boolean is =
+ (! Windows.is() &&
+ new File("/bin/busybox").exists());
+ }
+
static class UnicodeOS {
public static boolean is() { return is; }
private static final String osName = System.getProperty("os.name");
@@ -658,6 +665,45 @@
}
}
+ // On alpine linux, /bin/true and /bin/false are just links to /bin/busybox.
+ // Some tests copy /bin/true and /bin/false to files with a different filename.
+ // However, copying the busbox executable into a file with a different name
+ // won't result in the expected return codes. As workaround, we create
+ // executable files that can be copied and produce the exepected return
+ // values. We use this workaround, if we find the busybox executable.
+
+ private static class TrueExe {
+ public static String path() { return path; }
+ private static final String path = path0();
+ private static String path0(){
+ if (!BusyBox.is()) {
+ return "/bin/true";
+ }
+ else {
+ File trueExe = new File("true");
+ setFileContents(trueExe, "#!/bin/true\n");
+ trueExe.setExecutable(true);
+ return trueExe.getAbsolutePath();
+ }
+ }
+ }
+
+ private static class FalseExe {
+ public static String path() { return path; }
+ private static final String path = path0();
+ private static String path0(){
+ if (!BusyBox.is()) {
+ return "/bin/false";
+ }
+ else {
+ File falseExe = new File("false");
+ setFileContents(falseExe, "#!/bin/false\n");
+ falseExe.setExecutable(true);
+ return falseExe.getAbsolutePath();
+ }
+ }
+ }
+
static class EnglishUnix {
private static final Boolean is =
(! Windows.is() && isEnglish("LANG") && isEnglish("LC_ALL"));
@@ -1961,7 +2007,7 @@
//----------------------------------------------------------------
try {
new File("suBdiR").mkdirs();
- copy("/bin/true", "suBdiR/unliKely");
+ copy(TrueExe.path(), "suBdiR/unliKely");
final ProcessBuilder pb =
new ProcessBuilder(new String[]{"unliKely"});
pb.environment().put("PATH", "suBdiR");
--- old/test/jdk/java/lang/ProcessHandle/InfoTest.java
+++ new/test/jdk/java/lang/ProcessHandle/InfoTest.java
@@ -298,7 +298,14 @@
}
if (info.command().isPresent()) {
String command = info.command().get();
- String expected = Platform.isWindows() ? "sleep.exe" : "sleep";
+ String expected = "sleep";
+ if (Platform.isWindows()) {
+ expected = "sleep.exe";
+ } else if (new File("/bin/busybox").exists()) {
+ // With busybox sleep is just a sym link to busybox.
+ // The busbox executable is seen as ProcessHandle.Info command.
+ expected = "busybox";
+ }
Assert.assertTrue(command.endsWith(expected), "Command: expected: \'" +
expected + "\', actual: " + command);

View File

@ -0,0 +1,15 @@
The alpine builders print out a warning about sched_getaffinity() not working.
This causes the version check for the boot jdk to fail.
Patch the command to determine the version number to ignore any errors and warnings.
--- old/make/autoconf/boot-jdk.m4
+++ new/make/autoconf/boot-jdk.m4
@@ -74,7 +74,7 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java$EXE_SUFFIX" $USER_BOOT_JDK_OPTIONS -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java$EXE_SUFFIX" $USER_BOOT_JDK_OPTIONS -version 2>&1 | $GREP version | $HEAD -n 1`
if [ [[ "$BOOT_JDK_VERSION" =~ "Picked up" ]] ]; then
AC_MSG_NOTICE([You have _JAVA_OPTIONS or JAVA_TOOL_OPTIONS set. This can mess up the build. Please use --with-boot-jdk-jvmargs instead.])
AC_MSG_NOTICE([Java reports: "$BOOT_JDK_VERSION".])

View File

@ -0,0 +1,242 @@
The ucontext_t-Type is somewhat different with musl libc.
Add some precompiler conditions to use the right fields from the struct.
--- old/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
+++ new/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
@@ -48,6 +48,10 @@
#include "opto/intrinsicnode.hpp"
#endif
+#if ! (defined(__GLIBC__) || defined(__UCLIBC__))
+#include <asm/ptrace.h>
+#endif
+
#ifdef PRODUCT
#define BLOCK_COMMENT(str) // nothing
#else
@@ -1291,7 +1295,11 @@
// the safepoing polling page.
ucontext_t* uc = (ucontext_t*) ucontext;
// Set polling address.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address addr = (address)uc->uc_mcontext.regs->gpr[ra] + (ssize_t)ds;
+#else // Musl
+ address addr = (address)uc->uc_mcontext.gp_regs[ra] + (ssize_t) ds;
+#endif
if (polling_address_ptr != NULL) {
*polling_address_ptr = addr;
}
@@ -1354,11 +1362,20 @@
|| (is_stdu(instruction) && rs == 1)) {
int ds = inv_ds_field(instruction);
// return banged address
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return ds+(address)uc->uc_mcontext.regs->gpr[ra];
+#else // Musl
+ return ds+(address)uc->uc_mcontext.gp_regs[ra];
+#endif
} else if (is_stdux(instruction) && rs == 1) {
int rb = inv_rb_field(instruction);
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address sp = (address)uc->uc_mcontext.regs->gpr[1];
long rb_val = (long)uc->uc_mcontext.regs->gpr[rb];
+#else // Musl
+ address sp = (address)uc->uc_mcontext.gp_regs[1];
+ long rb_val = (long)uc->uc_mcontext.gp_regs[rb];
+#endif
return ra != 1 || rb_val >= 0 ? NULL // not a stack bang
: sp + rb_val; // banged address
}
--- old/src/hotspot/cpu/ppc/vm_version_ppc.cpp
+++ new/src/hotspot/cpu/ppc/vm_version_ppc.cpp
@@ -50,6 +50,10 @@
#endif
#endif
+#if ! (defined(__GLIBC__) || defined(__UCLIBC__))
+#include <asm/ptrace.h>
+#endif
+
bool VM_Version::_is_determine_features_test_running = false;
uint64_t VM_Version::_dscr_val = 0;
@@ -896,7 +900,7 @@
unsigned long auxv = getauxval(AT_HWCAP2);
if (auxv & PPC_FEATURE2_HTM_NOSC) {
- if (auxv & PPC_FEATURE2_HAS_HTM) {
+ if (auxv & PPC_FEATURE2_HTM) {
// TM on POWER8 and POWER9 in compat mode (VM) is supported by the JVM.
// TM on POWER9 DD2.1 NV (baremetal) is not supported by the JVM (TM on
// POWER9 DD2.1 NV has a few issues that need a couple of firmware
--- old/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
+++ new/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
@@ -76,7 +76,11 @@
# include <poll.h>
# include <ucontext.h>
+#if ! (defined(__GLIBC__) || defined(__UCLIBC__))
+#include <asm/ptrace.h>
+#endif
+
address os::current_stack_pointer() {
intptr_t* csp;
@@ -108,24 +112,42 @@
// - if uc was filled by getcontext(), it is undefined - getcontext() does not fill
// it because the volatile registers are not needed to make setcontext() work.
// Hopefully it was zero'd out beforehand.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
guarantee(uc->uc_mcontext.regs != NULL, "only use ucontext_get_pc in sigaction context");
return (address)uc->uc_mcontext.regs->nip;
+#else // Musl
+ guarantee(uc->uc_mcontext.gp_regs != NULL, "only use ucontext_get_pc in sigaction context");
+ return (address)uc->uc_mcontext.gp_regs[PT_NIP];
+#endif
}
// modify PC in ucontext.
// Note: Only use this for an ucontext handed down to a signal handler. See comment
// in ucontext_get_pc.
void os::Linux::ucontext_set_pc(ucontext_t * uc, address pc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
guarantee(uc->uc_mcontext.regs != NULL, "only use ucontext_set_pc in sigaction context");
uc->uc_mcontext.regs->nip = (unsigned long)pc;
+#else // Musl
+ guarantee(uc->uc_mcontext.gp_regs != NULL, "only use ucontext_set_pc in sigaction context");
+ uc->uc_mcontext.gp_regs[PT_NIP] = (unsigned long)pc;
+#endif
}
static address ucontext_get_lr(const ucontext_t * uc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return (address)uc->uc_mcontext.regs->link;
+#else // Musl
+ return (address)uc->uc_mcontext.gp_regs[PT_LNK];
+#endif
}
intptr_t* os::Linux::ucontext_get_sp(const ucontext_t * uc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return (intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/];
+#else // Musl
+ return (intptr_t*)uc->uc_mcontext.gp_regs[1/*REG_SP*/];
+#endif
}
intptr_t* os::Linux::ucontext_get_fp(const ucontext_t * uc) {
@@ -133,7 +155,11 @@
}
static unsigned long ucontext_get_trap(const ucontext_t * uc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return uc->uc_mcontext.regs->trap;
+#else // Musl
+ return uc->uc_mcontext.gp_regs[PT_TRAP];
+#endif
}
ExtendedPC os::fetch_frame_from_context(const void* ucVoid,
@@ -259,7 +285,11 @@
// 3.2.1 "Machine State Register"), however note that ISA notation for bit
// numbering is MSB 0, so for normal bit numbering (LSB 0) they come to be
// bits 33 and 34. It's not related to endianness, just a notation matter.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
if (second_uc->uc_mcontext.regs->msr & 0x600000000) {
+#else // Musl
+ if (second_uc->uc_mcontext.gp_regs[PT_MSR] & 0x600000000) {
+#endif
if (TraceTraps) {
tty->print_cr("caught signal in transaction, "
"ignoring to jump to abort handler");
@@ -588,6 +618,7 @@
const ucontext_t* uc = (const ucontext_t*)context;
st->print_cr("Registers:");
+#if defined(__GLIBC__) || defined(__UCLIBC__)
st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->nip);
st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->link);
st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.regs->ctr);
@@ -596,8 +627,18 @@
st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.regs->gpr[i]);
if (i % 3 == 2) st->cr();
}
+#else // Musl
+ st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[PT_NIP]);
+ st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[PT_LNK]);
+ st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[PT_CTR]);
st->cr();
+ for (int i = 0; i < 32; i++) {
+ st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.gp_regs[i]);
+ if (i % 3 == 2) st->cr();
+ }
+#endif
st->cr();
+ st->cr();
intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);
st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", p2i(sp));
@@ -620,12 +661,22 @@
st->print_cr("Register to memory mapping:");
st->cr();
+#if defined(__GLIBC__) || defined(__UCLIBC__)
st->print("pc ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->nip);
st->print("lr ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->link);
st->print("ctr ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->ctr);
+#else // Musl
+ st->print("pc ="); print_location(st, (intptr_t)uc->uc_mcontext.gp_regs[PT_NIP]);
+ st->print("lr ="); print_location(st, (intptr_t)uc->uc_mcontext.gp_regs[PT_LNK]);
+ st->print("ctr ="); print_location(st, (intptr_t)uc->uc_mcontext.gp_regs[PT_CTR]);
+#endif
for (int i = 0; i < 32; i++) {
st->print("r%-2d=", i);
+#if defined(__GLIBC__) || defined(__UCLIBC__)
print_location(st, uc->uc_mcontext.regs->gpr[i]);
+#else // Musl
+ print_location(st, uc->uc_mcontext.gp_regs[i]);
+#endif
}
st->cr();
}
--- old/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp
+++ new/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp
@@ -27,6 +27,10 @@
#include "runtime/frame.inline.hpp"
#include "runtime/thread.hpp"
+#if ! (defined(__GLIBC__) || defined(__UCLIBC__))
+#include <asm/ptrace.h>
+#endif
+
frame JavaThread::pd_last_frame() {
assert(has_last_Java_frame(), "must have last_Java_sp() when suspended");
@@ -56,8 +60,13 @@
// if we were running Java code when SIGPROF came in.
if (isInJava) {
ucontext_t* uc = (ucontext_t*) ucontext;
+#if defined(__GLIBC__) || defined(__UCLIBC__)
frame ret_frame((intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/],
(address)uc->uc_mcontext.regs->nip);
+#else // Musl
+ frame ret_frame((intptr_t*)uc->uc_mcontext.gp_regs[1/*REG_SP*/],
+ (address)uc->uc_mcontext.gp_regs[PT_NIP]);
+#endif
if (ret_frame.pc() == NULL) {
// ucontext wasn't useful
@@ -70,7 +79,11 @@
if (!Method::is_valid_method(m)) return false;
if (!Metaspace::contains(m->constMethod())) return false;
+#if defined(__GLIBC__) || defined(__UCLIBC__)
uint64_t reg_bcp = uc->uc_mcontext.regs->gpr[14/*R14_bcp*/];
+#else // Musl
+ uint64_t reg_bcp = uc->uc_mcontext.gp_regs[14/*R14_bcp*/];
+#endif
uint64_t istate_bcp = istate->bcp;
uint64_t code_start = (uint64_t)(m->code_base());
uint64_t code_end = (uint64_t)(m->code_base() + m->code_size());

View File

@ -0,0 +1,12 @@
The header is not present with musl and including is not needed
--- old/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
+++ new/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
@@ -75,7 +75,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-# include <fpu_control.h>
#define REG_FP 29
#define REG_LR 30

View File

@ -0,0 +1,500 @@
This patch contains mainly code from the portola project.
Adopted, enhanced and fixed so that it actually compiles with alpine.
--- old/make/ReleaseFile.gmk
+++ new/make/ReleaseFile.gmk
@@ -53,6 +53,7 @@
$(call info-file-item, "JAVA_VERSION_DATE", "$(VERSION_DATE)")
$(call info-file-item, "OS_NAME", "$(RELEASE_FILE_OS_NAME)")
$(call info-file-item, "OS_ARCH", "$(RELEASE_FILE_OS_ARCH)")
+ $(call info-file-item, "LIBC", "musl")
endef
# Param 1 - The file containing the MODULES list
--- old/make/hotspot/lib/CompileJvm.gmk
+++ new/make/hotspot/lib/CompileJvm.gmk
@@ -68,6 +68,7 @@
-DHOTSPOT_BUILD_USER='"$(USERNAME)"' \
-DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"' \
-DCPU='"$(OPENJDK_TARGET_CPU_VM_VERSION)"' \
+ -DLIBC='"musl"' \
#
ifneq ($(HOTSPOT_BUILD_TIME), )
--- old/make/modules/java.base/lib/CoreLibraries.gmk
+++ new/make/modules/java.base/lib/CoreLibraries.gmk
@@ -183,6 +183,7 @@
endif
LIBJLI_CFLAGS += $(LIBZ_CFLAGS)
+LIBJLI_CFLAGS += -DLIBC=\"musl\"
ifneq ($(USE_EXTERNAL_LIBZ), true)
LIBJLI_EXTRA_FILES += \
--- old/src/hotspot/os/linux/os_linux.cpp
+++ new/src/hotspot/os/linux/os_linux.cpp
@@ -103,7 +103,6 @@
# include <string.h>
# include <syscall.h>
# include <sys/sysinfo.h>
-# include <gnu/libc-version.h>
# include <sys/ipc.h>
# include <sys/shm.h>
# include <link.h>
@@ -600,6 +599,11 @@
// detecting pthread library
void os::Linux::libpthread_init() {
+#if !defined(__GLIBC__) && !defined(__UCLIBC__)
+ // Hard code Alpine Linux supported musl compatible settings
+ os::Linux::set_glibc_version("glibc 2.9");
+ os::Linux::set_libpthread_version("NPTL");
+#else
// Save glibc and pthread version strings.
#if !defined(_CS_GNU_LIBC_VERSION) || \
!defined(_CS_GNU_LIBPTHREAD_VERSION)
@@ -617,6 +621,7 @@
str = (char *)malloc(n, mtInternal);
confstr(_CS_GNU_LIBPTHREAD_VERSION, str, n);
os::Linux::set_libpthread_version(str);
+#endif
}
/////////////////////////////////////////////////////////////////////////////
@@ -3195,20 +3200,36 @@
extern "C" JNIEXPORT void numa_warn(int number, char *where, ...) { }
extern "C" JNIEXPORT void numa_error(char *where) { }
+static void* dlvsym_if_available(void* handle, const char* name, const char* version) {
+ typedef void* (*dlvsym_func_type)(void* handle, const char* name, const char* version);
+ static dlvsym_func_type dlvsym_func;
+ static bool initialized = false;
+
+ if (!initialized) {
+ dlvsym_func = (dlvsym_func_type)dlsym(RTLD_NEXT, "dlvsym");
+ initialized = true;
+ }
+
+ if (dlvsym_func != NULL) {
+ void *f = dlvsym_func(handle, name, version);
+ if (f != NULL) {
+ return f;
+ }
+ }
+
+ return dlsym(handle, name);
+}
+
// Handle request to load libnuma symbol version 1.1 (API v1). If it fails
// load symbol from base version instead.
void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
- void *f = dlvsym(handle, name, "libnuma_1.1");
- if (f == NULL) {
- f = dlsym(handle, name);
- }
- return f;
+ return dlvsym_if_available(handle, name, "libnuma_1.1");
}
// Handle request to load libnuma symbol version 1.2 (API v2) only.
// Return NULL if the symbol is not defined in this particular version.
void* os::Linux::libnuma_v2_dlsym(void* handle, const char* name) {
- return dlvsym(handle, name, "libnuma_1.2");
+ return dlvsym_if_available(handle, name, "libnuma_1.2");
}
bool os::Linux::libnuma_init() {
--- old/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
+++ new/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
@@ -76,9 +76,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-#ifndef AMD64
-# include <fpu_control.h>
-#endif
#ifdef AMD64
#define REG_SP REG_RSP
--- old/src/hotspot/share/gc/shared/genCollectedHeap.cpp
+++ new/src/hotspot/share/gc/shared/genCollectedHeap.cpp
@@ -1121,7 +1121,7 @@
static ScratchBlock *removeSmallestScratch(ScratchBlock **prev_ptr) {
bool first = true;
size_t min_size = 0; // "first" makes this conceptually infinite.
- ScratchBlock **smallest_ptr, *smallest;
+ ScratchBlock **smallest_ptr = NULL, *smallest;
ScratchBlock *cur = *prev_ptr;
while (cur) {
assert(*prev_ptr == cur, "just checking");
--- old/src/hotspot/share/utilities/globalDefinitions_gcc.hpp
+++ new/src/hotspot/share/utilities/globalDefinitions_gcc.hpp
@@ -112,7 +112,7 @@
#if defined(__APPLE__)
inline int g_isnan(double f) { return isnan(f); }
#elif defined(LINUX) || defined(_ALLBSD_SOURCE)
-inline int g_isnan(float f) { return isnanf(f); }
+inline int g_isnan(float f) { return isnan(f); }
inline int g_isnan(double f) { return isnan(f); }
#else
#error "missing platform-specific definition here"
--- old/src/java.base/linux/native/libnet/linux_close.c
+++ new/src/java.base/linux/native/libnet/linux_close.c
@@ -60,7 +60,7 @@
/*
* Signal to unblock thread
*/
-static int sigWakeup = (__SIGRTMAX - 2);
+static int sigWakeup;
/*
* fdTable holds one entry per file descriptor, up to a certain
@@ -149,6 +149,7 @@
/*
* Setup the signal handler
*/
+ sigWakeup = SIGRTMAX - 2;
sa.sa_handler = sig_wakeup;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
--- old/src/java.base/unix/native/libjava/childproc.c
+++ new/src/java.base/unix/native/libjava/childproc.c
@@ -236,7 +236,13 @@
{
if (envp == NULL || (char **) envp == environ) {
execvp(file, (char **) argv);
- return;
+ // ENOEXEC indicates that the file header was not recognized. The musl C
+ // library does not implement the fallback to /bin/sh for that case, so fall
+ // through to the code below which implements that fallback using
+ // execve_with_shell_fallback.
+ if (errno != ENOEXEC) {
+ return;
+ }
}
if (*file == '\0') {
--- old/src/java.base/unix/native/libjava/jdk_util_md.h
+++ new/src/java.base/unix/native/libjava/jdk_util_md.h
@@ -33,7 +33,7 @@
#define ISNAND(d) isnan(d)
#elif defined(__linux__) || defined(_ALLBSD_SOURCE)
#include <math.h>
-#define ISNANF(f) isnanf(f)
+#define ISNANF(f) isnan(f)
#define ISNAND(d) isnan(d)
#elif defined(_AIX)
#include <math.h>
--- old/src/java.base/unix/native/libjli/java_md.c
+++ new/src/java.base/unix/native/libjli/java_md.c
@@ -230,6 +230,39 @@
char *dmllp = NULL;
char *p; /* a utility pointer */
+#ifdef __linux
+#ifndef LIBC
+#error "LIBC not set"
+#endif
+
+ if (strcmp(LIBC, "musl") == 0) {
+ /*
+ * The musl library loader requires LD_LIBRARY_PATH to be set in
+ * order to correctly resolve the dependency libjava.so has on libjvm.so.
+ *
+ * Specifically, it differs from glibc in the sense that even if
+ * libjvm.so has already been loaded it will not be considered a
+ * candidate for resolving the dependency unless the *full* path
+ * of the already loaded library matches the dependency being loaded.
+ *
+ * libjvm.so is being loaded by the launcher using a long path to
+ * dlopen, not just the basename of the library. Typically this
+ * is something like "../lib/server/libjvm.so". However, if/when
+ * libjvm.so later tries to dlopen libjava.so (which it does in
+ * order to get access to a few functions implemented in
+ * libjava.so) the musl loader will, as part of loading
+ * dependent libraries, try to load libjvm.so using only its
+ * basename "libjvm.so". Since this does not match the longer
+ * path path it was first loaded with, the already loaded
+ * library is not considered a candidate, and the loader will
+ * instead look for libjvm.so elsewhere. If it's not in
+ * LD_LIBRARY_PATH the dependency load will fail, and libjava.so
+ * will therefore fail as well.
+ */
+ return JNI_TRUE;
+ }
+#endif
+
#ifdef AIX
/* We always have to set the LIBPATH on AIX because ld doesn't support $ORIGIN. */
return JNI_TRUE;
--- old/src/java.base/unix/native/libnio/ch/NativeThread.c
+++ new/src/java.base/unix/native/libnio/ch/NativeThread.c
@@ -36,7 +36,7 @@
#ifdef __linux__
#include <pthread.h>
/* Also defined in net/linux_close.c */
- #define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
+ #define INTERRUPT_SIGNAL (SIGRTMAX - 2)
#elif defined(_AIX)
#include <pthread.h>
/* Also defined in net/aix_close.c */
--- old/src/jdk.jdwp.agent/share/native/libjdwp/util.h
+++ new/src/jdk.jdwp.agent/share/native/libjdwp/util.h
@@ -35,15 +35,15 @@
#ifdef DEBUG
/* Just to make sure these interfaces are not used here. */
#undef free
- #define free(p) Do not use this interface.
+ #define free do_not_use_this_interface_free
#undef malloc
- #define malloc(p) Do not use this interface.
+ #define malloc do_not_use_this_interface_malloc
#undef calloc
- #define calloc(p) Do not use this interface.
+ #define calloc do_not_use_this_interface_calloc
#undef realloc
- #define realloc(p) Do not use this interface.
+ #define realloc do_not_use_this_interface_realloc
#undef strdup
- #define strdup(p) Do not use this interface.
+ #define strdup do_not_use_this_interface_strdup
#endif
#include "log_messages.h"
--- old/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
+++ new/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
@@ -33,6 +33,7 @@
#include <assert.h>
#include <jni.h>
+#include <jvm.h>
#include <alloca.h>
#include <signal.h>
#include <string.h>
@@ -91,6 +92,20 @@
}
}
+int get_java_stacksize () {
+ size_t stacksize;
+ pthread_attr_t attr;
+ JDK1_1InitArgs jdk_args;
+
+ jdk_args.version = JNI_VERSION_1_1;
+ JNI_GetDefaultJavaVMInitArgs(&jdk_args);
+ if (jdk_args.javaStackSize <= 0) {
+ fprintf(stderr, "Test ERROR. Can't get a valid value for the default stacksize.\n");
+ exit(7);
+ }
+ return jdk_args.javaStackSize;
+}
+
void *run_java_overflow (void *p) {
JNIEnv *env;
jclass class_id;
@@ -258,13 +273,19 @@
exit(7);
}
+ int stack_size = get_java_stacksize();
pthread_t thr;
+ pthread_attr_t thread_attr;
+ pthread_attr_init(&thread_attr);
+ pthread_attr_setstacksize(&thread_attr, stack_size);
+
if (argc > 1 && strcmp(argv[1], "test_java_overflow") == 0) {
printf("\nTesting JAVA_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_java_overflow, NULL);
+
+ pthread_create (&thr, &thread_attr, run_java_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
@@ -277,7 +298,7 @@
printf("\nTesting NATIVE_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_native_overflow, NULL);
+ pthread_create (&thr, &thread_attr, run_native_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
--- old/test/jdk/java/lang/ProcessBuilder/Basic.java
+++ new/test/jdk/java/lang/ProcessBuilder/Basic.java
@@ -400,8 +400,8 @@
if (failed != 0) throw new Error("null PATH");
} else if (action.equals("PATH search algorithm")) {
equal(System.getenv("PATH"), "dir1:dir2:");
- check(new File("/bin/true").exists());
- check(new File("/bin/false").exists());
+ check(new File(TrueExe.path()).exists());
+ check(new File(FalseExe.path()).exists());
String[] cmd = {"prog"};
ProcessBuilder pb1 = new ProcessBuilder(cmd);
ProcessBuilder pb2 = new ProcessBuilder(cmd);
@@ -442,13 +442,13 @@
checkPermissionDenied(pb);
// continue searching if EACCES
- copy("/bin/true", "dir2/prog");
+ copy(TrueExe.path(), "dir2/prog");
equal(run(pb).exitValue(), True.exitValue());
new File("dir1/prog").delete();
new File("dir2/prog").delete();
new File("dir2/prog").mkdirs();
- copy("/bin/true", "dir1/prog");
+ copy(TrueExe.path(), "dir1/prog");
equal(run(pb).exitValue(), True.exitValue());
// Check empty PATH component means current directory.
@@ -464,10 +464,10 @@
pb.command(command);
File prog = new File("./prog");
// "Normal" binaries
- copy("/bin/true", "./prog");
+ copy(TrueExe.path(), "./prog");
equal(run(pb).exitValue(),
True.exitValue());
- copy("/bin/false", "./prog");
+ copy(FalseExe.path(), "./prog");
equal(run(pb).exitValue(),
False.exitValue());
prog.delete();
@@ -522,12 +522,12 @@
new File("dir2/prog").delete();
new File("prog").delete();
new File("dir3").mkdirs();
- copy("/bin/true", "dir1/prog");
- copy("/bin/false", "dir3/prog");
+ copy(TrueExe.path(), "dir1/prog");
+ copy(FalseExe.path(), "dir3/prog");
pb.environment().put("PATH","dir3");
equal(run(pb).exitValue(), True.exitValue());
- copy("/bin/true", "dir3/prog");
- copy("/bin/false", "dir1/prog");
+ copy(TrueExe.path(), "dir3/prog");
+ copy(FalseExe.path(), "dir1/prog");
equal(run(pb).exitValue(), False.exitValue());
} finally {
@@ -624,6 +624,13 @@
new File("/bin/false").exists());
}
+ static class BusyBox {
+ public static boolean is() { return is; }
+ private static final boolean is =
+ (! Windows.is() &&
+ new File("/bin/busybox").exists());
+ }
+
static class UnicodeOS {
public static boolean is() { return is; }
private static final String osName = System.getProperty("os.name");
@@ -662,6 +669,45 @@
}
}
+ // On alpine linux, /bin/true and /bin/false are just links to /bin/busybox.
+ // Some tests copy /bin/true and /bin/false to files with a different filename.
+ // However, copying the busbox executable into a file with a different name
+ // won't result in the expected return codes. As workaround, we create
+ // executable files that can be copied and produce the exepected return
+ // values. We use this workaround, if we find the busybox executable.
+
+ private static class TrueExe {
+ public static String path() { return path; }
+ private static final String path = path0();
+ private static String path0(){
+ if (!BusyBox.is()) {
+ return "/bin/true";
+ }
+ else {
+ File trueExe = new File("true");
+ setFileContents(trueExe, "#!/bin/true\n");
+ trueExe.setExecutable(true);
+ return trueExe.getAbsolutePath();
+ }
+ }
+ }
+
+ private static class FalseExe {
+ public static String path() { return path; }
+ private static final String path = path0();
+ private static String path0(){
+ if (!BusyBox.is()) {
+ return "/bin/false";
+ }
+ else {
+ File falseExe = new File("false");
+ setFileContents(falseExe, "#!/bin/false\n");
+ falseExe.setExecutable(true);
+ return falseExe.getAbsolutePath();
+ }
+ }
+ }
+
static class EnglishUnix {
private static final Boolean is =
(! Windows.is() && isEnglish("LANG") && isEnglish("LC_ALL"));
@@ -1965,7 +2011,7 @@
//----------------------------------------------------------------
try {
new File("suBdiR").mkdirs();
- copy("/bin/true", "suBdiR/unliKely");
+ copy(TrueExe.path(), "suBdiR/unliKely");
final ProcessBuilder pb =
new ProcessBuilder(new String[]{"unliKely"});
pb.environment().put("PATH", "suBdiR");
--- old/test/jdk/java/lang/ProcessHandle/InfoTest.java
+++ new/test/jdk/java/lang/ProcessHandle/InfoTest.java
@@ -298,7 +298,14 @@
}
if (info.command().isPresent()) {
String command = info.command().get();
- String expected = Platform.isWindows() ? "sleep.exe" : "sleep";
+ String expected = "sleep";
+ if (Platform.isWindows()) {
+ expected = "sleep.exe";
+ } else if (new File("/bin/busybox").exists()) {
+ // With busybox sleep is just a sym link to busybox.
+ // The busbox executable is seen as ProcessHandle.Info command.
+ expected = "busybox";
+ }
Assert.assertTrue(command.endsWith(expected), "Command: expected: \'" +
expected + "\', actual: " + command);
--- old/test/hotspot/jtreg/runtime/TLS/exestack-tls.c
+++ new/test/hotspot/jtreg/runtime/TLS/exestack-tls.c
@@ -26,7 +26,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <gnu/libc-version.h>
// Declare the thread local variable(s) in the main executable. This can be
// used to demonstrate the issues associated with the on-stack static TLS blocks
@@ -56,6 +55,10 @@
// glibc 2.15 introduced __pthread_get_minstack
int glibc_has_pthread_get_minstack() {
+#if !defined(__GLIBC__) && !defined(__UCLIBC__)
+ // Hard code Alpine Linux supported musl compatible settings
+ return 0;
+#else
const char* glibc_vers = gnu_get_libc_version();
const int glibc_vers_major = atoi(glibc_vers);
const int glibc_vers_minor = atoi(strchr(glibc_vers, '.') + 1);;
@@ -65,6 +68,7 @@
}
printf("This version does not provide __pthread_get_minstack\n");
return 0;
+#endif
}
int run(jboolean addTLS) {

View File

@ -0,0 +1,242 @@
The ucontext_t-Type is somewhat different with musl libc.
Add some precompiler conditions to use the right fields from the struct.
--- old/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
+++ new/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
@@ -47,6 +47,10 @@
#include "utilities/macros.hpp"
#include "utilities/powerOfTwo.hpp"
+#if ! (defined(__GLIBC__) || defined(__UCLIBC__))
+#include <asm/ptrace.h>
+#endif
+
#ifdef PRODUCT
#define BLOCK_COMMENT(str) // nothing
#else
@@ -1290,7 +1294,11 @@
// the safepoing polling page.
ucontext_t* uc = (ucontext_t*) ucontext;
// Set polling address.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address addr = (address)uc->uc_mcontext.regs->gpr[ra] + (ssize_t)ds;
+#else // Musl
+ address addr = (address)uc->uc_mcontext.gp_regs[ra] + (ssize_t) ds;
+#endif
if (polling_address_ptr != NULL) {
*polling_address_ptr = addr;
}
@@ -1353,11 +1361,20 @@
|| (is_stdu(instruction) && rs == 1)) {
int ds = inv_ds_field(instruction);
// return banged address
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return ds+(address)uc->uc_mcontext.regs->gpr[ra];
+#else // Musl
+ return ds+(address)uc->uc_mcontext.gp_regs[ra];
+#endif
} else if (is_stdux(instruction) && rs == 1) {
int rb = inv_rb_field(instruction);
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address sp = (address)uc->uc_mcontext.regs->gpr[1];
long rb_val = (long)uc->uc_mcontext.regs->gpr[rb];
+#else // Musl
+ address sp = (address)uc->uc_mcontext.gp_regs[1];
+ long rb_val = (long)uc->uc_mcontext.gp_regs[rb];
+#endif
return ra != 1 || rb_val >= 0 ? NULL // not a stack bang
: sp + rb_val; // banged address
}
--- old/src/hotspot/cpu/ppc/vm_version_ppc.cpp
+++ new/src/hotspot/cpu/ppc/vm_version_ppc.cpp
@@ -51,6 +51,10 @@
#endif
#endif
+#if ! (defined(__GLIBC__) || defined(__UCLIBC__))
+#include <asm/ptrace.h>
+#endif
+
bool VM_Version::_is_determine_features_test_running = false;
uint64_t VM_Version::_dscr_val = 0;
@@ -912,7 +916,7 @@
unsigned long auxv = getauxval(AT_HWCAP2);
if (auxv & PPC_FEATURE2_HTM_NOSC) {
- if (auxv & PPC_FEATURE2_HAS_HTM) {
+ if (auxv & PPC_FEATURE2_HTM) {
// TM on POWER8 and POWER9 in compat mode (VM) is supported by the JVM.
// TM on POWER9 DD2.1 NV (baremetal) is not supported by the JVM (TM on
// POWER9 DD2.1 NV has a few issues that need a couple of firmware
--- old/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
+++ new/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
@@ -76,7 +76,11 @@
# include <poll.h>
# include <ucontext.h>
+#if ! (defined(__GLIBC__) || defined(__UCLIBC__))
+#include <asm/ptrace.h>
+#endif
+
address os::current_stack_pointer() {
intptr_t* csp;
@@ -108,24 +112,42 @@
// - if uc was filled by getcontext(), it is undefined - getcontext() does not fill
// it because the volatile registers are not needed to make setcontext() work.
// Hopefully it was zero'd out beforehand.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
guarantee(uc->uc_mcontext.regs != NULL, "only use ucontext_get_pc in sigaction context");
return (address)uc->uc_mcontext.regs->nip;
+#else // Musl
+ guarantee(uc->uc_mcontext.gp_regs != NULL, "only use ucontext_get_pc in sigaction context");
+ return (address)uc->uc_mcontext.gp_regs[PT_NIP];
+#endif
}
// modify PC in ucontext.
// Note: Only use this for an ucontext handed down to a signal handler. See comment
// in ucontext_get_pc.
void os::Linux::ucontext_set_pc(ucontext_t * uc, address pc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
guarantee(uc->uc_mcontext.regs != NULL, "only use ucontext_set_pc in sigaction context");
uc->uc_mcontext.regs->nip = (unsigned long)pc;
+#else // Musl
+ guarantee(uc->uc_mcontext.gp_regs != NULL, "only use ucontext_set_pc in sigaction context");
+ uc->uc_mcontext.gp_regs[PT_NIP] = (unsigned long)pc;
+#endif
}
static address ucontext_get_lr(const ucontext_t * uc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return (address)uc->uc_mcontext.regs->link;
+#else // Musl
+ return (address)uc->uc_mcontext.gp_regs[PT_LNK];
+#endif
}
intptr_t* os::Linux::ucontext_get_sp(const ucontext_t * uc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return (intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/];
+#else // Musl
+ return (intptr_t*)uc->uc_mcontext.gp_regs[1/*REG_SP*/];
+#endif
}
intptr_t* os::Linux::ucontext_get_fp(const ucontext_t * uc) {
@@ -133,7 +155,11 @@
}
static unsigned long ucontext_get_trap(const ucontext_t * uc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return uc->uc_mcontext.regs->trap;
+#else // Musl
+ return uc->uc_mcontext.gp_regs[PT_TRAP];
+#endif
}
ExtendedPC os::fetch_frame_from_context(const void* ucVoid,
@@ -259,7 +285,11 @@
// 3.2.1 "Machine State Register"), however note that ISA notation for bit
// numbering is MSB 0, so for normal bit numbering (LSB 0) they come to be
// bits 33 and 34. It's not related to endianness, just a notation matter.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
if (second_uc->uc_mcontext.regs->msr & 0x600000000) {
+#else // Musl
+ if (second_uc->uc_mcontext.gp_regs[PT_MSR] & 0x600000000) {
+#endif
if (TraceTraps) {
tty->print_cr("caught signal in transaction, "
"ignoring to jump to abort handler");
@@ -616,6 +646,7 @@
const ucontext_t* uc = (const ucontext_t*)context;
st->print_cr("Registers:");
+#if defined(__GLIBC__) || defined(__UCLIBC__)
st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->nip);
st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->link);
st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.regs->ctr);
@@ -624,8 +655,18 @@
st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.regs->gpr[i]);
if (i % 3 == 2) st->cr();
}
+#else // Musl
+ st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[PT_NIP]);
+ st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[PT_LNK]);
+ st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[PT_CTR]);
st->cr();
+ for (int i = 0; i < 32; i++) {
+ st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.gp_regs[i]);
+ if (i % 3 == 2) st->cr();
+ }
+#endif
st->cr();
+ st->cr();
intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);
st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", p2i(sp));
@@ -648,12 +689,22 @@
st->print_cr("Register to memory mapping:");
st->cr();
+#if defined(__GLIBC__) || defined(__UCLIBC__)
st->print("pc ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->nip);
st->print("lr ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->link);
st->print("ctr ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->ctr);
+#else // Musl
+ st->print("pc ="); print_location(st, (intptr_t)uc->uc_mcontext.gp_regs[PT_NIP]);
+ st->print("lr ="); print_location(st, (intptr_t)uc->uc_mcontext.gp_regs[PT_LNK]);
+ st->print("ctr ="); print_location(st, (intptr_t)uc->uc_mcontext.gp_regs[PT_CTR]);
+#endif
for (int i = 0; i < 32; i++) {
st->print("r%-2d=", i);
+#if defined(__GLIBC__) || defined(__UCLIBC__)
print_location(st, uc->uc_mcontext.regs->gpr[i]);
+#else // Musl
+ print_location(st, uc->uc_mcontext.gp_regs[i]);
+#endif
}
st->cr();
}
--- old/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp
+++ new/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp
@@ -27,6 +27,10 @@
#include "runtime/frame.inline.hpp"
#include "runtime/thread.hpp"
+#if ! (defined(__GLIBC__) || defined(__UCLIBC__))
+#include <asm/ptrace.h>
+#endif
+
frame JavaThread::pd_last_frame() {
assert(has_last_Java_frame(), "must have last_Java_sp() when suspended");
@@ -56,8 +60,13 @@
// if we were running Java code when SIGPROF came in.
if (isInJava) {
ucontext_t* uc = (ucontext_t*) ucontext;
+#if defined(__GLIBC__) || defined(__UCLIBC__)
frame ret_frame((intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/],
(address)uc->uc_mcontext.regs->nip);
+#else // Musl
+ frame ret_frame((intptr_t*)uc->uc_mcontext.gp_regs[1/*REG_SP*/],
+ (address)uc->uc_mcontext.gp_regs[PT_NIP]);
+#endif
if (ret_frame.pc() == NULL) {
// ucontext wasn't useful
@@ -70,7 +79,11 @@
if (!Method::is_valid_method(m)) return false;
if (!Metaspace::contains(m->constMethod())) return false;
+#if defined(__GLIBC__) || defined(__UCLIBC__)
uint64_t reg_bcp = uc->uc_mcontext.regs->gpr[14/*R14_bcp*/];
+#else // Musl
+ uint64_t reg_bcp = uc->uc_mcontext.gp_regs[14/*R14_bcp*/];
+#endif
uint64_t istate_bcp = istate->bcp;
uint64_t code_start = (uint64_t)(m->code_base());
uint64_t code_end = (uint64_t)(m->code_base() + m->code_size());

View File

@ -0,0 +1,12 @@
diff -Naur openjdk-7.271_p01/jdk/make/common/shared/Defs-utils.gmk openjdk-7.271_p01-copy/jdk/make/common/shared/Defs-utils.gmk
--- openjdk-7.271_p01/jdk/make/common/shared/Defs-utils.gmk 2020-10-15 21:59:38.743954976 -0400
+++ openjdk-7.271_p01-copy/jdk/make/common/shared/Defs-utils.gmk 2020-10-15 22:02:16.751954157 -0400
@@ -104,7 +104,7 @@
COMM = $(UTILS_USR_BIN_PATH)comm
COMPRESS = $(UTILS_USR_BIN_PATH)compress
CP = $(UTILS_COMMAND_PATH)cp
-CPIO = $(UTILS_COMMAND_PATH)cpio
+CPIO = $(UTILS_USR_BIN_PATH)cpio
CUT = $(UTILS_USR_BIN_PATH)cut
DATE = $(UTILS_COMMAND_PATH)date
DF = $(UTILS_COMMAND_PATH)df

View File

@ -0,0 +1,169 @@
diff -Naur openjdk-7.271_p01/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp openjdk-7.271_p01-copy-2/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp
--- openjdk-7.271_p01/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp 2020-10-15 21:59:37.871954981 -0400
+++ openjdk-7.271_p01-copy-2/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp 2020-10-15 22:12:55.555950845 -0400
@@ -1211,7 +1211,11 @@
// the safepoing polling page.
ucontext_t* uc = (ucontext_t*) ucontext;
// Set polling address.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address addr = (address)uc->uc_mcontext.regs->gpr[ra] + (ssize_t)ds;
+#else // Musl
+ address addr = (address)uc->uc_mcontext.gp_regs[ra] + (ssize_t)ds;
+#endif
if (polling_address_ptr != NULL) {
*polling_address_ptr = addr;
}
@@ -1232,15 +1236,24 @@
int rb = inv_rb_field(instruction);
// look up content of ra and rb in ucontext
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address ra_val=(address)uc->uc_mcontext.regs->gpr[ra];
long rb_val=(long)uc->uc_mcontext.regs->gpr[rb];
+#else // Musl
+ address ra_val=(address)uc->uc_mcontext.gp_regs[ra];
+ long rb_val=(long)uc->uc_mcontext.gp_regs[rb];
+#endif
return os::is_memory_serialize_page(thread, ra_val+rb_val);
} else if (is_stw(instruction) || is_stwu(instruction)) {
int ra = inv_ra_field(instruction);
int d1 = inv_d1_field(instruction);
// look up content of ra in ucontext
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address ra_val=(address)uc->uc_mcontext.regs->gpr[ra];
+#else // Musl
+ address ra_val=(address)uc->uc_mcontext.gp_regs[ra];
+#endif
return os::is_memory_serialize_page(thread, ra_val+d1);
} else {
return false;
@@ -1303,11 +1316,20 @@
|| (is_stdu(instruction) && rs == 1)) {
int ds = inv_ds_field(instruction);
// return banged address
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return ds+(address)uc->uc_mcontext.regs->gpr[ra];
+#else // Musl
+ return ds+(address)uc->uc_mcontext.gp_regs[ra];
+#endif
} else if (is_stdux(instruction) && rs == 1) {
int rb = inv_rb_field(instruction);
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address sp = (address)uc->uc_mcontext.regs->gpr[1];
long rb_val = (long)uc->uc_mcontext.regs->gpr[rb];
+#else // Musl
+ address sp = (address)uc->uc_mcontext.gp_regs[1];
+ long rb_val = (long)uc->uc_mcontext.gp_regs[rb];
+#endif
return ra != 1 || rb_val >= 0 ? NULL // not a stack bang
: sp + rb_val; // banged address
}
diff -Naur openjdk-7.271_p01/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp openjdk-7.271_p01-copy-2/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp
--- openjdk-7.271_p01/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp 2020-10-15 21:59:37.915954981 -0400
+++ openjdk-7.271_p01-copy-2/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp 2020-10-15 22:09:42.379951847 -0400
@@ -123,11 +123,19 @@
// it because the volatile registers are not needed to make setcontext() work.
// Hopefully it was zero'd out beforehand.
guarantee(uc->uc_mcontext.regs != NULL, "only use ucontext_get_pc in sigaction context");
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return (address)uc->uc_mcontext.regs->nip;
+#else // Musl
+ return (address)uc->uc_mcontext.gp_regs[32];
+#endif
}
intptr_t* os::Linux::ucontext_get_sp(ucontext_t * uc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return (intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/];
+#else // Musl
+ return (intptr_t*)uc->uc_mcontext.gp_regs[1/*REG_SP*/];
+#endif
}
intptr_t* os::Linux::ucontext_get_fp(ucontext_t * uc) {
@@ -226,7 +234,11 @@
if (uc) {
address const pc = os::Linux::ucontext_get_pc(uc);
if (pc && StubRoutines::is_safefetch_fault(pc)) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
uc->uc_mcontext.regs->nip = (unsigned long)StubRoutines::continuation_for_safefetch_fault(pc);
+#else // Musl
+ uc->uc_mcontext.gp_regs[32] = (unsigned long)StubRoutines::continuation_for_safefetch_fault(pc);
+#endif
return true;
}
}
@@ -370,7 +382,11 @@
// continue at the next instruction after the faulting read. Returning
// garbage from this read is ok.
thread->set_pending_unsafe_access_error();
+#if defined(__GLIBC__) || defined(__UCLIBC__)
uc->uc_mcontext.regs->nip = ((unsigned long)pc) + 4;
+#else // Musl
+ uc->uc_mcontext.gp_regs[32] = ((unsigned long)pc) + 4;
+#endif
return true;
}
}
@@ -389,7 +405,11 @@
// continue at the next instruction after the faulting read. Returning
// garbage from this read is ok.
thread->set_pending_unsafe_access_error();
+#if defined(__GLIBC__) || defined(__UCLIBC__)
uc->uc_mcontext.regs->nip = ((unsigned long)pc) + 4;
+#else // Musl
+ uc->uc_mcontext.gp_regs[32] = ((unsigned long)pc) + 4;
+#endif
return true;
}
}
@@ -412,7 +432,11 @@
if (stub != NULL) {
// Save all thread context in case we need to restore it.
if (thread != NULL) thread->set_saved_exception_pc(pc);
+#if defined(__GLIBC__) || defined(__UCLIBC__)
uc->uc_mcontext.regs->nip = (unsigned long)stub;
+#else
+ uc->uc_mcontext.gp_regs[32] = (unsigned long)stub;
+#endif
return true;
}
@@ -570,6 +594,7 @@
ucontext_t* uc = (ucontext_t*)context;
st->print_cr("Registers:");
+#if defined(__GLIBC__) || defined(__UCLIBC__)
st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->nip);
st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->link);
st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.regs->ctr);
@@ -578,6 +603,16 @@
st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.regs->gpr[i]);
if (i % 3 == 2) st->cr();
}
+#else // Musl
+ st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[32]);
+ st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[36]);
+ st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[35]);
+ st->cr();
+ for (int i = 0; i < 32; i++) {
+ st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.gp_regs[i]);
+ if (i % 3 == 2) st->cr();
+ }
+#endif
st->cr();
st->cr();
@@ -606,7 +641,11 @@
// this is only for the "general purpose" registers
for (int i = 0; i < 32; i++) {
st->print("r%-2d=", i);
+#if defined(__GLIBC__) || defined(__UCLIBC__)
print_location(st, uc->uc_mcontext.regs->gpr[i]);
+#else // Musl
+ print_location(st, uc->uc_mcontext.gp_regs[i]);
+#endif
}
st->cr();
}

View File

@ -0,0 +1,59 @@
diff -Naur openjdk-7.271_p01/hotspot/src/os/linux/vm/jvm_linux.cpp openjdk-7.271_p01-copy/hotspot/src/os/linux/vm/jvm_linux.cpp
--- openjdk-7.271_p01/hotspot/src/os/linux/vm/jvm_linux.cpp 2020-10-15 21:59:37.903954981 -0400
+++ openjdk-7.271_p01-copy/hotspot/src/os/linux/vm/jvm_linux.cpp 2020-10-15 22:15:53.711949921 -0400
@@ -154,7 +154,9 @@
#ifdef SIGSTKFLT
"STKFLT", SIGSTKFLT, /* Stack fault. */
#endif
+#ifdef SIGCLD
"CLD", SIGCLD, /* Same as SIGCHLD (System V). */
+#endif
"CHLD", SIGCHLD, /* Child status has changed (POSIX). */
"CONT", SIGCONT, /* Continue (POSIX). */
"STOP", SIGSTOP, /* Stop, unblockable (POSIX). */
diff -Naur openjdk-7.271_p01/hotspot/src/os/linux/vm/os_linux.inline.hpp openjdk-7.271_p01-copy/hotspot/src/os/linux/vm/os_linux.inline.hpp
--- openjdk-7.271_p01/hotspot/src/os/linux/vm/os_linux.inline.hpp 2020-10-15 21:59:37.911954981 -0400
+++ openjdk-7.271_p01-copy/hotspot/src/os/linux/vm/os_linux.inline.hpp 2020-10-15 22:16:17.291949799 -0400
@@ -52,7 +52,7 @@
#include <unistd.h>
#include <sys/socket.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <netdb.h>
inline void* os::thread_local_storage_at(int index) {
diff -Naur openjdk-7.271_p01/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp openjdk-7.271_p01-copy/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
--- openjdk-7.271_p01/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp 2020-10-15 21:59:37.919954981 -0400
+++ openjdk-7.271_p01-copy/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp 2020-10-15 22:17:32.267949410 -0400
@@ -73,7 +73,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-# include <fpu_control.h>
#ifdef AMD64
#define REG_SP REG_RSP
@@ -534,6 +533,9 @@
return true; // Mute compiler
}
+#define _FPU_GETCW(cw) __asm__ __volatile__ ("fnstcw %0" : "=m" (*&cw))
+#define _FPU_SETCW(cw) __asm__ __volatile__ ("fldcw %0" : : "m" (*&cw))
+
void os::Linux::init_thread_fpu_state(void) {
#ifndef AMD64
// set fpu to 53 bit precision
diff -Naur openjdk-7.271_p01/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp openjdk-7.271_p01-copy/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp
--- openjdk-7.271_p01/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp 2020-10-15 21:59:37.919954981 -0400
+++ openjdk-7.271_p01-copy/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp 2020-10-15 22:18:17.359949177 -0400
@@ -32,7 +32,9 @@
// map stack pointer to thread pointer - see notes in threadLS_linux_x86.cpp
#define SP_BITLENGTH 32
#define PAGE_SHIFT 12
+ #ifndef PAGE_SIZE
#define PAGE_SIZE (1UL << PAGE_SHIFT)
+ #endif
static Thread* _sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)];
public:

View File

@ -0,0 +1,59 @@
diff -Naur openjdk-7.271_p01/hotspot/make/linux/makefiles/defs.make openjdk-7.271_p01-copy/hotspot/make/linux/makefiles/defs.make
--- openjdk-7.271_p01/hotspot/make/linux/makefiles/defs.make 2020-10-15 21:59:37.863954981 -0400
+++ openjdk-7.271_p01-copy/hotspot/make/linux/makefiles/defs.make 2020-10-15 22:23:07.511947672 -0400
@@ -298,6 +298,9 @@
# Serviceability Binaries
# No SA Support for PPC, IA64, ARM or zero
+# or if thread_db.h missing (musl)
+
+ifneq ($(wildcard /usr/include/thread_db.h),)
ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
$(EXPORT_LIB_DIR)/sa-jdi.jar
ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
@@ -311,6 +314,10 @@
ADD_SA_BINARIES/sparc += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo
endif
endif
+else
+ADD_SA_BINARIES/x86 =
+ADD_SA_BINARIES/sparc =
+endif
ADD_SA_BINARIES/ppc =
ADD_SA_BINARIES/ppc64 =
ADD_SA_BINARIES/ia64 =
diff -Naur openjdk-7.271_p01/hotspot/make/linux/makefiles/sa.make openjdk-7.271_p01-copy/hotspot/make/linux/makefiles/sa.make
--- openjdk-7.271_p01/hotspot/make/linux/makefiles/sa.make 2020-10-15 21:59:37.863954981 -0400
+++ openjdk-7.271_p01-copy/hotspot/make/linux/makefiles/sa.make 2020-10-15 22:24:00.083947400 -0400
@@ -59,9 +59,12 @@
# if $(AGENT_DIR) does not exist, we don't build SA
# also, we don't build SA on Itanium or zero.
+# check for thread_db.h too (musl does not have it).
all:
if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" \
+ if [ -d $(AGENT_DIR) -a -f /usr/include/thread_db.h \
+ -a "$(SRCARCH)" != "ia64" \
-a "$(SRCARCH)" != "zero" ] ; then \
$(MAKE) -f sa.make $(GENERATED)/sa-jdi.jar; \
fi
diff -Naur openjdk-7.271_p01/hotspot/make/linux/makefiles/saproc.make openjdk-7.271_p01-copy/hotspot/make/linux/makefiles/saproc.make
--- openjdk-7.271_p01/hotspot/make/linux/makefiles/saproc.make 2020-10-15 21:59:37.863954981 -0400
+++ openjdk-7.271_p01-copy/hotspot/make/linux/makefiles/saproc.make 2020-10-15 22:24:38.647947200 -0400
@@ -65,12 +65,15 @@
# if $(AGENT_DIR) does not exist, we don't build SA
# also, we don't build SA on Itanium or zero.
+# check for thread_db.h too (musl does not have it).
+ifneq ($(wildcard /usr/include/thread_db.h),)
ifneq ($(wildcard $(AGENT_DIR)),)
ifneq ($(filter-out ia64 zero,$(SRCARCH)),)
BUILDLIBSAPROC = $(LIBSAPROC)
endif
endif
+endif
ifneq ($(ALT_SASRCDIR),)
ALT_SAINCDIR=-I$(ALT_SASRCDIR)

View File

@ -0,0 +1,94 @@
diff -Naur openjdk-7.271_p01/hotspot/src/os/linux/vm/os_linux.cpp openjdk-7.271_p01-copy/hotspot/src/os/linux/vm/os_linux.cpp
--- openjdk-7.271_p01/hotspot/src/os/linux/vm/os_linux.cpp 2020-10-15 21:59:37.903954981 -0400
+++ openjdk-7.271_p01-copy/hotspot/src/os/linux/vm/os_linux.cpp 2020-10-15 22:50:14.483939237 -0400
@@ -112,7 +112,6 @@
# include <string.h>
# include <syscall.h>
# include <sys/sysinfo.h>
-# include <gnu/libc-version.h>
# include <sys/ipc.h>
# include <sys/shm.h>
# include <link.h>
@@ -627,6 +626,13 @@
// detecting pthread library
void os::Linux::libpthread_init() {
+#if 1
+ // Hard code Alpine Linux supported uclibc/musl compatible settings
+ os::Linux::set_glibc_version("glibc 2.9");
+ os::Linux::set_libpthread_version("NPTL");
+ os::Linux::set_is_NPTL();
+ os::Linux::set_is_floating_stack();
+#else
// Save glibc and pthread version strings. Note that _CS_GNU_LIBC_VERSION
// and _CS_GNU_LIBPTHREAD_VERSION are supported in glibc >= 2.3.2. Use a
// generic name for earlier versions.
@@ -685,6 +691,7 @@
if (os::Linux::is_NPTL() || os::Linux::supports_variable_stack_size()) {
os::Linux::set_is_floating_stack();
}
+#endif
}
/////////////////////////////////////////////////////////////////////////////
@@ -2903,11 +2910,7 @@
// If we are running with earlier version, which did not have symbol versions,
// we should use the base version.
void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
- void *f = dlvsym(handle, name, "libnuma_1.1");
- if (f == NULL) {
- f = dlsym(handle, name);
- }
- return f;
+ return dlsym(handle, name);
}
bool os::Linux::libnuma_init() {
@@ -5550,7 +5553,25 @@
// Linux doesn't yet have a (official) notion of processor sets,
// so just return the system wide load average.
int os::loadavg(double loadavg[], int nelem) {
+#ifdef __UCLIBC__
+ FILE *LOADAVG;
+ double avg[3] = { 0.0, 0.0, 0.0 };
+ int i, res = -1;;
+
+ if ((LOADAVG = fopen("/proc/loadavg", "r"))) {
+ fscanf(LOADAVG, "%lf %lf %lf", &avg[0], &avg[1], &avg[2]);
+ res = 0;
+ fclose(LOADAVG);
+ }
+
+ for (i = 0; (i < nelem) && (i < 3); i++) {
+ loadavg[i] = avg[i];
+ }
+
+ return res;
+#else
return ::getloadavg(loadavg, nelem);
+#endif
}
void os::pause() {
diff -Naur openjdk-7.271_p01/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp openjdk-7.271_p01-copy/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
--- openjdk-7.271_p01/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp 2020-10-15 21:59:38.071954980 -0400
+++ openjdk-7.271_p01-copy/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp 2020-10-15 22:51:20.895938892 -0400
@@ -253,7 +253,7 @@
#elif defined(__APPLE__)
inline int g_isnan(double f) { return isnan(f); }
#elif defined(LINUX) || defined(_ALLBSD_SOURCE)
-inline int g_isnan(float f) { return isnanf(f); }
+inline int g_isnan(float f) { return isnan(f); }
inline int g_isnan(double f) { return isnan(f); }
#else
#error "missing platform-specific definition here"
@@ -269,7 +269,8 @@
inline int g_isfinite(jfloat f) { return finite(f); }
inline int g_isfinite(jdouble f) { return finite(f); }
-
+inline int g_isfinite(jfloat f) { return isfinite(f); }
+inline int g_isfinite(jdouble f) { return isfinite(f); }
// Wide characters

View File

@ -0,0 +1,42 @@
diff -Naur openjdk-7.271_p01/jdk/src/solaris/native/sun/awt/awt_xembed_server.c openjdk-7.271_p01-copy/jdk/src/solaris/native/sun/awt/awt_xembed_server.c
--- openjdk-7.271_p01/jdk/src/solaris/native/sun/awt/awt_xembed_server.c 2020-10-15 21:59:39.543954972 -0400
+++ openjdk-7.271_p01-copy/jdk/src/solaris/native/sun/awt/awt_xembed_server.c 2020-10-15 22:28:01.183946150 -0400
@@ -35,7 +35,7 @@
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <Xm/MwmUtil.h>
-#ifdef __linux__
+#if defined(__linux__) && defined(__GLIBC__) && ! defined(__UCLIBC__)
#include <execinfo.h>
#endif
#include <stdio.h>
@@ -835,7 +835,7 @@
AWT_UNLOCK();
}
-#ifdef __linux__
+#if defined(__linux__) && defined(__GLIBC__) && ! defined(__UCLIBC__)
void
print_stack (void)
{
diff -Naur openjdk-7.271_p01/jdk/src/solaris/native/sun/xawt/XToolkit.c openjdk-7.271_p01-copy/jdk/src/solaris/native/sun/xawt/XToolkit.c
--- openjdk-7.271_p01/jdk/src/solaris/native/sun/xawt/XToolkit.c 2020-10-15 21:59:39.571954972 -0400
+++ openjdk-7.271_p01-copy/jdk/src/solaris/native/sun/xawt/XToolkit.c 2020-10-15 22:28:45.963945917 -0400
@@ -27,7 +27,7 @@
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/Xatom.h>
-#ifdef __linux__
+#if defined(__linux__) && defined(__GLIBC__) && ! defined(__UCLIBC__)
#include <execinfo.h>
#endif
@@ -782,7 +782,7 @@
return ret;
}
-#ifdef __linux__
+#if defined(__linux__) && defined(__GLIBC__) && ! defined(__UCLIBC__)
void print_stack(void)
{
void *array[10];

View File

@ -0,0 +1,36 @@
diff -Naur openjdk-7.271_p01/jdk/make/common/Defs-linux.gmk openjdk-7.271_p01-copy/jdk/make/common/Defs-linux.gmk
--- openjdk-7.271_p01/jdk/make/common/Defs-linux.gmk 2020-10-15 21:59:38.731954976 -0400
+++ openjdk-7.271_p01-copy/jdk/make/common/Defs-linux.gmk 2020-10-15 22:31:27.507945080 -0400
@@ -360,7 +360,7 @@
EXTRA_LIBS += -lc
-LDFLAGS_DEFS_OPTION = -Xlinker -z -Xlinker defs
+LDFLAGS_DEFS_OPTION =
LDFLAGS_COMMON += $(LDFLAGS_DEFS_OPTION)
LDFLAGS_RELRO_OPTION = -Xlinker -z -Xlinker relro
diff -Naur openjdk-7.271_p01/jdk/make/common/shared/Defs-linux.gmk openjdk-7.271_p01-copy/jdk/make/common/shared/Defs-linux.gmk
--- openjdk-7.271_p01/jdk/make/common/shared/Defs-linux.gmk 2020-10-15 21:59:38.743954976 -0400
+++ openjdk-7.271_p01-copy/jdk/make/common/shared/Defs-linux.gmk 2020-10-15 22:32:42.447944691 -0400
@@ -207,8 +207,6 @@
if [ "`$(NM) -D -g --defined-only $1 | $(EGREP) 'SUNWprivate'`" = "" ] ; then \
$(ECHO) "$(MAPFILE_WARNING): File was not built with a mapfile: $1"; \
fi && \
- $(ECHO) "Library loads for: $1" && \
- $(LDD) $1 && \
$(ECHO) "RUNPATH for: $1" && \
( $(READELF) -d $1 | $(EGREP) 'NEEDED|RUNPATH|RPATH' ) \
)
diff -Naur openjdk-7.271_p01/jdk/make/sun/nio/cs/Makefile openjdk-7.271_p01-copy/jdk/make/sun/nio/cs/Makefile
--- openjdk-7.271_p01/jdk/make/sun/nio/cs/Makefile 2020-10-15 21:59:38.903954975 -0400
+++ openjdk-7.271_p01-copy/jdk/make/sun/nio/cs/Makefile 2020-10-15 22:32:13.523944841 -0400
@@ -106,7 +106,7 @@
$(GENCSDATASRC)/DoubleByte-X.java.template \
$(GENCSDATASRC)/extsbcs $(GENCSDATASRC)/dbcs
@$(prep-target)
- $(RM) -r $(GENCSEXT)
+ $(RM) -f "$(GENCSEXT)"/*
$(MKDIR) -p $(GENCSEXT)
$(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) $(GENCSDATASRC) $(GENCSEXT) extsbcs
$(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) $(GENCSDATASRC) $(GENCSEXT) euctw \

View File

@ -0,0 +1,43 @@
diff -Naur openjdk-7.271_p01/jdk/src/solaris/native/java/net/net_util_md.c openjdk-7.271_p01-copy/jdk/src/solaris/native/java/net/net_util_md.c
--- openjdk-7.271_p01/jdk/src/solaris/native/java/net/net_util_md.c 2020-10-15 21:59:39.539954972 -0400
+++ openjdk-7.271_p01-copy/jdk/src/solaris/native/java/net/net_util_md.c 2020-10-15 22:36:09.911943616 -0400
@@ -712,7 +712,7 @@
static struct localinterface *localifs = 0;
static int localifsSize = 0; /* size of array */
-static int nifs = 0; /* number of entries used in array */
+static int nifs = -1; /* number of entries used in array */
/* not thread safe: make sure called once from one thread */
@@ -724,6 +724,10 @@
int index, x1, x2, x3;
unsigned int u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,ua,ub,uc,ud,ue,uf;
+ if (nifs >= 0)
+ return ;
+ nifs = 0;
+
if ((f = fopen("/proc/net/if_inet6", "r")) == NULL) {
return ;
}
@@ -752,7 +756,7 @@
localifs = (struct localinterface *) realloc (
localifs, sizeof (struct localinterface)* (localifsSize+5));
if (localifs == 0) {
- nifs = 0;
+ nifs = -1;
fclose (f);
return;
}
@@ -775,9 +779,7 @@
static int getLocalScopeID (char *addr) {
struct localinterface *lif;
int i;
- if (localifs == 0) {
- initLocalIfs();
- }
+ initLocalIfs();
for (i=0, lif=localifs; i<nifs; i++, lif++) {
if (memcmp (addr, lif->localaddr, 16) == 0) {
return lif->index;

View File

@ -0,0 +1,113 @@
diff -Naur openjdk-7.271_p01/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp openjdk-7.271_p01-copy/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp
--- openjdk-7.271_p01/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp 2020-10-15 21:59:39.479954972 -0400
+++ openjdk-7.271_p01-copy/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp 2020-10-15 22:37:16.487943270 -0400
@@ -46,6 +46,8 @@
#include "zip.h"
+#define uchar unsigned char
+
#ifdef NO_ZLIB
inline bool jar::deflate_bytes(bytes& head, bytes& tail) {
diff -Naur openjdk-7.271_p01/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h openjdk-7.271_p01-copy/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h
--- openjdk-7.271_p01/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h 2020-10-15 21:59:39.479954972 -0400
+++ openjdk-7.271_p01-copy/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h 2020-10-15 22:37:32.791943186 -0400
@@ -26,6 +26,7 @@
#define ushort unsigned short
#define uint unsigned int
#define uchar unsigned char
+#include <sys/types.h>
struct unpacker;
diff -Naur openjdk-7.271_p01/jdk/src/share/native/sun/awt/medialib/mlib_types.h openjdk-7.271_p01-copy/jdk/src/share/native/sun/awt/medialib/mlib_types.h
--- openjdk-7.271_p01/jdk/src/share/native/sun/awt/medialib/mlib_types.h 2020-10-15 21:59:39.515954972 -0400
+++ openjdk-7.271_p01-copy/jdk/src/share/native/sun/awt/medialib/mlib_types.h 2020-10-15 22:38:10.879942988 -0400
@@ -27,6 +27,7 @@
#ifndef MLIB_TYPES_H
#define MLIB_TYPES_H
+#include <stddef.h> /* for NULL */
#include <limits.h>
#if defined(_MSC_VER)
#include <float.h> /* for FLT_MAX and DBL_MAX */
diff -Naur openjdk-7.271_p01/jdk/src/solaris/native/java/net/Inet4AddressImpl.c openjdk-7.271_p01-copy/jdk/src/solaris/native/java/net/Inet4AddressImpl.c
--- openjdk-7.271_p01/jdk/src/solaris/native/java/net/Inet4AddressImpl.c 2020-10-15 21:59:39.539954972 -0400
+++ openjdk-7.271_p01-copy/jdk/src/solaris/native/java/net/Inet4AddressImpl.c 2020-10-15 22:39:04.595942710 -0400
@@ -47,7 +47,7 @@
#include "java_net_Inet4AddressImpl.h"
-#if defined(__GLIBC__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 601104))
+#if defined(__linux__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 601104))
#define HAS_GLIBC_GETHOSTBY_R 1
#endif
diff -Naur openjdk-7.271_p01/jdk/src/solaris/native/java/net/NetworkInterface.c openjdk-7.271_p01-copy/jdk/src/solaris/native/java/net/NetworkInterface.c
--- openjdk-7.271_p01/jdk/src/solaris/native/java/net/NetworkInterface.c 2020-10-15 21:59:39.539954972 -0400
+++ openjdk-7.271_p01-copy/jdk/src/solaris/native/java/net/NetworkInterface.c 2020-10-15 22:39:38.103942536 -0400
@@ -47,7 +47,6 @@
#ifdef __linux__
#include <sys/ioctl.h>
-#include <bits/ioctls.h>
#include <sys/utsname.h>
#include <stdio.h>
#endif
diff -Naur openjdk-7.271_p01/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c openjdk-7.271_p01-copy/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c
--- openjdk-7.271_p01/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c 2020-10-15 21:59:39.539954972 -0400
+++ openjdk-7.271_p01-copy/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c 2020-10-15 22:40:04.275942400 -0400
@@ -35,7 +35,6 @@
#endif
#ifdef __linux__
#include <unistd.h>
-#include <sys/sysctl.h>
#include <sys/utsname.h>
#include <netinet/ip.h>
diff -Naur openjdk-7.271_p01/jdk/src/solaris/native/java/net/PlainSocketImpl.c openjdk-7.271_p01-copy/jdk/src/solaris/native/java/net/PlainSocketImpl.c
--- openjdk-7.271_p01/jdk/src/solaris/native/java/net/PlainSocketImpl.c 2020-10-15 21:59:39.539954972 -0400
+++ openjdk-7.271_p01-copy/jdk/src/solaris/native/java/net/PlainSocketImpl.c 2020-10-15 22:40:35.663942238 -0400
@@ -43,7 +43,6 @@
#endif
#ifdef __linux__
#include <unistd.h>
-#include <sys/sysctl.h>
#endif
#include "jvm.h"
diff -Naur openjdk-7.271_p01/jdk/src/solaris/native/java/net/linux_close.c openjdk-7.271_p01-copy/jdk/src/solaris/native/java/net/linux_close.c
--- openjdk-7.271_p01/jdk/src/solaris/native/java/net/linux_close.c 2020-10-15 21:59:39.539954972 -0400
+++ openjdk-7.271_p01-copy/jdk/src/solaris/native/java/net/linux_close.c 2020-10-15 22:41:37.471941917 -0400
@@ -75,7 +75,7 @@
#ifdef _AIX
static int sigWakeup = (SIGRTMAX - 1);
#else
-static int sigWakeup = (__SIGRTMAX - 2);
+static int sigWakeup;
#endif
/*
@@ -148,6 +148,9 @@
/*
* Setup the signal handler
*/
+#ifndef __AIX
+ sigWakeup = SIGRTMAX - 2;
+#endif
sa.sa_handler = sig_wakeup;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
diff -Naur openjdk-7.271_p01/jdk/src/solaris/native/sun/nio/ch/NativeThread.c openjdk-7.271_p01-copy/jdk/src/solaris/native/sun/nio/ch/NativeThread.c
--- openjdk-7.271_p01/jdk/src/solaris/native/sun/nio/ch/NativeThread.c 2020-10-15 21:59:39.559954972 -0400
+++ openjdk-7.271_p01-copy/jdk/src/solaris/native/sun/nio/ch/NativeThread.c 2020-10-15 22:42:01.295941794 -0400
@@ -38,7 +38,7 @@
#include <sys/signal.h>
/* Also defined in src/solaris/native/java/net/linux_close.c */
-#define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
+#define INTERRUPT_SIGNAL (SIGRTMAX - 2)
static void
nullHandler(int sig)

View File

@ -0,0 +1,13 @@
diff -Naur openjdk-7.271_p01/jdk/make/common/Defs-linux.gmk openjdk-7.271_p01-copy/jdk/make/common/Defs-linux.gmk
--- openjdk-7.271_p01/jdk/make/common/Defs-linux.gmk 2020-10-15 21:59:38.731954976 -0400
+++ openjdk-7.271_p01-copy/jdk/make/common/Defs-linux.gmk 2020-10-15 22:44:02.031941168 -0400
@@ -371,7 +371,9 @@
#
LDFLAGS_OPT = -Xlinker -O1
LDFLAGS_COMMON += -L$(LIBDIR)/$(LIBARCH)
+ifdef LIBRARY
LDFLAGS_COMMON += -Wl,-soname=$(LIB_PREFIX)$(LIBRARY).$(LIBRARY_SUFFIX)
+endif
#
# -static-libgcc is a gcc-3 flag to statically link libgcc, gcc-2.9x always

View File

@ -0,0 +1,116 @@
diff -Naur openjdk-8.265_p01/hotspot/src/os/linux/vm/jvm_linux.cpp openjdk-8.265_p01-copy/hotspot/src/os/linux/vm/jvm_linux.cpp
--- openjdk-8.265_p01/hotspot/src/os/linux/vm/jvm_linux.cpp 2020-10-11 15:53:08.468010359 -0400
+++ openjdk-8.265_p01-copy/hotspot/src/os/linux/vm/jvm_linux.cpp 2020-10-11 20:42:02.152018764 -0400
@@ -154,7 +154,9 @@
#ifdef SIGSTKFLT
"STKFLT", SIGSTKFLT, /* Stack fault. */
#endif
+#ifdef SIGCLD
"CLD", SIGCLD, /* Same as SIGCHLD (System V). */
+#endif
"CHLD", SIGCHLD, /* Child status has changed (POSIX). */
"CONT", SIGCONT, /* Continue (POSIX). */
"STOP", SIGSTOP, /* Stop, unblockable (POSIX). */
diff -Naur openjdk-8.265_p01/hotspot/src/os/linux/vm/os_linux.cpp openjdk-8.265_p01-copy/hotspot/src/os/linux/vm/os_linux.cpp
--- openjdk-8.265_p01/hotspot/src/os/linux/vm/os_linux.cpp 2020-10-11 15:53:08.468010359 -0400
+++ openjdk-8.265_p01-copy/hotspot/src/os/linux/vm/os_linux.cpp 2020-10-11 20:43:52.252018818 -0400
@@ -95,7 +95,6 @@
# include <string.h>
# include <syscall.h>
# include <sys/sysinfo.h>
-# include <gnu/libc-version.h>
# include <sys/ipc.h>
# include <sys/shm.h>
# include <link.h>
@@ -581,6 +580,13 @@
// detecting pthread library
void os::Linux::libpthread_init() {
+#if 1
+ // Hard code Alpine Linux supported musl compatible settings
+ os::Linux::set_glibc_version("glibc 2.9");
+ os::Linux::set_libpthread_version("NPTL");
+ os::Linux::set_is_NPTL();
+ os::Linux::set_is_floating_stack();
+#else
// Save glibc and pthread version strings. Note that _CS_GNU_LIBC_VERSION
// and _CS_GNU_LIBPTHREAD_VERSION are supported in glibc >= 2.3.2. Use a
// generic name for earlier versions.
@@ -639,6 +645,7 @@
if (os::Linux::is_NPTL() || os::Linux::supports_variable_stack_size()) {
os::Linux::set_is_floating_stack();
}
+#endif
}
/////////////////////////////////////////////////////////////////////////////
@@ -2968,6 +2975,11 @@
extern "C" JNIEXPORT void numa_error(char *where) { }
extern "C" JNIEXPORT int fork1() { return fork(); }
+static void *dlvsym(void *handle, const char *name, const char *ver)
+{
+ return dlsym(handle, name);
+}
+
// Handle request to load libnuma symbol version 1.1 (API v1). If it fails
// load symbol from base version instead.
void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
diff -Naur openjdk-8.265_p01/hotspot/src/os/linux/vm/os_linux.inline.hpp openjdk-8.265_p01-copy/hotspot/src/os/linux/vm/os_linux.inline.hpp
--- openjdk-8.265_p01/hotspot/src/os/linux/vm/os_linux.inline.hpp 2020-10-11 15:53:08.468010359 -0400
+++ openjdk-8.265_p01-copy/hotspot/src/os/linux/vm/os_linux.inline.hpp 2020-10-11 20:44:18.000018830 -0400
@@ -33,7 +33,7 @@
#include <unistd.h>
#include <sys/socket.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <netdb.h>
inline void* os::thread_local_storage_at(int index) {
diff -Naur openjdk-8.265_p01/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp openjdk-8.265_p01-copy/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
--- openjdk-8.265_p01/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp 2020-10-11 15:53:08.472010359 -0400
+++ openjdk-8.265_p01-copy/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp 2020-10-11 20:47:50.888018933 -0400
@@ -72,7 +72,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-# include <fpu_control.h>
#ifdef AMD64
#define REG_SP REG_RSP
@@ -543,6 +542,9 @@
ShouldNotReachHere();
}
+#define _FPU_GETCW(cw) __asm__ __volatile__ ("fnstcw %0" : "=m" (*&cw))
+#define _FPU_SETCW(cw) __asm__ __volatile__ ("fldcw %0" : : "m" (*&cw))
+
void os::Linux::init_thread_fpu_state(void) {
#ifndef AMD64
// set fpu to 53 bit precision
diff -Naur openjdk-8.265_p01/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp openjdk-8.265_p01-copy/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp
--- openjdk-8.265_p01/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp 2020-10-11 15:53:08.472010359 -0400
+++ openjdk-8.265_p01-copy/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp 2020-10-11 20:48:23.452018949 -0400
@@ -32,7 +32,9 @@
// map stack pointer to thread pointer - see notes in threadLS_linux_x86.cpp
#define SP_BITLENGTH 32
#define PAGE_SHIFT 12
+ #ifndef PAGE_SIZE
#define PAGE_SIZE (1UL << PAGE_SHIFT)
+ #endif
static Thread* _sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)];
public:
diff -Naur openjdk-8.265_p01/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp openjdk-8.265_p01-copy/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
--- openjdk-8.265_p01/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp 2020-10-11 15:53:08.572010359 -0400
+++ openjdk-8.265_p01-copy/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp 2020-10-11 20:49:02.568018968 -0400
@@ -235,7 +235,7 @@
#elif defined(__APPLE__)
inline int g_isnan(double f) { return isnan(f); }
#elif defined(LINUX) || defined(_ALLBSD_SOURCE)
-inline int g_isnan(float f) { return isnanf(f); }
+inline int g_isnan(float f) { return isnan(f); }
inline int g_isnan(double f) { return isnan(f); }
#else
#error "missing platform-specific definition here"

View File

@ -0,0 +1,24 @@
diff -Naur openjdk-8.265_p01/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp openjdk-8.265_p01-copy/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp
--- openjdk-8.265_p01/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp 2020-10-11 15:53:08.452010359 -0400
+++ openjdk-8.265_p01-copy/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp 2020-10-11 20:51:15.688019033 -0400
@@ -44,6 +44,8 @@
#include "gc_implementation/g1/heapRegion.hpp"
#endif // INCLUDE_ALL_GCS
+#include <asm/ptrace.h>
+
#ifdef PRODUCT
#define BLOCK_COMMENT(str) // nothing
#else
diff -Naur openjdk-8.265_p01/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.cpp openjdk-8.265_p01-copy/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.cpp
--- openjdk-8.265_p01/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.cpp 2020-10-11 15:53:08.472010359 -0400
+++ openjdk-8.265_p01-copy/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.cpp 2020-10-11 20:51:42.444019045 -0400
@@ -27,6 +27,8 @@
#include "runtime/frame.inline.hpp"
#include "runtime/thread.hpp"
+#include <asm/ptrace.h>
+
bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava) {
assert(this->is_Java_thread(), "must be JavaThread");

View File

@ -0,0 +1,12 @@
diff -Naur openjdk-8.265_p01/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp openjdk-8.265_p01-copy/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp
--- openjdk-8.265_p01/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp 2020-07-26 20:20:35.000000000 -0400
+++ openjdk-8.265_p01-copy/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp 2020-10-11 21:49:21.268020723 -0400
@@ -72,7 +72,7 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-# include <fpu_control.h>
+# include <linux/types.h> /* provides __u64 */
#define REG_FP 29

View File

@ -1,7 +1,7 @@
diff -Naurw openjdk.orig/common/autoconf/configure openjdk/common/autoconf/configure
--- openjdk.orig/common/autoconf/configure 2016-02-02 13:31:48.655932240 -0800
+++ openjdk/common/autoconf/configure 2016-02-02 13:36:24.860924385 -0800
@@ -96,7 +96,7 @@
diff -Naur openjdk-8.265_p01/common/autoconf/configure openjdk-8.265_p01-copy/common/autoconf/configure
--- openjdk-8.265_p01/common/autoconf/configure 2020-10-11 15:53:08.360010359 -0400
+++ openjdk-8.265_p01-copy/common/autoconf/configure 2020-10-11 21:19:41.768019860 -0400
@@ -103,7 +103,7 @@
}
# Check for local changes
@ -10,9 +10,9 @@ diff -Naurw openjdk.orig/common/autoconf/configure openjdk/common/autoconf/confi
if test -e $conf_custom_script_dir/generated-configure.sh; then
# Test if open configure is newer than custom configure, if so, custom needs to
diff -Naurw openjdk.orig/common/autoconf/jdk-options.m4 openjdk/common/autoconf/jdk-options.m4
--- openjdk.orig/common/autoconf/jdk-options.m4 2016-02-02 13:31:48.657932240 -0800
+++ openjdk/common/autoconf/jdk-options.m4 2016-02-02 13:36:24.860924385 -0800
diff -Naur openjdk-8.265_p01/common/autoconf/jdk-options.m4 openjdk-8.265_p01-copy/common/autoconf/jdk-options.m4
--- openjdk-8.265_p01/common/autoconf/jdk-options.m4 2020-10-11 15:53:08.364010359 -0400
+++ openjdk-8.265_p01-copy/common/autoconf/jdk-options.m4 2020-10-11 21:20:14.764019876 -0400
@@ -151,7 +151,7 @@
AC_SUBST(JVM_VARIANT_ZEROSHARK)
AC_SUBST(JVM_VARIANT_CORE)
@ -22,10 +22,10 @@ diff -Naurw openjdk.orig/common/autoconf/jdk-options.m4 openjdk/common/autoconf/
if test "x$JVM_VARIANT_ZERO" = xtrue ; then
INCLUDE_SA=false
fi
diff -Naurw openjdk.orig/hotspot/make/linux/makefiles/defs.make openjdk/hotspot/make/linux/makefiles/defs.make
--- openjdk.orig/hotspot/make/linux/makefiles/defs.make 2016-02-02 13:31:53.410932105 -0800
+++ openjdk/hotspot/make/linux/makefiles/defs.make 2016-02-02 13:36:24.861924385 -0800
@@ -309,6 +309,9 @@
diff -Naur openjdk-8.265_p01/hotspot/make/linux/makefiles/defs.make openjdk-8.265_p01-copy/hotspot/make/linux/makefiles/defs.make
--- openjdk-8.265_p01/hotspot/make/linux/makefiles/defs.make 2020-10-11 15:53:08.448010359 -0400
+++ openjdk-8.265_p01-copy/hotspot/make/linux/makefiles/defs.make 2020-10-11 21:21:24.716019910 -0400
@@ -296,6 +296,9 @@
# Serviceability Binaries
# No SA Support for PPC, IA64, ARM or zero
@ -35,10 +35,10 @@ diff -Naurw openjdk.orig/hotspot/make/linux/makefiles/defs.make openjdk/hotspot/
ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
$(EXPORT_LIB_DIR)/sa-jdi.jar
ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
@@ -326,6 +329,11 @@
@@ -311,6 +314,11 @@
endif
endif
endif
endif
+else
+ADD_SA_BINARIES/x86 =
+ADD_SA_BINARIES/sparc =
@ -47,26 +47,27 @@ diff -Naurw openjdk.orig/hotspot/make/linux/makefiles/defs.make openjdk/hotspot/
ADD_SA_BINARIES/ppc =
ADD_SA_BINARIES/ia64 =
ADD_SA_BINARIES/arm =
diff -Naurw openjdk.orig/hotspot/make/linux/makefiles/sa.make openjdk/hotspot/make/linux/makefiles/sa.make
--- openjdk.orig/hotspot/make/linux/makefiles/sa.make 2016-02-02 13:31:53.414932105 -0800
+++ openjdk/hotspot/make/linux/makefiles/sa.make 2016-02-02 13:36:24.861924385 -0800
diff -Naur openjdk-8.265_p01/hotspot/make/linux/makefiles/sa.make openjdk-8.265_p01-copy/hotspot/make/linux/makefiles/sa.make
--- openjdk-8.265_p01/hotspot/make/linux/makefiles/sa.make 2020-10-11 15:53:08.448010359 -0400
+++ openjdk-8.265_p01-copy/hotspot/make/linux/makefiles/sa.make 2020-10-11 21:22:39.556019946 -0400
@@ -59,9 +59,11 @@
# if $(AGENT_DIR) does not exist, we don't build SA
# also, we don't build SA on Itanium or zero.
+# check for thread_db.h too (musl does not have it).
all:
-all:
- if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" \
+all:
+ if [ -d $(AGENT_DIR) -a -f /usr/include/thread_db.h \
+ -a "$(SRCARCH)" != "ia64" \
-a "$(SRCARCH)" != "zero" ] ; then \
$(MAKE) -f sa.make $(GENERATED)/sa-jdi.jar; \
fi
diff -Naurw openjdk.orig/hotspot/make/linux/makefiles/saproc.make openjdk/hotspot/make/linux/makefiles/saproc.make
--- openjdk.orig/hotspot/make/linux/makefiles/saproc.make 2016-02-02 13:31:53.745932095 -0800
+++ openjdk/hotspot/make/linux/makefiles/saproc.make 2016-02-02 13:36:24.861924385 -0800
@@ -61,12 +61,15 @@
diff -Naur openjdk-8.265_p01/hotspot/make/linux/makefiles/saproc.make openjdk-8.265_p01-copy/hotspot/make/linux/makefiles/saproc.make
--- openjdk-8.265_p01/hotspot/make/linux/makefiles/saproc.make 2020-10-11 15:53:08.448010359 -0400
+++ openjdk-8.265_p01-copy/hotspot/make/linux/makefiles/saproc.make 2020-10-11 21:23:13.672019963 -0400
@@ -66,12 +66,15 @@
# if $(AGENT_DIR) does not exist, we don't build SA
# also, we don't build SA on Itanium or zero.

View File

@ -0,0 +1,12 @@
diff -Naur openjdk-8.265_p01/jdk/src/solaris/bin/java_md_solinux.c openjdk-8.265_p01-copy/jdk/src/solaris/bin/java_md_solinux.c
--- openjdk-8.265_p01/jdk/src/solaris/bin/java_md_solinux.c 2020-10-11 15:53:09.288010360 -0400
+++ openjdk-8.265_p01-copy/jdk/src/solaris/bin/java_md_solinux.c 2020-10-11 20:57:18.932019209 -0400
@@ -291,6 +291,8 @@
char *dmllp = NULL;
char *p; /* a utility pointer */
+ return JNI_TRUE;
+
#ifdef AIX
/* We always have to set the LIBPATH on AIX because ld doesn't support $ORIGIN. */
return JNI_TRUE;

View File

@ -0,0 +1,83 @@
diff -Naur openjdk-8.265_p01/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp openjdk-8.265_p01-copy/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp
--- openjdk-8.265_p01/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp 2020-10-11 15:53:09.224010360 -0400
+++ openjdk-8.265_p01-copy/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp 2020-10-11 20:58:53.716019255 -0400
@@ -46,6 +46,8 @@
#include "zip.h"
+#define uchar unsigned char
+
#ifdef NO_ZLIB
inline bool jar::deflate_bytes(bytes& head, bytes& tail) {
diff -Naur openjdk-8.265_p01/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h openjdk-8.265_p01-copy/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h
--- openjdk-8.265_p01/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h 2020-10-11 15:53:09.224010360 -0400
+++ openjdk-8.265_p01-copy/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h 2020-10-11 20:59:15.072019265 -0400
@@ -23,9 +23,7 @@
* questions.
*/
-#define ushort unsigned short
-#define uint unsigned int
-#define uchar unsigned char
+#include <sys/types.h>
struct unpacker;
diff -Naur openjdk-8.265_p01/jdk/src/share/native/sun/awt/medialib/mlib_types.h openjdk-8.265_p01-copy/jdk/src/share/native/sun/awt/medialib/mlib_types.h
--- openjdk-8.265_p01/jdk/src/share/native/sun/awt/medialib/mlib_types.h 2020-10-11 15:53:09.236010360 -0400
+++ openjdk-8.265_p01-copy/jdk/src/share/native/sun/awt/medialib/mlib_types.h 2020-10-11 20:59:44.012019279 -0400
@@ -27,6 +27,7 @@
#ifndef MLIB_TYPES_H
#define MLIB_TYPES_H
+#include <stddef.h> /* for NULL */
#include <limits.h>
#if defined(_MSC_VER)
#include <float.h> /* for FLT_MAX and DBL_MAX */
diff -Naur openjdk-8.265_p01/jdk/src/solaris/native/java/net/Inet4AddressImpl.c openjdk-8.265_p01-copy/jdk/src/solaris/native/java/net/Inet4AddressImpl.c
--- openjdk-8.265_p01/jdk/src/solaris/native/java/net/Inet4AddressImpl.c 2020-10-11 15:53:09.308010360 -0400
+++ openjdk-8.265_p01-copy/jdk/src/solaris/native/java/net/Inet4AddressImpl.c 2020-10-11 21:00:21.952019297 -0400
@@ -47,7 +47,7 @@
#include "java_net_Inet4AddressImpl.h"
-#if defined(__GLIBC__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 601104))
+#if defined(__linux__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 601104))
#define HAS_GLIBC_GETHOSTBY_R 1
#endif
diff -Naur openjdk-8.265_p01/jdk/src/solaris/native/java/net/linux_close.c openjdk-8.265_p01-copy/jdk/src/solaris/native/java/net/linux_close.c
--- openjdk-8.265_p01/jdk/src/solaris/native/java/net/linux_close.c 2020-10-11 15:53:09.308010360 -0400
+++ openjdk-8.265_p01-copy/jdk/src/solaris/native/java/net/linux_close.c 2020-10-11 21:01:22.872019327 -0400
@@ -58,7 +58,7 @@
/*
* Signal to unblock thread
*/
-static int sigWakeup = (__SIGRTMAX - 2);
+static int sigWakeup;
/*
* fdTable holds one entry per file descriptor, up to a certain
@@ -147,6 +147,9 @@
/*
* Setup the signal handler
*/
+#ifndef __AIX
+ sigWakeup = SIGRTMAX - 2;
+#endif
sa.sa_handler = sig_wakeup;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
diff -Naur openjdk-8.265_p01/jdk/src/solaris/native/sun/nio/ch/NativeThread.c openjdk-8.265_p01-copy/jdk/src/solaris/native/sun/nio/ch/NativeThread.c
--- openjdk-8.265_p01/jdk/src/solaris/native/sun/nio/ch/NativeThread.c 2020-10-11 15:53:09.316010360 -0400
+++ openjdk-8.265_p01-copy/jdk/src/solaris/native/sun/nio/ch/NativeThread.c 2020-10-11 21:02:12.156019351 -0400
@@ -36,7 +36,7 @@
#include <pthread.h>
#include <sys/signal.h>
/* Also defined in net/linux_close.c */
- #define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
+ #define INTERRUPT_SIGNAL (SIGRTMAX - 2)
#elif __solaris__
#include <thread.h>
#include <signal.h>

View File

@ -0,0 +1,144 @@
diff -Naur openjdk-8.265_p01/jdk/src/aix/native/java/net/aix_close.c openjdk-8.265_p01-copy/jdk/src/aix/native/java/net/aix_close.c
--- openjdk-8.265_p01/jdk/src/aix/native/java/net/aix_close.c 2020-10-11 15:53:09.260010360 -0400
+++ openjdk-8.265_p01-copy/jdk/src/aix/native/java/net/aix_close.c 2020-10-11 21:03:15.540019382 -0400
@@ -54,7 +54,7 @@
#include <unistd.h>
#include <errno.h>
-#include <sys/poll.h>
+#include <poll.h>
/*
* Stack allocated by thread when doing blocking operation
diff -Naur openjdk-8.265_p01/jdk/src/aix/native/sun/nio/ch/AixNativeThread.c openjdk-8.265_p01-copy/jdk/src/aix/native/sun/nio/ch/AixNativeThread.c
--- openjdk-8.265_p01/jdk/src/aix/native/sun/nio/ch/AixNativeThread.c 2020-10-11 15:53:09.260010360 -0400
+++ openjdk-8.265_p01-copy/jdk/src/aix/native/sun/nio/ch/AixNativeThread.c 2020-10-11 21:03:39.704019393 -0400
@@ -32,7 +32,7 @@
#include "sun_nio_ch_NativeThread.h"
#include <pthread.h>
-#include <sys/signal.h>
+#include <signal.h>
/* Also defined in src/aix/native/java/net/aix_close.c */
#define INTERRUPT_SIGNAL (SIGRTMAX - 1)
diff -Naur openjdk-8.265_p01/jdk/src/aix/native/sun/nio/ch/AixPollPort.c openjdk-8.265_p01-copy/jdk/src/aix/native/sun/nio/ch/AixPollPort.c
--- openjdk-8.265_p01/jdk/src/aix/native/sun/nio/ch/AixPollPort.c 2020-10-11 15:53:09.260010360 -0400
+++ openjdk-8.265_p01-copy/jdk/src/aix/native/sun/nio/ch/AixPollPort.c 2020-10-11 21:03:55.880019401 -0400
@@ -34,7 +34,7 @@
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <sys/pollset.h>
#include <fcntl.h>
#include <stddef.h>
diff -Naur openjdk-8.265_p01/jdk/src/macosx/javavm/export/jvm_md.h openjdk-8.265_p01-copy/jdk/src/macosx/javavm/export/jvm_md.h
--- openjdk-8.265_p01/jdk/src/macosx/javavm/export/jvm_md.h 2020-10-11 15:53:09.268010360 -0400
+++ openjdk-8.265_p01-copy/jdk/src/macosx/javavm/export/jvm_md.h 2020-10-11 21:04:16.324019411 -0400
@@ -60,7 +60,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
-#include <sys/signal.h>
+#include <signal.h>
/* O Flags */
diff -Naur openjdk-8.265_p01/jdk/src/solaris/javavm/export/jvm_md.h openjdk-8.265_p01-copy/jdk/src/solaris/javavm/export/jvm_md.h
--- openjdk-8.265_p01/jdk/src/solaris/javavm/export/jvm_md.h 2020-10-11 15:53:09.304010360 -0400
+++ openjdk-8.265_p01-copy/jdk/src/solaris/javavm/export/jvm_md.h 2020-10-11 21:04:38.324019422 -0400
@@ -65,7 +65,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
-#include <sys/signal.h>
+#include <signal.h>
/* O Flags */
diff -Naur openjdk-8.265_p01/jdk/src/solaris/native/java/net/PlainSocketImpl.c openjdk-8.265_p01-copy/jdk/src/solaris/native/java/net/PlainSocketImpl.c
--- openjdk-8.265_p01/jdk/src/solaris/native/java/net/PlainSocketImpl.c 2020-10-11 15:53:09.308010360 -0400
+++ openjdk-8.265_p01-copy/jdk/src/solaris/native/java/net/PlainSocketImpl.c 2020-10-11 21:05:07.272019436 -0400
@@ -28,7 +28,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#if defined(__linux__) && !defined(USE_SELECT)
-#include <sys/poll.h>
+#include <poll.h>
#endif
#include <netinet/tcp.h> /* Defines TCP_NODELAY, needed for 2.6 */
#include <netinet/in.h>
diff -Naur openjdk-8.265_p01/jdk/src/solaris/native/java/net/bsd_close.c openjdk-8.265_p01-copy/jdk/src/solaris/native/java/net/bsd_close.c
--- openjdk-8.265_p01/jdk/src/solaris/native/java/net/bsd_close.c 2020-10-11 15:53:09.308010360 -0400
+++ openjdk-8.265_p01-copy/jdk/src/solaris/native/java/net/bsd_close.c 2020-10-11 21:05:21.300019443 -0400
@@ -38,7 +38,7 @@
#include <sys/uio.h>
#include <unistd.h>
#include <errno.h>
-#include <sys/poll.h>
+#include <poll.h>
/*
* Stack allocated by thread when doing blocking operation
diff -Naur openjdk-8.265_p01/jdk/src/solaris/native/java/net/net_util_md.h openjdk-8.265_p01-copy/jdk/src/solaris/native/java/net/net_util_md.h
--- openjdk-8.265_p01/jdk/src/solaris/native/java/net/net_util_md.h 2020-10-11 15:53:09.308010360 -0400
+++ openjdk-8.265_p01-copy/jdk/src/solaris/native/java/net/net_util_md.h 2020-10-11 21:05:34.772019449 -0400
@@ -33,7 +33,7 @@
#include <unistd.h>
#ifndef USE_SELECT
-#include <sys/poll.h>
+#include <poll.h>
#endif
diff -Naur openjdk-8.265_p01/jdk/src/solaris/native/sun/nio/ch/DevPollArrayWrapper.c openjdk-8.265_p01-copy/jdk/src/solaris/native/sun/nio/ch/DevPollArrayWrapper.c
--- openjdk-8.265_p01/jdk/src/solaris/native/sun/nio/ch/DevPollArrayWrapper.c 2020-10-11 15:53:09.316010360 -0400
+++ openjdk-8.265_p01-copy/jdk/src/solaris/native/sun/nio/ch/DevPollArrayWrapper.c 2020-10-11 21:05:53.824019458 -0400
@@ -28,7 +28,7 @@
#include "jvm.h"
#include "jlong.h"
#include "sun_nio_ch_DevPollArrayWrapper.h"
-#include <sys/poll.h>
+#include <poll.h>
#include <unistd.h>
#include <sys/time.h>
diff -Naur openjdk-8.265_p01/jdk/src/solaris/native/sun/nio/ch/NativeThread.c openjdk-8.265_p01-copy/jdk/src/solaris/native/sun/nio/ch/NativeThread.c
--- openjdk-8.265_p01/jdk/src/solaris/native/sun/nio/ch/NativeThread.c 2020-10-11 15:53:09.316010360 -0400
+++ openjdk-8.265_p01-copy/jdk/src/solaris/native/sun/nio/ch/NativeThread.c 2020-10-11 21:06:07.272019465 -0400
@@ -34,7 +34,7 @@
#ifdef __linux__
#include <pthread.h>
- #include <sys/signal.h>
+ #include <signal.h>
/* Also defined in net/linux_close.c */
#define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
#elif __solaris__
diff -Naur openjdk-8.265_p01/jdk/src/solaris/native/sun/nio/ch/Net.c openjdk-8.265_p01-copy/jdk/src/solaris/native/sun/nio/ch/Net.c
--- openjdk-8.265_p01/jdk/src/solaris/native/sun/nio/ch/Net.c 2020-10-11 15:53:09.316010360 -0400
+++ openjdk-8.265_p01-copy/jdk/src/solaris/native/sun/nio/ch/Net.c 2020-10-11 21:06:25.348019474 -0400
@@ -23,7 +23,7 @@
* questions.
*/
-#include <sys/poll.h>
+#include <poll.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <string.h>
diff -Naur openjdk-8.265_p01/jdk/src/solaris/transport/socket/socket_md.c openjdk-8.265_p01-copy/jdk/src/solaris/transport/socket/socket_md.c
--- openjdk-8.265_p01/jdk/src/solaris/transport/socket/socket_md.c 2020-10-11 15:53:09.316010360 -0400
+++ openjdk-8.265_p01-copy/jdk/src/solaris/transport/socket/socket_md.c 2020-10-11 21:06:44.348019483 -0400
@@ -37,7 +37,7 @@
#include <thread.h>
#else
#include <pthread.h>
-#include <sys/poll.h>
+#include <poll.h>
#endif
#include "socket_md.h"

View File

@ -0,0 +1,21 @@
diff -Naur openjdk-8.265_p01/jdk/src/solaris/native/sun/xawt/XToolkit.c openjdk-8.265_p01-copy/jdk/src/solaris/native/sun/xawt/XToolkit.c
--- openjdk-8.265_p01/jdk/src/solaris/native/sun/xawt/XToolkit.c 2020-10-11 15:53:09.316010360 -0400
+++ openjdk-8.265_p01-copy/jdk/src/solaris/native/sun/xawt/XToolkit.c 2020-10-11 21:09:12.892019555 -0400
@@ -27,7 +27,7 @@
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/Xatom.h>
-#ifdef __linux__
+#if defined(__linux__) && defined(__GLIBC__) && ! defined(__UCLIBC__)
#include <execinfo.h>
#endif
@@ -803,7 +803,7 @@
return ret;
}
-#ifdef __linux__
+#if defined(__linux__) && defined(__GLIBC__) && ! defined(__UCLIBC__)
void print_stack(void)
{
void *array[10];

View File

@ -0,0 +1,43 @@
diff -Naur openjdk-8.265_p01/jdk/src/solaris/native/java/net/net_util_md.c openjdk-8.265_p01-copy/jdk/src/solaris/native/java/net/net_util_md.c
--- openjdk-8.265_p01/jdk/src/solaris/native/java/net/net_util_md.c 2020-10-11 15:53:09.308010360 -0400
+++ openjdk-8.265_p01-copy/jdk/src/solaris/native/java/net/net_util_md.c 2020-10-11 21:32:57.480020246 -0400
@@ -662,7 +662,7 @@
static struct localinterface *localifs = 0;
static int localifsSize = 0; /* size of array */
-static int nifs = 0; /* number of entries used in array */
+static int nifs = -1; /* number of entries used in array */
/* not thread safe: make sure called once from one thread */
@@ -674,6 +674,10 @@
int index, x1, x2, x3;
unsigned int u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,ua,ub,uc,ud,ue,uf;
+ if (nifs >= 0)
+ return ;
+ nifs = 0;
+
if ((f = fopen("/proc/net/if_inet6", "r")) == NULL) {
return ;
}
@@ -702,7 +706,7 @@
localifs = (struct localinterface *) realloc (
localifs, sizeof (struct localinterface)* (localifsSize+5));
if (localifs == 0) {
- nifs = 0;
+ nifs = -1;
fclose (f);
return;
}
@@ -725,9 +729,7 @@
static int getLocalScopeID (char *addr) {
struct localinterface *lif;
int i;
- if (localifs == 0) {
- initLocalIfs();
- }
+ initLocalIfs();
for (i=0, lif=localifs; i<nifs; i++, lif++) {
if (memcmp (addr, lif->localaddr, 16) == 0) {
return lif->index;

View File

@ -0,0 +1,103 @@
diff -Naur openjdk-8.265_p01/jdk/src/solaris/native/java/lang/childproc.c openjdk-8.265_p01-copy/jdk/src/solaris/native/java/lang/childproc.c
--- openjdk-8.265_p01/jdk/src/solaris/native/java/lang/childproc.c 2020-10-11 15:53:09.308010360 -0400
+++ openjdk-8.265_p01-copy/jdk/src/solaris/native/java/lang/childproc.c 2020-10-11 21:38:33.888020409 -0400
@@ -30,6 +30,7 @@
#include <string.h>
#include <unistd.h>
#include <limits.h>
+#include <poll.h>
#include "childproc.h"
@@ -57,59 +58,46 @@
}
int
-isAsciiDigit(char c)
-{
- return c >= '0' && c <= '9';
-}
-
-#ifdef _ALLBSD_SOURCE
-#define FD_DIR "/dev/fd"
-#define dirent64 dirent
-#define readdir64 readdir
-#elif defined(_AIX)
-/* AIX does not understand '/proc/self' - it requires the real process ID */
-#define FD_DIR aix_fd_dir
-#else
-#define FD_DIR "/proc/self/fd"
-#endif
-
-int
closeDescriptors(void)
{
- DIR *dp;
- struct dirent64 *dirp;
int from_fd = FAIL_FILENO + 1;
+ struct pollfd pfds[1024];
+ int i, total, nclosed = 0;
+ int max_fd = sysconf(_SC_OPEN_MAX);
- /* We're trying to close all file descriptors, but opendir() might
- * itself be implemented using a file descriptor, and we certainly
- * don't want to close that while it's in use. We assume that if
- * opendir() is implemented using a file descriptor, then it uses
- * the lowest numbered file descriptor, just like open(). So we
- * close a couple explicitly. */
-
- close(from_fd); /* for possible use by opendir() */
- close(from_fd + 1); /* another one for good luck */
-
-#if defined(_AIX)
- /* AIX does not understand '/proc/self' - it requires the real process ID */
- char aix_fd_dir[32]; /* the pid has at most 19 digits */
- snprintf(aix_fd_dir, 32, "/proc/%d/fd", getpid());
-#endif
-
- if ((dp = opendir(FD_DIR)) == NULL)
+ if (max_fd < 0)
return 0;
- /* We use readdir64 instead of readdir to work around Solaris bug
- * 6395699: /proc/self/fd fails to report file descriptors >= 1024 on Solaris 9
- */
- while ((dirp = readdir64(dp)) != NULL) {
- int fd;
- if (isAsciiDigit(dirp->d_name[0]) &&
- (fd = strtol(dirp->d_name, NULL, 10)) >= from_fd + 2)
- close(fd);
+ /* init events */
+ total = max_fd - from_fd;
+ for (i = 0; i < (total < 1024 ? total : 1024); i++) {
+ pfds[i].events = 0;
}
- closedir(dp);
+ while (from_fd < max_fd) {
+ int nfds, r = 0;
+
+ total = max_fd - from_fd;
+ nfds = total < 1024 ? total : 1024;
+
+ for (i = 0; i < nfds; i++)
+ pfds[i].fd = from_fd + i;
+
+ do {
+ r = poll(pfds, nfds, 0);
+ } while (r == -1 && errno == EINTR);
+
+ if (r < 0)
+ return 0;
+
+
+ for (i = 0; i < nfds; i++)
+ if (pfds[i].revents != POLLNVAL) {
+ nclosed++;
+ close(pfds[i].fd);
+ }
+ from_fd += nfds;
+ }
return 1;
}

View File

@ -0,0 +1,11 @@
--- old/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp
+++ new/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp
@@ -77,7 +77,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-# include <fpu_control.h>
#ifdef BUILTIN_SIM
#define REG_SP REG_RSP

View File

@ -0,0 +1,541 @@
--- old/common/autoconf/build-aux/config.guess
+++ new/common/autoconf/build-aux/config.guess
@@ -30,6 +30,17 @@
DIR=`dirname $0`
OUT=`. $DIR/autoconf-config.guess`
+# config.guess doesn't identify systems running the musl C library, and will
+# instead return a string with a -gnu suffix. This block detects musl and
+# modifies the string to have a -musl suffix instead.
+echo $OUT | grep -- -linux- > /dev/null 2> /dev/null
+if test $? = 0; then
+ ldd_version=`ldd --version 2>&1 | head -1 | cut -f1 -d' '`
+ if [ x"${ldd_version}" = x"musl" ]; then
+ OUT=`echo $OUT | sed 's/-gnu/-musl/'`
+ fi
+fi
+
# Test and fix solaris on x86_64
echo $OUT | grep i386-pc-solaris > /dev/null 2> /dev/null
if test $? = 0; then
--- old/hotspot/make/lib/CompileJvm.gmk
+++ new/hotspot/make/lib/CompileJvm.gmk
@@ -135,6 +135,7 @@
-DHOTSPOT_BUILD_USER='"$(USERNAME)"' \
-DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"' \
-DCPU='"$(OPENJDK_TARGET_CPU_VM_VERSION)"' \
+ -DLIBC='"musl"' \
#
# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
--- old/hotspot/src/os/linux/vm/os_linux.cpp
+++ new/hotspot/src/os/linux/vm/os_linux.cpp
@@ -98,7 +98,6 @@
# include <string.h>
# include <syscall.h>
# include <sys/sysinfo.h>
-# include <gnu/libc-version.h>
# include <sys/ipc.h>
# include <sys/shm.h>
# include <link.h>
@@ -496,6 +495,11 @@
// detecting pthread library
void os::Linux::libpthread_init() {
+#if !defined(__GLIBC__) && !defined(__UCLIBC__)
+ // Hard code Alpine Linux supported musl compatible settings
+ os::Linux::set_glibc_version("glibc 2.9");
+ os::Linux::set_libpthread_version("NPTL");
+#else
// Save glibc and pthread version strings.
#if !defined(_CS_GNU_LIBC_VERSION) || \
!defined(_CS_GNU_LIBPTHREAD_VERSION)
@@ -513,6 +517,7 @@
str = (char *)malloc(n, mtInternal);
confstr(_CS_GNU_LIBPTHREAD_VERSION, str, n);
os::Linux::set_libpthread_version(str);
+#endif
}
/////////////////////////////////////////////////////////////////////////////
@@ -2803,17 +2808,32 @@
extern "C" JNIEXPORT void numa_warn(int number, char *where, ...) { }
extern "C" JNIEXPORT void numa_error(char *where) { }
+static void* dlvsym_if_available(void* handle, const char* name, const char* version) {
+ typedef void* (*dlvsym_func_type)(void* handle, const char* name, const char* version);
+ static dlvsym_func_type dlvsym_func;
+ static bool initialized = false;
+ if (!initialized) {
+ dlvsym_func = (dlvsym_func_type)dlsym(RTLD_NEXT, "dlvsym");
+ initialized = true;
+ }
+
+ if (dlvsym_func != NULL) {
+ void *f = dlvsym_func(handle, name, version);
+ if (f != NULL) {
+ return f;
+ }
+ }
+
+ return dlsym(handle, name);
+}
+
// If we are running with libnuma version > 2, then we should
// be trying to use symbols with versions 1.1
// If we are running with earlier version, which did not have symbol versions,
// we should use the base version.
void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
- void *f = dlvsym(handle, name, "libnuma_1.1");
- if (f == NULL) {
- f = dlsym(handle, name);
- }
- return f;
+ return dlvsym_if_available(handle, name, "libnuma_1.1");
}
bool os::Linux::libnuma_init() {
--- old/hotspot/src/os/linux/vm/os_linux.inline.hpp
+++ new/hotspot/src/os/linux/vm/os_linux.inline.hpp
@@ -31,7 +31,7 @@
#include <unistd.h>
#include <sys/socket.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <netdb.h>
// File names are case-sensitive on windows only
--- old/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
+++ new/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
@@ -73,7 +73,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-# include <fpu_control.h>
#ifdef AMD64
#define REG_SP REG_RSP
--- old/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp
+++ new/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp
@@ -1017,7 +1017,7 @@
static ScratchBlock *removeSmallestScratch(ScratchBlock **prev_ptr) {
bool first = true;
size_t min_size = 0; // "first" makes this conceptually infinite.
- ScratchBlock **smallest_ptr, *smallest;
+ ScratchBlock **smallest_ptr = NULL, *smallest;
ScratchBlock *cur = *prev_ptr;
while (cur) {
assert(*prev_ptr == cur, "just checking");
--- old/hotspot/src/share/vm/runtime/vm_version.cpp
+++ new/hotspot/src/share/vm/runtime/vm_version.cpp
@@ -263,7 +263,7 @@
#endif
#define INTERNAL_VERSION_SUFFIX VM_RELEASE ")" \
- " for " OS "-" CPU FLOAT_ARCH_STR \
+ " for " OS "-" CPU FLOAT_ARCH_STR LIBC \
" JRE (" VERSION_STRING "), built on " __DATE__ " " __TIME__ \
" by " XSTR(HOTSPOT_BUILD_USER) " with " HOTSPOT_BUILD_COMPILER
--- old/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
+++ new/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
@@ -216,7 +216,7 @@
#elif defined(__APPLE__)
inline int g_isnan(double f) { return isnan(f); }
#elif defined(LINUX) || defined(_ALLBSD_SOURCE)
-inline int g_isnan(float f) { return isnanf(f); }
+inline int g_isnan(float f) { return isnan(f); }
inline int g_isnan(double f) { return isnan(f); }
#else
#error "missing platform-specific definition here"
--- old/hotspot/test/runtime/StackGuardPages/exeinvoke.c
+++ new/hotspot/test/runtime/StackGuardPages/exeinvoke.c
@@ -33,6 +33,7 @@
#include <assert.h>
#include <jni.h>
+#include <jvm.h>
#include <alloca.h>
#include <signal.h>
#include <string.h>
@@ -91,6 +92,20 @@
}
}
+int get_java_stacksize () {
+ size_t stacksize;
+ pthread_attr_t attr;
+ JDK1_1InitArgs jdk_args;
+
+ jdk_args.version = JNI_VERSION_1_1;
+ JNI_GetDefaultJavaVMInitArgs(&jdk_args);
+ if (jdk_args.javaStackSize <= 0) {
+ fprintf(stderr, "Test ERROR. Can't get a valid value for the default stacksize.\n");
+ exit(7);
+ }
+ return jdk_args.javaStackSize;
+}
+
void *run_java_overflow (void *p) {
JNIEnv *env;
jclass class_id;
@@ -254,13 +269,19 @@
exit(7);
}
+ int stack_size = get_java_stacksize();
pthread_t thr;
+ pthread_attr_t thread_attr;
+ pthread_attr_init(&thread_attr);
+ pthread_attr_setstacksize(&thread_attr, stack_size);
+
if (argc > 1 && strcmp(argv[1], "test_java_overflow") == 0) {
printf("\nTesting JAVA_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_java_overflow, NULL);
+
+ pthread_create (&thr, &thread_attr, run_java_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
@@ -273,7 +294,7 @@
printf("\nTesting NATIVE_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_native_overflow, NULL);
+ pthread_create (&thr, &thread_attr, run_native_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
--- old/jdk/make/lib/CoreLibraries.gmk
+++ new/jdk/make/lib/CoreLibraries.gmk
@@ -339,6 +339,7 @@
endif
LIBJLI_CFLAGS += $(addprefix -I, $(LIBJLI_SRC_DIRS))
+LIBJLI_CFLAGS += -DLIBC=\"musl\"
ifneq ($(USE_EXTERNAL_LIBZ), true)
LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS)
--- old/jdk/src/java.base/linux/native/libnet/linux_close.c
+++ new/jdk/src/java.base/linux/native/libnet/linux_close.c
@@ -58,7 +58,7 @@
/*
* Signal to unblock thread
*/
-static int sigWakeup = (__SIGRTMAX - 2);
+static int sigWakeup;
/*
* fdTable holds one entry per file descriptor, up to a certain
@@ -147,6 +147,7 @@
/*
* Setup the signal handler
*/
+ sigWakeup = SIGRTMAX - 2;
sa.sa_handler = sig_wakeup;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
--- old/jdk/src/java.base/unix/native/include/jvm_md.h
+++ new/jdk/src/java.base/unix/native/include/jvm_md.h
@@ -65,7 +65,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
-#include <sys/signal.h>
+#include <signal.h>
/* O Flags */
--- old/jdk/src/java.base/unix/native/libjava/childproc.c
+++ new/jdk/src/java.base/unix/native/libjava/childproc.c
@@ -237,7 +237,13 @@
{
if (envp == NULL || (char **) envp == environ) {
execvp(file, (char **) argv);
- return;
+ // ENOEXEC indicates that the file header was not recognized. The musl C
+ // library does not implement the fallback to /bin/sh for that case, so fall
+ // through to the code below which implements that fallback using
+ // execve_with_shell_fallback.
+ if (errno != ENOEXEC) {
+ return;
+ }
}
if (*file == '\0') {
--- old/jdk/src/java.base/unix/native/libjava/jdk_util_md.h
+++ new/jdk/src/java.base/unix/native/libjava/jdk_util_md.h
@@ -37,7 +37,7 @@
#define ISNAND(d) isnan(d)
#elif defined(__linux__) || defined(_ALLBSD_SOURCE)
#include <math.h>
-#define ISNANF(f) isnanf(f)
+#define ISNANF(f) isnan(f)
#define ISNAND(d) isnan(d)
#elif defined(_AIX)
#include <math.h>
--- old/jdk/src/java.base/unix/native/libjli/java_md_solinux.c
+++ new/jdk/src/java.base/unix/native/libjli/java_md_solinux.c
@@ -241,6 +241,39 @@
char *dmllp = NULL;
char *p; /* a utility pointer */
+#ifdef __linux
+#ifndef LIBC
+#error "LIBC not set"
+#endif
+
+ if (strcmp(LIBC, "musl") == 0) {
+ /*
+ * The musl library loader requires LD_LIBRARY_PATH to be set in
+ * order to correctly resolve the dependency libjava.so has on libjvm.so.
+ *
+ * Specifically, it differs from glibc in the sense that even if
+ * libjvm.so has already been loaded it will not be considered a
+ * candidate for resolving the dependency unless the *full* path
+ * of the already loaded library matches the dependency being loaded.
+ *
+ * libjvm.so is being loaded by the launcher using a long path to
+ * dlopen, not just the basename of the library. Typically this
+ * is something like "../lib/server/libjvm.so". However, if/when
+ * libjvm.so later tries to dlopen libjava.so (which it does in
+ * order to get access to a few functions implemented in
+ * libjava.so) the musl loader will, as part of loading
+ * dependent libraries, try to load libjvm.so using only its
+ * basename "libjvm.so". Since this does not match the longer
+ * path path it was first loaded with, the already loaded
+ * library is not considered a candidate, and the loader will
+ * instead look for libjvm.so elsewhere. If it's not in
+ * LD_LIBRARY_PATH the dependency load will fail, and libjava.so
+ * will therefore fail as well.
+ */
+ return JNI_TRUE;
+ }
+#endif
+
#ifdef AIX
/* We always have to set the LIBPATH on AIX because ld doesn't support $ORIGIN. */
return JNI_TRUE;
--- old/jdk/src/java.base/unix/native/libnet/net_util_md.h
+++ new/jdk/src/java.base/unix/native/libnet/net_util_md.h
@@ -27,7 +27,7 @@
#define NET_UTILS_MD_H
#include <netdb.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <sys/socket.h>
/************************************************************************
--- old/jdk/src/java.base/unix/native/libnio/ch/NativeThread.c
+++ new/jdk/src/java.base/unix/native/libnio/ch/NativeThread.c
@@ -36,7 +36,7 @@
#include <pthread.h>
#include <sys/signal.h>
/* Also defined in net/linux_close.c */
- #define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
+ #define INTERRUPT_SIGNAL (SIGRTMAX - 2)
#elif _AIX
#include <pthread.h>
#include <sys/signal.h>
--- old/jdk/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c
+++ new/jdk/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c
@@ -27,9 +27,6 @@
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/Xatom.h>
-#ifdef __linux__
-#include <execinfo.h>
-#endif
#include <jvm.h>
#include <jni.h>
@@ -786,26 +783,6 @@
}
return ret;
}
-
-#ifdef __linux__
-void print_stack(void)
-{
- void *array[10];
- size_t size;
- char **strings;
- size_t i;
-
- size = backtrace (array, 10);
- strings = backtrace_symbols (array, size);
-
- fprintf (stderr, "Obtained %zd stack frames.\n", size);
-
- for (i = 0; i < size; i++)
- fprintf (stderr, "%s\n", strings[i]);
-
- free (strings);
-}
-#endif
Window get_xawt_root_shell(JNIEnv *env) {
static jclass classXRootWindow = NULL;
--- old/jdk/test/java/lang/ProcessBuilder/Basic.java
+++ new/jdk/test/java/lang/ProcessBuilder/Basic.java
@@ -391,8 +391,8 @@
if (failed != 0) throw new Error("null PATH");
} else if (action.equals("PATH search algorithm")) {
equal(System.getenv("PATH"), "dir1:dir2:");
- check(new File("/bin/true").exists());
- check(new File("/bin/false").exists());
+ check(new File(TrueExe.path()).exists());
+ check(new File(FalseExe.path()).exists());
String[] cmd = {"prog"};
ProcessBuilder pb1 = new ProcessBuilder(cmd);
ProcessBuilder pb2 = new ProcessBuilder(cmd);
@@ -433,13 +433,13 @@
checkPermissionDenied(pb);
// continue searching if EACCES
- copy("/bin/true", "dir2/prog");
+ copy(TrueExe.path(), "dir2/prog");
equal(run(pb).exitValue(), True.exitValue());
new File("dir1/prog").delete();
new File("dir2/prog").delete();
new File("dir2/prog").mkdirs();
- copy("/bin/true", "dir1/prog");
+ copy(TrueExe.path(), "dir1/prog");
equal(run(pb).exitValue(), True.exitValue());
// Check empty PATH component means current directory.
@@ -455,10 +455,10 @@
pb.command(command);
File prog = new File("./prog");
// "Normal" binaries
- copy("/bin/true", "./prog");
+ copy(TrueExe.path(), "./prog");
equal(run(pb).exitValue(),
True.exitValue());
- copy("/bin/false", "./prog");
+ copy(FalseExe.path(), "./prog");
equal(run(pb).exitValue(),
False.exitValue());
prog.delete();
@@ -513,12 +513,12 @@
new File("dir2/prog").delete();
new File("prog").delete();
new File("dir3").mkdirs();
- copy("/bin/true", "dir1/prog");
- copy("/bin/false", "dir3/prog");
+ copy(TrueExe.path(), "dir1/prog");
+ copy(FalseExe.path(), "dir3/prog");
pb.environment().put("PATH","dir3");
equal(run(pb).exitValue(), True.exitValue());
- copy("/bin/true", "dir3/prog");
- copy("/bin/false", "dir1/prog");
+ copy(TrueExe.path(), "dir3/prog");
+ copy(FalseExe.path(), "dir1/prog");
equal(run(pb).exitValue(), False.exitValue());
} finally {
@@ -615,6 +615,13 @@
new File("/bin/false").exists());
}
+ static class BusyBox {
+ public static boolean is() { return is; }
+ private static final boolean is =
+ (! Windows.is() &&
+ new File("/bin/busybox").exists());
+ }
+
static class UnicodeOS {
public static boolean is() { return is; }
private static final String osName = System.getProperty("os.name");
@@ -653,6 +660,45 @@
}
}
+ // On alpine linux, /bin/true and /bin/false are just links to /bin/busybox.
+ // Some tests copy /bin/true and /bin/false to files with a different filename.
+ // However, copying the busbox executable into a file with a different name
+ // won't result in the expected return codes. As workaround, we create
+ // executable files that can be copied and produce the exepected return
+ // values. We use this workaround, if we find the busybox executable.
+
+ private static class TrueExe {
+ public static String path() { return path; }
+ private static final String path = path0();
+ private static String path0(){
+ if (!BusyBox.is()) {
+ return "/bin/true";
+ }
+ else {
+ File trueExe = new File("true");
+ setFileContents(trueExe, "#!/bin/true\n");
+ trueExe.setExecutable(true);
+ return trueExe.getAbsolutePath();
+ }
+ }
+ }
+
+ private static class FalseExe {
+ public static String path() { return path; }
+ private static final String path = path0();
+ private static String path0(){
+ if (!BusyBox.is()) {
+ return "/bin/false";
+ }
+ else {
+ File falseExe = new File("false");
+ setFileContents(falseExe, "#!/bin/false\n");
+ falseExe.setExecutable(true);
+ return falseExe.getAbsolutePath();
+ }
+ }
+ }
+
static class EnglishUnix {
private static final Boolean is =
(! Windows.is() && isEnglish("LANG") && isEnglish("LC_ALL"));
@@ -1956,7 +2002,7 @@
//----------------------------------------------------------------
try {
new File("suBdiR").mkdirs();
- copy("/bin/true", "suBdiR/unliKely");
+ copy(TrueExe.path(), "suBdiR/unliKely");
final ProcessBuilder pb =
new ProcessBuilder(new String[]{"unliKely"});
pb.environment().put("PATH", "suBdiR");
--- old/jdk/test/java/lang/ProcessHandle/InfoTest.java
+++ new/jdk/test/java/lang/ProcessHandle/InfoTest.java
@@ -293,7 +293,14 @@
}
if (info.command().isPresent()) {
String command = info.command().get();
- String expected = Platform.isWindows() ? "sleep.exe" : "sleep";
+ String expected = "sleep";
+ if (Platform.isWindows()) {
+ expected = "sleep.exe";
+ } else if (new File("/bin/busybox").exists()) {
+ // With busybox sleep is just a sym link to busybox.
+ // The busbox executable is seen as ProcessHandle.Info command.
+ expected = "busybox";
+ }
Assert.assertTrue(command.endsWith(expected), "Command: expected: \'" +
expected + "\', actual: " + command);
--- old/make/ReleaseFile.gmk
+++ new/make/ReleaseFile.gmk
@@ -50,6 +50,7 @@
$(call info-file-item, "IMPLEMENTOR", "$(COMPANY_NAME)")
$(call info-file-item, "OS_NAME", "$(RELEASE_FILE_OS_NAME)")
$(call info-file-item, "OS_ARCH", "$(RELEASE_FILE_OS_ARCH)")
+ $(call info-file-item, "LIBC", "musl")
endef
# Param 1 - The file containing the MODULES list

View File

@ -0,0 +1,15 @@
The alpine builders print out a warning about sched_getaffinity() not working.
This causes the version check for the boot jdk to fail.
Patch the command to determine the version number to ignore any errors and warnings.
--- old/common/autoconf/boot-jdk.m4
+++ new/common/autoconf/boot-jdk.m4
@@ -74,7 +74,7 @@
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $GREP version | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
[FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"9([\.+-].*)?\"|(1\.[89]\.)'`]

View File

@ -0,0 +1,17 @@
upstream report: https://bugs.openjdk.java.net/browse/JDK-8237879.
diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk
index 170c3ed..697f9d2 100644
--- a/make/common/MakeBase.gmk
+++ b/make/common/MakeBase.gmk
@@ -904,7 +904,9 @@ DependOnVariableHelper = \
$(info NewVariable $1: >$(strip $($1))<) \
$(info OldVariable $1: >$(strip $($1_old))<)) \
$(call WriteFile, $1_old:=$(call DoubleDollar,$(call EscapeHash,$($1))), \
- $(call DependOnVariableFileName, $1, $2))) \
+ $(call DependOnVariableFileName, $1, $2)) \
+ $(eval $(call DependOnVariableFileName, $1, $2): ) \
+ ) \
$(call DependOnVariableFileName, $1, $2) \
)

View File

@ -0,0 +1,151 @@
--- old/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp
+++ new/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp
@@ -1292,7 +1292,11 @@
// the safepoing polling page.
ucontext_t* uc = (ucontext_t*) ucontext;
// Set polling address.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address addr = (address)uc->uc_mcontext.regs->gpr[ra] + (ssize_t)ds;
+#else // Musl
+ address addr = (address)uc->uc_mcontext.gp_regs[ra] + (ssize_t) ds;
+#endif
if (polling_address_ptr != NULL) {
*polling_address_ptr = addr;
}
@@ -1313,15 +1317,24 @@
int rb = inv_rb_field(instruction);
// look up content of ra and rb in ucontext
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address ra_val=(address)uc->uc_mcontext.regs->gpr[ra];
long rb_val=(long)uc->uc_mcontext.regs->gpr[rb];
+#else // Musl
+ address ra_val=(address)uc->uc_mcontext.gp_regs[ra];
+ long rb_val=(long)uc->uc_mcontext.gp_regs[rb];
+#endif
return os::is_memory_serialize_page(thread, ra_val+rb_val);
} else if (is_stw(instruction) || is_stwu(instruction)) {
int ra = inv_ra_field(instruction);
int d1 = inv_d1_field(instruction);
// look up content of ra in ucontext
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address ra_val=(address)uc->uc_mcontext.regs->gpr[ra];
+#else // Musl
+ address ra_val=(address)uc->uc_mcontext.gp_regs[ra];
+#endif
return os::is_memory_serialize_page(thread, ra_val+d1);
} else {
return false;
@@ -1384,11 +1397,20 @@
|| (is_stdu(instruction) && rs == 1)) {
int ds = inv_ds_field(instruction);
// return banged address
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return ds+(address)uc->uc_mcontext.regs->gpr[ra];
+#else // Musl
+ return ds+(address)uc->uc_mcontext.gp_regs[ra];
+#endif
} else if (is_stdux(instruction) && rs == 1) {
int rb = inv_rb_field(instruction);
+#if defined(__GLIBC__) || defined(__UCLIBC__)
address sp = (address)uc->uc_mcontext.regs->gpr[1];
long rb_val = (long)uc->uc_mcontext.regs->gpr[rb];
+#else // Musl
+ address sp = (address)uc->uc_mcontext.gp_regs[1];
+ long rb_val = (long)uc->uc_mcontext.gp_regs[rb];
+#endif
return ra != 1 || rb_val >= 0 ? NULL // not a stack bang
: sp + rb_val; // banged address
}
--- old/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp
+++ new/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp
@@ -109,20 +109,34 @@
// - if uc was filled by getcontext(), it is undefined - getcontext() does not fill
// it because the volatile registers are not needed to make setcontext() work.
// Hopefully it was zero'd out beforehand.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
guarantee(uc->uc_mcontext.regs != NULL, "only use ucontext_get_pc in sigaction context");
return (address)uc->uc_mcontext.regs->nip;
+#else // Musl
+ guarantee(uc->uc_mcontext.gp_regs != NULL, "only use ucontext_get_pc in sigaction context");
+ return (address)uc->uc_mcontext.gp_regs[32];
+#endif
}
// modify PC in ucontext.
// Note: Only use this for an ucontext handed down to a signal handler. See comment
// in ucontext_get_pc.
void os::Linux::ucontext_set_pc(ucontext_t * uc, address pc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
guarantee(uc->uc_mcontext.regs != NULL, "only use ucontext_set_pc in sigaction context");
uc->uc_mcontext.regs->nip = (unsigned long)pc;
+#else // Musl
+ guarantee(uc->uc_mcontext.gp_regs != NULL, "only use ucontext_set_pc in sigaction context");
+ uc->uc_mcontext.gp_regs[32] = (unsigned long)pc;
+#endif
}
intptr_t* os::Linux::ucontext_get_sp(const ucontext_t * uc) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
return (intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/];
+#else // Musl
+ return (intptr_t*)uc->uc_mcontext.gp_regs[1/*REG_SP*/];
+#endif
}
intptr_t* os::Linux::ucontext_get_fp(const ucontext_t * uc) {
@@ -252,7 +266,13 @@
// 3.2.1 "Machine State Register"), however note that ISA notation for bit
// numbering is MSB 0, so for normal bit numbering (LSB 0) they come to be
// bits 33 and 34. It's not related to endianness, just a notation matter.
+#if defined(__GLIBC__) || defined(__UCLIBC__)
if (second_uc->uc_mcontext.regs->msr & 0x600000000) {
+#else // Musl
+ // why 33?
+ // see comment for glibc NGREG: "r0-r31, nip, msr, lr, etc."
+ if (second_uc->uc_mcontext.gp_regs[33] & 0x600000000) {
+#endif
if (TraceTraps) {
tty->print_cr("caught signal in transaction, "
"ignoring to jump to abort handler");
@@ -557,6 +577,7 @@
const ucontext_t* uc = (const ucontext_t*)context;
st->print_cr("Registers:");
+#if defined(__GLIBC__) || defined(__UCLIBC__)
st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->nip);
st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->link);
st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.regs->ctr);
@@ -565,8 +586,18 @@
st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.regs->gpr[i]);
if (i % 3 == 2) st->cr();
}
+#else // Musl
+ st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[32]);
+ st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[36]);
+ st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[35]);
st->cr();
+ for (int i = 0; i < 32; i++) {
+ st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.gp_regs[i]);
+ if (i % 3 == 2) st->cr();
+ }
+#endif
st->cr();
+ st->cr();
intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);
st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", p2i(sp));
@@ -593,7 +624,11 @@
// this is only for the "general purpose" registers
for (int i = 0; i < 32; i++) {
st->print("r%-2d=", i);
+#if defined(__GLIBC__) || defined(__UCLIBC__)
print_location(st, uc->uc_mcontext.regs->gpr[i]);
+#else // Musl
+ print_location(st, uc->uc_mcontext.gp_regs[i]);
+#endif
}
st->cr();
}

View File

@ -0,0 +1,16 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
VERSION="OpenJDK ${PV}"
JAVA_HOME="${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}"
JDK_HOME="${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}"
JAVAC="\${JAVA_HOME}/bin/javac"
PATH="\${JAVA_HOME}/bin"
ROOTPATH="\${JAVA_HOME}/bin"
LDPATH="\${JAVA_HOME}/lib/:\${JAVA_HOME}/lib/server/"
MANPATH="\${JAVA_HOME}/man"
PROVIDES_TYPE="JDK JRE"
PROVIDES_VERSION="1.${SLOT}"
BOOTCLASSPATH="\${JAVA_HOME}/jre/lib/resources.jar:\${JAVA_HOME}/jre/lib/rt.jar:\${JAVA_HOME}/jre/lib/jsse.jar:\${JAVA_HOME}/jre/lib/jce.jar:\${JAVA_HOME}/jre/lib/charsets.jar:\${JAVA_HOME}/jre/lib/jfr.jar"
GENERATION="2"
ENV_VARS="JAVA_HOME JDK_HOME JAVAC PATH ROOTPATH LDPATH MANPATH"

View File

@ -0,0 +1,16 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
VERSION="OpenJDK ${PV}"
JAVA_HOME="${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}"
JDK_HOME="${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}"
JAVAC="\${JAVA_HOME}/bin/javac"
PATH="\${JAVA_HOME}/bin"
ROOTPATH="\${JAVA_HOME}/bin"
LDPATH="\${JAVA_HOME}/lib/:\${JAVA_HOME}/lib/server/"
MANPATH="\${JAVA_HOME}/man"
PROVIDES_TYPE="JDK JRE"
PROVIDES_VERSION="1.${SLOT}"
BOOTCLASSPATH="\${JAVA_HOME}/jre/lib/resources.jar:\${JAVA_HOME}/jre/lib/rt.jar:\${JAVA_HOME}/jre/lib/jsse.jar:\${JAVA_HOME}/jre/lib/jce.jar:\${JAVA_HOME}/jre/lib/charsets.jar:\${JAVA_HOME}/jre/lib/jfr.jar"
GENERATION="2"
ENV_VARS="JAVA_HOME JDK_HOME JAVAC PATH ROOTPATH LDPATH MANPATH"

View File

@ -1,183 +0,0 @@
--- openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
+++ openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
@@ -73,7 +73,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-# include <fpu_control.h>
#ifdef AMD64
#define REG_SP REG_RSP
@@ -532,6 +531,9 @@
ShouldNotReachHere();
}
+
+#define _FPU_GETCW(cw) __asm__ __volatile__ ("fnstcw %0" : "=m" (*&cw))
+#define _FPU_SETCW(cw) __asm__ __volatile__ ("fldcw %0" : : "m" (*&cw))
void os::Linux::init_thread_fpu_state(void) {
#ifndef AMD64
--- openjdk.orig/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp
+++ openjdk/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp
@@ -75,7 +75,7 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-# include <fpu_control.h>
+# include <linux/types.h> /* provides __u64 */
#ifdef BUILTIN_SIM
#define REG_SP REG_RSP
--- openjdk.orig/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/proc_service.h 2018-01-22 15:19:02.000000000 +0000
+++ openjdk/hostspot/src/jdk.hotspot.agent/linux/native/libsaproc/proc_service.h 2020-10-12 12:56:27.323706510 +0000
@@ -26,7 +26,7 @@
#define _PROC_SERVICE_H_
#include <stdio.h>
-#include <thread_db.h>
+#include <sys/procfs.h>
// Linux does not have the proc service library, though it does provide the
// thread_db library which can be used to manipulate threads without having
@@ -43,34 +43,4 @@
PS_NOFREGS /* FPU register set not available for given lwp */
} ps_err_e;
-// ps_getpid() is only defined on Linux to return a thread's process ID
-pid_t ps_getpid(struct ps_prochandle *ph);
-
-// ps_pglobal_lookup() looks up the symbol sym_name in the symbol table
-// of the load object object_name in the target process identified by ph.
-// It returns the symbol's value as an address in the target process in
-// *sym_addr.
-
-ps_err_e ps_pglobal_lookup(struct ps_prochandle *ph, const char *object_name,
- const char *sym_name, psaddr_t *sym_addr);
-
-// read "size" bytes of data from debuggee at address "addr"
-ps_err_e ps_pdread(struct ps_prochandle *ph, psaddr_t addr,
- void *buf, size_t size);
-
-// write "size" bytes of data to debuggee at address "addr"
-ps_err_e ps_pdwrite(struct ps_prochandle *ph, psaddr_t addr,
- const void *buf, size_t size);
-
-ps_err_e ps_lsetfpregs(struct ps_prochandle *ph, lwpid_t lid, const prfpregset_t *fpregs);
-
-ps_err_e ps_lsetregs(struct ps_prochandle *ph, lwpid_t lid, const prgregset_t gregset);
-
-ps_err_e ps_lgetfpregs(struct ps_prochandle *ph, lwpid_t lid, prfpregset_t *fpregs);
-
-ps_err_e ps_lgetregs(struct ps_prochandle *ph, lwpid_t lid, prgregset_t gregset);
-
-// new libthread_db of NPTL seem to require this symbol
-ps_err_e ps_get_thread_area();
-
#endif /* _PROC_SERVICE_H_ */
--- openjdk.orig/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c 2018-01-22 15:19:02.000000000 +0000
+++ openjdk/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c 2020-10-12 13:00:33.143035725 +0000
@@ -26,7 +26,7 @@
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
-#include <thread_db.h>
+#include <dirent.h>
#include "libproc_impl.h"
#define SA_ALTROOT "SA_ALTROOT"
@@ -116,11 +116,13 @@
// init debug mode
_libsaproc_debug = debug;
+#ifdef INCLUDE_SA_ATTACH
// initialize the thread_db library
if (td_init() != TD_OK) {
print_debug("libthread_db's td_init failed\n");
return false;
}
+#endif
return true;
}
@@ -273,6 +275,7 @@
}
+#ifdef INCLUDE_SA_ATTACH
// struct used for client data from thread_db callback
struct thread_db_client_data {
struct ps_prochandle* ph;
@@ -299,9 +302,11 @@
return TD_OK;
}
+#endif
// read thread_info using libthread_db
bool read_thread_info(struct ps_prochandle* ph, thread_info_callback cb) {
+#ifdef INCLUDE_SA_ATTACH
struct thread_db_client_data mydata;
td_thragent_t* thread_agent = NULL;
if (td_ta_new(ph, &thread_agent) != TD_OK) {
@@ -322,6 +327,30 @@
// delete thread agent
td_ta_delete(thread_agent);
+#else
+ DIR *dir = NULL;
+ struct dirent *ent = NULL;
+ char taskpath[80];
+ pid_t pid = ph->pid;
+
+ // Find the lwpids to attach to by traversing the /proc/<pid>/task/ directory.
+ snprintf(taskpath, sizeof (taskpath), "/proc/%ld/task", (unsigned long)pid);
+ if ((dir = opendir(taskpath)) != NULL) {
+ while ((ent = readdir(dir)) != NULL) {
+ unsigned long lwp;
+
+ if ((lwp = strtoul(ent->d_name, NULL, 10)) != 0) {
+ // Create and add the thread info.
+ (*cb)(ph, 0, lwp);
+ }
+ }
+ } else {
+ print_debug("Could not open /proc/%ld/task.\n", (unsigned long)pid);
+ return false;
+ }
+
+ closedir(dir);
+#endif
return true;
}
diff -U3 -r openjdk-9.0.4_p12/work/hotspot-jdk-9.0.4+12/make/lib/Lib-jdk.hotspot.agent.gmk openjdk-9.0.4_p12.orig/work/hotspot-jdk-9.0.4+12/make/lib/Lib-jdk.hotspot.agent.gmk
--- openjdk.orig/hotspot/make/lib/Lib-jdk.hotspot.agent.gmk 2018-01-22 15:19:02.000000000 +0000
+++ openjdk/hotspot/make/lib/Lib-jdk.hotspot.agent.gmk 2020-10-12 13:03:00.569605599 +0000
@@ -57,7 +57,10 @@
SA_CFLAGS := $(CFLAGS_JDKLIB) -D_FILE_OFFSET_BITS=64 \
$(SA_MACHINE_FLAG_linux)
SA_LDFLAGS := $(LDFLAGS_JDKLIB) $(SA_MACHINE_FLAG_linux)
- SA_LIBS := -lthread_db $(LIBDL)
+ SA_LIBS := $(LIBDL)
+ ifeq ($(INCLUDE_SA_ATTACH), true)
+ SA_LIBS += -lthread_db
+ endif
else ifeq ($(OPENJDK_TARGET_OS), solaris)
SA_TOOLCHAIN := TOOLCHAIN_LINK_CXX
@@ -95,6 +98,13 @@
endif
endif
+ifeq ($(INCLUDE_SA_ATTACH), true)
+ SA_CFLAGS += -DINCLUDE_SA_ATTACH
+endif
+
+SA_CFLAGS += -DLIBC=\"$(OPENJDK_TARGET_LIBC)\"
+
+
################################################################################
$(eval $(call SetupNativeCompilation, BUILD_LIBSA, \

View File

@ -1,48 +0,0 @@
# HG changeset patch
# User mikael
# Date 1491957311 25200
# Node ID 38d9b9a9c4762b42a5c16928470c73c0f632d71c
# Parent 8ca8c24ffc52e453ed58a198b479a85c911d6da0
Make printing of rlim_t values more portable
diff -r 8ca8c24ffc52 -r 38d9b9a9c476 src/os/posix/vm/os_posix.cpp
--- a/src/os/posix/vm/os_posix.cpp Tue Apr 11 16:59:40 2017 -0700
+++ b/src/os/posix/vm/os_posix.cpp Tue Apr 11 17:35:11 2017 -0700
@@ -207,30 +207,30 @@
st->print(" STACK ");
getrlimit(RLIMIT_STACK, &rlim);
if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
- else st->print("%luk", rlim.rlim_cur >> 10);
+ else st->print(UINT64_FORMAT "k", u8(rlim.rlim_cur) >> 10);
st->print(", CORE ");
getrlimit(RLIMIT_CORE, &rlim);
if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
- else st->print("%luk", rlim.rlim_cur >> 10);
+ else st->print(UINT64_FORMAT "k", u8(rlim.rlim_cur) >> 10);
// Isn't there on solaris
#if !defined(SOLARIS) && !defined(AIX)
st->print(", NPROC ");
getrlimit(RLIMIT_NPROC, &rlim);
if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
- else st->print("%lu", rlim.rlim_cur);
+ else st->print(UINT64_FORMAT, u8(rlim.rlim_cur));
#endif
st->print(", NOFILE ");
getrlimit(RLIMIT_NOFILE, &rlim);
if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
- else st->print("%lu", rlim.rlim_cur);
+ else st->print(UINT64_FORMAT, u8(rlim.rlim_cur));
st->print(", AS ");
getrlimit(RLIMIT_AS, &rlim);
if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
- else st->print("%luk", rlim.rlim_cur >> 10);
+ else st->print(UINT64_FORMAT "k", u8(rlim.rlim_cur) >> 10);
st->cr();
}

View File

@ -1,42 +0,0 @@
From 1624e2dd3739fe208efa13b31abf4bc53ae2e5c1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.draszik at jci.com <https://lists.yoctoproject.org/listinfo/yocto>>
Date: Tue, 27 Feb 2018 11:24:44 +0000
Subject: [PATCH 1/9] hotspot: stop using obsolete isnanf()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Compiling against musl-libc gives the following error:
| hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp: In function 'int g_isnan(float)':
| hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp:238:39: error: 'isnanf' was not declared in this scope
| inline int g_isnan(float f) { return isnanf(f); }
| ^~~~~~
isnanf() is obsolete, and musl doesn't implement it. isnan()
is the right thing to use for all types (float and double),
replacing isnanf(), even on glibc.
Do so.
Upstream-Status: Pending
Signed-off-by: André Draszik <andre.draszik at jci.com <https://lists.yoctoproject.org/listinfo/yocto>>
---
hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp b/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
index efa0b4e1..6df2302e 100644
--- a/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
+++ b/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
@@ -235,7 +235,7 @@ inline int g_isnan(double f) { return isnand(f); }
#elif defined(__APPLE__)
inline int g_isnan(double f) { return isnan(f); }
#elif defined(LINUX) || defined(_ALLBSD_SOURCE)
-inline int g_isnan(float f) { return isnanf(f); }
+inline int g_isnan(float f) { return isnan(f); }
inline int g_isnan(double f) { return isnan(f); }
#else
#error "missing platform-specific definition here"
--
2.16.2

View File

@ -1,21 +0,0 @@
diff -Naurw openjdk.orig/jdk/src/solaris/native/sun/xawt/XToolkit.c openjdk/jdk/src/solaris/native/sun/xawt/XToolkit.c
--- a/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c 2015-03-23 10:05:01.000000000 +0700
+++ b/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c 2015-08-26 15:55:39.775658680 +0700
@@ -27,7 +27,7 @@
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/Xatom.h>
-#ifdef __linux__
+#if defined(__linux__) && defined(__GLIBC__) && !defined(__UCLIBC__)
#include <execinfo.h>
#endif
@@ -799,7 +799,7 @@
return ret;
}
-#ifdef __linux__
+#if defined(__linux__) && defined(__GLIBC__) && !defined(__UCLIBC__)
void print_stack(void)
{
void *array[10];

View File

@ -1,69 +0,0 @@
From ec37e9e5663611e49c7c976d34450ea6b90d0f24 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.draszik at jci.com <https://lists.yoctoproject.org/listinfo/yocto>>
Date: Fri, 2 Mar 2018 13:37:20 +0000
Subject: [PATCH 8/9] jdk: musl build fix (use SIGRTMAX rather than __SIGRTMAX)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
__SIGRTMAX is a private glibc symbol, which isn't provided
by musl, thus failing compilation.
From https://sourceware.org/ml/rda/2005-q4/msg00011.html
On a GNU(ish) system, [SIGRTMIN / SIGRTMAX] these macros are defined
to call functions which compute the actual minimum and maximum
realtime signal numbers. In particular, this computation will exclude
any signals used by the C library for its own purposes. These signals
could include signals related to thread debugging or, more
importantly, for thread cancellation.
[...]
[The __SIGRTMIN and __SIGRTMAX] constants represent a hard minumum
and maximum.
Patch taken from Alpine Linux:
https://git.alpinelinux.org/cgit/aports/tree/community/openjdk8/icedtea-jdk-musl.patch?id=4d34f29dddd3934358df7a9607706d09ae0433c3
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: André Draszik <andre.draszik at jci.com <https://lists.yoctoproject.org/listinfo/yocto>>
---
jdk/src/solaris/native/java/net/linux_close.c | 3 ++-
jdk/src/solaris/native/sun/nio/ch/NativeThread.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/jdk/src/solaris/native/java/net/linux_close.c b/jdk/src/solaris/native/java/net/linux_close.c
index 85fba135..e635dafd 100644
--- a/jdk/src/java.base/linux/native/libnet/linux_close.c
+++ b/jdk/src/java.base/linux/native/libnet/linux_close.c
@@ -56,7 +56,7 @@ typedef struct {
/*
* Signal to unblock thread
*/
-static int sigWakeup = (__SIGRTMAX - 2);
+static int sigWakeup;
/*
* The fd table and the number of file descriptors
@@ -95,6 +95,7 @@ static void __attribute((constructor)) init() {
/*
* Setup the signal handler
*/
+ sigWakeup = SIGRTMAX - 2;
sa.sa_handler = sig_wakeup;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
diff --git a/jdk/src/solaris/native/sun/nio/ch/NativeThread.c b/jdk/src/solaris/native/sun/nio/ch/NativeThread.c
index 204f0441..f5483bbd 100644
--- a/jdk/src/java.base/unix/native/libnio/ch/NativeThread.c
+++ b/jdk/src/java.base/unix/native/libnio/ch/NativeThread.c
@@ -36,7 +36,7 @@
#include <pthread.h>
#include <sys/signal.h>
/* Also defined in net/linux_close.c */
- #define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
+ #define INTERRUPT_SIGNAL (SIGRTMAX - 2)
#elif _AIX
#include <pthread.h>
#include <sys/signal.h>
--
2.16.2

View File

@ -1,37 +0,0 @@
From 4429d73853b3938a53a6058cc0dcaac08d191995 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.draszik@jci.com>
Date: Tue, 27 Feb 2018 16:01:54 +0000
Subject: [PATCH 3/9] jdk: fix libjvm load on musl (set LD_LIBRARY_PATH)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
musl needs LD_LIBRARY_PATH set because when .so is opened
with dlopen(/abs/path) it does not qualify for providing
symbols for NEEDED dependency.
Patch taken from Alpine Linux:
https://git.alpinelinux.org/cgit/aports/tree/community/openjdk8/icedtea-jdk-fix-libjvm-load.patch?id=4d34f29dddd3934358df7a9607706d09ae0433c3
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: André Draszik <andre.draszik@jci.com>
---
jdk/src/solaris/bin/java_md_solinux.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/jdk/src/solaris/bin/java_md_solinux.c b/jdk/src/solaris/bin/java_md_solinux.c
index 6d977109..e9a0a1eb 100644
--- a/jdk/src/java.base/unix/native/libjli/java_md_solinux.c
+++ b/jdk/src/java.base/unix/native/libjli/java_md_solinux.c
@@ -291,6 +291,8 @@ RequiresSetenv(int wanted, const char *jvmpath) {
char *dmllp = NULL;
char *p; /* a utility pointer */
+ return JNI_TRUE;
+
#ifdef AIX
/* We always have to set the LIBPATH on AIX because ld doesn't support $ORIGIN. */
return JNI_TRUE;
--
2.16.2

View File

@ -1,40 +0,0 @@
--- a/src/os/linux/vm/os_linux.orig 2020-07-19 13:28:52.744716037 +0000
+++ b/src/os/linux/vm/os_linux.cpp 2020-07-19 13:31:44.582341353 +0000
@@ -98,7 +98,6 @@
# include <string.h>
# include <syscall.h>
# include <sys/sysinfo.h>
-# include <gnu/libc-version.h>
# include <sys/ipc.h>
# include <sys/shm.h>
# include <link.h>
@@ -496,6 +495,11 @@
// detecting pthread library
void os::Linux::libpthread_init() {
+#if 1
+ // Hard code supported musl compatible settings (taken from alpine linux)
+ os::Linux::set_glibc_version("glibc 2.9");
+ os::Linux::set_libpthread_version("NPTL");
+#else
// Save glibc and pthread version strings.
#if !defined(_CS_GNU_LIBC_VERSION) || \
!defined(_CS_GNU_LIBPTHREAD_VERSION)
@@ -513,6 +519,7 @@
str = (char *)malloc(n, mtInternal);
confstr(_CS_GNU_LIBPTHREAD_VERSION, str, n);
os::Linux::set_libpthread_version(str);
+#endif
}
/////////////////////////////////////////////////////////////////////////////
@@ -2799,6 +2806,9 @@
return (retval == -1) ? retval : cpu;
}
+// musl doesn't have dlvsym()
+#define dlvsym(h,s,v) dlsym(h,s)
+
// Something to do with the numa-aware allocator needs these symbols
extern "C" JNIEXPORT void numa_warn(int number, char *where, ...) { }
extern "C" JNIEXPORT void numa_error(char *where) { }

View File

@ -20,10 +20,10 @@
<use>
<flag name="headless-awt">Don't install the X backend for AWT, needed by some GUIs</flag>
<flag name="gentoo-vm">Allow this JDK to be recognised by Gentoo (package manager, eselect, java-config, EXPERIMENTAL!)</flag>
<flag name="javafx" restrict="&lt;=dev-java/openjdk-9">Provide JavaFX support via <pkg>dev-java/openjfx</pkg></flag>
<flag name="javafx" restrict="&gt;=dev-java/openjdk-11">Import OpenJFX modules at build time, via <pkg>dev-java/openjfx</pkg></flag>
<flag name="jbootstrap">Build OpenJDK twice, the second time using the result of the first</flag>
<flag name="source">Install JVM sources</flag>
<flag name="systemtap" restrict="&gt;=dev-java/openjdk-11">Enable SystemTAP/DTrace tracing</flag>
<flag name="webstart">Provide javaws command through symlink to icedtea-web</flag>
</use>
</pkgmetadata>

View File

@ -132,6 +132,24 @@ pkg_setup() {
src_prepare() {
default
# conditionally apply patches for musl compatibility
if use elibc_musl; then
eapply "${FILESDIR}/musl/${SLOT}/build.patch"
eapply "${FILESDIR}/musl/${SLOT}/fix-bootjdk-check.patch"
eapply "${FILESDIR}/musl/${SLOT}/make-4.3.patch"
eapply "${FILESDIR}/musl/${SLOT}/ppc64le.patch"
eapply "${FILESDIR}/musl/${SLOT}/aarch64.patch"
fi
# conditionally remove not compilable module (hotspot jdk.hotspot.agent)
# this needs libthread_db which is only provided by glibc
#
# haven't found any way to disable this module so just remove it.
if use elibc_musl; then
rm -rf "${S}"/src/jdk.hotspot.agent || die "failed to remove HotSpot agent"
fi
chmod +x configure || die
}
@ -262,3 +280,4 @@ pkg_postinst() {
ewarn "absolute location under ${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}."
fi
}

View File

@ -3,29 +3,19 @@
EAPI=6
inherit versionator autotools check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils toolchain-funcs
inherit autotools check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils toolchain-funcs
# we need -ga tag to fetch tarball and unpack it, but exact number everywhere else to
# set build version properly
MY_PV="${PV/_p/+}"
FULL_VERSION="${PV%_p*}"
SLOT=$(get_major_version)
# First release of major jdk releases do not contain u at end jdk<slot>.
# so 15.0.0 would fetch jdk-15-ga.tar.gz from jdk15, 15.0.1 jdk-15.0.1-ga.tar.gz from jdk15u
if [ $(get_after_major_version $FULL_VERSION) = "0.0" ]; then
SRC_URI="https://github.com/openjdk/jdk${SLOT}/archive/jdk-${SLOT}-ga.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/jdk${SLOT}-jdk-${SLOT}-ga"
else
SRC_URI="https://github.com/openjdk/jdk${SLOT}u/archive/jdk-${FULL_VERSION}-ga.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/jdk${SLOT}u-jdk-${FULL_VERSION}-ga"
fi
MY_PV="${PV%_p*}-ga"
SLOT="${MY_PV%%[.+]*}"
DESCRIPTION="Open source implementation of the Java programming language"
HOMEPAGE="https://openjdk.java.net"
#SRC_URI="https://hg.${PN}.java.net/jdk-updates/jdk${SLOT}u/archi${SLOT}/jdk-${MY_PV}.tar.bz2 -> ${P}.tar.bz2"
SRC_URI="https://hg.${PN}.java.net/jdk-updates/jdk${SLOT}u/archive/jdk-${MY_PV}.tar.bz2 -> ${P}.tar.bz2"
LICENSE="GPL-2"
KEYWORDS="amd64 ~arm arm64 ~ppc64"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64"
IUSE="alsa cups debug doc examples gentoo-vm headless-awt javafx +jbootstrap +pch selinux source systemtap"
@ -73,8 +63,6 @@ DEPEND="
x11-libs/libXtst
javafx? ( dev-java/openjfx:${SLOT}= )
|| (
dev-java/openjdk-bin:$((SLOT-1))
dev-java/openjdk:$((SLOT-1))
dev-java/openjdk-bin:${SLOT}
dev-java/openjdk:${SLOT}
)
@ -82,6 +70,8 @@ DEPEND="
REQUIRED_USE="javafx? ( alsa !headless-awt )"
S="${WORKDIR}/jdk${SLOT}u-jdk-${MY_PV}"
# The space required to build varies wildly depending on USE flags,
# ranging from 2GB to 16GB. This function is certainly not exact but
# should be close enough to be useful.
@ -98,7 +88,7 @@ openjdk_check_requirements() {
pkg_pretend() {
openjdk_check_requirements
if [[ ${MERGE_TYPE} != binary ]]; then
has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}"
has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}, bug #677876"
fi
}
@ -106,9 +96,9 @@ pkg_setup() {
openjdk_check_requirements
java-vm-2_pkg_setup
JAVA_PKG_WANT_BUILD_VM="openjdk-${SLOT} openjdk-$((SLOT-1)) openjdk-bin-${SLOT} openjdk-bin-$((SLOT-1))"
JAVA_PKG_WANT_SOURCE="$((SLOT-1))"
JAVA_PKG_WANT_TARGET="$((SLOT-1))"
JAVA_PKG_WANT_BUILD_VM="openjdk-${SLOT} openjdk-bin-${SLOT}"
JAVA_PKG_WANT_SOURCE="${SLOT}"
JAVA_PKG_WANT_TARGET="${SLOT}"
# The nastiness below is necessary while the gentoo-vm USE flag is
# masked. First we call java-pkg-2_pkg_setup if it looks like the
@ -141,6 +131,23 @@ pkg_setup() {
src_prepare() {
default
# conditionally apply patches for musl compatibility
if use elibc_musl; then
eapply "${FILESDIR}/musl/${SLOT}/build.patch"
eapply "${FILESDIR}/musl/${SLOT}/fix-bootjdk-check.patch"
eapply "${FILESDIR}/musl/${SLOT}/ppc64le.patch"
eapply "${FILESDIR}/musl/${SLOT}/aarch64.patch"
fi
# conditionally remove not compilable module (hotspot jdk.hotspot.agent)
# this needs libthread_db which is only provided by glibc
#
# haven't found any way to disable this module so just remove it.
if use elibc_musl; then
rm -rf "${S}"/src/jdk.hotspot.agent || die "failed to remove HotSpot agent"
fi
chmod +x configure || die
}

View File

@ -133,6 +133,24 @@ pkg_setup() {
src_prepare() {
default
# conditionally apply patches for musl compatibility
if use elibc_musl; then
eapply "${FILESDIR}/musl/${SLOT}/build.patch"
eapply "${FILESDIR}/musl/${SLOT}/fix-bootjdk-check.patch"
eapply "${FILESDIR}/musl/${SLOT}/make-4.3.patch"
eapply "${FILESDIR}/musl/${SLOT}/ppc64le.patch"
eapply "${FILESDIR}/musl/${SLOT}/aarch64.patch"
fi
# conditionally remove not compilable module (hotspot jdk.hotspot.agent)
# this needs libthread_db which is only provided by glibc
#
# haven't found any way to disable this module so just remove it.
if use elibc_musl; then
rm -rf "${S}"/src/jdk.hotspot.agent || die "failed to remove HotSpot agent"
fi
chmod +x configure || die
}

View File

@ -1,21 +1,23 @@
# Copyright 1999-2019 Gentoo Authors
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit autotools check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils toolchain-funcs
MY_PV=${PV/_p/+}
SLOT=${MY_PV%%[.+]*}
# we need -ga tag to fetch tarball and unpack it, but exact number everywhere else to
# set build version properly
MY_PV="${PV%_p*}-ga"
SLOT="${MY_PV%%[.+]*}"
DESCRIPTION="Open source implementation of the Java programming language"
HOMEPAGE="https://openjdk.java.net"
SRC_URI="https://hg.${PN}.java.net/jdk-updates/jdk${SLOT}u/archive/jdk-${MY_PV}.tar.bz2"
SRC_URI="https://hg.${PN}.java.net/jdk-updates/jdk${SLOT}u/archive/jdk-${MY_PV}.tar.gz -> ${P}.tar.gz"
LICENSE="GPL-2"
KEYWORDS="amd64 ~arm arm64 ~ppc64"
IUSE="alsa cups debug doc examples gentoo-vm headless-awt javafx +jbootstrap nsplugin +pch selinux source systemtap +webstart"
IUSE="alsa cups debug doc examples gentoo-vm headless-awt javafx +jbootstrap +pch selinux source systemtap"
COMMON_DEPEND="
media-libs/freetype:2=
@ -59,20 +61,15 @@ DEPEND="
x11-libs/libXrender
x11-libs/libXt
x11-libs/libXtst
javafx? ( dev-java/openjfx:${SLOT} )
javafx? ( dev-java/openjfx:${SLOT}= )
|| (
dev-java/openjdk-bin:${SLOT}
dev-java/openjdk:${SLOT}
dev-java/openjdk-bin:$((SLOT-1))[gentoo-vm]
dev-java/openjdk:$((SLOT-1))[gentoo-vm]
dev-java/openjdk-bin:$((SLOT-1))
dev-java/openjdk:$((SLOT-1))
)
"
PDEPEND="
webstart? ( >=dev-java/icedtea-web-1.6.1:0 )
nsplugin? ( >=dev-java/icedtea-web-1.6.1:0[nsplugin] )
"
REQUIRED_USE="javafx? ( alsa !headless-awt )"
S="${WORKDIR}/jdk${SLOT}u-jdk-${MY_PV}"
@ -92,7 +89,9 @@ openjdk_check_requirements() {
pkg_pretend() {
openjdk_check_requirements
has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}"
if [[ ${MERGE_TYPE} != binary ]]; then
has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}"
fi
}
pkg_setup() {
@ -134,6 +133,23 @@ pkg_setup() {
src_prepare() {
default
# conditionally apply patches for musl compatibility
if use elibc_musl; then
eapply "${FILESDIR}/musl/${SLOT}/build.patch"
eapply "${FILESDIR}/musl/${SLOT}/fix-bootjdk-check.patch"
eapply "${FILESDIR}/musl/${SLOT}/ppc64le.patch"
eapply "${FILESDIR}/musl/${SLOT}/aarch64.patch"
fi
# conditionally remove not compilable module (hotspot jdk.hotspot.agent)
# this needs libthread_db which is only provided by glibc
#
# haven't found any way to disable this module so just remove it.
if use elibc_musl; then
rm -rf "${S}"/src/jdk.hotspot.agent || die "failed to remove HotSpot agent"
fi
chmod +x configure || die
}
@ -141,6 +157,9 @@ src_configure() {
# Work around stack alignment issue, bug #647954. in case we ever have x86
use x86 && append-flags -mincoming-stack-boundary=2
# Work around -fno-common ( GCC10 default ), bug #713180
append-flags -fcommon
# Enabling full docs appears to break doc building. If not
# explicitly disabled, the flag will get auto-enabled if pandoc and
# graphviz are detected. pandoc has loads of dependencies anyway.
@ -161,11 +180,12 @@ src_configure() {
--with-vendor-url="https://gentoo.org"
--with-vendor-bug-url="https://bugs.gentoo.org"
--with-vendor-vm-bug-url="https://bugs.openjdk.java.net"
--with-vendor-version-string="${PV}"
--with-vendor-version-string="${PVR}"
--with-version-pre=""
--with-version-string=${MY_PV%+*}
--with-version-build=${MY_PV#*+}
--with-version-string="${PV%_p*}"
--with-version-build="${PV#*_p}"
--with-zlib=system
--disable-warnings-as-errors
--enable-dtrace=$(usex systemtap yes no)
--enable-headless-only=$(usex headless-awt yes no)
)
@ -198,7 +218,7 @@ src_compile() {
local myemakeargs=(
JOBS=$(makeopts_jobs)
LOG=debug
CFLAGS_WARNINGS_ARE_ERRORS= # No -Werror
ALL_NAMED_TESTS= # Build error
$(usex doc docs '')
$(usex jbootstrap bootcycle-images product-images)
)
@ -235,7 +255,7 @@ src_install() {
dodir "${dest}"
cp -pPR * "${ddest}" || die
dosym "${EPREFIX}"/etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts
dosym ../../../../../etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts
# must be done before running itself
java-vm_set-pax-markings "${ddest}"
@ -248,9 +268,9 @@ src_install() {
java-vm_sandbox-predict /dev/random /proc/self/coredump_filter
if use doc ; then
insinto /usr/share/doc/"${PF}"/html
doins -r "${S}"/build/*-release/images/docs/*
dosym /usr/share/doc/"${PF}" /usr/share/doc/"${PN}-${SLOT}"
docinto html
dodoc -r "${S}"/build/*-release/images/docs/*
dosym ../../../usr/share/doc/"${PF}" /usr/share/doc/"${PN}-${SLOT}"
fi
}
@ -269,3 +289,4 @@ pkg_postinst() {
ewarn "absolute location under ${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}."
fi
}

View File

@ -133,6 +133,23 @@ pkg_setup() {
src_prepare() {
default
# conditionally apply patches for musl compatibility
if use elibc_musl; then
eapply "${FILESDIR}/musl/${SLOT}/build.patch"
eapply "${FILESDIR}/musl/${SLOT}/fix-bootjdk-check.patch"
eapply "${FILESDIR}/musl/${SLOT}/ppc64le.patch"
eapply "${FILESDIR}/musl/${SLOT}/aarch64.patch"
fi
# conditionally remove not compilable module (hotspot jdk.hotspot.agent)
# this needs libthread_db which is only provided by glibc
#
# haven't found any way to disable this module so just remove it.
if use elibc_musl; then
rm -rf "${S}"/src/jdk.hotspot.agent || die "failed to remove HotSpot agent"
fi
chmod +x configure || die
}
@ -272,3 +289,4 @@ pkg_postinst() {
ewarn "absolute location under ${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}."
fi
}

View File

@ -3,10 +3,8 @@
EAPI=6
inherit versionator autotools check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils toolchain-funcs
inherit autotools check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils toolchain-funcs
# we need -ga tag to fetch tarball and unpack it, but exact number everywhere else to
# set build version properly
MY_PV="${PV/_p/+}"
FULL_VERSION="${PV%_p*}"
SLOT=$(get_major_version)
@ -22,7 +20,6 @@ fi
DESCRIPTION="Open source implementation of the Java programming language"
HOMEPAGE="https://openjdk.java.net"
#SRC_URI="https://hg.${PN}.java.net/jdk-updates/jdk${SLOT}u/archi${SLOT}/jdk-${MY_PV}.tar.bz2 -> ${P}.tar.bz2"
LICENSE="GPL-2"
KEYWORDS="amd64 ~arm arm64 ~ppc64"
@ -73,10 +70,10 @@ DEPEND="
x11-libs/libXtst
javafx? ( dev-java/openjfx:${SLOT}= )
|| (
dev-java/openjdk-bin:$((SLOT-1))
dev-java/openjdk:$((SLOT-1))
dev-java/openjdk-bin:${SLOT}
dev-java/openjdk:${SLOT}
dev-java/openjdk-bin:$((SLOT-1))
dev-java/openjdk:$((SLOT-1))
)
"
@ -106,9 +103,9 @@ pkg_setup() {
openjdk_check_requirements
java-vm-2_pkg_setup
JAVA_PKG_WANT_BUILD_VM="openjdk-${SLOT} openjdk-$((SLOT-1)) openjdk-bin-${SLOT} openjdk-bin-$((SLOT-1))"
JAVA_PKG_WANT_SOURCE="$((SLOT-1))"
JAVA_PKG_WANT_TARGET="$((SLOT-1))"
JAVA_PKG_WANT_BUILD_VM="openjdk-${SLOT} openjdk-bin-${SLOT} openjdk-$((SLOT-1)) openjdk-bin-$((SLOT-1))"
JAVA_PKG_WANT_SOURCE="${SLOT}"
JAVA_PKG_WANT_TARGET="${SLOT}"
# The nastiness below is necessary while the gentoo-vm USE flag is
# masked. First we call java-pkg-2_pkg_setup if it looks like the
@ -141,6 +138,22 @@ pkg_setup() {
src_prepare() {
default
# conditionally apply patches for musl compatibility
if use elibc_musl; then
eapply "${FILESDIR}/musl/${SLOT}/build.patch"
eapply "${FILESDIR}/musl/${SLOT}/ppc64le.patch"
eapply "${FILESDIR}/musl/${SLOT}/aarch64.patch"
fi
# conditionally remove not compilable module (hotspot jdk.hotspot.agent)
# this needs libthread_db which is only provided by glibc
#
# haven't found any way to disable this module so just remove it.
if use elibc_musl; then
rm -rf "${S}"/src/jdk.hotspot.agent || die "failed to remove HotSpot agent"
fi
chmod +x configure || die
}
@ -176,6 +189,7 @@ src_configure() {
--with-version-string="${PV%_p*}"
--with-version-build="${PV#*_p}"
--with-zlib=system
--disable-warnings-as-errors
--enable-dtrace=$(usex systemtap yes no)
--enable-headless-only=$(usex headless-awt yes no)
)
@ -208,7 +222,7 @@ src_compile() {
local myemakeargs=(
JOBS=$(makeopts_jobs)
LOG=debug
CFLAGS_WARNINGS_ARE_ERRORS= # No -Werror
ALL_NAMED_TESTS= # Build error
$(usex doc docs '')
$(usex jbootstrap bootcycle-images product-images)
)
@ -279,3 +293,4 @@ pkg_postinst() {
ewarn "absolute location under ${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}."
fi
}

View File

@ -0,0 +1,267 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit check-reqs eapi7-ver flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils toolchain-funcs
# we need latest -ga tag from hg, but want to keep build number as well
# as _p component of the gentoo version string.
MY_PV=$(ver_rs 1 'u' 2 '-' ${PV%_p*}-ga)
MY_PN_AARCH64="${PN}-aarch64-shenandoah"
MY_PV_AARCH64="$(ver_rs 1 'u' 2 '-' ${PV/_p/-b})"
MY_P_AARCH64="${MY_PN_AARCH64/#${PN}-}-jdk${MY_PV_AARCH64}"
BASE_URI="https://hg.${PN}.java.net/jdk8u/jdk8u"
AARCH64_URI="https://hg.${PN}.java.net/aarch64-port/jdk8u-shenandoah"
DESCRIPTION="Open source implementation of the Java programming language"
HOMEPAGE="https://openjdk.java.net"
SRC_URI="
!arm64? (
${BASE_URI}/archive/jdk${MY_PV}.tar.bz2 -> ${P}.tar.bz2
${BASE_URI}/corba/archive/jdk${MY_PV}.tar.bz2 -> ${PN}-corba-${PV}.tar.bz2
${BASE_URI}/hotspot/archive/jdk${MY_PV}.tar.bz2 -> ${PN}-hotspot-${PV}.tar.bz2
${BASE_URI}/jaxp/archive/jdk${MY_PV}.tar.bz2 -> ${PN}-jaxp-${PV}.tar.bz2
${BASE_URI}/jaxws/archive/jdk${MY_PV}.tar.bz2 -> ${PN}-jaxws-${PV}.tar.bz2
${BASE_URI}/jdk/archive/jdk${MY_PV}.tar.bz2 -> ${PN}-jdk-${PV}.tar.bz2
${BASE_URI}/langtools/archive/jdk${MY_PV}.tar.bz2 -> ${PN}-langtools-${PV}.tar.bz2
${BASE_URI}/nashorn/archive/jdk${MY_PV}.tar.bz2 -> ${PN}-nashorn-${PV}.tar.bz2
)
arm64? (
${AARCH64_URI}/archive/${MY_P_AARCH64}.tar.bz2 -> ${MY_PN_AARCH64}-${PV}.tar.bz2
${AARCH64_URI}/corba/archive/${MY_P_AARCH64}.tar.bz2 -> ${MY_PN_AARCH64}-corba-${PV}.tar.bz2
${AARCH64_URI}/hotspot/archive/${MY_P_AARCH64}.tar.bz2 -> ${MY_PN_AARCH64}-hotspot-${PV}.tar.bz2
${AARCH64_URI}/jaxp/archive/${MY_P_AARCH64}.tar.bz2 -> ${MY_PN_AARCH64}-jaxp-${PV}.tar.bz2
${AARCH64_URI}/jaxws/archive/${MY_P_AARCH64}.tar.bz2 -> ${MY_PN_AARCH64}-jaxws-${PV}.tar.bz2
${AARCH64_URI}/jdk/archive/${MY_P_AARCH64}.tar.bz2 -> ${MY_PN_AARCH64}-jdk-${PV}.tar.bz2
${AARCH64_URI}/langtools/archive/${MY_P_AARCH64}.tar.bz2 -> ${MY_PN_AARCH64}-langtools-${PV}.tar.bz2
${AARCH64_URI}/nashorn/archive/${MY_P_AARCH64}.tar.bz2 -> ${MY_PN_AARCH64}-nashorn-jdk${PV}.tar.bz2
)
"
LICENSE="GPL-2"
SLOT="$(ver_cut 1)"
KEYWORDS="amd64 ~arm64 ppc64 x86"
IUSE="alsa debug cups doc examples headless-awt javafx +jbootstrap +pch selinux source"
COMMON_DEPEND="
media-libs/freetype:2=
media-libs/giflib:0/7
sys-libs/zlib
"
# Many libs are required to build, but not to run, make is possible to remove
# by listing conditionally in RDEPEND unconditionally in DEPEND
RDEPEND="
${COMMON_DEPEND}
>=sys-apps/baselayout-java-0.1.0-r1
!headless-awt? (
x11-libs/libX11
x11-libs/libXext
x11-libs/libXi
x11-libs/libXrender
x11-libs/libXt
x11-libs/libXtst
)
alsa? ( media-libs/alsa-lib )
cups? ( net-print/cups )
selinux? ( sec-policy/selinux-java )
"
DEPEND="
${COMMON_DEPEND}
app-arch/zip
media-libs/alsa-lib
net-print/cups
x11-base/xorg-proto
x11-libs/libX11
x11-libs/libXext
x11-libs/libXi
x11-libs/libXrender
x11-libs/libXt
x11-libs/libXtst
|| (
dev-java/openjdk-bin:${SLOT}
dev-java/icedtea-bin:${SLOT}
dev-java/openjdk:${SLOT}
dev-java/icedtea:${SLOT}
)
"
PDEPEND="javafx? ( dev-java/openjfx:${SLOT} )"
# The space required to build varies wildly depending on USE flags,
# ranging from 2GB to 16GB. This function is certainly not exact but
# should be close enough to be useful.
openjdk_check_requirements() {
local M
M=2048
M=$(( $(usex debug 3 1) * $M ))
M=$(( $(usex jbootstrap 2 1) * $M ))
M=$(( $(usex doc 320 0) + $(usex source 128 0) + 192 + $M ))
CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}
}
pkg_pretend() {
openjdk_check_requirements
if [[ ${MERGE_TYPE} != binary ]]; then
has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}, bug #677876"
fi
}
pkg_setup() {
openjdk_check_requirements
JAVA_PKG_WANT_BUILD_VM="openjdk-${SLOT} openjdk-bin-${SLOT} icedtea-${SLOT} icedtea-bin-${SLOT}"
JAVA_PKG_WANT_SOURCE="${SLOT}"
JAVA_PKG_WANT_TARGET="${SLOT}"
java-vm-2_pkg_setup
java-pkg-2_pkg_setup
}
src_unpack() {
default
mv -v "jdk${SLOT}u"* "${P}" || die
local repo
for repo in corba hotspot jdk jaxp jaxws langtools nashorn; do
mv -v "${repo}-"* "${P}/${repo}" || die
done
}
src_prepare() {
default
# new warnings in new gcc https://bugs.gentoo.org/685426
sed -i '/^WARNINGS_ARE_ERRORS/ s/-Werror/-Wno-error/' \
hotspot/make/linux/makefiles/gcc.make || die
# conditionally apply patches for musl compatibility
if use elibc_musl; then
eapply "${FILESDIR}/musl/${SLOT}/0001_musl_hotspot.patch"
eapply "${FILESDIR}/musl/${SLOT}/0002_musl_hotspot_ppc.patch"
eapply "${FILESDIR}/musl/${SLOT}/0004_musl_hotspot_noagent.patch"
eapply "${FILESDIR}/musl/${SLOT}/0005_musl_fix_libjvm_load.patch"
eapply "${FILESDIR}/musl/${SLOT}/0006_musl_jdk.patch"
eapply "${FILESDIR}/musl/${SLOT}/0007_musl_jdk_includes.patch"
eapply "${FILESDIR}/musl/${SLOT}/0008_musl_jdk_execinfo.patch"
eapply "${FILESDIR}/musl/${SLOT}/0009_fix_jdk_ipv6_init.patch"
eapply "${FILESDIR}/musl/${SLOT}/0010_fix_jdk_close_fds.patch"
fi
# apply this patch here as the sources are not available unless ARCH == arm64
if use elibc_musl && use arm64; then
eapply "${FILESDIR}/patches/${PN}-${SLOT}/0003_musl_hotspot_aarch64.patch"
fi
chmod +x configure || die
}
src_configure() {
# general build info found here:
#https://hg.openjdk.java.net/jdk8/jdk8/raw-file/tip/README-builds.html
# Work around stack alignment issue, bug #647954.
use x86 && append-flags -mincoming-stack-boundary=2
# Work around -fno-common ( GCC10 default ), bug #706638
append-flags -fcommon
tc-export_build_env CC CXX PKG_CONFIG STRIP
local myconf=(
--disable-ccache
--enable-unlimited-crypto
--with-boot-jdk="${JDK_HOME}"
--with-extra-cflags="${CFLAGS}"
--with-extra-cxxflags="${CXXFLAGS}"
--with-extra-ldflags="${LDFLAGS}"
--with-giflib=system
--with-jtreg=no
--with-jobs=1
--with-num-cores=1
--with-update-version="$(ver_cut 2)"
--with-build-number="b$(ver_cut 4)"
--with-milestone="fcs" # magic variable that means "release version"
--with-vendor-name="Gentoo"
--with-vendor-url="https://gentoo.org"
--with-vendor-bug-url="https://bugs.gentoo.org"
--with-vendor-vm-bug-url="https://bugs.openjdk.java.net"
--with-zlib=system
--with-native-debug-symbols=$(usex debug internal none)
$(usex headless-awt --disable-headful '')
)
# PaX breaks pch, bug #601016
if use pch && ! host-is-pax; then
myconf+=( --enable-precompiled-headers )
else
myconf+=( --disable-precompiled-headers )
fi
(
unset _JAVA_OPTIONS JAVA JAVA_TOOL_OPTIONS JAVAC XARGS
CFLAGS= CXXFLAGS= LDFLAGS= \
CONFIG_SITE=/dev/null \
CONFIG_SHELL="${EPREFIX}/bin/bash"
econf "${myconf[@]}"
)
}
src_compile() {
local myemakeargs=(
JOBS=$(makeopts_jobs)
LOG=debug
$(usex doc docs '')
$(usex jbootstrap bootcycle-images images)
)
emake "${myemakeargs[@]}" -j1 #nowarn
}
src_install() {
local dest="/usr/$(get_libdir)/${PN}-${SLOT}"
local ddest="${ED%/}/${dest#/}"
cd "${S}"/build/*-release/images/j2sdk-image || die
if ! use alsa; then
rm -v jre/lib/$(get_system_arch)/libjsoundalsa.* || die
fi
# build system does not remove that
if use headless-awt ; then
rm -fvr jre/lib/$(get_system_arch)/lib*{[jx]awt,splashscreen}* \
{,jre/}bin/policytool bin/appletviewer || die
fi
if ! use examples ; then
rm -vr demo/ || die
fi
if ! use source ; then
rm -v src.zip || die
fi
dodir "${dest}"
cp -pPR * "${ddest}" || die
dosym ../../../../../../etc/ssl/certs/java/cacerts "${dest}"/jre/lib/security/cacerts
java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.env.sh
java-vm_set-pax-markings "${ddest}"
java-vm_revdep-mask
java-vm_sandbox-predict /dev/random /proc/self/coredump_filter
if use doc ; then
docinto html
dodoc -r "${S}"/build/*-release/docs/*
fi
}
pkg_postinst() {
java-vm-2_pkg_postinst
einfo "JavaWebStart functionality provided by icedtea-web package"
}

View File

@ -1,4 +1,4 @@
# Copyright 1999-2020 Gentoo Authors
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@ -25,7 +25,7 @@ SRC_URI="
LICENSE="GPL-2"
KEYWORDS="amd64 arm64"
IUSE="debug cups doc examples gentoo-vm +jbootstrap nsplugin +pch selinux source +webstart"
IUSE="alsa debug cups doc examples gentoo-vm headless-awt +jbootstrap nsplugin +pch selinux source +webstart"
COMMON_DEPEND="
media-libs/freetype:2=
@ -37,13 +37,15 @@ COMMON_DEPEND="
RDEPEND="
${COMMON_DEPEND}
>=sys-apps/baselayout-java-0.1.0-r1
x11-libs/libX11
x11-libs/libXext
x11-libs/libXi
x11-libs/libXrender
x11-libs/libXt
x11-libs/libXtst
media-libs/alsa-lib
!headless-awt? (
x11-libs/libX11
x11-libs/libXext
x11-libs/libXi
x11-libs/libXrender
x11-libs/libXt
x11-libs/libXtst
)
alsa? ( media-libs/alsa-lib )
cups? ( net-print/cups )
selinux? ( sec-policy/selinux-java )
"
@ -77,7 +79,7 @@ PDEPEND="
nsplugin? ( >=dev-java/icedtea-web-1.6.1:0[nsplugin] )
"
S="${WORKDIR}/jdk${SLOT}u-jdk-${MY_PV}"
S="${WORKDIR}/${PN}-${PV}"
# The space required to build varies wildly depending on USE flags,
# ranging from 2GB to 16GB. This function is certainly not exact but
@ -134,30 +136,40 @@ pkg_setup() {
fi
}
src_prepare() {
src_unpack() {
default
chmod +x configure || die
mv -v "jdk${SLOT}u"* "${P}" || die
local repo
for repo in corba hotspot jdk jaxp jaxws langtools nashorn; do
ln -s "../${repo}-jdk-${MY_PV}" "${repo}" || die
mv -v "${repo}-"* "${P}/${repo}" || die
done
}
src_prepare() {
default
chmod +x configure || die
# conditionally apply patches for musl compatibility
if use elibc_musl; then
eapply "${FILESDIR}/musl/${SLOT}/build.patch"
eapply "${FILESDIR}/musl/${SLOT}/fix-bootjdk-check.patch"
eapply "${FILESDIR}/musl/${SLOT}/make-4.3.patch"
eapply "${FILESDIR}/musl/${SLOT}/ppc64le.patch"
eapply "${FILESDIR}/musl/${SLOT}/aarch64.patch"
fi
# conditionally remove not compilable module (hotspot jdk.hotspot.agent)
# this needs libthread_db which is only provided by glibc
#
# haven't found any way to disable this module so just remove it.
if use elibc_musl; then
rm -rf "${S}"/hotspot/src/jdk.hotspot.agent || die "failed to remove HotSpot agent"
fi
# https://bugs.openjdk.java.net/browse/JDK-8201788
eapply "${FILESDIR}/bootcycle_jobs.patch"
# conditionally apply patches for musl compatibility
if use elibc_musl; then
cd "../hotspot-jdk-${MY_PV}"
eapply -p2 "${FILESDIR}/${PN}${SLOT}-hotspot-stop-using-obsolete-isnanf.patch"
eapply -p2 "${FILESDIR}/${PN}${SLOT}-hotspot-musl.patch"
eapply "${FILESDIR}/${PN}${SLOT}-hotspot-rlim_t.patch"
eapply "${FILESDIR}/${PN}${SLOT}-os_linux-remove-glibc-dependencies.patch"
cd "../jdk-jdk-${MY_PV}"
eapply -p2 "${FILESDIR}/${PN}${SLOT}-jdk-musl-build-fix-use-SIGRTMAX-rather-than-__SIGRTM.patch"
eapply -p1 "${FILESDIR}/${PN}${SLOT}-jdk-execinfo.patch"
eapply -p2 "${FILESDIR}/${PN}${SLOT}-musl-fix-libjvm-load-on-musl.patch"
fi
epatch "${FILESDIR}/bootcycle_jobs.patch"
}
src_configure() {
@ -184,6 +196,7 @@ src_configure() {
--with-milestone="fcs" # magic variable that means "release version"
--with-zlib=system
--with-native-debug-symbols=$(usex debug internal none)
$(usex headless-awt --disable-headful '')
)
# PaX breaks pch, bug #601016
@ -217,6 +230,16 @@ src_install() {
cd "${S}"/build/*-release/images/jdk || die
if ! use alsa; then
rm -v jre/lib/$(get_system_arch)/libjsoundalsa.* || die
fi
# stupid build system does not remove that
if use headless-awt ; then
rm -fvr jre/lib/$(get_system_arch)/lib*{[jx]awt,splashscreen}* \
{,jre/}bin/policytool bin/appletviewer || die
fi
if ! use examples ; then
rm -vr demo/ || die
fi
@ -255,3 +278,4 @@ pkg_postinst() {
ewarn "absolute location under ${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}."
fi
}