summaryrefslogtreecommitdiff
path: root/dev-util/hip
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-01-31 15:02:11 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-01-31 15:02:11 +0000
commite860dfa5acdb67f8e2b8938b005dbaaaaf2c984a (patch)
tree38fd83ad8fb940fa7c8b31bc24cda66c9346ca80 /dev-util/hip
parente9bf3526a3a5e02396f24203bf8535a21b6f9784 (diff)
gentoo auto-resync : 31:01:2023 - 15:02:11
Diffstat (limited to 'dev-util/hip')
-rw-r--r--dev-util/hip/Manifest15
-rw-r--r--dev-util/hip/files/0001-SWDEV-344620-hipcc-fails-to-parse-version-of-clang-i.patch70
-rw-r--r--dev-util/hip/files/0001-SWDEV-352878-LLVM-pkg-search-directly-using-find_dep.patch163
-rw-r--r--dev-util/hip/files/0002-SWDEV-355608-Remove-clang-include-path-2996.patch51
-rw-r--r--dev-util/hip/files/0003-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch173
-rw-r--r--dev-util/hip/files/hip-5.3.3-disable-Werror.patch16
-rw-r--r--dev-util/hip/files/hip-5.3.3-remove-cmake-doxygen-commands.patch21
-rw-r--r--dev-util/hip/files/hipvars-5.3.3.pm20
-rw-r--r--dev-util/hip/hip-5.1.3-r4.ebuild (renamed from dev-util/hip/hip-5.1.3-r3.ebuild)10
-rw-r--r--dev-util/hip/hip-5.3.3-r2.ebuild (renamed from dev-util/hip/hip-5.3.3-r1.ebuild)69
-rw-r--r--dev-util/hip/metadata.xml4
11 files changed, 557 insertions, 55 deletions
diff --git a/dev-util/hip/Manifest b/dev-util/hip/Manifest
index 3e525c5f8a19..bcf5b441cec1 100644
--- a/dev-util/hip/Manifest
+++ b/dev-util/hip/Manifest
@@ -1,4 +1,8 @@
AUX 0001-SWDEV-316128-HIP-surface-API-support.patch 1156 BLAKE2B 52ff9a2389533ac213055ff8c1d4359cbd490f64699233a6c97dbb54ea8216d94039b016b9dcdde7a304662b9ca5c444ac889a6491e847b0a701e0b0cc0e4b59 SHA512 0c210ac60929a951ce1210b1f76e2e6966cc411834a350e6d01d1eb20cb862056cec881a00978cdbe5bfc61e53128c1cd09c6138cca9469213a6bbf425b8686d
+AUX 0001-SWDEV-344620-hipcc-fails-to-parse-version-of-clang-i.patch 2734 BLAKE2B 5580ae24e854a42837979a1f6e688eb7edcfeee554577f41611941aa69d5a0bf3f1eb1916c4c7b2ba0389fc16efc31b229a9b21dbec3bfcf0cccad20241191a7 SHA512 156f650559fdeb625c15a8b94320f0b422b04b883f84a5e74ef03293420292be25c118df67bba1ae11fca6a1ac7429b0254aa32b963f7e09a7d8d923589009fd
+AUX 0001-SWDEV-352878-LLVM-pkg-search-directly-using-find_dep.patch 7304 BLAKE2B 3fca9d44f706250438f1c3f5d44142e1fa3040336eb9ab8b9e7fc54b9473e11957962a9a93cdb3b6980228fffe1a3fd5dab3f8c972340a83723858c12790c1f8 SHA512 7e54d22b0a0924c79d0b31764586891401d1a39f37380d3809e23a60075baacc55468930c30fa5a8ce64083b274701dbc190f67244822191873ae4f831a7fc33
+AUX 0002-SWDEV-355608-Remove-clang-include-path-2996.patch 1866 BLAKE2B 89e377104b0bc383f69c10f894ff28cb8282eeaf042fcb27b03a64b78959c147ef6cd4291aef47a25b616ea2b801363d7a382df4d924ba94fcea7e9ffa1b26f6 SHA512 7f73d7a66adc959ef4dd0dc3540b6db472a3650926f315f4c79761a45e619432107898dc58cb15958be4b36823029ccf91e599760a23fd886429789de586db3b
+AUX 0003-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch 8063 BLAKE2B c0b7b83682c13bb21e6a152b8c4c2b003024fd2dfc4f5f59e8b91b3d933bbfa888549c1a4471a29a225400f3d900d47023c3394111d41a3ecf52a48647db1694 SHA512 972a249daf692ce847884821a1205608d9ee2941793c474cb36f435eff2ad52dc7cb4f1a3a48a4037df3d62a6e47db84c86014933c94b4bb9bf7b7b12f31cce1
AUX hip-4.2.0-cancel-hcc-header-removal.patch 820 BLAKE2B 544f93864fafe38a0ac2456f6301f8076ea24061bd4fe9a5501a366cca6d46edbb50eaac6c71acb3534579cdd9fa5518a687ac7e6d265926db53f0820fdec0f2 SHA512 3e37b761148cc31f78d6beb6bdff4b472fe4171a496b8f76ecbe82900f1483df690f846e0473ae700127482bcc3787af16bcd6217506e1e9dd1ad019408725a5
AUX hip-4.2.0-config-cmake-in.patch 588 BLAKE2B 98081d4caa593756c966b8eff9e3a306ba4d9799abaaccb9bdab40db3e32dd769b07b3c428a22787231e8819e62cd50a33f549f2d1de32f9528036f1abf400cb SHA512 803aae515ee8e2694e5ba1cf6b5d66c98a9e0abf422479c7f599e8bfa38b027062a40e3e9806fa0057fa89a00d019c93d22f1c1ad78f68f1ac3f9bea5ebd93be
AUX hip-5.0.1-DisableTest.patch 1689 BLAKE2B dd25393370a594abd3cb6fe8abab6481c2c544edb3f84c7b6481501fd5c2cd33970245cb38d148c5218915a67a8c1d24fde14a5a5c47ed809c613ec78b6d25c7 SHA512 6932af7662b067766b6566f858dba9606818757070b642778d559b83052097ee2ecedb1ae0184ab000c7b068b5413201bb5521e0aa3bf090df369139f292306e
@@ -12,12 +16,14 @@ AUX hip-5.1.3-fno-stack-protector.patch 788 BLAKE2B 8f9d01ceeec2098df4d49e116c14
AUX hip-5.1.3-llvm-15-noinline-keyword.patch 829 BLAKE2B 39b859e90acacd2eccdd60b690e1d882b63cfa66ff1b12effe447b18de72ffd61dd32983552f9ae39b384c3bbfbbcfd59ff2bb47943c1340bf6c1df5cb7d4075 SHA512 1933e883f84451e8512669572ea03dd25c916c6baeafac27b07e3d4a5e89165952a64afaceade4546e7e2d4473aba9811ac21131f283f9680d35e777ad9659a7
AUX hip-5.1.3-remove-cmake-doxygen-commands.patch 896 BLAKE2B 35640516bf416760db69b736d72c1e78efdbad8a930d621fdaffd13c5c250f5d80a6975c1e4c368389ce8059aee964c36645f420d0844141d09463637ba0bccb SHA512 b1288e1f4b7553c5bf0fe38a46fbdf269ca5c01fd8e0e225b9454d4916092601d565c57eaf9f716e06fee816e41cb3a948884060551b5a9d71da9b1a050765f9
AUX hip-5.1.3-rocm-path.patch 564 BLAKE2B ad554063a11d58ce5acfa8c8980bac2668d199b059bc2555d4cea40fbc53b6334daaea448d99cc391cee246d8318a450efdef669db2ee164a4db3a55d7d8e193 SHA512 eaa03f4d2394f61dcedde376de6c398625d284a7ac0c94ff2484929efdf298f455c796b96f16bf3989de6593a9a026a7681620b5ca13ce403aba4a32e5a38226
+AUX hip-5.3.3-disable-Werror.patch 621 BLAKE2B 9bcdec821484ac20343e1352e3c3d5a9297f8e7ab81ed135c5b27f11dd0667c68939fe04157ae8b7dacc5cdcbb6631e0a1b66d6cc2cd796f6322b6ded75055c7 SHA512 799c40b5a2524e166aa674c432c7bfb93c03fe00832680a99cd701b2498cd33c52e5582f9754161173f17048b6ae346a7a5b6d59eddce8696670b1f229858fef
+AUX hip-5.3.3-remove-cmake-doxygen-commands.patch 976 BLAKE2B edff02ed7b2371739f1659a93ecad9485045091ec48c6aa018d8fde3a9f4a9a48bdcf0cca660e03b4f3ff0e6c4f019068019407f429913f8c3231cdb252b0464 SHA512 f6835f74fb34cd4a9ea0db693eff6e57c742f6912b29046f7b01b87037c014cdeb38f17dd0a6b90dd823656e2957b2d0bc981eb0c71221994ae455cefc03805b
AUX hipvars-5.0.2.pm 590 BLAKE2B b67de8f86bc53d9fbcd50a9cfa9759feb0145f3b3e40360cc322676411e038ff21b8f81265ba27d099e51c3dc55230f87c477cbadfba2b48c08978216f2fbd81 SHA512 0becd625e6f34d687338e25ca4697e68a735a1df60a4c2c53f577e7999a34bc07041f513632f9534aa4b35da2cf50b02c96187f69fd183bff893343257aa85b9
AUX hipvars-5.1.3.pm 629 BLAKE2B 6149f230aa0756603ac0b455d802db9c698be8e4a22367e98915db974ea16176f85f9b5a22e2572183641734cedbbe2ba2c826aa0223ea3e12c5550983db0480 SHA512 26ba459b13df1ad6dc50411ac6589dd3d17eff727fee0e938275912e36459c7a43b35233a7f78bbed282a992e969d8b8f95007964c810a5954b0abeccc67082d
+AUX hipvars-5.3.3.pm 581 BLAKE2B edf0c1df5f7f5c57189c76fbcedec8155072a9f8e2c580d637dcfb557a844e7cc276b754d0fd8f5a9f59d2c5bbcfda6c9ac9951ad16d8a12bb48e74f062987ab SHA512 9fd72b000f59ec25a74ef5965f4affc5e866025424211b4d81fbea979ffba9f08319dde0063c8c835507a1b9db990f8f25eea3a8e2e6d88faceaf34d5dd722cb
AUX hipvars.pm 598 BLAKE2B 1645b12179195b95757d207248c85b7c8d9eda0347caee5cb48bdc66e85fda517f607bcb69cdfc63657a0db04ad8e96494a0a80268df7c17d6bb0e689325c2e8 SHA512 6c4e71455341673a329b4b0163fefd7f2f4b7d62da3496643d0de096755899c99b3b5a80fffbdf29896c234cb4f617b368217f4eecfd005849b294ff434b79c6
DIST 5.0.2-update-header.patch.gz 5136 BLAKE2B 290b9e250e3004a1147ad28606d7d205078affbd809c6a429744767ebabf35bd8df6395dc135984d345ae2f23fa457dcb2524bcbf31c5bf16903d3ee2007bf5d SHA512 41b1025c403e874026a712ec6f6571c873203b08ddadf68848f6d1f63924c21b206677b330f79edad2c4b85e2ba5053b1d33f70c7c09ff9c17bc5905b849da0c
DIST hip-5.1.3-update-header.patch.gz 3406 BLAKE2B 805539c3396a9cdcc4b807afd96eacd2de0e494a9ec927a1526cb8ce26b1c6e0a4d06415cd0210cba1398b5ff70f995fa67ad22b659578c075eb24c2a2cc9228 SHA512 eef4d70f9470a61d1d8cb140728cc4f2e792a4e64e0900a7410a74f3a6421410e7546e4e62bbbf35ae231b566bf162fb85de1f1ad1d8cfb2f282d2ed9a34b53a
-DIST hip-5.3.3-update-header.patch.gz 3406 BLAKE2B 805539c3396a9cdcc4b807afd96eacd2de0e494a9ec927a1526cb8ce26b1c6e0a4d06415cd0210cba1398b5ff70f995fa67ad22b659578c075eb24c2a2cc9228 SHA512 eef4d70f9470a61d1d8cb140728cc4f2e792a4e64e0900a7410a74f3a6421410e7546e4e62bbbf35ae231b566bf162fb85de1f1ad1d8cfb2f282d2ed9a34b53a
DIST rocclr-5.0.2.tar.gz 853965 BLAKE2B a0d568eb3b230845970d8256a5a2f32018e4b9fb68e0f1aa13a1f3fc953e614025315b90cbe68c107f7150cf91b4b1ea438455429062c7dc06ef77d65dedd2ec SHA512 b30a57c09973d8ef624511f422babaf9722685b9f85643783aebc000671b41fd54f44b308cece0baab187e1ee00b10335c6d22b6bad6fb3468abe6ef0da97d73
DIST rocclr-5.1.3.tar.gz 618606 BLAKE2B 02b7732ddd03c0883bee49c56466cd21c649159f801bfb2537eea6e640c65613eb57b37d942f465a9deb83d65735f51212dde5e4f77ba8239d1a6b7037e1800c SHA512 89fd2eca39ed84a1cf525b2c606089ef39f64c1f997c4880e10722da6de4864110752640e1508db1aeb9d15c48ba4e6fe5dbe7a9e56718853ece42548028b2ca
DIST rocclr-5.3.3.tar.gz 625944 BLAKE2B 0cdbc1415a355e1d56628834846aaa8587c9827eeea59f4312b788e868265dcb42197181fd5ef411416da2e11662c7f665f578aa750ab88c3a5405bcc58ee449 SHA512 3f85532cffc09c2ca8e7cd1770263d1c1a38633ed2bc5cfe62072e12a6f8f669db400519950718be31f6b77693d372e2ef905f06c7f02e126aa9ff7d2da97924
@@ -32,8 +38,7 @@ DIST rocm-opencl-runtime-5.1.3.tar.gz 1004765 BLAKE2B 64d9b42026d2be1d0e4aa66678
DIST rocm-opencl-runtime-5.3.3.tar.gz 1007773 BLAKE2B a3f600a68183337f92b152a123241cb7025889cca2ef6814d9d5b5a2146a78703b171d20bcb432bc7a2cdd1f24ad349408c17816b25a66702e9f0f5345af9082 SHA512 391f0f244b7f02972df8cada821e69ee8d81d96b9cff3c14f1d0838da583d8fb136ec4bd5ee820f6dd261968e9eef5e9a5b10b7bb76b1b64625c399d79bcb03f
DIST rocm-tracer-5.0.2.tar.gz 474669 BLAKE2B b350111590140e1282338e4f134caf6228677c49361ceb9bc7ba0da8709346daa4fd014644c04adff0e903dba6014a84edd2eb3a5c132a8f91b479e4d5b085e5 SHA512 3fc1449cc9c9bf83e5233a7a0e83c0e3fa9da225d5ee4427b7d6fa15e3580497e1b9fbcd63892e4a99df01582aecd3ccfd66d2a19af2d8c25949ee705894ea44
DIST rocm-tracer-5.1.3.tar.gz 511617 BLAKE2B 4142979b3b7d649798a7ac0b2a04b42aa7fbcbf82f2cf51b0e5363ec0da538046d6e59283d0ce1bfd341317bf24ac2f694d5c8a7d1f132f9b21caea5caf7eda3 SHA512 e73b0c921ffbdcac571d8b0825de39bd8a4fd5f2720ecdd0c189951db85efb607a0b1cd7a9bb02b3dbf329b277cb5e197525216a8e8927eea4e6ce290b7e7c7b
-DIST rocm-tracer-5.3.3.tar.gz 353041 BLAKE2B b7614707ae3af2f5a46d058dacadfb0ef3b980963ac49face66a80c8396e66cf13e0430ab41737ba15e163f5da03697376b13238ea1decfe7ee4a7f31c7664a5 SHA512 95a202f76f6b68a35942750233bd09d372a9be843150d7ec02824da13c6b9a7c8da7a752ac69f66776e7ccfb6176473745dc46a7baadfe77c99c0596fbc2ffeb
EBUILD hip-5.0.2-r3.ebuild 4915 BLAKE2B 71cf130b99182044b8cbfff278de4d0728866b95dbf2b6467319904a35f5ebe4c9fd444079c6e37b7e76e92739bdc09331166265956c2687d9c781455b27cc33 SHA512 333f83af738b7c630ce5f758d6c381f7c5ae1ab2fbea0acad1f7499eb807eddd6a11213dd940ce1aad0c4f4b172745b2bfa34cb61abd5cbb68f54e83759b6b6c
-EBUILD hip-5.1.3-r3.ebuild 6478 BLAKE2B f751d69531054ad513b35df1161e55b1693b2b73d9bbcbf4fe259e2f51ee5e59403df41468ceef9528bc9bd3b50589bb0c7a0a47ce3e04ff8e158f93a2fc6b80 SHA512 5fdb5238338d4130e157fceb6857dd74ecace9cdf18aa73468fc832cefa7ae2c65bf151cb9a1e9412956ca7a8379356ab2ae4d5192a4593b9953b5a950a5021d
-EBUILD hip-5.3.3-r1.ebuild 5991 BLAKE2B decff6d448eb7751ef55a80efad95919d1512aa49e2c1d9514d8d7a250cc24aecbc258898c06d9d51ce6fe24881df1b464adffc5d52d59c827c6d85b65d63a8c SHA512 1abff9d8864fb6e46a0c9e7630cc2ee479701f9a81428c4f2bdc90344744afa4becca18345210f1455d09d059ca38af5cf928129b1a3d0ce1cf3cd62e020ce69
-MISC metadata.xml 597 BLAKE2B cca1b105463e26741aa4bf95c9d85dd582df075795646f633ed5f0d39bace0b07be98f771aa8eb1b89984788249837303b67617e92c4076eb7601611cd2abf6d SHA512 42767156ae0e89b3ce438bfb163161b543e15114838a5c14b4b1c889fe799e44dd9bf9684ee685798a1fc5d2d4c520d3c42c9c74a88178a079ccb634148e0738
+EBUILD hip-5.1.3-r4.ebuild 6561 BLAKE2B eb04725deb7efa065bb83a127a298fbf24c768e2251226c1e1c246e09dc4107486bc2bd9a4e6ec7cb3abdb37a58638fe41456eda5e96ee3d5d6529e4b87ff20b SHA512 d3e3559331ed80e7e880af4b95bc27359dc8afb0fbde6e9beefe511b1ac96e086230e55468533d7882f6fe3ad26d734b2ec0c4d53e300bc2d13b551e608dc217
+EBUILD hip-5.3.3-r2.ebuild 5085 BLAKE2B 664fc12c3a17c33aa01a5b54f6054217c84e9dd68fa949d465663d6b486ac74550fb6da0e8a847756b65460f0d91d3f24dd50de8b3ffe5921e4c6742e856f31b SHA512 75a9d6e6c59ab7947cc6ea6e3a0ee697e9b2d445426482db8cdde031896899e78fe074a453cbaf5bf075c5d6ae71bd42dddbb8f850e558c7853e0c8ed7b4b1c2
+MISC metadata.xml 729 BLAKE2B 92e36c42f6d8335e5a8e3a86b591ff9e6306e0d187644620fab7f8f7ddd00156ee91ff49184ffbe379e509f2096c51c421575a69de7abea3c0b372fdcec52ccb SHA512 84fc8234a5fdf54bf43228c2144d809a461862fb45fea24bf366ee5937df3882c3332429938792981e37dbb4cda6e5d7e05ac5deaded34d8bcce1eb53df8d0fd
diff --git a/dev-util/hip/files/0001-SWDEV-344620-hipcc-fails-to-parse-version-of-clang-i.patch b/dev-util/hip/files/0001-SWDEV-344620-hipcc-fails-to-parse-version-of-clang-i.patch
new file mode 100644
index 000000000000..b9a1329e5931
--- /dev/null
+++ b/dev-util/hip/files/0001-SWDEV-344620-hipcc-fails-to-parse-version-of-clang-i.patch
@@ -0,0 +1,70 @@
+From 73430b62a5437d1ba6c36a1d812a1434d1ad9df7 Mon Sep 17 00:00:00 2001
+From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com>
+Date: Tue, 20 Dec 2022 06:51:12 +0530
+Subject: [PATCH 1/3] SWDEV-344620 - hipcc fails to parse version of clang in
+ some cases (#3119)
+
+Change-Id: I46f716c82a7500b9a2bcaf5f9ff4ad8a8f982770
+Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
+---
+ bin/hipcc.pl | 22 +++++++---------------
+ 1 file changed, 7 insertions(+), 15 deletions(-)
+
+diff --git a/bin/hipcc.pl b/bin/hipcc.pl
+index 645ae62d..2a01dcc3 100755
+--- a/bin/hipcc.pl
++++ b/bin/hipcc.pl
+@@ -144,7 +144,7 @@ if ($HIP_PLATFORM eq "amd") {
+ $execExtension = "";
+ if($isWindows) {
+ $execExtension = ".exe";
+- }
++ }
+ $HIPCC="$HIP_CLANG_PATH/clang++" . $execExtension;
+
+ # If $HIPCC clang++ is not compiled, use clang instead
+@@ -157,13 +157,10 @@ if ($HIP_PLATFORM eq "amd") {
+ $HIPLDFLAGS .= " -fuse-ld=lld";
+ $HIPLDFLAGS .= " --ld-path=$HIP_CLANG_PATH/lld-link.exe";
+ }
+- $HIP_CLANG_VERSION = `$HIPCC --version`;
+- $HIP_CLANG_VERSION=~/.*clang version (\S+).*/;
+- $HIP_CLANG_VERSION=$1;
+
+- # Figure out the target with which llvm is configured
+- $HIP_CLANG_TARGET = `$HIPCC -print-target-triple`;
+- $HIP_CLANG_TARGET = chomp($HIP_CLANG_TARGET);
++ # get Clang RT Builtin path
++ $HIP_CLANG_RT_LIB = `$HIPCC --print-runtime-dir`;
++ chomp($HIP_CLANG_RT_LIB);
+
+ if (! defined $HIP_CLANG_INCLUDE_PATH) {
+ $HIP_CLANG_INCLUDE_PATH = abs_path("$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/include");
+@@ -184,7 +181,7 @@ if ($HIP_PLATFORM eq "amd") {
+ print ("HIP_INCLUDE_PATH=$HIP_INCLUDE_PATH\n");
+ print ("HIP_LIB_PATH=$HIP_LIB_PATH\n");
+ print ("DEVICE_LIB_PATH=$DEVICE_LIB_PATH\n");
+- print ("HIP_CLANG_TARGET=$HIP_CLANG_TARGET\n");
++ print ("HIP_CLANG_RT_LIB=$HIP_CLANG_RT_LIB\n");
+ }
+
+ if ($isWindows) {
+@@ -715,13 +712,8 @@ if ($HIP_PLATFORM eq "amd") {
+ } else {
+ $toolArgs = ${toolArgs} . " -Wl,--enable-new-dtags -Wl,-rpath=$HIP_LIB_PATH:$ROCM_PATH/lib -lamdhip64 ";
+ }
+- # To support __fp16 and _Float16, explicitly link with compiler-rt
+- $HIP_CLANG_BUILTIN_LIB="$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/lib/$HIP_CLANG_TARGET/libclang_rt.builtins.a";
+- if (-e $HIP_CLANG_BUILTIN_LIB) {
+- $toolArgs .= " -L$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/lib/$HIP_CLANG_TARGET -lclang_rt.builtins "
+- } else {
+- $toolArgs .= " -L$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/lib/linux -lclang_rt.builtins-x86_64 "
+- }
++
++ $toolArgs .= " -L$HIP_CLANG_RT_LIB -lclang_rt.builtins-x86_64 "
+ }
+ }
+
+--
+2.38.1
+
diff --git a/dev-util/hip/files/0001-SWDEV-352878-LLVM-pkg-search-directly-using-find_dep.patch b/dev-util/hip/files/0001-SWDEV-352878-LLVM-pkg-search-directly-using-find_dep.patch
new file mode 100644
index 000000000000..9dbfe8a55395
--- /dev/null
+++ b/dev-util/hip/files/0001-SWDEV-352878-LLVM-pkg-search-directly-using-find_dep.patch
@@ -0,0 +1,163 @@
+From 6c12b045bc3c434dd13e74bf124ed54afec668c6 Mon Sep 17 00:00:00 2001
+From: AravindanC <aravindan.cheruvally@amd.com>
+Date: Fri, 26 Aug 2022 15:02:09 -0700
+Subject: [PATCH] SWDEV-352878 - LLVM pkg search directly using find_dep() for
+ CLANG Include path
+
+Change-Id: I355e39890757be07de8b9332deca159f35039dfd
+Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
+---
+ hip-config.cmake.in | 108 ++++++++++++++++++++++++++------------------
+ 1 file changed, 64 insertions(+), 44 deletions(-)
+
+diff --git a/hip-config.cmake.in b/hip-config.cmake.in
+index 89d1224e..67d898d8 100755
+--- a/hip-config.cmake.in
++++ b/hip-config.cmake.in
+@@ -147,41 +147,62 @@ if(HIP_COMPILER STREQUAL "clang")
+ if(NOT HIP_CXX_COMPILER)
+ set(HIP_CXX_COMPILER ${CMAKE_CXX_COMPILER})
+ endif()
+- if(HIP_CXX_COMPILER MATCHES ".*hipcc" OR HIP_CXX_COMPILER MATCHES ".*clang\\+\\+")
+- execute_process(COMMAND ${HIP_CXX_COMPILER} --version
++
++ # Use HIP_CXX_COMPILER option -print-resource-dir
++ # To fetch the clang include path
++ execute_process(
++ COMMAND ${HIP_CXX_COMPILER} -print-resource-dir
++ OUTPUT_VARIABLE HIP_CLANG_INCLUDE_PATH
++ OUTPUT_STRIP_TRAILING_WHITESPACE
++ RESULT_VARIABLE CLANG_INCLUDE_PATH_FETCH_EXIT_CODE)
++
++ if( NOT "${CLANG_INCLUDE_PATH_FETCH_EXIT_CODE}" STREQUAL "0" )
++ if(HIP_CXX_COMPILER MATCHES ".*hipcc" OR HIP_CXX_COMPILER MATCHES ".*clang\\+\\+")
++ # IF not successful in fetching HIP_CLANG_INCLUDE_PATH using
++ # HIP_CXX_COMPILER binary command options -print-resource-dir
++ # fallback to old method of getting include by finding HIP_CLANG_ROOT
++ # and from predefined relative path of HIP_CLANG_ROOT
++ execute_process(COMMAND ${HIP_CXX_COMPILER} --version
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ OUTPUT_VARIABLE HIP_CXX_COMPILER_VERSION_OUTPUT)
+- # Capture the repo, branch and patch level details of the HIP CXX Compiler.
+- # Ex. clang version 13.0.0 (https://github.com/ROCm-Developer-Tools/HIP main 12345 COMMIT_HASH)
+- # HIP_CLANG_REPO: https://github.com/ROCm-Developer-Tools/HIP
+- # HIP_CLANG_BRANCH: main
+- # HIP_CLANG_PATCH_LEVEL: 12345
+- if(${HIP_CXX_COMPILER_VERSION_OUTPUT} MATCHES "clang version [0-9]+\\.[0-9]+\\.[0-9]+ \\(([^ \n]*) ([^ \n]*) ([^ \n]*)")
+- set(HIP_CLANG_REPO ${CMAKE_MATCH_1})
+- set(HIP_CLANG_BRANCH ${CMAKE_MATCH_2})
+- set(HIP_CLANG_PATCH_LEVEL ${CMAKE_MATCH_3})
+- endif()
+- endif()
+- if(HIP_CXX_COMPILER MATCHES ".*hipcc")
+- if(HIP_CXX_COMPILER_VERSION_OUTPUT MATCHES "InstalledDir:[ \t]*([^\n]*)")
+- get_filename_component(HIP_CLANG_ROOT "${CMAKE_MATCH_1}" DIRECTORY)
+- endif()
+- elseif (HIP_CXX_COMPILER MATCHES ".*clang\\+\\+")
+- get_filename_component(_HIP_CLANG_REAL_PATH "${HIP_CXX_COMPILER}" REALPATH)
+- get_filename_component(_HIP_CLANG_BIN_PATH "${_HIP_CLANG_REAL_PATH}" DIRECTORY)
+- get_filename_component(HIP_CLANG_ROOT "${_HIP_CLANG_BIN_PATH}" DIRECTORY)
+- endif()
+- file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS ${HIP_CLANG_ROOT}/lib/clang/*/include)
+- find_path(HIP_CLANG_INCLUDE_PATH stddef.h
+- HINTS
++ # Capture the repo, branch and patch level details of the HIP CXX Compiler.
++ # Ex. clang version 13.0.0 (https://github.com/ROCm-Developer-Tools/HIP main 12345 COMMIT_HASH)
++ # HIP_CLANG_REPO: https://github.com/ROCm-Developer-Tools/HIP
++ # HIP_CLANG_BRANCH: main
++ # HIP_CLANG_PATCH_LEVEL: 12345
++ if(${HIP_CXX_COMPILER_VERSION_OUTPUT} MATCHES "clang version [0-9]+\\.[0-9]+\\.[0-9]+ \\(([^ \n]*) ([^ \n]*) ([^ \n]*)")
++ set(HIP_CLANG_REPO ${CMAKE_MATCH_1})
++ set(HIP_CLANG_BRANCH ${CMAKE_MATCH_2})
++ set(HIP_CLANG_PATCH_LEVEL ${CMAKE_MATCH_3})
++ endif()
++ if(HIP_CXX_COMPILER MATCHES ".*hipcc")
++ if(HIP_CXX_COMPILER_VERSION_OUTPUT MATCHES "InstalledDir:[ \t]*([^\n]*)")
++ get_filename_component(HIP_CLANG_ROOT "${CMAKE_MATCH_1}" DIRECTORY)
++ endif()
++ elseif (HIP_CXX_COMPILER MATCHES ".*clang\\+\\+")
++ get_filename_component(_HIP_CLANG_REAL_PATH "${HIP_CXX_COMPILER}" REALPATH)
++ get_filename_component(_HIP_CLANG_BIN_PATH "${_HIP_CLANG_REAL_PATH}" DIRECTORY)
++ get_filename_component(HIP_CLANG_ROOT "${_HIP_CLANG_BIN_PATH}" DIRECTORY)
++ endif()
++
++
++ file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS ${HIP_CLANG_ROOT}/lib/clang/*/include)
++ find_path(HIP_CLANG_INCLUDE_PATH stddef.h
++ HINTS
+ ${HIP_CLANG_INCLUDE_SEARCH_PATHS}
+- NO_DEFAULT_PATH)
++ NO_DEFAULT_PATH)
++ # Since INTERFACE_INCLUDE_DIRECTORIES need to set the parent directory
++ # of HIP_CLANG_INCLUDE_PATH incase using find_path() of stddefs.h
++ set(HIP_CLANG_INCLUDE_PATH "${HIP_CLANG_INCLUDE_PATH}/..")
++ endif() # HIP_CXX_COMPILER Check
++ endif() # CLANG_INCLUDE_PATH_FETCH_EXIT_CODE Check
++
+ if(NOT WIN32)
+ find_dependency(AMDDeviceLibs)
+ endif()
+ set(AMDGPU_TARGETS "gfx900;gfx906;gfx908;gfx90a;gfx1030" CACHE STRING "AMD GPU targets to compile for")
+ set(GPU_TARGETS "${AMDGPU_TARGETS}" CACHE STRING "GPU targets to compile for")
+-endif()
++endif() # HIP_COMPILER check
+
+ if(NOT WIN32)
+ find_dependency(amd_comgr)
+@@ -263,11 +284,11 @@ if(HIP_COMPILER STREQUAL "clang")
+ hip_add_interface_link_flags(hip::device --hip-link)
+
+ set_property(TARGET hip::device APPEND PROPERTY
+- INTERFACE_INCLUDE_DIRECTORIES "${HIP_CLANG_INCLUDE_PATH}/.."
++ INTERFACE_INCLUDE_DIRECTORIES "${HIP_CLANG_INCLUDE_PATH}"
+ )
+
+ set_property(TARGET hip::device APPEND PROPERTY
+- INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${HIP_CLANG_INCLUDE_PATH}/.."
++ INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${HIP_CLANG_INCLUDE_PATH}"
+ )
+
+ foreach(GPU_TARGET ${GPU_TARGETS})
+@@ -291,25 +312,24 @@ if(HIP_COMPILER STREQUAL "clang")
+ endif()
+ endif()
+
+- file(GLOB HIP_CLANGRT_LIB_SEARCH_PATHS "${HIP_CLANG_ROOT}/lib/clang/*/lib/*")
+- find_library(CLANGRT_BUILTINS
+- NAMES
+- clang_rt.builtins
+- clang_rt.builtins-x86_64
+- PATHS
+- ${HIP_CLANGRT_LIB_SEARCH_PATHS}
+- ${HIP_CLANG_INCLUDE_PATH}/../lib/linux
+- ${HIP_CLANG_INCLUDE_PATH}/../lib/windows
+- NO_DEFAULT_PATH)
++
++ # Use HIP_CXX option -print-libgcc-file-name --rtlib=compiler-rt
++ # To fetch the compiler rt library file name.
++ execute_process(
++ COMMAND ${HIP_CXX_COMPILER} -print-libgcc-file-name --rtlib=compiler-rt
++ OUTPUT_VARIABLE CLANGRT_BUILTINS
++ OUTPUT_STRIP_TRAILING_WHITESPACE
++ RESULT_VARIABLE CLANGRT_BUILTINS_FETCH_EXIT_CODE)
+
+ # Add support for __fp16 and _Float16, explicitly link with compiler-rt
+- if(NOT CLANGRT_BUILTINS)
+- message(FATAL_ERROR "clangrt builtins lib not found")
+- else()
++ if( "${CLANGRT_BUILTINS_FETCH_EXIT_CODE}" STREQUAL "0" )
++ # CLANG_RT Builtins found Successfully Set interface link libraries property
+ set_property(TARGET hip::host APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${CLANGRT_BUILTINS}")
+ set_property(TARGET hip::device APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${CLANGRT_BUILTINS}")
+- endif()
+-endif()
++ else()
++ message(STATUS "clangrt builtins lib not found: ${CLANGRT_BUILTINS_FETCH_EXIT_CODE}")
++ endif() # CLANGRT_BUILTINS_FETCH_EXIT_CODE Check
++endif() # HIP_COMPILER Check
+
+ set( hip_LIBRARIES hip::host hip::device)
+ set( hip_LIBRARY ${hip_LIBRARIES})
+--
+2.38.1
+
diff --git a/dev-util/hip/files/0002-SWDEV-355608-Remove-clang-include-path-2996.patch b/dev-util/hip/files/0002-SWDEV-355608-Remove-clang-include-path-2996.patch
new file mode 100644
index 000000000000..6d64ad8c9fd8
--- /dev/null
+++ b/dev-util/hip/files/0002-SWDEV-355608-Remove-clang-include-path-2996.patch
@@ -0,0 +1,51 @@
+From 7613e00fe0299d6584d3ee67e5d4010e7fc0866a Mon Sep 17 00:00:00 2001
+From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com>
+Date: Fri, 14 Oct 2022 16:02:40 +0530
+Subject: [PATCH 2/3] SWDEV-355608 - Remove clang include path (#2996)
+
+Clang doesn't need to be told where to find the clang headers
+
+Change-Id: I175781731c43647676d91eedc8a915124f2479ab
+Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
+---
+ bin/hipcc.pl | 11 -----------
+ 1 file changed, 11 deletions(-)
+
+diff --git a/bin/hipcc.pl b/bin/hipcc.pl
+index 2a01dcc3..7e82cad8 100755
+--- a/bin/hipcc.pl
++++ b/bin/hipcc.pl
+@@ -162,9 +162,6 @@ if ($HIP_PLATFORM eq "amd") {
+ $HIP_CLANG_RT_LIB = `$HIPCC --print-runtime-dir`;
+ chomp($HIP_CLANG_RT_LIB);
+
+- if (! defined $HIP_CLANG_INCLUDE_PATH) {
+- $HIP_CLANG_INCLUDE_PATH = abs_path("$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/include");
+- }
+ if (! defined $HIP_INCLUDE_PATH) {
+ $HIP_INCLUDE_PATH = "$HIP_PATH/include";
+ }
+@@ -177,20 +174,12 @@ if ($HIP_PLATFORM eq "amd") {
+ print ("HIP_ROCCLR_HOME=$HIP_ROCCLR_HOME\n");
+ }
+ print ("HIP_CLANG_PATH=$HIP_CLANG_PATH\n");
+- print ("HIP_CLANG_INCLUDE_PATH=$HIP_CLANG_INCLUDE_PATH\n");
+ print ("HIP_INCLUDE_PATH=$HIP_INCLUDE_PATH\n");
+ print ("HIP_LIB_PATH=$HIP_LIB_PATH\n");
+ print ("DEVICE_LIB_PATH=$DEVICE_LIB_PATH\n");
+ print ("HIP_CLANG_RT_LIB=$HIP_CLANG_RT_LIB\n");
+ }
+
+- if ($isWindows) {
+- $HIPCXXFLAGS .= " -std=c++14 -fms-extensions -fms-compatibility";
+- } else {
+- $HIPCXXFLAGS .= " -std=c++11";
+- }
+- $HIPCXXFLAGS .= " -isystem \"$HIP_CLANG_INCLUDE_PATH/..\"";
+- $HIPCFLAGS .= " -isystem \"$HIP_CLANG_INCLUDE_PATH/..\"";
+ $HIPLDFLAGS .= " -L\"$HIP_LIB_PATH\"";
+ if ($isWindows) {
+ $HIPLDFLAGS .= " -lamdhip64";
+--
+2.38.1
+
diff --git a/dev-util/hip/files/0003-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch b/dev-util/hip/files/0003-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch
new file mode 100644
index 000000000000..f92cce4cf8d8
--- /dev/null
+++ b/dev-util/hip/files/0003-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch
@@ -0,0 +1,173 @@
+From fddbcef9a5a45ab63d4805c53d1f8fcf5c30d095 Mon Sep 17 00:00:00 2001
+From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com>
+Date: Fri, 6 Jan 2023 02:37:15 +0530
+Subject: [PATCH 3/3] SWDEV-352878 - Removed relative path based CLANG include,
+ CLANGRT dependencies (#3124)
+
+Change-Id: Ifdcd117679bff548a6351ba915a8272689e647de
+Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
+---
+ cmake/FindHIP.cmake | 37 ++++++++++++++++++++++++++++-
+ hip-lang-config.cmake.in | 51 +++++++++++++++++++++-------------------
+ 2 files changed, 63 insertions(+), 25 deletions(-)
+
+diff --git a/cmake/FindHIP.cmake b/cmake/FindHIP.cmake
+index 8b196dea..109c9f65 100644
+--- a/cmake/FindHIP.cmake
++++ b/cmake/FindHIP.cmake
+@@ -48,6 +48,29 @@ mark_as_advanced(HIP_HOST_COMPILATION_CPP)
+ # FIND: HIP and associated helper binaries
+ ###############################################################################
+
++if(NOT HIP_CXX_COMPILER)
++ set(HIP_CXX_COMPILER ${CMAKE_CXX_COMPILER})
++endif()
++
++# Approach: To find HIP_CLANG_PATH using HIP_CXX_COMPILER options
++# Using --version option of HIP_CXX_COMPILER get the Install Directory
++# This install directory is set as the HIP_CLANG_PATH.
++# IF not successful in getting the Install Directory using HIP_CXX_COMPILER
++# fallback to Old Method to find HIP_CLANG_PATH from ENV Vars, ROCMPATH, HIPPATH etc.
++execute_process(COMMAND ${HIP_CXX_COMPILER} --version
++ OUTPUT_STRIP_TRAILING_WHITESPACE
++ OUTPUT_VARIABLE HIP_CXX_COMPILER_VERSION_OUTPUT)
++if(HIP_CXX_COMPILER MATCHES ".*hipcc")
++ if(HIP_CXX_COMPILER_VERSION_OUTPUT MATCHES "InstalledDir:[ \t]*([^\n]*)")
++ get_filename_component(HIP_CLANG_INSTALL_DIR "${CMAKE_MATCH_1}" DIRECTORY)
++ endif()
++elseif (HIP_CXX_COMPILER MATCHES ".*clang\\+\\+")
++ get_filename_component(_HIP_CLANG_REAL_PATH "${HIP_CXX_COMPILER}" REALPATH)
++ get_filename_component(_HIP_CLANG_BIN_PATH "${_HIP_CLANG_REAL_PATH}" DIRECTORY)
++ get_filename_component(HIP_CLANG_INSTALL_DIR "${_HIP_CLANG_BIN_PATH}" DIRECTORY)
++endif()
++
++
+ get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../" REALPATH)
+
+ # HIP is currently not supported for apple
+@@ -230,6 +253,10 @@ if("${HIP_COMPILER}" STREQUAL "nvcc")
+ elseif("${HIP_COMPILER}" STREQUAL "clang")
+ #Set HIP_CLANG_PATH
+ if("x${HIP_CLANG_PATH}" STREQUAL "x")
++ # IF HIP_CLANG_INSTALL_DIR is Found
++ if( HIP_CLANG_INSTALL_DIR )
++ set(HIP_CLANG_PATH ${HIP_CLANG_INSTALL_DIR})
++ else() # IF HIP_CLANG_INSTALL_DIR is not found
+ if(DEFINED ENV{HIP_CLANG_PATH})
+ set(HIP_CLANG_PATH $ENV{HIP_CLANG_PATH})
+ elseif(DEFINED ENV{ROCM_PATH})
+@@ -252,7 +279,9 @@ elseif("${HIP_COMPILER}" STREQUAL "clang")
+ else()
+ message(FATAL_ERROR "Unable to find the clang compiler path. Set ROCM_PATH or HIP_PATH in env ")
+ endif()
+- endif()
++ endif() # HIP_CLANG_INSTALL_DIR Check
++ endif() # Set HIP_CLANG_PATH
++
+ #Number of parallel jobs by default is 1
+ if(NOT DEFINED HIP_CLANG_NUM_PARALLEL_JOBS)
+ set(HIP_CLANG_NUM_PARALLEL_JOBS 1)
+@@ -660,6 +689,10 @@ macro(HIP_ADD_EXECUTABLE hip_target)
+ endif()
+ if("${HIP_COMPILER}" STREQUAL "clang")
+ if("x${HIP_CLANG_PATH}" STREQUAL "x")
++ # IF HIP_CLANG_INSTALL_DIR is Found
++ if( HIP_CLANG_INSTALL_DIR )
++ set(HIP_CLANG_PATH ${HIP_CLANG_INSTALL_DIR})
++ else() # IF HIP_CLANG_INSTALL_DIR is not found
+ if(DEFINED ENV{HIP_CLANG_PATH})
+ set(HIP_CLANG_PATH $ENV{HIP_CLANG_PATH})
+ elseif(DEFINED ENV{ROCM_PATH})
+@@ -682,7 +715,9 @@ macro(HIP_ADD_EXECUTABLE hip_target)
+ else()
+ message(FATAL_ERROR "Unable to find the clang compiler path. Set ROCM_PATH or HIP_PATH in env")
+ endif()
++ endif() # HIP_CLANG_INSTALL_DIR Check
+ endif()
++
+ set(CMAKE_HIP_LINK_EXECUTABLE "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HIP_CLANG_PATH} ${HIP_CLANG_PARALLEL_BUILD_LINK_OPTIONS} <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+ else()
+ set(CMAKE_HIP_LINK_EXECUTABLE "${HIP_HIPCC_CMAKE_LINKER_HELPER} <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+diff --git a/hip-lang-config.cmake.in b/hip-lang-config.cmake.in
+index 9250a68a..1cf4e40f 100644
+--- a/hip-lang-config.cmake.in
++++ b/hip-lang-config.cmake.in
+@@ -70,15 +70,6 @@ get_filename_component(_DIR "${CMAKE_CURRENT_LIST_DIR}" REALPATH)
+ get_filename_component(_IMPORT_PREFIX "${_DIR}/../../../" REALPATH)
+
+
+-#need _IMPORT_PREFIX to be set #FILE_REORG_BACKWARD_COMPATIBILITY
+-file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS "${_IMPORT_PREFIX}/../llvm/lib/clang/*/include")
+-file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS_REORG "${_IMPORT_PREFIX}/llvm/lib/clang/*/include")
+-find_path(HIP_CLANG_INCLUDE_PATH __clang_cuda_math.h
+- HINTS ${HIP_CLANG_INCLUDE_SEARCH_PATHS}
+- ${HIP_CLANG_INCLUDE_SEARCH_PATHS_REORG}
+- NO_DEFAULT_PATH)
+-get_filename_component(HIP_CLANG_INCLUDE_PATH "${HIP_CLANG_INCLUDE_PATH}" DIRECTORY)
+-
+ #If HIP isnot installed under ROCm, need this to find HSA assuming HSA is under ROCm
+ if( DEFINED ENV{ROCM_PATH} )
+ set(ROCM_PATH "$ENV{ROCM_PATH}")
+@@ -96,18 +87,10 @@ if (NOT HSA_HEADER)
+ message (FATAL_ERROR "HSA header not found! ROCM_PATH environment not set")
+ endif()
+
+-get_filename_component(HIP_COMPILER_INSTALL_PATH ${CMAKE_HIP_COMPILER} DIRECTORY)
+-file(GLOB HIP_CLANGRT_LIB_SEARCH_PATHS "${HIP_COMPILER_INSTALL_PATH}/../lib/clang/*/lib/*")
+-find_library(CLANGRT_BUILTINS
+- NAMES
+- clang_rt.builtins
+- clang_rt.builtins-x86_64
+- PATHS
+- ${HIP_CLANGRT_LIB_SEARCH_PATHS}
+- ${HIP_CLANG_INCLUDE_PATH}/../lib/linux)
++
+ set_target_properties(hip-lang::device PROPERTIES
+- INTERFACE_INCLUDE_DIRECTORIES "$<$<COMPILE_LANGUAGE:HIP>:${_IMPORT_PREFIX}/include;${HIP_CLANG_INCLUDE_PATH}>"
+- INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "$<$<COMPILE_LANGUAGE:HIP>:${_IMPORT_PREFIX}/include;${HIP_CLANG_INCLUDE_PATH}>"
++ INTERFACE_INCLUDE_DIRECTORIES "$<$<COMPILE_LANGUAGE:HIP>:${_IMPORT_PREFIX}/include>"
++ INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "$<$<COMPILE_LANGUAGE:HIP>:${_IMPORT_PREFIX}/include>"
+ )
+
+ set_target_properties(hip-lang::amdhip64 PROPERTIES
+@@ -133,13 +116,33 @@ set_property(TARGET hip-lang::device APPEND PROPERTY
+ INTERFACE_LINK_OPTIONS "$<$<LINK_LANGUAGE:HIP>:--hip-link>"
+ )
+
++# Approach: Check CLANGRT LIB support for CMAKE_HIP_COMPILER
++# Use CMAKE_HIP_COMPILER option -print-libgcc-file-name --rtlib=compiler-rt
++# Note: For Linux add additional option -unwindlib=libgcc also
++# To fetch the compiler rt library file name and confirm.
++# If unsuccessful in getting clangrt using this option then
++# FATAL_ERROR message send since compiler-rt linkage dependency is mandatory.
++# If successful then --rtlib=compiler-rt (and -unwindlib=libgcc for non windows)
++# added to Target's INTERFACE_LINK_LIBRARIES property
++if (NOT WIN32)
++ set(CLANGRT_LINUX_OPTION "-unwindlib=libgcc")
++endif()
++
++execute_process(
++ COMMAND ${CMAKE_HIP_COMPILER} -print-libgcc-file-name --rtlib=compiler-rt ${CLANGRT_LINUX_OPTION}
++ OUTPUT_VARIABLE CLANGRT_BUILTINS
++ OUTPUT_STRIP_TRAILING_WHITESPACE
++ RESULT_VARIABLE CLANGRT_BUILTINS_FETCH_EXIT_CODE)
++
+ # Add support for __fp16 and _Float16, explicitly link with compiler-rt
+-if(NOT CLANGRT_BUILTINS)
+- message(FATAL_ERROR "clangrt builtins lib not found")
+-else()
++if( "${CLANGRT_BUILTINS_FETCH_EXIT_CODE}" STREQUAL "0" )
+ set_property(TARGET hip-lang::device APPEND PROPERTY
+- INTERFACE_LINK_LIBRARIES "$<$<LINK_LANGUAGE:HIP>:${CLANGRT_BUILTINS}>"
++ INTERFACE_LINK_OPTIONS $<$<LINK_LANGUAGE:HIP>:--rtlib=compiler-rt ${CLANGRT_LINUX_OPTION}>
+ )
++else()
++ # FATAL_ERROR send if not successfull on compiler-rt linkage dependency
++ message(FATAL_ERROR
++ "${CMAKE_FIND_PACKAGE_NAME} Error:${CLANGRT_BUILTINS_FETCH_EXIT_CODE} - clangrt builtins lib could not be found.")
+ endif()
+
+ # Approved by CMake to use this name. This is used so that HIP can
+--
+2.38.1
+
diff --git a/dev-util/hip/files/hip-5.3.3-disable-Werror.patch b/dev-util/hip/files/hip-5.3.3-disable-Werror.patch
new file mode 100644
index 000000000000..bed46bd144f4
--- /dev/null
+++ b/dev-util/hip/files/hip-5.3.3-disable-Werror.patch
@@ -0,0 +1,16 @@
+Index: hipamd-rocm-5.3.3/src/CMakeLists.txt
+===================================================================
+--- hipamd-rocm-5.3.3.orig/src/CMakeLists.txt
++++ hipamd-rocm-5.3.3/src/CMakeLists.txt
+@@ -44,11 +44,6 @@ if(ADDRESS_SANITIZER)
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${ASAN_LINKER_FLAGS} -Wl,--build-id=sha1")
+ endif()
+
+-if(CMAKE_COMPILER_IS_GNUCC)
+- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
+- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
+-endif()
+-
+ option(DISABLE_DIRECT_DISPATCH "Disable Direct Dispatch" OFF)
+
+ option(BUILD_SHARED_LIBS "Build the shared library" ON)
diff --git a/dev-util/hip/files/hip-5.3.3-remove-cmake-doxygen-commands.patch b/dev-util/hip/files/hip-5.3.3-remove-cmake-doxygen-commands.patch
new file mode 100644
index 000000000000..c4cd955bed90
--- /dev/null
+++ b/dev-util/hip/files/hip-5.3.3-remove-cmake-doxygen-commands.patch
@@ -0,0 +1,21 @@
+Index: hipamd-rocm-5.3.3/packaging/CMakeLists.txt
+===================================================================
+--- hipamd-rocm-5.3.3.orig/packaging/CMakeLists.txt
++++ hipamd-rocm-5.3.3/packaging/CMakeLists.txt
+@@ -94,16 +94,6 @@ install(FILES ${CMAKE_BINARY_DIR}/.hipVe
+ install(DIRECTORY ${HIP_COMMON_DIR}/cmake/ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/hip COMPONENT dev)
+ #End dev files install
+
+-#Begin doc files install
+-find_program(DOXYGEN_EXE doxygen)
+-if(DOXYGEN_EXE)
+- add_custom_target(build_doxygen ALL
+- COMMAND HIP_PATH=${HIP_COMMON_DIR} doxygen ${HIP_COMMON_DIR}/docs/doxygen-input/doxy.cfg)
+- install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/RuntimeAPI/html
+- DESTINATION ${CMAKE_INSTALL_DOCDIR}/RuntimeAPI COMPONENT doc)
+-endif()
+-#End doc files install
+-
+ #Begin samples files install
+ install(DIRECTORY ${HIP_COMMON_DIR}/samples DESTINATION ${CMAKE_INSTALL_DATADIR}/hip COMPONENT samples)
+ #End samples files install
diff --git a/dev-util/hip/files/hipvars-5.3.3.pm b/dev-util/hip/files/hipvars-5.3.3.pm
new file mode 100644
index 000000000000..fd1403661efb
--- /dev/null
+++ b/dev-util/hip/files/hipvars-5.3.3.pm
@@ -0,0 +1,20 @@
+#!/usr/bin/perl -w
+package hipvars;
+
+$HIP_BASE_VERSION_MAJOR = "@HIP_BASE_VERSION_MAJOR@";
+$HIP_BASE_VERSION_MINOR = "@HIP_BASE_VERSION_MINOR@";
+
+$isWindows = 0;
+$HIP_PATH='/usr';
+$ROCM_PATH='/usr';
+$CUDA_PATH='/opt/cuda';
+$HSA_PATH='/usr';
+$HIP_CLANG_PATH='@CLANG_PATH@';
+$HIP_ROCCLR_HOME=$HIP_PATH;
+$HIP_PLATFORM='amd';
+$HIP_COMPILER = "clang";
+$HIP_RUNTIME = "rocclr";
+$HIP_VERSION_MAJOR = $HIP_BASE_VERSION_MAJOR;
+$HIP_VERSION_MINOR = $HIP_BASE_VERSION_MINOR;
+$HIP_VERSION_PATCH = "@HIP_VERSION_PATCH@";
+$HIP_VERSION="$HIP_VERSION_MAJOR.$HIP_VERSION_MINOR.$HIP_VERSION_PATCH";
diff --git a/dev-util/hip/hip-5.1.3-r3.ebuild b/dev-util/hip/hip-5.1.3-r4.ebuild
index 56090c5077df..3ea312756ff5 100644
--- a/dev-util/hip/hip-5.1.3-r3.ebuild
+++ b/dev-util/hip/hip-5.1.3-r4.ebuild
@@ -105,19 +105,19 @@ src_prepare() {
# which makes "stdlib.h" not found when using "#include_next" in header files;
sed -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
-e "/HIP.*FLAGS.*isystem.*HIP_INCLUDE_PATH/d" \
- -e "s:\$ENV{'DEVICE_LIB_PATH'}:'/usr/lib/amdgcn/bitcode':" \
- -e "s:\$ENV{'HIP_LIB_PATH'}:'/usr/$(get_libdir)':" \
+ -e "s:\$ENV{'DEVICE_LIB_PATH'}:'${EPREFIX}/usr/lib/amdgcn/bitcode':" \
+ -e "s:\$ENV{'HIP_LIB_PATH'}:'${EPREFIX}/usr/$(get_libdir)':" \
-e "/rpath/s,--rpath=[^ ]*,," \
-e "s,\$HIP_CLANG_PATH/../lib/clang/\$HIP_CLANG_VERSION/,${CLANG_RESOURCE_DIR}/,g" \
-i bin/hipcc.pl || die
# change --hip-device-lib-path to "/usr/lib/amdgcn/bitcode", must align with "dev-libs/rocm-device-libs"
- sed -e "s:\${AMD_DEVICE_LIBS_PREFIX}/lib:/usr/lib/amdgcn/bitcode:" \
+ sed -e "s:\${AMD_DEVICE_LIBS_PREFIX}/lib:${EPREFIX}/usr/lib/amdgcn/bitcode:" \
-i "${S}/hip-config.cmake.in" || die
einfo "prefixing hipcc and its utils..."
- hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${S}")
- hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${HIP_S}")
+ hprefixify $(grep -rl --exclude-dir=build/ --exclude="hip-config.cmake.in" "/usr" "${S}")
+ hprefixify $(grep -rl --exclude-dir=build/ --exclude="hipcc.pl" "/usr" "${HIP_S}")
cp "$(prefixify_ro "${FILESDIR}"/hipvars-5.1.3.pm)" bin/hipvars.pm || die "failed to replace hipvars.pm"
sed -e "s,@HIP_BASE_VERSION_MAJOR@,$(ver_cut 1)," -e "s,@HIP_BASE_VERSION_MINOR@,$(ver_cut 2)," \
diff --git a/dev-util/hip/hip-5.3.3-r1.ebuild b/dev-util/hip/hip-5.3.3-r2.ebuild
index 07b7709afbc2..072b8d319e97 100644
--- a/dev-util/hip/hip-5.3.3-r1.ebuild
+++ b/dev-util/hip/hip-5.3.3-r2.ebuild
@@ -3,11 +3,10 @@
EAPI=8
-PYTHON_COMPAT=( python3_{9..11} )
DOCS_BUILDER="doxygen"
DOCS_DEPEND="media-gfx/graphviz"
-inherit cmake docs llvm prefix python-any-r1
+inherit cmake docs llvm prefix
LLVM_MAX_SLOT=15
@@ -16,16 +15,13 @@ HOMEPAGE="https://github.com/ROCm-Developer-Tools/hipamd"
SRC_URI="https://github.com/ROCm-Developer-Tools/hipamd/archive/rocm-${PV}.tar.gz -> rocm-hipamd-${PV}.tar.gz
https://github.com/ROCm-Developer-Tools/HIP/archive/rocm-${PV}.tar.gz -> rocm-hip-${PV}.tar.gz
https://github.com/ROCm-Developer-Tools/ROCclr/archive/rocm-${PV}.tar.gz -> rocclr-${PV}.tar.gz
- https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/rocm-${PV}.tar.gz -> rocm-opencl-runtime-${PV}.tar.gz
- profile? ( https://github.com/ROCm-Developer-Tools/roctracer/archive/refs/tags/rocm-${PV}.tar.gz -> rocm-tracer-${PV}.tar.gz
- https://github.com/ROCm-Developer-Tools/hipamd/files/8991181/hip_prof_str_diff.gz -> ${P}-update-header.patch.gz
- )"
+ https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/rocm-${PV}.tar.gz -> rocm-opencl-runtime-${PV}.tar.gz"
KEYWORDS="~amd64"
LICENSE="MIT"
SLOT="0/$(ver_cut 1-2)"
-IUSE="debug profile"
+IUSE="debug"
DEPEND="
>=dev-util/rocminfo-5
@@ -37,23 +33,16 @@ RDEPEND="${DEPEND}
dev-perl/URI-Encode
sys-devel/clang-runtime:=
>=dev-libs/roct-thunk-interface-5"
-BDEPEND="profile? ( $(python_gen_any_dep '
- dev-python/CppHeaderParser[${PYTHON_USEDEP}]
- ') )
-"
PATCHES=(
"${FILESDIR}/${PN}-5.0.1-DisableTest.patch"
"${FILESDIR}/${PN}-5.0.1-hip_vector_types.patch"
"${FILESDIR}/${PN}-5.0.2-set-build-id.patch"
+ "${FILESDIR}/${PN}-5.3.3-remove-cmake-doxygen-commands.patch"
+ "${FILESDIR}/${PN}-5.3.3-disable-Werror.patch"
+ "${FILESDIR}/0001-SWDEV-352878-LLVM-pkg-search-directly-using-find_dep.patch"
)
-python_check_deps() {
- if use profile; then
- python_has_version "dev-python/CppHeaderParser[${PYTHON_USEDEP}]"
- fi
-}
-
S="${WORKDIR}/hipamd-rocm-${PV}"
HIP_S="${WORKDIR}"/HIP-rocm-${PV}
OCL_S="${WORKDIR}"/ROCm-OpenCL-Runtime-rocm-${PV}
@@ -62,64 +51,55 @@ RTC_S="${WORKDIR}"/roctracer-rocm-${PV}
DOCS_DIR="${HIP_S}"/docs/doxygen-input
DOCS_CONFIG_NAME=doxy.cfg
+pkg_setup() {
+ # Ignore QA FLAGS check for library compiled from assembly sources
+ QA_FLAGS_IGNORED="/usr/$(get_libdir)/libhiprtc-builtins.so.$(ver_cut 1-2)"
+}
+
src_prepare() {
cmake_src_prepare
- use profile && eapply "${WORKDIR}/${P}-update-header.patch"
eapply_user
# Use Gentoo slot number, otherwise git hash is attempted in vain.
sed -e "/set (HIP_LIB_VERSION_STRING/cset (HIP_LIB_VERSION_STRING ${SLOT#*/})" -i CMakeLists.txt || die
- # disable PCH, because it results in a build error in ROCm 4.0.0
- sed -e "s:option(__HIP_ENABLE_PCH:#option(__HIP_ENABLE_PCH:" -i CMakeLists.txt || die
-
# correctly find HIP_CLANG_INCLUDE_PATH using cmake
local LLVM_PREFIX="$(get_llvm_prefix "${LLVM_MAX_SLOT}")"
- local CLANG_RESOURCE_DIR=$("${LLVM_PREFIX}/bin/clang" -print-resource-dir)
sed -e "/set(HIP_CLANG_ROOT/s:\"\${ROCM_PATH}/llvm\":${LLVM_PREFIX}:" -i hip-config.cmake.in || die
# correct libs and cmake install dir
- sed -e "/LIB_INSTALL_DIR/s:PREFIX}/lib:PREFIX}/$(get_libdir):" \
- -e "/\${HIP_COMMON_DIR}/s:cmake DESTINATION .):cmake/ DESTINATION share/cmake/Modules):" -i CMakeLists.txt || die
- sed -e "/LIBRARY DESTINATION/s:lib:$(get_libdir):" -i src/CMakeLists.txt || die
+ sed -e "/\${HIP_COMMON_DIR}/s:cmake DESTINATION .):cmake/ DESTINATION share/cmake/Modules):" -i CMakeLists.txt || die
sed -e "/\.hip/d" \
- -e "s,DESTINATION lib,DESTINATION $(get_libdir),g" \
- -e "/cmake DESTINATION/d" \
-e "/CPACK_RESOURCE_FILE_LICENSE/d" -i packaging/CMakeLists.txt || die
pushd ${HIP_S} || die
- eapply "${FILESDIR}/${PN}-5.1.3-clang-include-path.patch"
eapply "${FILESDIR}/${PN}-5.1.3-rocm-path.patch"
eapply "${FILESDIR}/${PN}-5.1.3-fno-stack-protector.patch"
+ eapply "${FILESDIR}/0001-SWDEV-344620-hipcc-fails-to-parse-version-of-clang-i.patch"
+ eapply "${FILESDIR}/0002-SWDEV-355608-Remove-clang-include-path-2996.patch"
+ eapply "${FILESDIR}/0003-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch"
# Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"
# which makes "stdlib.h" not found when using "#include_next" in header files;
sed -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
-e "/HIP.*FLAGS.*isystem.*HIP_INCLUDE_PATH/d" \
- -e "s:\$ENV{'DEVICE_LIB_PATH'}:'/usr/lib/amdgcn/bitcode':" \
- -e "s:\$ENV{'HIP_LIB_PATH'}:'/usr/$(get_libdir)':" \
- -e "/rpath/s,--rpath=[^ ]*,," \
- -e "s,\$HIP_CLANG_PATH/../lib/clang/\$HIP_CLANG_VERSION/,${CLANG_RESOURCE_DIR}/,g" \
- -i bin/hipcc.pl || die
+ -e "s:\$ENV{'DEVICE_LIB_PATH'}:'${EPREFIX}/usr/lib/amdgcn/bitcode':" \
+ -e "s:\$ENV{'HIP_LIB_PATH'}:'${EPREFIX}/usr/$(get_libdir)':" \
+ -e "/rpath/s,--rpath=[^ ]*,," -i bin/hipcc.pl || die
# change --hip-device-lib-path to "/usr/lib/amdgcn/bitcode", must align with "dev-libs/rocm-device-libs"
- sed -e "s:\${AMD_DEVICE_LIBS_PREFIX}/lib:/usr/lib/amdgcn/bitcode:" \
+ sed -e "s:\${AMD_DEVICE_LIBS_PREFIX}/lib:${EPREFIX}/usr/lib/amdgcn/bitcode:" \
-i "${S}/hip-config.cmake.in" || die
einfo "prefixing hipcc and its utils..."
- hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${S}")
- hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${HIP_S}")
+ hprefixify $(grep -rl --exclude-dir=build/ --exclude="hip-config.cmake.in" "/usr" "${S}")
+ hprefixify $(grep -rl --exclude-dir=build/ --exclude="hipcc.pl" "/usr" "${HIP_S}")
- cp "$(prefixify_ro "${FILESDIR}"/hipvars-5.1.3.pm)" bin/hipvars.pm || die "failed to replace hipvars.pm"
+ cp "$(prefixify_ro "${FILESDIR}"/hipvars-5.3.3.pm)" bin/hipvars.pm || die "failed to replace hipvars.pm"
sed -e "s,@HIP_BASE_VERSION_MAJOR@,$(ver_cut 1)," -e "s,@HIP_BASE_VERSION_MINOR@,$(ver_cut 2)," \
-e "s,@HIP_VERSION_PATCH@,$(ver_cut 3)," \
- -e "s,@CLANG_INCLUDE_PATH@,${CLANG_RESOURCE_DIR}/include," \
-e "s,@CLANG_PATH@,${LLVM_PREFIX}/bin," -i bin/hipvars.pm || die
-
- sed -e "/HIP_CLANG_INCLUDE_SEARCH_PATHS/s,\${_IMPORT_PREFIX}.*/include,${CLANG_RESOURCE_DIR}/include," -i hip-lang-config.cmake.in || die
- popd || die
- sed -e "/HIP_CLANG_INCLUDE_SEARCH_PATHS/s,\${HIP_CLANG_ROOT}.*/include,${CLANG_RESOURCE_DIR}/include," -i hip-config.cmake.in || die
}
src_configure() {
@@ -139,14 +119,13 @@ src_configure() {
-DHIP_PLATFORM=amd
-DHIP_COMPILER=clang
-DROCM_PATH="${EPREFIX}/usr"
- -DUSE_PROF_API=$(usex profile 1 0)
+ -DUSE_PROF_API=0
+ -DFILE_REORG_BACKWARD_COMPATIBILITY=OFF
-DROCCLR_PATH=${CLR_S}
-DHIP_COMMON_DIR=${HIP_S}
-DAMD_OPENCL_PATH=${OCL_S}
)
- use profile && mycmakeargs+=( -DPROF_API_HEADER_PATH="${RTC_S}"/inc/ext )
-
cmake_src_configure
}
diff --git a/dev-util/hip/metadata.xml b/dev-util/hip/metadata.xml
index 633796671a49..21b0e03f6a41 100644
--- a/dev-util/hip/metadata.xml
+++ b/dev-util/hip/metadata.xml
@@ -10,6 +10,10 @@
<name>Craig Andrews</name>
</maintainer>
<maintainer type="person" proxied="yes">
+ <email>xgreenlandforwyy@gmail.com</email>
+ <name>Yiyang Wu</name>
+ </maintainer>
+ <maintainer type="person" proxied="yes">
<email>gentoo@holzke.net</email>
<name>Wilfried Holzke</name>
</maintainer>