From 67efaff61522aeb024152ab6cddf7c40ffacb530 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 19 Oct 2023 21:52:41 +0100 Subject: gentoo auto-resync : 19:10:2023 - 21:52:41 --- sys-devel/llvm/Manifest | 19 +- sys-devel/llvm/llvm-17.0.1.ebuild | 540 ------------------------- sys-devel/llvm/llvm-17.0.2-r1.ebuild | 541 -------------------------- sys-devel/llvm/llvm-17.0.3.9999.ebuild | 1 - sys-devel/llvm/llvm-18.0.0.9999.ebuild | 1 - sys-devel/llvm/llvm-18.0.0_pre20230925.ebuild | 532 ------------------------- sys-devel/llvm/llvm-18.0.0_pre20231002.ebuild | 539 ------------------------- sys-devel/llvm/llvm-18.0.0_pre20231013.ebuild | 1 - sys-devel/llvm/llvm-18.0.0_pre20231019.ebuild | 538 +++++++++++++++++++++++++ 9 files changed, 543 insertions(+), 2169 deletions(-) delete mode 100644 sys-devel/llvm/llvm-17.0.1.ebuild delete mode 100644 sys-devel/llvm/llvm-17.0.2-r1.ebuild delete mode 100644 sys-devel/llvm/llvm-18.0.0_pre20230925.ebuild delete mode 100644 sys-devel/llvm/llvm-18.0.0_pre20231002.ebuild create mode 100644 sys-devel/llvm/llvm-18.0.0_pre20231019.ebuild (limited to 'sys-devel/llvm') diff --git a/sys-devel/llvm/Manifest b/sys-devel/llvm/Manifest index d9653b9a90a8..498313c4644b 100644 --- a/sys-devel/llvm/Manifest +++ b/sys-devel/llvm/Manifest @@ -5,31 +5,22 @@ DIST llvm-17.0.1-manpages.tar.bz2 263148 BLAKE2B 6485a261e356eacc4a274f9b8d329b5 DIST llvm-gentoo-patchset-14.0.6-r4.tar.xz 19360 BLAKE2B 814dd617d237b0bd9c80bdd9d921196b8f93248b731083e79455d4609a05dd15b6847fc227359624abce683ecdaadaefea71dc9b65b7edd1fc3912123fa55054 SHA512 9ac57abc87a63cf31ecd021e6dd44f5f11cd6136fa3b92e89c52a6d13e0ed471f88e6e96160baeac4615eedff7943048a35a98c8d37387894c9c2d1f5df277ce DIST llvm-gentoo-patchset-15.0.7-r3.tar.xz 24268 BLAKE2B 6531ae385ecea87bc26dba8ce19b4cde8ff224c80fd81f04c6ded131e305ecfdeb8d29ebd3b68a641d240805dc83eb0ebc7cc85124f02ad0ee66e0f201b91d7e SHA512 66cb33f8b423736b990fb75d4f2d1e5f14c0b03308f403297204dd1a352d72f85f34220fd66d3de5d6df328cdf2ffce03c2a111cb0bb57791cf68a88069ac7df DIST llvm-gentoo-patchset-16.0.6.tar.xz 17340 BLAKE2B 37cdf4b38367b4256d4f7a25d1b4f41758e5f81be8e20a1c94a10d6c5e36642e9672121b455e73a0bac2eb40467ef2db4b43789b2912a6790593d97b8b5c27e3 SHA512 2c02b9d8a4c5af9fddcd26c95dc66fffae32cb5b7f85c65a1aa4ed00dd8cd5b01cc1975a711aee63c0b8b11e9dc20f2bc05ea753904eb516892b820f02aff825 -DIST llvm-gentoo-patchset-17.0.2.tar.xz 5040 BLAKE2B 99c3767fe29a009dca0badab36f9762ec31c8eb662f2771cc4b717ff36265f7b13363f9f436e032b58668ea18aaedca147a58cf3750c9dc0f94e209026a9bf1f SHA512 5ba9450d5d64ba4770aff694481d5d9d1e0841b92d32b29782662197a6e0de391cff498d34e7b735617aed9be195345a6457440a222a7b6f5a0e29c79027e51d DIST llvm-project-14.0.6.src.tar.xz 105618228 BLAKE2B ee67c5407df8cef493b9c0004f15e428f22a536a17e5f4e3eb29a003b8a8ec0abe0fa3e072591161d5f30ef7d8867c1ce34d1b341ad858e93c00263499941a99 SHA512 6fc6eeb60fac698702d1aac495fc0161eb7216a1f8db2020af8fccec5837831f7cc20dc2a169bf4f0b5f520748280b4a86621f3697d622aa58faaa45dbfaad13 DIST llvm-project-14.0.6.src.tar.xz.sig 566 BLAKE2B cb658ad43d8ab6c43a5773aedadf0569c97b5ee4b1bd58eceb10e1879a30880c741c3d66bedd462c892309b688fb7b2673115a62d1f74d71ee375a578de9547f SHA512 b4a7b368532a7a4a24376cfa7db8f6d3478f6d4446474342fc00b474ecf466330cd0f16783209263c4c72d5fc7ddedfb11b95578842e700cfb7ee0bb34cc95d6 DIST llvm-project-15.0.7.src.tar.xz 110936452 BLAKE2B f3d277e2029157329e5be78b78af36b0826a1dfd9a337992499bf701e33149665bfc47d5e14978e38f342559629a559f8b2ce328705ba34fdf6830f5ae9721a5 SHA512 4836d3603f32e8e54434cbfa8ef33d9d473ac5dc20ebf9c67132653c73f4524931abd1084655eaee5f20bcfcb91bcc4bbc5c4a0b603ad0c9029c556e14dc4c52 DIST llvm-project-15.0.7.src.tar.xz.sig 566 BLAKE2B 47dc8c82d86237b80c6d85f83a6c9a6e9e174cf8e7f367b071e0cd9481d7cd408e991337c5624e07f3f370f26387c814f212808575ed1c1b58404d3e3836b7df SHA512 fc6891b440dd1175eb8df3790590af8d36bc92301660f84744ae15123475aeb900a151e6a8e7998ded27ec4d86871903ad0b89cd61164943054c2e3bc8d8beb2 DIST llvm-project-16.0.6.src.tar.xz 118013488 BLAKE2B 95192d39cbd2914e5609db365965f1c00bfea6c2d653b3996bd2acef8a2b37e37f6fc8a9d2b65711ad72657e0ef52c42f733053cf65051e7822f27396c30406d SHA512 89a67ebfbbc764cc456e8825ecfa90707741f8835b1b2adffae0b227ab1fe5ca9cce75b0efaffc9ca8431cae528dc54fd838867a56a2b645344d9e82d19ab1b7 DIST llvm-project-16.0.6.src.tar.xz.sig 566 BLAKE2B 2060cebd5ed57cb8a86a44238c43dfd4b921649298b10c3d19da308374c1e49869174294e29943c2af459fe06428264e26881d6c1288ebbc48686cc2cf467c7a SHA512 ca249262c7102e0889ec1bdc6f71a3a6f0e7e5d5fbab8abcd6fccd2871e7955eff7af5b055a76006097baf0dfaf2f5069eff3035b3107fc552abdb2481b21447 -DIST llvm-project-17.0.1.src.tar.xz 127830376 BLAKE2B bb3b9f7358df9006307f5eeccfc5c5ee5497498c4f091347924911cb6534e8d930024c35387456af24bf647d9e24a3d927aa49199036fb475018a610b5d792c7 SHA512 6fc1d5ff4fec49ef5bb495ba9d8f9ee9052c10999ec9d3ac8f825c718e3cdd64abd95408c4e5bb7f67eb9a7bfac9e26d2a949c4da9f163b5646c02e8a670ead5 -DIST llvm-project-17.0.1.src.tar.xz.sig 438 BLAKE2B 3182e3c3a48635fdec39b945ee3b782d7c9c2a07911d9ede2e3421031bb1b4959bd495c5e39d094aeaf555579b9fe3eb834c1449077c154c629f5db605375e7c SHA512 301a6e6c46d6fee13c86dec1a021c35f6bf3a97e5d6b0aa7b7eac34e7ca52f6cefffc25a9e376250b1eb721a65a5852f2f1948abd432698363a81dd7ee19d81c -DIST llvm-project-17.0.2.src.tar.xz 127833708 BLAKE2B fa9e2e48ce1117063f5cef0aeef85ce84b99bd8fae23022572a6f016eff2ffbf8aab6250b0bdb6e0bbea1c4daf10cecceb18e80496260b5aa81086075d503e12 SHA512 4586224c3f547e8065fa4f0ca3629a1dfed868dfc372ab192d8b9384f0f74dc8cb27dcb6269dc4230202e6a524aae852d98b40fa02ed0393086a162387ea7659 -DIST llvm-project-17.0.2.src.tar.xz.sig 438 BLAKE2B 3ba5d7a09e9de3f38a6f7b5b771b08b1c4e96ea7eda948cfa679598d240fa5211fd37220fbe09e37682212b17fb71b8b5539475edb8ff46d9767054983f670cb SHA512 234276813e3f4b5ee9b1dc640a613fd2e60f1d659f4e089733278d08dd0e208ad37d4d64c9e1edd420b6b87e112458ecec5f76ed9a243c3023b0adbab19ab909 DIST llvm-project-17.0.3.src.tar.xz 127843636 BLAKE2B 5331d9b545faab282a4caec9ee688d0f1e0615a56a26aa24d8f6fbbae10258e132d94634dab2f7bd69ada06bb28dc899730b9cd774a1086d7c03d5706de6d997 SHA512 44f37dea494a66a83c252e28d7d0517c3b2eed5b196565432dc663c7914bd66d665c8d13479e2776a14cac1905faf6972f986176722c053b58528570a6e68316 DIST llvm-project-17.0.3.src.tar.xz.sig 438 BLAKE2B 045e7ca82c8d9b3f182e4fa331ec841b24777ac1888f10de435a389ae3a88172e0559a3fca0c2d37cc874464411ae50d7bc0d0829455149a8de8b953ef6c98c7 SHA512 95f9e6729074cfd71b0ffb21e423cd0fd87763268c24e0513f7afd6a85d08061658c44c03ea3ea3b6e3cc7051676d44c41a791e6905c8abb456d48a3762fc152 -DIST llvm-project-39fec5457c0925bd39f67f63fe17391584e08258.tar.gz 198361956 BLAKE2B 001b9d9b7997762dcce4f0b1deb94d41c3d840c178ba1e92208782e7e21fdc0041cde359051b2b1b1fc75526ff6504d3b9375ff873831350de359530c944a961 SHA512 b560e71c9855aff9fb5385f9fb30f63fbef074fd695e7cb31847192837a161bfe4808ceb09c514a676ae817616f15fb5a57d325aa9744eaac46b8f4b20b77a13 DIST llvm-project-5d35273a32d239b7407338e13ed71b59174d6536.tar.gz 198787569 BLAKE2B 7f4f1eb490028e18826a6ebade649a682e433252ceab1f3dcd9e50c34f24e7ef108c3325ec209a4d4fa1ded8e09ebda4980cb9d8ddce8a0d517923d6c38b8f4a SHA512 4d263561fb12cc07a5e8f7ed2f8f22a3645aa959cf963a6a735a9bb93cfc2a51bf7e4d36b54e8425725029cfcfd868dfcc53af95d26d84be72be124d8c564271 -DIST llvm-project-f5cb9cb59d7c9c6ac3d5c41c677f68c9b75d34a3.tar.gz 198113948 BLAKE2B 1688920eb790421f4143e92bd7bd26794a2497e7b445dde6d55b59c9df4b1aebb848833c7cb1b7c273c5e002763f2531a341313500ce207242f992dfe343b988 SHA512 9817e8b7adf7c69d673124e8334c3e511dfd1cc386832c52b2fb0f2517475d29cd98513ad87188a962f9697dfac39ea03f5b2db6c549c307cf3d27b1370ffdf3 +DIST llvm-project-e6e90840708099425b7b69dd053634ff25d4907f.tar.gz 199022115 BLAKE2B 442aff8f561f7c5834a36b7eb217fd2b984e58af9cbcf3e6495305f386a7651e73345bbe65133af4bffaf8cb209cfb9a94fb28756ffaaaae8f7d28ec253ccb78 SHA512 fa9c180f36f4c782208ae7baff1683ee466c70f7d021b21b9cb8a8fd0f2005c0b47889d8bb37f5fb984f6b2ec26c74df60490c7b51ac3d080830e6844e33e300 EBUILD llvm-14.0.6-r4.ebuild 12313 BLAKE2B fc192cd5a0ce4392b3aae13e068522dcac0925cd67afae7c230b150e8ddab3a302dd3dbf5b9eb9ea0092ca8d5464e43f4a37d6e615998fc8259a2fbd669deb44 SHA512 839388316772e70d13ac1b6f72d93171dc698659a79766057a7dc16b191f5f417c919398c9ff09430fb128654452a01fa1dcfce27c60ac29aa11edb5eed3be0b EBUILD llvm-15.0.7-r3.ebuild 12486 BLAKE2B 1c62b4a9f7493b3cf9bd2ca388d9c09da2077a5be4b19dba2628352e0524e37df1e3481cc3e0658d3ce8eeb81fe7b4e379be7d5ba9e20a60376616e5a38f6264 SHA512 d6eea0d3330e29a4a27bb758cb5abec08b35f5b0d6a9bacfeddcaf031b0c125ba9454d4eb77a65fe6dd5b379654dd895d603e0a01008b57476502be82ffb392c EBUILD llvm-16.0.6.ebuild 12812 BLAKE2B 1063af92819795e6867db4ef9c7f31826df93560b99a56fdc33f315319cc916dde824f2282c74b54430da11a5a9e5428de6552ee57ef0f4bdd4b3c69d3ee230f SHA512 d23327496b4a9d58aa8bae415d85fda284bfc499c3552a272b160bb6f6f85d1300f0e5d536d24c97e58def556e1743ebeae9dc7d718bf6a0a994a63e07054969 -EBUILD llvm-17.0.1.ebuild 13080 BLAKE2B 40b706c98bbe0a3be6b3c68f8a863f93b263f2a11228bd180cc7f25120fe3f9fdbd45a621200f471c17b0384fe2eb9a0847b6462903af4106c032a42cae51199 SHA512 dbd372ab87de2a4c27d471261d13f64cdbc34aa0a901457788e239dfa22b9168914cba80ec17f4f6d3aab95f130f7e81a3f2f789fdb0427ae2eeac229e8ae565 -EBUILD llvm-17.0.2-r1.ebuild 13100 BLAKE2B 054b13ea90105c70a9b40cef1cdee3157515bca2350b5fcf69ea8d81a45fb259c523f70e2306f101b6078e367143c1798acc3d7c5e5391a9c6e15c5053f11768 SHA512 6a1973ec5a0045c65e45e53c8f18230098831c5ba4893c908cdf22f4747f03702e19627cabe1d1c7407ab988d52c74ee83a287f96dccaf1e6af8caaa45585d68 -EBUILD llvm-17.0.3.9999.ebuild 12990 BLAKE2B 295cb963dd707d91c40c63c9eb51d02cda2e2d3d86716be0575da2ebbd1958014c316f044d6e636dd68b38e59e572b7c8afb31677e5d9af16cd90f90d816ab88 SHA512 23a1f157812b88c5b8cde8d23c33e5c84f417afd2a06def1c9620709d9fad35f57c290f96534721a5645cd2f1e2d2a097ff09de72fea1bad0c3716d7c77a4646 +EBUILD llvm-17.0.3.9999.ebuild 12978 BLAKE2B b8454e70702ad8bc8826ca20999bcdc8605ecfd09a8e25c730285bbf3e59ed31f0c392b4c358bd2cec7897de85d8d16c2f14a93c00e55d15f9ebfe5e512b9216 SHA512 14db6693abd7a11ec3a63db1f113b8be9a73b922920fc4de87b094e4ddf29a3e121ecc5d98d9a40c108c1b99e5f41496fb27a88d2cc3b6bc2d262ba9bf4e1527 EBUILD llvm-17.0.3.ebuild 13080 BLAKE2B 40b706c98bbe0a3be6b3c68f8a863f93b263f2a11228bd180cc7f25120fe3f9fdbd45a621200f471c17b0384fe2eb9a0847b6462903af4106c032a42cae51199 SHA512 dbd372ab87de2a4c27d471261d13f64cdbc34aa0a901457788e239dfa22b9168914cba80ec17f4f6d3aab95f130f7e81a3f2f789fdb0427ae2eeac229e8ae565 -EBUILD llvm-18.0.0.9999.ebuild 12962 BLAKE2B 0cd4168bad25b539482bdded2988a43738af06e51500cb6cf059d962d40f33e596ac4ac8b14d66cafda75a01db98d93bba5430053605fa7c2f8474788cf996e3 SHA512 fc87fdf0b1ded8256dc5f250f957c8deafd8950474edc90c4a183ab09c2f534e997df85feb7b302aef3ebb233ff151f28c68dd902a49eda73a41d2cbeaa13a7e -EBUILD llvm-18.0.0_pre20230925.ebuild 12662 BLAKE2B 197f93ba73d9a6083c9bd9014199183dace77ef12727484de5c685df5530e4c24ad894fe3e79f4061684a5b0adbcdb49019b367161666c2567064ac1d8a09481 SHA512 d7a356937690a0cfd1c8a8a59f1c513b591febf7afd77a798211ae7f83d3afbaa31f6939e152529ce3f0848fbd141e08ea741b77016ae5d405f7ce7b00520937 -EBUILD llvm-18.0.0_pre20231002.ebuild 12962 BLAKE2B 0cd4168bad25b539482bdded2988a43738af06e51500cb6cf059d962d40f33e596ac4ac8b14d66cafda75a01db98d93bba5430053605fa7c2f8474788cf996e3 SHA512 fc87fdf0b1ded8256dc5f250f957c8deafd8950474edc90c4a183ab09c2f534e997df85feb7b302aef3ebb233ff151f28c68dd902a49eda73a41d2cbeaa13a7e -EBUILD llvm-18.0.0_pre20231013.ebuild 12962 BLAKE2B 0cd4168bad25b539482bdded2988a43738af06e51500cb6cf059d962d40f33e596ac4ac8b14d66cafda75a01db98d93bba5430053605fa7c2f8474788cf996e3 SHA512 fc87fdf0b1ded8256dc5f250f957c8deafd8950474edc90c4a183ab09c2f534e997df85feb7b302aef3ebb233ff151f28c68dd902a49eda73a41d2cbeaa13a7e +EBUILD llvm-18.0.0.9999.ebuild 12950 BLAKE2B d34e221c69ca3bf4fd37f20011d38dfa5d307c9206801f8fa4f9c452ca74fcb9a3f25aa4f3b97593f0e566e65827d64ce703d1c0b5219b86e36d9a801935be79 SHA512 153437999d9b1fe20678fa5a7fb2342a6d4ba61ba3b8199167c334263852ecb207a3960c8d6c9945f5e72e3fa5811ed6233fbce22925ac1d14b0f850d6ba451c +EBUILD llvm-18.0.0_pre20231013.ebuild 12950 BLAKE2B d34e221c69ca3bf4fd37f20011d38dfa5d307c9206801f8fa4f9c452ca74fcb9a3f25aa4f3b97593f0e566e65827d64ce703d1c0b5219b86e36d9a801935be79 SHA512 153437999d9b1fe20678fa5a7fb2342a6d4ba61ba3b8199167c334263852ecb207a3960c8d6c9945f5e72e3fa5811ed6233fbce22925ac1d14b0f850d6ba451c +EBUILD llvm-18.0.0_pre20231019.ebuild 12950 BLAKE2B d34e221c69ca3bf4fd37f20011d38dfa5d307c9206801f8fa4f9c452ca74fcb9a3f25aa4f3b97593f0e566e65827d64ce703d1c0b5219b86e36d9a801935be79 SHA512 153437999d9b1fe20678fa5a7fb2342a6d4ba61ba3b8199167c334263852ecb207a3960c8d6c9945f5e72e3fa5811ed6233fbce22925ac1d14b0f850d6ba451c MISC metadata.xml 2782 BLAKE2B 4bd546287f630462c3f5d98cbd15a59a4cdef4023f86a5f4fe64fc5f10256cae7014d18823bd0909f4af4e42f299b6e7983c9c3c569cfab1ad38b0160f1eae40 SHA512 6bf1dc4f71f50e1eecc55cbb8366d8ed82a3dd328871acf1d808fc5e3ee4d203d623f81d9968bda45a87c72a2f20ed69b735b0a289b0052b048175cf6502e124 diff --git a/sys-devel/llvm/llvm-17.0.1.ebuild b/sys-devel/llvm/llvm-17.0.1.ebuild deleted file mode 100644 index a7a24bb390c2..000000000000 --- a/sys-devel/llvm/llvm-17.0.1.ebuild +++ /dev/null @@ -1,540 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..12} ) - -inherit cmake llvm.org multilib-minimal pax-utils python-any-r1 -inherit toolchain-funcs - -DESCRIPTION="Low Level Virtual Machine" -HOMEPAGE="https://llvm.org/" - -# Additional licenses: -# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD. -# 2. xxhash: BSD. -# 3. MD5 code: public-domain. -# 4. ConvertUTF.h: TODO. - -LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc" -SLOT="${LLVM_MAJOR}/${LLVM_SOABI}" -KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~ppc-macos ~x64-macos" -IUSE=" - +binutils-plugin debug debuginfod doc exegesis libedit +libffi - ncurses test xar xml z3 zstd -" -RESTRICT="!test? ( test )" - -RDEPEND=" - sys-libs/zlib:0=[${MULTILIB_USEDEP}] - debuginfod? ( - net-misc/curl:= - dev-cpp/cpp-httplib:= - ) - exegesis? ( dev-libs/libpfm:= ) - libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] ) - libffi? ( >=dev-libs/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] ) - ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] ) - xar? ( app-arch/xar ) - xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] ) - z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] ) - zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] ) -" -DEPEND=" - ${RDEPEND} - binutils-plugin? ( sys-libs/binutils-libs ) -" -BDEPEND=" - ${PYTHON_DEPS} - dev-lang/perl - >=dev-util/cmake-3.16 - sys-devel/gnuconfig - kernel_Darwin? ( - =sys-devel/binutils-apple-5.1 - ) - doc? ( $(python_gen_any_dep ' - dev-python/recommonmark[${PYTHON_USEDEP}] - dev-python/sphinx[${PYTHON_USEDEP}] - ') ) - libffi? ( virtual/pkgconfig ) -" -# There are no file collisions between these versions but having :0 -# installed means llvm-config there will take precedence. -RDEPEND=" - ${RDEPEND} - !sys-devel/llvm:0 -" -PDEPEND=" - sys-devel/llvm-common - sys-devel/llvm-toolchain-symlinks:${LLVM_MAJOR} - binutils-plugin? ( >=sys-devel/llvmgold-${LLVM_MAJOR} ) -" - -LLVM_COMPONENTS=( llvm cmake third-party ) -LLVM_MANPAGES=1 -LLVM_USE_TARGETS=provide -llvm.org_set_globals - -python_check_deps() { - use doc || return 0 - - python_has_version -b "dev-python/recommonmark[${PYTHON_USEDEP}]" && - python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]" -} - -check_uptodate() { - local prod_targets=( - $(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \ - | tail -n +2 | head -n -1) - ) - local all_targets=( - lib/Target/*/ - ) - all_targets=( "${all_targets[@]#lib/Target/}" ) - all_targets=( "${all_targets[@]%/}" ) - - local exp_targets=() i - for i in "${all_targets[@]}"; do - has "${i}" "${prod_targets[@]}" || exp_targets+=( "${i}" ) - done - - if [[ ${exp_targets[*]} != ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]} ]]; then - eqawarn "ALL_LLVM_EXPERIMENTAL_TARGETS is outdated!" - eqawarn " Have: ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]}" - eqawarn "Expected: ${exp_targets[*]}" - eqawarn - fi - - if [[ ${prod_targets[*]} != ${ALL_LLVM_PRODUCTION_TARGETS[*]} ]]; then - eqawarn "ALL_LLVM_PRODUCTION_TARGETS is outdated!" - eqawarn " Have: ${ALL_LLVM_PRODUCTION_TARGETS[*]}" - eqawarn "Expected: ${prod_targets[*]}" - fi -} - -check_distribution_components() { - if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then - local all_targets=() my_targets=() l - cd "${BUILD_DIR}" || die - - while read -r l; do - if [[ ${l} == install-*-stripped:* ]]; then - l=${l#install-} - l=${l%%-stripped*} - - case ${l} in - # shared libs - LLVM|LLVMgold) - ;; - # TableGen lib + deps - LLVMDemangle|LLVMSupport|LLVMTableGen) - ;; - # testing libraries - LLVMTestingAnnotations|LLVMTestingSupport) - ;; - # static libs - LLVM*) - continue - ;; - # meta-targets - distribution|llvm-libraries) - continue - ;; - # used only w/ USE=doc - docs-llvm-html) - use doc || continue - ;; - esac - - all_targets+=( "${l}" ) - fi - done < <(${NINJA} -t targets all) - - while read -r l; do - my_targets+=( "${l}" ) - done < <(get_distribution_components $"\n") - - local add=() remove=() - for l in "${all_targets[@]}"; do - if ! has "${l}" "${my_targets[@]}"; then - add+=( "${l}" ) - fi - done - for l in "${my_targets[@]}"; do - if ! has "${l}" "${all_targets[@]}"; then - remove+=( "${l}" ) - fi - done - - if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then - eqawarn "get_distribution_components() is outdated!" - eqawarn " Add: ${add[*]}" - eqawarn "Remove: ${remove[*]}" - fi - cd - >/dev/null || die - fi -} - -src_prepare() { - # disable use of SDK on OSX, bug #568758 - sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die - - # Update config.guess to support more systems - cp "${BROOT}/usr/share/gnuconfig/config.guess" cmake/ || die - - # Verify that the ebuild is up-to-date - check_uptodate - - llvm.org_src_prepare -} - -get_distribution_components() { - local sep=${1-;} - - local out=( - # shared libs - LLVM - LTO - Remarks - - # tools - llvm-config - - # common stuff - cmake-exports - llvm-headers - - # libraries needed for clang-tblgen - LLVMDemangle - LLVMSupport - LLVMTableGen - - # testing libraries - llvm_gtest - llvm_gtest_main - LLVMTestingAnnotations - LLVMTestingSupport - ) - - if multilib_is_native_abi; then - out+=( - # utilities - llvm-tblgen - FileCheck - llvm-PerfectShuffle - count - not - yaml-bench - UnicodeNameMappingGenerator - - # tools - bugpoint - dsymutil - llc - lli - lli-child-target - llvm-addr2line - llvm-ar - llvm-as - llvm-bcanalyzer - llvm-bitcode-strip - llvm-c-test - llvm-cat - llvm-cfi-verify - llvm-config - llvm-cov - llvm-cvtres - llvm-cxxdump - llvm-cxxfilt - llvm-cxxmap - llvm-debuginfo-analyzer - llvm-debuginfod-find - llvm-diff - llvm-dis - llvm-dlltool - llvm-dwarfdump - llvm-dwarfutil - llvm-dwp - llvm-exegesis - llvm-extract - llvm-gsymutil - llvm-ifs - llvm-install-name-tool - llvm-jitlink - llvm-jitlink-executor - llvm-lib - llvm-libtool-darwin - llvm-link - llvm-lipo - llvm-lto - llvm-lto2 - llvm-mc - llvm-mca - llvm-ml - llvm-modextract - llvm-mt - llvm-nm - llvm-objcopy - llvm-objdump - llvm-opt-report - llvm-otool - llvm-pdbutil - llvm-profdata - llvm-profgen - llvm-ranlib - llvm-rc - llvm-readelf - llvm-readobj - llvm-reduce - llvm-remark-size-diff - llvm-remarkutil - llvm-rtdyld - llvm-sim - llvm-size - llvm-split - llvm-stress - llvm-strings - llvm-strip - llvm-symbolizer - llvm-tapi-diff - llvm-tli-checker - llvm-undname - llvm-windres - llvm-xray - obj2yaml - opt - sancov - sanstats - split-file - verify-uselistorder - yaml2obj - - # python modules - opt-viewer - ) - - if llvm_are_manpages_built; then - out+=( - # manpages - docs-dsymutil-man - docs-llvm-dwarfdump-man - docs-llvm-man - ) - fi - use doc && out+=( - docs-llvm-html - ) - - use binutils-plugin && out+=( - LLVMgold - ) - use debuginfod && out+=( - llvm-debuginfod - ) - fi - - printf "%s${sep}" "${out[@]}" -} - -multilib_src_configure() { - local ffi_cflags ffi_ldflags - if use libffi; then - ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi) - ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi) - fi - - local libdir=$(get_libdir) - local mycmakeargs=( - # disable appending VCS revision to the version to improve - # direct cache hit ratio - -DLLVM_APPEND_VC_REV=OFF - -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}" - -DLLVM_LIBDIR_SUFFIX=${libdir#lib} - - -DBUILD_SHARED_LIBS=OFF - -DLLVM_BUILD_LLVM_DYLIB=ON - -DLLVM_LINK_LLVM_DYLIB=ON - -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components) - - # cheap hack: LLVM combines both anyway, and the only difference - # is that the former list is explicitly verified at cmake time - -DLLVM_TARGETS_TO_BUILD="" - -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}" - -DLLVM_INCLUDE_BENCHMARKS=OFF - -DLLVM_INCLUDE_TESTS=ON - -DLLVM_BUILD_TESTS=$(usex test) - -DLLVM_INSTALL_GTEST=ON - - -DLLVM_ENABLE_FFI=$(usex libffi) - -DLLVM_ENABLE_LIBEDIT=$(usex libedit) - -DLLVM_ENABLE_TERMINFO=$(usex ncurses) - -DLLVM_ENABLE_LIBXML2=$(usex xml) - -DLLVM_ENABLE_ASSERTIONS=$(usex debug) - -DLLVM_ENABLE_LIBPFM=$(usex exegesis) - -DLLVM_ENABLE_EH=ON - -DLLVM_ENABLE_RTTI=ON - -DLLVM_ENABLE_Z3_SOLVER=$(usex z3) - -DLLVM_ENABLE_ZSTD=$(usex zstd) - -DLLVM_ENABLE_CURL=$(usex debuginfod) - -DLLVM_ENABLE_HTTPLIB=$(usex debuginfod) - - -DLLVM_HOST_TRIPLE="${CHOST}" - - -DFFI_INCLUDE_DIR="${ffi_cflags#-I}" - -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}" - # used only for llvm-objdump tool - -DLLVM_HAVE_LIBXAR=$(multilib_native_usex xar 1 0) - - -DPython3_EXECUTABLE="${PYTHON}" - - # disable OCaml bindings (now in dev-ml/llvm-ocaml) - -DOCAMLFIND=NO - ) - - local suffix= - if [[ -n ${EGIT_VERSION} && ${EGIT_BRANCH} != release/* ]]; then - # the ABI of the main branch is not stable, so let's include - # the commit id in the SOVERSION to contain the breakage - suffix+="git${EGIT_VERSION::8}" - fi - if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then - # Smart hack: alter version suffix -> SOVERSION when linking - # against libc++. This way we won't end up mixing LLVM libc++ - # libraries with libstdc++ clang, and the other way around. - suffix+="+libcxx" - mycmakeargs+=( - -DLLVM_ENABLE_LIBCXX=ON - ) - fi - mycmakeargs+=( - -DLLVM_VERSION_SUFFIX="${suffix}" - ) - - use test && mycmakeargs+=( - -DLLVM_LIT_ARGS="$(get_lit_flags)" - ) - - if multilib_is_native_abi; then - local build_docs=OFF - if llvm_are_manpages_built; then - build_docs=ON - mycmakeargs+=( - -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man" - -DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html" - -DSPHINX_WARNINGS_AS_ERRORS=OFF - ) - fi - - mycmakeargs+=( - -DLLVM_BUILD_DOCS=${build_docs} - -DLLVM_ENABLE_OCAMLDOC=OFF - -DLLVM_ENABLE_SPHINX=${build_docs} - -DLLVM_ENABLE_DOXYGEN=OFF - -DLLVM_INSTALL_UTILS=ON - ) - use binutils-plugin && mycmakeargs+=( - -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include - ) - fi - - # On Macos prefix, Gentoo doesn't split sys-libs/ncurses to libtinfo and - # libncurses, but llvm tries to use libtinfo before libncurses, and ends up - # using libtinfo (actually, libncurses.dylib) from system instead of prefix - use kernel_Darwin && mycmakeargs+=( - -DTerminfo_LIBRARIES=-lncurses - ) - - # workaround BMI bug in gcc-7 (fixed in 7.4) - # https://bugs.gentoo.org/649880 - # apply only to x86, https://bugs.gentoo.org/650506 - if tc-is-gcc && [[ ${MULTILIB_ABI_FLAG} == abi_x86* ]] && - [[ $(gcc-major-version) -eq 7 && $(gcc-minor-version) -lt 4 ]] - then - local CFLAGS="${CFLAGS} -mno-bmi" - local CXXFLAGS="${CXXFLAGS} -mno-bmi" - fi - - # LLVM can have very high memory consumption while linking, - # exhausting the limit on 32-bit linker executable - use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory" - - # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 - use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" - cmake_src_configure - - grep -q -E "^CMAKE_PROJECT_VERSION_MAJOR(:.*)?=${LLVM_MAJOR}$" \ - CMakeCache.txt || - die "Incorrect version, did you update _LLVM_MAIN_MAJOR?" - multilib_is_native_abi && check_distribution_components -} - -multilib_src_compile() { - tc-env_build cmake_build distribution - - pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld - pax-mark m "${BUILD_DIR}"/bin/lli - pax-mark m "${BUILD_DIR}"/bin/lli-child-target - - if use test; then - pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests - pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests - pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests - fi -} - -multilib_src_test() { - # respect TMPDIR! - local -x LIT_PRESERVES_TMP=1 - cmake_build check -} - -src_install() { - local MULTILIB_CHOST_TOOLS=( - /usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-config - ) - - local MULTILIB_WRAPPED_HEADERS=( - /usr/include/llvm/Config/llvm-config.h - ) - - local LLVM_LDPATHS=() - multilib-minimal_src_install - - # move wrapped headers back - mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die -} - -multilib_src_install() { - DESTDIR=${D} cmake_build install-distribution - - # move headers to /usr/include for wrapping - rm -rf "${ED}"/usr/include || die - mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die - - LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)" ) -} - -multilib_src_install_all() { - local revord=$(( 9999 - ${LLVM_MAJOR} )) - newenvd - "60llvm-${revord}" <<-_EOF_ - PATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin" - # we need to duplicate it in ROOTPATH for Portage to respect... - ROOTPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin" - MANPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man" - LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )" - _EOF_ - - docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man" - llvm_install_manpages -} - -pkg_postinst() { - elog "You can find additional opt-viewer utility scripts in:" - elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/opt-viewer" - elog "To use these scripts, you will need Python along with the following" - elog "packages:" - elog " dev-python/pygments (for opt-viewer)" - elog " dev-python/pyyaml (for all of them)" -} diff --git a/sys-devel/llvm/llvm-17.0.2-r1.ebuild b/sys-devel/llvm/llvm-17.0.2-r1.ebuild deleted file mode 100644 index 8c476ecc2bc9..000000000000 --- a/sys-devel/llvm/llvm-17.0.2-r1.ebuild +++ /dev/null @@ -1,541 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..12} ) - -inherit cmake llvm.org multilib-minimal pax-utils python-any-r1 -inherit toolchain-funcs - -DESCRIPTION="Low Level Virtual Machine" -HOMEPAGE="https://llvm.org/" - -# Additional licenses: -# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD. -# 2. xxhash: BSD. -# 3. MD5 code: public-domain. -# 4. ConvertUTF.h: TODO. - -LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc" -SLOT="${LLVM_MAJOR}/${LLVM_SOABI}" -KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~ppc-macos ~x64-macos" -IUSE=" - +binutils-plugin debug debuginfod doc exegesis libedit +libffi - ncurses test xar xml z3 zstd -" -RESTRICT="!test? ( test )" - -RDEPEND=" - sys-libs/zlib:0=[${MULTILIB_USEDEP}] - debuginfod? ( - net-misc/curl:= - dev-cpp/cpp-httplib:= - ) - exegesis? ( dev-libs/libpfm:= ) - libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] ) - libffi? ( >=dev-libs/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] ) - ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] ) - xar? ( app-arch/xar ) - xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] ) - z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] ) - zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] ) -" -DEPEND=" - ${RDEPEND} - binutils-plugin? ( sys-libs/binutils-libs ) -" -BDEPEND=" - ${PYTHON_DEPS} - dev-lang/perl - >=dev-util/cmake-3.16 - sys-devel/gnuconfig - kernel_Darwin? ( - =sys-devel/binutils-apple-5.1 - ) - doc? ( $(python_gen_any_dep ' - dev-python/recommonmark[${PYTHON_USEDEP}] - dev-python/sphinx[${PYTHON_USEDEP}] - ') ) - libffi? ( virtual/pkgconfig ) -" -# There are no file collisions between these versions but having :0 -# installed means llvm-config there will take precedence. -RDEPEND=" - ${RDEPEND} - !sys-devel/llvm:0 -" -PDEPEND=" - sys-devel/llvm-common - sys-devel/llvm-toolchain-symlinks:${LLVM_MAJOR} - binutils-plugin? ( >=sys-devel/llvmgold-${LLVM_MAJOR} ) -" - -LLVM_COMPONENTS=( llvm cmake third-party ) -LLVM_MANPAGES=1 -LLVM_PATCHSET=${PV} -LLVM_USE_TARGETS=provide -llvm.org_set_globals - -python_check_deps() { - use doc || return 0 - - python_has_version -b "dev-python/recommonmark[${PYTHON_USEDEP}]" && - python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]" -} - -check_uptodate() { - local prod_targets=( - $(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \ - | tail -n +2 | head -n -1) - ) - local all_targets=( - lib/Target/*/ - ) - all_targets=( "${all_targets[@]#lib/Target/}" ) - all_targets=( "${all_targets[@]%/}" ) - - local exp_targets=() i - for i in "${all_targets[@]}"; do - has "${i}" "${prod_targets[@]}" || exp_targets+=( "${i}" ) - done - - if [[ ${exp_targets[*]} != ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]} ]]; then - eqawarn "ALL_LLVM_EXPERIMENTAL_TARGETS is outdated!" - eqawarn " Have: ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]}" - eqawarn "Expected: ${exp_targets[*]}" - eqawarn - fi - - if [[ ${prod_targets[*]} != ${ALL_LLVM_PRODUCTION_TARGETS[*]} ]]; then - eqawarn "ALL_LLVM_PRODUCTION_TARGETS is outdated!" - eqawarn " Have: ${ALL_LLVM_PRODUCTION_TARGETS[*]}" - eqawarn "Expected: ${prod_targets[*]}" - fi -} - -check_distribution_components() { - if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then - local all_targets=() my_targets=() l - cd "${BUILD_DIR}" || die - - while read -r l; do - if [[ ${l} == install-*-stripped:* ]]; then - l=${l#install-} - l=${l%%-stripped*} - - case ${l} in - # shared libs - LLVM|LLVMgold) - ;; - # TableGen lib + deps - LLVMDemangle|LLVMSupport|LLVMTableGen) - ;; - # testing libraries - LLVMTestingAnnotations|LLVMTestingSupport) - ;; - # static libs - LLVM*) - continue - ;; - # meta-targets - distribution|llvm-libraries) - continue - ;; - # used only w/ USE=doc - docs-llvm-html) - use doc || continue - ;; - esac - - all_targets+=( "${l}" ) - fi - done < <(${NINJA} -t targets all) - - while read -r l; do - my_targets+=( "${l}" ) - done < <(get_distribution_components $"\n") - - local add=() remove=() - for l in "${all_targets[@]}"; do - if ! has "${l}" "${my_targets[@]}"; then - add+=( "${l}" ) - fi - done - for l in "${my_targets[@]}"; do - if ! has "${l}" "${all_targets[@]}"; then - remove+=( "${l}" ) - fi - done - - if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then - eqawarn "get_distribution_components() is outdated!" - eqawarn " Add: ${add[*]}" - eqawarn "Remove: ${remove[*]}" - fi - cd - >/dev/null || die - fi -} - -src_prepare() { - # disable use of SDK on OSX, bug #568758 - sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die - - # Update config.guess to support more systems - cp "${BROOT}/usr/share/gnuconfig/config.guess" cmake/ || die - - # Verify that the ebuild is up-to-date - check_uptodate - - llvm.org_src_prepare -} - -get_distribution_components() { - local sep=${1-;} - - local out=( - # shared libs - LLVM - LTO - Remarks - - # tools - llvm-config - - # common stuff - cmake-exports - llvm-headers - - # libraries needed for clang-tblgen - LLVMDemangle - LLVMSupport - LLVMTableGen - - # testing libraries - llvm_gtest - llvm_gtest_main - LLVMTestingAnnotations - LLVMTestingSupport - ) - - if multilib_is_native_abi; then - out+=( - # utilities - llvm-tblgen - FileCheck - llvm-PerfectShuffle - count - not - yaml-bench - UnicodeNameMappingGenerator - - # tools - bugpoint - dsymutil - llc - lli - lli-child-target - llvm-addr2line - llvm-ar - llvm-as - llvm-bcanalyzer - llvm-bitcode-strip - llvm-c-test - llvm-cat - llvm-cfi-verify - llvm-config - llvm-cov - llvm-cvtres - llvm-cxxdump - llvm-cxxfilt - llvm-cxxmap - llvm-debuginfo-analyzer - llvm-debuginfod-find - llvm-diff - llvm-dis - llvm-dlltool - llvm-dwarfdump - llvm-dwarfutil - llvm-dwp - llvm-exegesis - llvm-extract - llvm-gsymutil - llvm-ifs - llvm-install-name-tool - llvm-jitlink - llvm-jitlink-executor - llvm-lib - llvm-libtool-darwin - llvm-link - llvm-lipo - llvm-lto - llvm-lto2 - llvm-mc - llvm-mca - llvm-ml - llvm-modextract - llvm-mt - llvm-nm - llvm-objcopy - llvm-objdump - llvm-opt-report - llvm-otool - llvm-pdbutil - llvm-profdata - llvm-profgen - llvm-ranlib - llvm-rc - llvm-readelf - llvm-readobj - llvm-reduce - llvm-remark-size-diff - llvm-remarkutil - llvm-rtdyld - llvm-sim - llvm-size - llvm-split - llvm-stress - llvm-strings - llvm-strip - llvm-symbolizer - llvm-tapi-diff - llvm-tli-checker - llvm-undname - llvm-windres - llvm-xray - obj2yaml - opt - sancov - sanstats - split-file - verify-uselistorder - yaml2obj - - # python modules - opt-viewer - ) - - if llvm_are_manpages_built; then - out+=( - # manpages - docs-dsymutil-man - docs-llvm-dwarfdump-man - docs-llvm-man - ) - fi - use doc && out+=( - docs-llvm-html - ) - - use binutils-plugin && out+=( - LLVMgold - ) - use debuginfod && out+=( - llvm-debuginfod - ) - fi - - printf "%s${sep}" "${out[@]}" -} - -multilib_src_configure() { - local ffi_cflags ffi_ldflags - if use libffi; then - ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi) - ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi) - fi - - local libdir=$(get_libdir) - local mycmakeargs=( - # disable appending VCS revision to the version to improve - # direct cache hit ratio - -DLLVM_APPEND_VC_REV=OFF - -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}" - -DLLVM_LIBDIR_SUFFIX=${libdir#lib} - - -DBUILD_SHARED_LIBS=OFF - -DLLVM_BUILD_LLVM_DYLIB=ON - -DLLVM_LINK_LLVM_DYLIB=ON - -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components) - - # cheap hack: LLVM combines both anyway, and the only difference - # is that the former list is explicitly verified at cmake time - -DLLVM_TARGETS_TO_BUILD="" - -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}" - -DLLVM_INCLUDE_BENCHMARKS=OFF - -DLLVM_INCLUDE_TESTS=ON - -DLLVM_BUILD_TESTS=$(usex test) - -DLLVM_INSTALL_GTEST=ON - - -DLLVM_ENABLE_FFI=$(usex libffi) - -DLLVM_ENABLE_LIBEDIT=$(usex libedit) - -DLLVM_ENABLE_TERMINFO=$(usex ncurses) - -DLLVM_ENABLE_LIBXML2=$(usex xml) - -DLLVM_ENABLE_ASSERTIONS=$(usex debug) - -DLLVM_ENABLE_LIBPFM=$(usex exegesis) - -DLLVM_ENABLE_EH=ON - -DLLVM_ENABLE_RTTI=ON - -DLLVM_ENABLE_Z3_SOLVER=$(usex z3) - -DLLVM_ENABLE_ZSTD=$(usex zstd) - -DLLVM_ENABLE_CURL=$(usex debuginfod) - -DLLVM_ENABLE_HTTPLIB=$(usex debuginfod) - - -DLLVM_HOST_TRIPLE="${CHOST}" - - -DFFI_INCLUDE_DIR="${ffi_cflags#-I}" - -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}" - # used only for llvm-objdump tool - -DLLVM_HAVE_LIBXAR=$(multilib_native_usex xar 1 0) - - -DPython3_EXECUTABLE="${PYTHON}" - - # disable OCaml bindings (now in dev-ml/llvm-ocaml) - -DOCAMLFIND=NO - ) - - local suffix= - if [[ -n ${EGIT_VERSION} && ${EGIT_BRANCH} != release/* ]]; then - # the ABI of the main branch is not stable, so let's include - # the commit id in the SOVERSION to contain the breakage - suffix+="git${EGIT_VERSION::8}" - fi - if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then - # Smart hack: alter version suffix -> SOVERSION when linking - # against libc++. This way we won't end up mixing LLVM libc++ - # libraries with libstdc++ clang, and the other way around. - suffix+="+libcxx" - mycmakeargs+=( - -DLLVM_ENABLE_LIBCXX=ON - ) - fi - mycmakeargs+=( - -DLLVM_VERSION_SUFFIX="${suffix}" - ) - - use test && mycmakeargs+=( - -DLLVM_LIT_ARGS="$(get_lit_flags)" - ) - - if multilib_is_native_abi; then - local build_docs=OFF - if llvm_are_manpages_built; then - build_docs=ON - mycmakeargs+=( - -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man" - -DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html" - -DSPHINX_WARNINGS_AS_ERRORS=OFF - ) - fi - - mycmakeargs+=( - -DLLVM_BUILD_DOCS=${build_docs} - -DLLVM_ENABLE_OCAMLDOC=OFF - -DLLVM_ENABLE_SPHINX=${build_docs} - -DLLVM_ENABLE_DOXYGEN=OFF - -DLLVM_INSTALL_UTILS=ON - ) - use binutils-plugin && mycmakeargs+=( - -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include - ) - fi - - # On Macos prefix, Gentoo doesn't split sys-libs/ncurses to libtinfo and - # libncurses, but llvm tries to use libtinfo before libncurses, and ends up - # using libtinfo (actually, libncurses.dylib) from system instead of prefix - use kernel_Darwin && mycmakeargs+=( - -DTerminfo_LIBRARIES=-lncurses - ) - - # workaround BMI bug in gcc-7 (fixed in 7.4) - # https://bugs.gentoo.org/649880 - # apply only to x86, https://bugs.gentoo.org/650506 - if tc-is-gcc && [[ ${MULTILIB_ABI_FLAG} == abi_x86* ]] && - [[ $(gcc-major-version) -eq 7 && $(gcc-minor-version) -lt 4 ]] - then - local CFLAGS="${CFLAGS} -mno-bmi" - local CXXFLAGS="${CXXFLAGS} -mno-bmi" - fi - - # LLVM can have very high memory consumption while linking, - # exhausting the limit on 32-bit linker executable - use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory" - - # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 - use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" - cmake_src_configure - - grep -q -E "^CMAKE_PROJECT_VERSION_MAJOR(:.*)?=${LLVM_MAJOR}$" \ - CMakeCache.txt || - die "Incorrect version, did you update _LLVM_MAIN_MAJOR?" - multilib_is_native_abi && check_distribution_components -} - -multilib_src_compile() { - tc-env_build cmake_build distribution - - pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld - pax-mark m "${BUILD_DIR}"/bin/lli - pax-mark m "${BUILD_DIR}"/bin/lli-child-target - - if use test; then - pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests - pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests - pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests - fi -} - -multilib_src_test() { - # respect TMPDIR! - local -x LIT_PRESERVES_TMP=1 - cmake_build check -} - -src_install() { - local MULTILIB_CHOST_TOOLS=( - /usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-config - ) - - local MULTILIB_WRAPPED_HEADERS=( - /usr/include/llvm/Config/llvm-config.h - ) - - local LLVM_LDPATHS=() - multilib-minimal_src_install - - # move wrapped headers back - mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die -} - -multilib_src_install() { - DESTDIR=${D} cmake_build install-distribution - - # move headers to /usr/include for wrapping - rm -rf "${ED}"/usr/include || die - mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die - - LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)" ) -} - -multilib_src_install_all() { - local revord=$(( 9999 - ${LLVM_MAJOR} )) - newenvd - "60llvm-${revord}" <<-_EOF_ - PATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin" - # we need to duplicate it in ROOTPATH for Portage to respect... - ROOTPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin" - MANPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man" - LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )" - _EOF_ - - docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man" - llvm_install_manpages -} - -pkg_postinst() { - elog "You can find additional opt-viewer utility scripts in:" - elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/opt-viewer" - elog "To use these scripts, you will need Python along with the following" - elog "packages:" - elog " dev-python/pygments (for opt-viewer)" - elog " dev-python/pyyaml (for all of them)" -} diff --git a/sys-devel/llvm/llvm-17.0.3.9999.ebuild b/sys-devel/llvm/llvm-17.0.3.9999.ebuild index 6bda0f273990..295accea8feb 100644 --- a/sys-devel/llvm/llvm-17.0.3.9999.ebuild +++ b/sys-devel/llvm/llvm-17.0.3.9999.ebuild @@ -19,7 +19,6 @@ HOMEPAGE="https://llvm.org/" LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc" SLOT="${LLVM_MAJOR}/${LLVM_SOABI}" -KEYWORDS="" IUSE=" +binutils-plugin +debug debuginfod doc exegesis libedit +libffi ncurses test xar xml z3 zstd diff --git a/sys-devel/llvm/llvm-18.0.0.9999.ebuild b/sys-devel/llvm/llvm-18.0.0.9999.ebuild index 14a1681c7f69..ae46685bcec9 100644 --- a/sys-devel/llvm/llvm-18.0.0.9999.ebuild +++ b/sys-devel/llvm/llvm-18.0.0.9999.ebuild @@ -19,7 +19,6 @@ HOMEPAGE="https://llvm.org/" LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc" SLOT="${LLVM_MAJOR}/${LLVM_SOABI}" -KEYWORDS="" IUSE=" +binutils-plugin +debug debuginfod doc exegesis libedit +libffi ncurses test xar xml z3 zstd diff --git a/sys-devel/llvm/llvm-18.0.0_pre20230925.ebuild b/sys-devel/llvm/llvm-18.0.0_pre20230925.ebuild deleted file mode 100644 index 8f7c0ff09445..000000000000 --- a/sys-devel/llvm/llvm-18.0.0_pre20230925.ebuild +++ /dev/null @@ -1,532 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..12} ) - -inherit cmake llvm.org multilib-minimal pax-utils python-any-r1 -inherit toolchain-funcs - -DESCRIPTION="Low Level Virtual Machine" -HOMEPAGE="https://llvm.org/" - -# Additional licenses: -# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD. -# 2. xxhash: BSD. -# 3. MD5 code: public-domain. -# 4. ConvertUTF.h: TODO. - -LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc" -SLOT="${LLVM_MAJOR}/${LLVM_SOABI}" -KEYWORDS="" -IUSE=" - +binutils-plugin +debug debuginfod doc exegesis libedit +libffi - ncurses test xar xml z3 zstd -" -RESTRICT="!test? ( test )" - -RDEPEND=" - sys-libs/zlib:0=[${MULTILIB_USEDEP}] - debuginfod? ( - net-misc/curl:= - dev-cpp/cpp-httplib:= - ) - exegesis? ( dev-libs/libpfm:= ) - libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] ) - libffi? ( >=dev-libs/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] ) - ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] ) - xar? ( app-arch/xar ) - xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] ) - z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] ) - zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] ) -" -DEPEND=" - ${RDEPEND} - binutils-plugin? ( sys-libs/binutils-libs ) -" -BDEPEND=" - ${PYTHON_DEPS} - dev-lang/perl - >=dev-util/cmake-3.16 - sys-devel/gnuconfig - kernel_Darwin? ( - =sys-devel/binutils-apple-5.1 - ) - doc? ( $(python_gen_any_dep ' - dev-python/recommonmark[${PYTHON_USEDEP}] - dev-python/sphinx[${PYTHON_USEDEP}] - ') ) - libffi? ( virtual/pkgconfig ) -" -# There are no file collisions between these versions but having :0 -# installed means llvm-config there will take precedence. -RDEPEND=" - ${RDEPEND} - !sys-devel/llvm:0 -" -PDEPEND=" - sys-devel/llvm-common - sys-devel/llvm-toolchain-symlinks:${LLVM_MAJOR} - binutils-plugin? ( >=sys-devel/llvmgold-${LLVM_MAJOR} ) -" - -LLVM_COMPONENTS=( llvm cmake third-party ) -LLVM_MANPAGES=1 -LLVM_USE_TARGETS=provide -llvm.org_set_globals - -python_check_deps() { - use doc || return 0 - - python_has_version -b "dev-python/recommonmark[${PYTHON_USEDEP}]" && - python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]" -} - -check_uptodate() { - local prod_targets=( - $(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \ - | tail -n +2 | head -n -1) - ) - local all_targets=( - lib/Target/*/ - ) - all_targets=( "${all_targets[@]#lib/Target/}" ) - all_targets=( "${all_targets[@]%/}" ) - - local exp_targets=() i - for i in "${all_targets[@]}"; do - has "${i}" "${prod_targets[@]}" || exp_targets+=( "${i}" ) - done - - if [[ ${exp_targets[*]} != ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]} ]]; then - eqawarn "ALL_LLVM_EXPERIMENTAL_TARGETS is outdated!" - eqawarn " Have: ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]}" - eqawarn "Expected: ${exp_targets[*]}" - eqawarn - fi - - if [[ ${prod_targets[*]} != ${ALL_LLVM_PRODUCTION_TARGETS[*]} ]]; then - eqawarn "ALL_LLVM_PRODUCTION_TARGETS is outdated!" - eqawarn " Have: ${ALL_LLVM_PRODUCTION_TARGETS[*]}" - eqawarn "Expected: ${prod_targets[*]}" - fi -} - -check_distribution_components() { - if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then - local all_targets=() my_targets=() l - cd "${BUILD_DIR}" || die - - while read -r l; do - if [[ ${l} == install-*-stripped:* ]]; then - l=${l#install-} - l=${l%%-stripped*} - - case ${l} in - # shared libs - LLVM|LLVMgold) - ;; - # TableGen lib + deps - LLVMDemangle|LLVMSupport|LLVMTableGen) - ;; - # testing libraries - LLVMTestingAnnotations|LLVMTestingSupport) - ;; - # static libs - LLVM*) - continue - ;; - # meta-targets - distribution|llvm-libraries) - continue - ;; - # used only w/ USE=doc - docs-llvm-html) - use doc || continue - ;; - esac - - all_targets+=( "${l}" ) - fi - done < <(${NINJA} -t targets all) - - while read -r l; do - my_targets+=( "${l}" ) - done < <(get_distribution_components $"\n") - - local add=() remove=() - for l in "${all_targets[@]}"; do - if ! has "${l}" "${my_targets[@]}"; then - add+=( "${l}" ) - fi - done - for l in "${my_targets[@]}"; do - if ! has "${l}" "${all_targets[@]}"; then - remove+=( "${l}" ) - fi - done - - if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then - eqawarn "get_distribution_components() is outdated!" - eqawarn " Add: ${add[*]}" - eqawarn "Remove: ${remove[*]}" - fi - cd - >/dev/null || die - fi -} - -src_prepare() { - # disable use of SDK on OSX, bug #568758 - sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die - - # Update config.guess to support more systems - cp "${BROOT}/usr/share/gnuconfig/config.guess" cmake/ || die - - # Verify that the ebuild is up-to-date - check_uptodate - - llvm.org_src_prepare -} - -get_distribution_components() { - local sep=${1-;} - - local out=( - # shared libs - LLVM - LTO - Remarks - - # tools - llvm-config - - # common stuff - cmake-exports - llvm-headers - - # libraries needed for clang-tblgen - LLVMDemangle - LLVMSupport - LLVMTableGen - - # testing libraries - llvm_gtest - llvm_gtest_main - LLVMTestingAnnotations - LLVMTestingSupport - ) - - if multilib_is_native_abi; then - out+=( - # utilities - llvm-tblgen - FileCheck - llvm-PerfectShuffle - count - not - yaml-bench - UnicodeNameMappingGenerator - - # tools - bugpoint - dsymutil - llc - lli - lli-child-target - llvm-addr2line - llvm-ar - llvm-as - llvm-bcanalyzer - llvm-bitcode-strip - llvm-c-test - llvm-cat - llvm-cfi-verify - llvm-config - llvm-cov - llvm-cvtres - llvm-cxxdump - llvm-cxxfilt - llvm-cxxmap - llvm-debuginfo-analyzer - llvm-debuginfod-find - llvm-diff - llvm-dis - llvm-dlltool - llvm-dwarfdump - llvm-dwarfutil - llvm-dwp - llvm-exegesis - llvm-extract - llvm-gsymutil - llvm-ifs - llvm-install-name-tool - llvm-jitlink - llvm-jitlink-executor - llvm-lib - llvm-libtool-darwin - llvm-link - llvm-lipo - llvm-lto - llvm-lto2 - llvm-mc - llvm-mca - llvm-ml - llvm-modextract - llvm-mt - llvm-nm - llvm-objcopy - llvm-objdump - llvm-opt-report - llvm-otool - llvm-pdbutil - llvm-profdata - llvm-profgen - llvm-ranlib - llvm-rc - llvm-readelf - llvm-readobj - llvm-readtapi - llvm-reduce - llvm-remarkutil - llvm-rtdyld - llvm-sim - llvm-size - llvm-split - llvm-stress - llvm-strings - llvm-strip - llvm-symbolizer - llvm-tli-checker - llvm-undname - llvm-windres - llvm-xray - obj2yaml - opt - sancov - sanstats - split-file - verify-uselistorder - yaml2obj - - # python modules - opt-viewer - ) - - if llvm_are_manpages_built; then - out+=( - # manpages - docs-dsymutil-man - docs-llvm-dwarfdump-man - docs-llvm-man - ) - fi - use doc && out+=( - docs-llvm-html - ) - - use binutils-plugin && out+=( - LLVMgold - ) - use debuginfod && out+=( - llvm-debuginfod - ) - fi - - printf "%s${sep}" "${out[@]}" -} - -multilib_src_configure() { - local ffi_cflags ffi_ldflags - if use libffi; then - ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi) - ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi) - fi - - local libdir=$(get_libdir) - local mycmakeargs=( - # disable appending VCS revision to the version to improve - # direct cache hit ratio - -DLLVM_APPEND_VC_REV=OFF - -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}" - -DLLVM_LIBDIR_SUFFIX=${libdir#lib} - - -DBUILD_SHARED_LIBS=OFF - -DLLVM_BUILD_LLVM_DYLIB=ON - -DLLVM_LINK_LLVM_DYLIB=ON - -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components) - - # cheap hack: LLVM combines both anyway, and the only difference - # is that the former list is explicitly verified at cmake time - -DLLVM_TARGETS_TO_BUILD="" - -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}" - -DLLVM_INCLUDE_BENCHMARKS=OFF - -DLLVM_INCLUDE_TESTS=ON - -DLLVM_BUILD_TESTS=$(usex test) - -DLLVM_INSTALL_GTEST=ON - - -DLLVM_ENABLE_FFI=$(usex libffi) - -DLLVM_ENABLE_LIBEDIT=$(usex libedit) - -DLLVM_ENABLE_TERMINFO=$(usex ncurses) - -DLLVM_ENABLE_LIBXML2=$(usex xml) - -DLLVM_ENABLE_ASSERTIONS=$(usex debug) - -DLLVM_ENABLE_LIBPFM=$(usex exegesis) - -DLLVM_ENABLE_EH=ON - -DLLVM_ENABLE_RTTI=ON - -DLLVM_ENABLE_Z3_SOLVER=$(usex z3) - -DLLVM_ENABLE_ZSTD=$(usex zstd) - -DLLVM_ENABLE_CURL=$(usex debuginfod) - -DLLVM_ENABLE_HTTPLIB=$(usex debuginfod) - - -DLLVM_HOST_TRIPLE="${CHOST}" - - -DFFI_INCLUDE_DIR="${ffi_cflags#-I}" - -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}" - # used only for llvm-objdump tool - -DLLVM_HAVE_LIBXAR=$(multilib_native_usex xar 1 0) - - -DPython3_EXECUTABLE="${PYTHON}" - - # disable OCaml bindings (now in dev-ml/llvm-ocaml) - -DOCAMLFIND=NO - ) - - local suffix= - if [[ -n ${EGIT_VERSION} && ${EGIT_BRANCH} != release/* ]]; then - # the ABI of the main branch is not stable, so let's include - # the commit id in the SOVERSION to contain the breakage - suffix+="git${EGIT_VERSION::8}" - fi - if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then - # Smart hack: alter version suffix -> SOVERSION when linking - # against libc++. This way we won't end up mixing LLVM libc++ - # libraries with libstdc++ clang, and the other way around. - suffix+="+libcxx" - mycmakeargs+=( - -DLLVM_ENABLE_LIBCXX=ON - ) - fi - mycmakeargs+=( - -DLLVM_VERSION_SUFFIX="${suffix}" - ) - - use test && mycmakeargs+=( - -DLLVM_LIT_ARGS="$(get_lit_flags)" - ) - - if multilib_is_native_abi; then - local build_docs=OFF - if llvm_are_manpages_built; then - build_docs=ON - mycmakeargs+=( - -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man" - -DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html" - -DSPHINX_WARNINGS_AS_ERRORS=OFF - ) - fi - - mycmakeargs+=( - -DLLVM_BUILD_DOCS=${build_docs} - -DLLVM_ENABLE_OCAMLDOC=OFF - -DLLVM_ENABLE_SPHINX=${build_docs} - -DLLVM_ENABLE_DOXYGEN=OFF - -DLLVM_INSTALL_UTILS=ON - ) - use binutils-plugin && mycmakeargs+=( - -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include - ) - fi - - # workaround BMI bug in gcc-7 (fixed in 7.4) - # https://bugs.gentoo.org/649880 - # apply only to x86, https://bugs.gentoo.org/650506 - if tc-is-gcc && [[ ${MULTILIB_ABI_FLAG} == abi_x86* ]] && - [[ $(gcc-major-version) -eq 7 && $(gcc-minor-version) -lt 4 ]] - then - local CFLAGS="${CFLAGS} -mno-bmi" - local CXXFLAGS="${CXXFLAGS} -mno-bmi" - fi - - # LLVM can have very high memory consumption while linking, - # exhausting the limit on 32-bit linker executable - use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory" - - # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 - use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" - cmake_src_configure - - grep -q -E "^CMAKE_PROJECT_VERSION_MAJOR(:.*)?=${LLVM_MAJOR}$" \ - CMakeCache.txt || - die "Incorrect version, did you update _LLVM_MAIN_MAJOR?" - multilib_is_native_abi && check_distribution_components -} - -multilib_src_compile() { - tc-env_build cmake_build distribution - - pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld - pax-mark m "${BUILD_DIR}"/bin/lli - pax-mark m "${BUILD_DIR}"/bin/lli-child-target - - if use test; then - pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests - pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests - pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests - fi -} - -multilib_src_test() { - # respect TMPDIR! - local -x LIT_PRESERVES_TMP=1 - cmake_build check -} - -src_install() { - local MULTILIB_CHOST_TOOLS=( - /usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-config - ) - - local MULTILIB_WRAPPED_HEADERS=( - /usr/include/llvm/Config/llvm-config.h - ) - - local LLVM_LDPATHS=() - multilib-minimal_src_install - - # move wrapped headers back - mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die -} - -multilib_src_install() { - DESTDIR=${D} cmake_build install-distribution - - # move headers to /usr/include for wrapping - rm -rf "${ED}"/usr/include || die - mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die - - LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)" ) -} - -multilib_src_install_all() { - local revord=$(( 9999 - ${LLVM_MAJOR} )) - newenvd - "60llvm-${revord}" <<-_EOF_ - PATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin" - # we need to duplicate it in ROOTPATH for Portage to respect... - ROOTPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin" - MANPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man" - LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )" - _EOF_ - - docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man" - llvm_install_manpages -} - -pkg_postinst() { - elog "You can find additional opt-viewer utility scripts in:" - elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/opt-viewer" - elog "To use these scripts, you will need Python along with the following" - elog "packages:" - elog " dev-python/pygments (for opt-viewer)" - elog " dev-python/pyyaml (for all of them)" -} diff --git a/sys-devel/llvm/llvm-18.0.0_pre20231002.ebuild b/sys-devel/llvm/llvm-18.0.0_pre20231002.ebuild deleted file mode 100644 index 14a1681c7f69..000000000000 --- a/sys-devel/llvm/llvm-18.0.0_pre20231002.ebuild +++ /dev/null @@ -1,539 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..12} ) - -inherit cmake llvm.org multilib-minimal pax-utils python-any-r1 -inherit toolchain-funcs - -DESCRIPTION="Low Level Virtual Machine" -HOMEPAGE="https://llvm.org/" - -# Additional licenses: -# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD. -# 2. xxhash: BSD. -# 3. MD5 code: public-domain. -# 4. ConvertUTF.h: TODO. - -LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc" -SLOT="${LLVM_MAJOR}/${LLVM_SOABI}" -KEYWORDS="" -IUSE=" - +binutils-plugin +debug debuginfod doc exegesis libedit +libffi - ncurses test xar xml z3 zstd -" -RESTRICT="!test? ( test )" - -RDEPEND=" - sys-libs/zlib:0=[${MULTILIB_USEDEP}] - debuginfod? ( - net-misc/curl:= - dev-cpp/cpp-httplib:= - ) - exegesis? ( dev-libs/libpfm:= ) - libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] ) - libffi? ( >=dev-libs/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] ) - ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] ) - xar? ( app-arch/xar ) - xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] ) - z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] ) - zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] ) -" -DEPEND=" - ${RDEPEND} - binutils-plugin? ( sys-libs/binutils-libs ) -" -BDEPEND=" - ${PYTHON_DEPS} - dev-lang/perl - >=dev-util/cmake-3.16 - sys-devel/gnuconfig - kernel_Darwin? ( - =sys-devel/binutils-apple-5.1 - ) - doc? ( $(python_gen_any_dep ' - dev-python/myst-parser[${PYTHON_USEDEP}] - dev-python/sphinx[${PYTHON_USEDEP}] - ') ) - libffi? ( virtual/pkgconfig ) -" -# There are no file collisions between these versions but having :0 -# installed means llvm-config there will take precedence. -RDEPEND=" - ${RDEPEND} - !sys-devel/llvm:0 -" -PDEPEND=" - sys-devel/llvm-common - sys-devel/llvm-toolchain-symlinks:${LLVM_MAJOR} - binutils-plugin? ( >=sys-devel/llvmgold-${LLVM_MAJOR} ) -" - -LLVM_COMPONENTS=( llvm cmake third-party ) -LLVM_MANPAGES=1 -LLVM_USE_TARGETS=provide -llvm.org_set_globals - -python_check_deps() { - use doc || return 0 - - python_has_version -b "dev-python/myst-parser[${PYTHON_USEDEP}]" && - python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]" -} - -check_uptodate() { - local prod_targets=( - $(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \ - | tail -n +2 | head -n -1) - ) - local all_targets=( - lib/Target/*/ - ) - all_targets=( "${all_targets[@]#lib/Target/}" ) - all_targets=( "${all_targets[@]%/}" ) - - local exp_targets=() i - for i in "${all_targets[@]}"; do - has "${i}" "${prod_targets[@]}" || exp_targets+=( "${i}" ) - done - - if [[ ${exp_targets[*]} != ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]} ]]; then - eqawarn "ALL_LLVM_EXPERIMENTAL_TARGETS is outdated!" - eqawarn " Have: ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]}" - eqawarn "Expected: ${exp_targets[*]}" - eqawarn - fi - - if [[ ${prod_targets[*]} != ${ALL_LLVM_PRODUCTION_TARGETS[*]} ]]; then - eqawarn "ALL_LLVM_PRODUCTION_TARGETS is outdated!" - eqawarn " Have: ${ALL_LLVM_PRODUCTION_TARGETS[*]}" - eqawarn "Expected: ${prod_targets[*]}" - fi -} - -check_distribution_components() { - if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then - local all_targets=() my_targets=() l - cd "${BUILD_DIR}" || die - - while read -r l; do - if [[ ${l} == install-*-stripped:* ]]; then - l=${l#install-} - l=${l%%-stripped*} - - case ${l} in - # shared libs - LLVM|LLVMgold) - ;; - # TableGen lib + deps - LLVMDemangle|LLVMSupport|LLVMTableGen) - ;; - # testing libraries - LLVMTestingAnnotations|LLVMTestingSupport) - ;; - # static libs - LLVM*) - continue - ;; - # meta-targets - distribution|llvm-libraries) - continue - ;; - # used only w/ USE=doc - docs-llvm-html) - use doc || continue - ;; - esac - - all_targets+=( "${l}" ) - fi - done < <(${NINJA} -t targets all) - - while read -r l; do - my_targets+=( "${l}" ) - done < <(get_distribution_components $"\n") - - local add=() remove=() - for l in "${all_targets[@]}"; do - if ! has "${l}" "${my_targets[@]}"; then - add+=( "${l}" ) - fi - done - for l in "${my_targets[@]}"; do - if ! has "${l}" "${all_targets[@]}"; then - remove+=( "${l}" ) - fi - done - - if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then - eqawarn "get_distribution_components() is outdated!" - eqawarn " Add: ${add[*]}" - eqawarn "Remove: ${remove[*]}" - fi - cd - >/dev/null || die - fi -} - -src_prepare() { - # disable use of SDK on OSX, bug #568758 - sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die - - # Update config.guess to support more systems - cp "${BROOT}/usr/share/gnuconfig/config.guess" cmake/ || die - - # Verify that the ebuild is up-to-date - check_uptodate - - llvm.org_src_prepare -} - -get_distribution_components() { - local sep=${1-;} - - local out=( - # shared libs - LLVM - LTO - Remarks - - # tools - llvm-config - - # common stuff - cmake-exports - llvm-headers - - # libraries needed for clang-tblgen - LLVMDemangle - LLVMSupport - LLVMTableGen - - # testing libraries - llvm_gtest - llvm_gtest_main - LLVMTestingAnnotations - LLVMTestingSupport - ) - - if multilib_is_native_abi; then - out+=( - # utilities - llvm-tblgen - FileCheck - llvm-PerfectShuffle - count - not - yaml-bench - UnicodeNameMappingGenerator - - # tools - bugpoint - dsymutil - llc - lli - lli-child-target - llvm-addr2line - llvm-ar - llvm-as - llvm-bcanalyzer - llvm-bitcode-strip - llvm-c-test - llvm-cat - llvm-cfi-verify - llvm-config - llvm-cov - llvm-cvtres - llvm-cxxdump - llvm-cxxfilt - llvm-cxxmap - llvm-debuginfo-analyzer - llvm-debuginfod-find - llvm-diff - llvm-dis - llvm-dlltool - llvm-dwarfdump - llvm-dwarfutil - llvm-dwp - llvm-exegesis - llvm-extract - llvm-gsymutil - llvm-ifs - llvm-install-name-tool - llvm-jitlink - llvm-jitlink-executor - llvm-lib - llvm-libtool-darwin - llvm-link - llvm-lipo - llvm-lto - llvm-lto2 - llvm-mc - llvm-mca - llvm-ml - llvm-modextract - llvm-mt - llvm-nm - llvm-objcopy - llvm-objdump - llvm-opt-report - llvm-otool - llvm-pdbutil - llvm-profdata - llvm-profgen - llvm-ranlib - llvm-rc - llvm-readelf - llvm-readobj - llvm-readtapi - llvm-reduce - llvm-remarkutil - llvm-rtdyld - llvm-sim - llvm-size - llvm-split - llvm-stress - llvm-strings - llvm-strip - llvm-symbolizer - llvm-tli-checker - llvm-undname - llvm-windres - llvm-xray - obj2yaml - opt - sancov - sanstats - split-file - verify-uselistorder - yaml2obj - - # python modules - opt-viewer - ) - - if llvm_are_manpages_built; then - out+=( - # manpages - docs-dsymutil-man - docs-llvm-dwarfdump-man - docs-llvm-man - ) - fi - use doc && out+=( - docs-llvm-html - ) - - use binutils-plugin && out+=( - LLVMgold - ) - use debuginfod && out+=( - llvm-debuginfod - ) - fi - - printf "%s${sep}" "${out[@]}" -} - -multilib_src_configure() { - local ffi_cflags ffi_ldflags - if use libffi; then - ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi) - ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi) - fi - - local libdir=$(get_libdir) - local mycmakeargs=( - # disable appending VCS revision to the version to improve - # direct cache hit ratio - -DLLVM_APPEND_VC_REV=OFF - -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}" - -DLLVM_LIBDIR_SUFFIX=${libdir#lib} - - -DBUILD_SHARED_LIBS=OFF - -DLLVM_BUILD_LLVM_DYLIB=ON - -DLLVM_LINK_LLVM_DYLIB=ON - -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components) - - # cheap hack: LLVM combines both anyway, and the only difference - # is that the former list is explicitly verified at cmake time - -DLLVM_TARGETS_TO_BUILD="" - -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}" - -DLLVM_INCLUDE_BENCHMARKS=OFF - -DLLVM_INCLUDE_TESTS=ON - -DLLVM_BUILD_TESTS=$(usex test) - -DLLVM_INSTALL_GTEST=ON - - -DLLVM_ENABLE_FFI=$(usex libffi) - -DLLVM_ENABLE_LIBEDIT=$(usex libedit) - -DLLVM_ENABLE_TERMINFO=$(usex ncurses) - -DLLVM_ENABLE_LIBXML2=$(usex xml) - -DLLVM_ENABLE_ASSERTIONS=$(usex debug) - -DLLVM_ENABLE_LIBPFM=$(usex exegesis) - -DLLVM_ENABLE_EH=ON - -DLLVM_ENABLE_RTTI=ON - -DLLVM_ENABLE_Z3_SOLVER=$(usex z3) - -DLLVM_ENABLE_ZSTD=$(usex zstd) - -DLLVM_ENABLE_CURL=$(usex debuginfod) - -DLLVM_ENABLE_HTTPLIB=$(usex debuginfod) - - -DLLVM_HOST_TRIPLE="${CHOST}" - - -DFFI_INCLUDE_DIR="${ffi_cflags#-I}" - -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}" - # used only for llvm-objdump tool - -DLLVM_HAVE_LIBXAR=$(multilib_native_usex xar 1 0) - - -DPython3_EXECUTABLE="${PYTHON}" - - # disable OCaml bindings (now in dev-ml/llvm-ocaml) - -DOCAMLFIND=NO - ) - - local suffix= - if [[ -n ${EGIT_VERSION} && ${EGIT_BRANCH} != release/* ]]; then - # the ABI of the main branch is not stable, so let's include - # the commit id in the SOVERSION to contain the breakage - suffix+="git${EGIT_VERSION::8}" - fi - if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then - # Smart hack: alter version suffix -> SOVERSION when linking - # against libc++. This way we won't end up mixing LLVM libc++ - # libraries with libstdc++ clang, and the other way around. - suffix+="+libcxx" - mycmakeargs+=( - -DLLVM_ENABLE_LIBCXX=ON - ) - fi - mycmakeargs+=( - -DLLVM_VERSION_SUFFIX="${suffix}" - ) - - use test && mycmakeargs+=( - -DLLVM_LIT_ARGS="$(get_lit_flags)" - ) - - if multilib_is_native_abi; then - local build_docs=OFF - if llvm_are_manpages_built; then - build_docs=ON - mycmakeargs+=( - -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man" - -DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html" - -DSPHINX_WARNINGS_AS_ERRORS=OFF - ) - fi - - mycmakeargs+=( - -DLLVM_BUILD_DOCS=${build_docs} - -DLLVM_ENABLE_OCAMLDOC=OFF - -DLLVM_ENABLE_SPHINX=${build_docs} - -DLLVM_ENABLE_DOXYGEN=OFF - -DLLVM_INSTALL_UTILS=ON - ) - use binutils-plugin && mycmakeargs+=( - -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include - ) - fi - - # On Macos prefix, Gentoo doesn't split sys-libs/ncurses to libtinfo and - # libncurses, but llvm tries to use libtinfo before libncurses, and ends up - # using libtinfo (actually, libncurses.dylib) from system instead of prefix - use kernel_Darwin && mycmakeargs+=( - -DTerminfo_LIBRARIES=-lncurses - ) - - # workaround BMI bug in gcc-7 (fixed in 7.4) - # https://bugs.gentoo.org/649880 - # apply only to x86, https://bugs.gentoo.org/650506 - if tc-is-gcc && [[ ${MULTILIB_ABI_FLAG} == abi_x86* ]] && - [[ $(gcc-major-version) -eq 7 && $(gcc-minor-version) -lt 4 ]] - then - local CFLAGS="${CFLAGS} -mno-bmi" - local CXXFLAGS="${CXXFLAGS} -mno-bmi" - fi - - # LLVM can have very high memory consumption while linking, - # exhausting the limit on 32-bit linker executable - use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory" - - # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 - use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" - cmake_src_configure - - grep -q -E "^CMAKE_PROJECT_VERSION_MAJOR(:.*)?=${LLVM_MAJOR}$" \ - CMakeCache.txt || - die "Incorrect version, did you update _LLVM_MAIN_MAJOR?" - multilib_is_native_abi && check_distribution_components -} - -multilib_src_compile() { - tc-env_build cmake_build distribution - - pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld - pax-mark m "${BUILD_DIR}"/bin/lli - pax-mark m "${BUILD_DIR}"/bin/lli-child-target - - if use test; then - pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests - pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests - pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests - fi -} - -multilib_src_test() { - # respect TMPDIR! - local -x LIT_PRESERVES_TMP=1 - cmake_build check -} - -src_install() { - local MULTILIB_CHOST_TOOLS=( - /usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-config - ) - - local MULTILIB_WRAPPED_HEADERS=( - /usr/include/llvm/Config/llvm-config.h - ) - - local LLVM_LDPATHS=() - multilib-minimal_src_install - - # move wrapped headers back - mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die -} - -multilib_src_install() { - DESTDIR=${D} cmake_build install-distribution - - # move headers to /usr/include for wrapping - rm -rf "${ED}"/usr/include || die - mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die - - LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)" ) -} - -multilib_src_install_all() { - local revord=$(( 9999 - ${LLVM_MAJOR} )) - newenvd - "60llvm-${revord}" <<-_EOF_ - PATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin" - # we need to duplicate it in ROOTPATH for Portage to respect... - ROOTPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin" - MANPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man" - LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )" - _EOF_ - - docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man" - llvm_install_manpages -} - -pkg_postinst() { - elog "You can find additional opt-viewer utility scripts in:" - elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/opt-viewer" - elog "To use these scripts, you will need Python along with the following" - elog "packages:" - elog " dev-python/pygments (for opt-viewer)" - elog " dev-python/pyyaml (for all of them)" -} diff --git a/sys-devel/llvm/llvm-18.0.0_pre20231013.ebuild b/sys-devel/llvm/llvm-18.0.0_pre20231013.ebuild index 14a1681c7f69..ae46685bcec9 100644 --- a/sys-devel/llvm/llvm-18.0.0_pre20231013.ebuild +++ b/sys-devel/llvm/llvm-18.0.0_pre20231013.ebuild @@ -19,7 +19,6 @@ HOMEPAGE="https://llvm.org/" LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc" SLOT="${LLVM_MAJOR}/${LLVM_SOABI}" -KEYWORDS="" IUSE=" +binutils-plugin +debug debuginfod doc exegesis libedit +libffi ncurses test xar xml z3 zstd diff --git a/sys-devel/llvm/llvm-18.0.0_pre20231019.ebuild b/sys-devel/llvm/llvm-18.0.0_pre20231019.ebuild new file mode 100644 index 000000000000..ae46685bcec9 --- /dev/null +++ b/sys-devel/llvm/llvm-18.0.0_pre20231019.ebuild @@ -0,0 +1,538 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) + +inherit cmake llvm.org multilib-minimal pax-utils python-any-r1 +inherit toolchain-funcs + +DESCRIPTION="Low Level Virtual Machine" +HOMEPAGE="https://llvm.org/" + +# Additional licenses: +# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD. +# 2. xxhash: BSD. +# 3. MD5 code: public-domain. +# 4. ConvertUTF.h: TODO. + +LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc" +SLOT="${LLVM_MAJOR}/${LLVM_SOABI}" +IUSE=" + +binutils-plugin +debug debuginfod doc exegesis libedit +libffi + ncurses test xar xml z3 zstd +" +RESTRICT="!test? ( test )" + +RDEPEND=" + sys-libs/zlib:0=[${MULTILIB_USEDEP}] + debuginfod? ( + net-misc/curl:= + dev-cpp/cpp-httplib:= + ) + exegesis? ( dev-libs/libpfm:= ) + libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] ) + libffi? ( >=dev-libs/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] ) + ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] ) + xar? ( app-arch/xar ) + xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] ) + z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] ) + zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] ) +" +DEPEND=" + ${RDEPEND} + binutils-plugin? ( sys-libs/binutils-libs ) +" +BDEPEND=" + ${PYTHON_DEPS} + dev-lang/perl + >=dev-util/cmake-3.16 + sys-devel/gnuconfig + kernel_Darwin? ( + =sys-devel/binutils-apple-5.1 + ) + doc? ( $(python_gen_any_dep ' + dev-python/myst-parser[${PYTHON_USEDEP}] + dev-python/sphinx[${PYTHON_USEDEP}] + ') ) + libffi? ( virtual/pkgconfig ) +" +# There are no file collisions between these versions but having :0 +# installed means llvm-config there will take precedence. +RDEPEND=" + ${RDEPEND} + !sys-devel/llvm:0 +" +PDEPEND=" + sys-devel/llvm-common + sys-devel/llvm-toolchain-symlinks:${LLVM_MAJOR} + binutils-plugin? ( >=sys-devel/llvmgold-${LLVM_MAJOR} ) +" + +LLVM_COMPONENTS=( llvm cmake third-party ) +LLVM_MANPAGES=1 +LLVM_USE_TARGETS=provide +llvm.org_set_globals + +python_check_deps() { + use doc || return 0 + + python_has_version -b "dev-python/myst-parser[${PYTHON_USEDEP}]" && + python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]" +} + +check_uptodate() { + local prod_targets=( + $(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \ + | tail -n +2 | head -n -1) + ) + local all_targets=( + lib/Target/*/ + ) + all_targets=( "${all_targets[@]#lib/Target/}" ) + all_targets=( "${all_targets[@]%/}" ) + + local exp_targets=() i + for i in "${all_targets[@]}"; do + has "${i}" "${prod_targets[@]}" || exp_targets+=( "${i}" ) + done + + if [[ ${exp_targets[*]} != ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]} ]]; then + eqawarn "ALL_LLVM_EXPERIMENTAL_TARGETS is outdated!" + eqawarn " Have: ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]}" + eqawarn "Expected: ${exp_targets[*]}" + eqawarn + fi + + if [[ ${prod_targets[*]} != ${ALL_LLVM_PRODUCTION_TARGETS[*]} ]]; then + eqawarn "ALL_LLVM_PRODUCTION_TARGETS is outdated!" + eqawarn " Have: ${ALL_LLVM_PRODUCTION_TARGETS[*]}" + eqawarn "Expected: ${prod_targets[*]}" + fi +} + +check_distribution_components() { + if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then + local all_targets=() my_targets=() l + cd "${BUILD_DIR}" || die + + while read -r l; do + if [[ ${l} == install-*-stripped:* ]]; then + l=${l#install-} + l=${l%%-stripped*} + + case ${l} in + # shared libs + LLVM|LLVMgold) + ;; + # TableGen lib + deps + LLVMDemangle|LLVMSupport|LLVMTableGen) + ;; + # testing libraries + LLVMTestingAnnotations|LLVMTestingSupport) + ;; + # static libs + LLVM*) + continue + ;; + # meta-targets + distribution|llvm-libraries) + continue + ;; + # used only w/ USE=doc + docs-llvm-html) + use doc || continue + ;; + esac + + all_targets+=( "${l}" ) + fi + done < <(${NINJA} -t targets all) + + while read -r l; do + my_targets+=( "${l}" ) + done < <(get_distribution_components $"\n") + + local add=() remove=() + for l in "${all_targets[@]}"; do + if ! has "${l}" "${my_targets[@]}"; then + add+=( "${l}" ) + fi + done + for l in "${my_targets[@]}"; do + if ! has "${l}" "${all_targets[@]}"; then + remove+=( "${l}" ) + fi + done + + if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then + eqawarn "get_distribution_components() is outdated!" + eqawarn " Add: ${add[*]}" + eqawarn "Remove: ${remove[*]}" + fi + cd - >/dev/null || die + fi +} + +src_prepare() { + # disable use of SDK on OSX, bug #568758 + sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die + + # Update config.guess to support more systems + cp "${BROOT}/usr/share/gnuconfig/config.guess" cmake/ || die + + # Verify that the ebuild is up-to-date + check_uptodate + + llvm.org_src_prepare +} + +get_distribution_components() { + local sep=${1-;} + + local out=( + # shared libs + LLVM + LTO + Remarks + + # tools + llvm-config + + # common stuff + cmake-exports + llvm-headers + + # libraries needed for clang-tblgen + LLVMDemangle + LLVMSupport + LLVMTableGen + + # testing libraries + llvm_gtest + llvm_gtest_main + LLVMTestingAnnotations + LLVMTestingSupport + ) + + if multilib_is_native_abi; then + out+=( + # utilities + llvm-tblgen + FileCheck + llvm-PerfectShuffle + count + not + yaml-bench + UnicodeNameMappingGenerator + + # tools + bugpoint + dsymutil + llc + lli + lli-child-target + llvm-addr2line + llvm-ar + llvm-as + llvm-bcanalyzer + llvm-bitcode-strip + llvm-c-test + llvm-cat + llvm-cfi-verify + llvm-config + llvm-cov + llvm-cvtres + llvm-cxxdump + llvm-cxxfilt + llvm-cxxmap + llvm-debuginfo-analyzer + llvm-debuginfod-find + llvm-diff + llvm-dis + llvm-dlltool + llvm-dwarfdump + llvm-dwarfutil + llvm-dwp + llvm-exegesis + llvm-extract + llvm-gsymutil + llvm-ifs + llvm-install-name-tool + llvm-jitlink + llvm-jitlink-executor + llvm-lib + llvm-libtool-darwin + llvm-link + llvm-lipo + llvm-lto + llvm-lto2 + llvm-mc + llvm-mca + llvm-ml + llvm-modextract + llvm-mt + llvm-nm + llvm-objcopy + llvm-objdump + llvm-opt-report + llvm-otool + llvm-pdbutil + llvm-profdata + llvm-profgen + llvm-ranlib + llvm-rc + llvm-readelf + llvm-readobj + llvm-readtapi + llvm-reduce + llvm-remarkutil + llvm-rtdyld + llvm-sim + llvm-size + llvm-split + llvm-stress + llvm-strings + llvm-strip + llvm-symbolizer + llvm-tli-checker + llvm-undname + llvm-windres + llvm-xray + obj2yaml + opt + sancov + sanstats + split-file + verify-uselistorder + yaml2obj + + # python modules + opt-viewer + ) + + if llvm_are_manpages_built; then + out+=( + # manpages + docs-dsymutil-man + docs-llvm-dwarfdump-man + docs-llvm-man + ) + fi + use doc && out+=( + docs-llvm-html + ) + + use binutils-plugin && out+=( + LLVMgold + ) + use debuginfod && out+=( + llvm-debuginfod + ) + fi + + printf "%s${sep}" "${out[@]}" +} + +multilib_src_configure() { + local ffi_cflags ffi_ldflags + if use libffi; then + ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi) + ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi) + fi + + local libdir=$(get_libdir) + local mycmakeargs=( + # disable appending VCS revision to the version to improve + # direct cache hit ratio + -DLLVM_APPEND_VC_REV=OFF + -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}" + -DLLVM_LIBDIR_SUFFIX=${libdir#lib} + + -DBUILD_SHARED_LIBS=OFF + -DLLVM_BUILD_LLVM_DYLIB=ON + -DLLVM_LINK_LLVM_DYLIB=ON + -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components) + + # cheap hack: LLVM combines both anyway, and the only difference + # is that the former list is explicitly verified at cmake time + -DLLVM_TARGETS_TO_BUILD="" + -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}" + -DLLVM_INCLUDE_BENCHMARKS=OFF + -DLLVM_INCLUDE_TESTS=ON + -DLLVM_BUILD_TESTS=$(usex test) + -DLLVM_INSTALL_GTEST=ON + + -DLLVM_ENABLE_FFI=$(usex libffi) + -DLLVM_ENABLE_LIBEDIT=$(usex libedit) + -DLLVM_ENABLE_TERMINFO=$(usex ncurses) + -DLLVM_ENABLE_LIBXML2=$(usex xml) + -DLLVM_ENABLE_ASSERTIONS=$(usex debug) + -DLLVM_ENABLE_LIBPFM=$(usex exegesis) + -DLLVM_ENABLE_EH=ON + -DLLVM_ENABLE_RTTI=ON + -DLLVM_ENABLE_Z3_SOLVER=$(usex z3) + -DLLVM_ENABLE_ZSTD=$(usex zstd) + -DLLVM_ENABLE_CURL=$(usex debuginfod) + -DLLVM_ENABLE_HTTPLIB=$(usex debuginfod) + + -DLLVM_HOST_TRIPLE="${CHOST}" + + -DFFI_INCLUDE_DIR="${ffi_cflags#-I}" + -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}" + # used only for llvm-objdump tool + -DLLVM_HAVE_LIBXAR=$(multilib_native_usex xar 1 0) + + -DPython3_EXECUTABLE="${PYTHON}" + + # disable OCaml bindings (now in dev-ml/llvm-ocaml) + -DOCAMLFIND=NO + ) + + local suffix= + if [[ -n ${EGIT_VERSION} && ${EGIT_BRANCH} != release/* ]]; then + # the ABI of the main branch is not stable, so let's include + # the commit id in the SOVERSION to contain the breakage + suffix+="git${EGIT_VERSION::8}" + fi + if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then + # Smart hack: alter version suffix -> SOVERSION when linking + # against libc++. This way we won't end up mixing LLVM libc++ + # libraries with libstdc++ clang, and the other way around. + suffix+="+libcxx" + mycmakeargs+=( + -DLLVM_ENABLE_LIBCXX=ON + ) + fi + mycmakeargs+=( + -DLLVM_VERSION_SUFFIX="${suffix}" + ) + + use test && mycmakeargs+=( + -DLLVM_LIT_ARGS="$(get_lit_flags)" + ) + + if multilib_is_native_abi; then + local build_docs=OFF + if llvm_are_manpages_built; then + build_docs=ON + mycmakeargs+=( + -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man" + -DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html" + -DSPHINX_WARNINGS_AS_ERRORS=OFF + ) + fi + + mycmakeargs+=( + -DLLVM_BUILD_DOCS=${build_docs} + -DLLVM_ENABLE_OCAMLDOC=OFF + -DLLVM_ENABLE_SPHINX=${build_docs} + -DLLVM_ENABLE_DOXYGEN=OFF + -DLLVM_INSTALL_UTILS=ON + ) + use binutils-plugin && mycmakeargs+=( + -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include + ) + fi + + # On Macos prefix, Gentoo doesn't split sys-libs/ncurses to libtinfo and + # libncurses, but llvm tries to use libtinfo before libncurses, and ends up + # using libtinfo (actually, libncurses.dylib) from system instead of prefix + use kernel_Darwin && mycmakeargs+=( + -DTerminfo_LIBRARIES=-lncurses + ) + + # workaround BMI bug in gcc-7 (fixed in 7.4) + # https://bugs.gentoo.org/649880 + # apply only to x86, https://bugs.gentoo.org/650506 + if tc-is-gcc && [[ ${MULTILIB_ABI_FLAG} == abi_x86* ]] && + [[ $(gcc-major-version) -eq 7 && $(gcc-minor-version) -lt 4 ]] + then + local CFLAGS="${CFLAGS} -mno-bmi" + local CXXFLAGS="${CXXFLAGS} -mno-bmi" + fi + + # LLVM can have very high memory consumption while linking, + # exhausting the limit on 32-bit linker executable + use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory" + + # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 + use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" + cmake_src_configure + + grep -q -E "^CMAKE_PROJECT_VERSION_MAJOR(:.*)?=${LLVM_MAJOR}$" \ + CMakeCache.txt || + die "Incorrect version, did you update _LLVM_MAIN_MAJOR?" + multilib_is_native_abi && check_distribution_components +} + +multilib_src_compile() { + tc-env_build cmake_build distribution + + pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld + pax-mark m "${BUILD_DIR}"/bin/lli + pax-mark m "${BUILD_DIR}"/bin/lli-child-target + + if use test; then + pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests + pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests + pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests + fi +} + +multilib_src_test() { + # respect TMPDIR! + local -x LIT_PRESERVES_TMP=1 + cmake_build check +} + +src_install() { + local MULTILIB_CHOST_TOOLS=( + /usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-config + ) + + local MULTILIB_WRAPPED_HEADERS=( + /usr/include/llvm/Config/llvm-config.h + ) + + local LLVM_LDPATHS=() + multilib-minimal_src_install + + # move wrapped headers back + mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die +} + +multilib_src_install() { + DESTDIR=${D} cmake_build install-distribution + + # move headers to /usr/include for wrapping + rm -rf "${ED}"/usr/include || die + mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die + + LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)" ) +} + +multilib_src_install_all() { + local revord=$(( 9999 - ${LLVM_MAJOR} )) + newenvd - "60llvm-${revord}" <<-_EOF_ + PATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin" + # we need to duplicate it in ROOTPATH for Portage to respect... + ROOTPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin" + MANPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man" + LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )" + _EOF_ + + docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man" + llvm_install_manpages +} + +pkg_postinst() { + elog "You can find additional opt-viewer utility scripts in:" + elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/opt-viewer" + elog "To use these scripts, you will need Python along with the following" + elog "packages:" + elog " dev-python/pygments (for opt-viewer)" + elog " dev-python/pyyaml (for all of them)" +} -- cgit v1.2.3