File: 0020-replace-x86_64-with-variables.patch

package info (click to toggle)
rocm-hipamd 5.7.1-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 19,804 kB
  • sloc: cpp: 243,188; ansic: 35,728; perl: 1,227; sh: 902; python: 588; asm: 166; makefile: 59
file content (34 lines) | stat: -rw-r--r-- 1,928 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From: Cordell Bloor <cgmb@slerp.xyz>
Date: Tue, 14 Feb 2023 03:25:28 -0700
Subject: replace x86_64 with variables

The changes to hipcc.pl and hip_embed_pch won't allow cross-compiling,
but they will enable the build to proceed on other architectures.

Bug: https://github.com/ROCm/HIP/issues/2215
---
 hip-config.cmake.in          | 6 +++++-
 hip/bin/hip_embed_pch.sh     | 2 +-
 hip/bin/hipcc.pl             | 3 ++-
 hip/hip-lang-config.cmake.in | 6 +++++-
 4 files changed, 13 insertions(+), 4 deletions(-)

--- a/hipamd/src/hip_embed_pch.sh
+++ b/hipamd/src/hip_embed_pch.sh
@@ -140,14 +140,14 @@
 
   cat $tmp/hip_macros.h >> $tmp/pch_wave32.cui &&
 
-  $LLVM_DIR/bin/clang -cc1 -O3 -emit-pch -triple amdgcn-amd-amdhsa -aux-triple x86_64-unknown-linux-gnu -fcuda-is-device -std=c++17 -fgnuc-version=4.2.1 -o $tmp/hip_wave32.pch -x hip-cpp-output - <$tmp/pch_wave32.cui &&
+  $LLVM_DIR/bin/clang -cc1 -O3 -emit-pch -triple amdgcn-amd-amdhsa -aux-triple $(uname -m)-unknown-linux-gnu -fcuda-is-device -std=c++17 -fgnuc-version=4.2.1 -o $tmp/hip_wave32.pch -x hip-cpp-output - <$tmp/pch_wave32.cui &&
 
   # For other devices
   $LLVM_DIR/bin/clang -O3 --rocm-path=$HIP_INC_DIR/.. -std=c++17 -nogpulib -isystem $HIP_INC_DIR -isystem $HIP_BUILD_INC_DIR -isystem $HIP_AMD_INC_DIR --cuda-device-only -x hip $tmp/hip_pch.h -E >$tmp/pch_wave64.cui &&
 
   cat $tmp/hip_macros.h >> $tmp/pch_wave64.cui &&
 
-  $LLVM_DIR/bin/clang -cc1 -O3 -emit-pch -triple amdgcn-amd-amdhsa -aux-triple x86_64-unknown-linux-gnu -fcuda-is-device -std=c++17 -fgnuc-version=4.2.1 -o $tmp/hip_wave64.pch -x hip-cpp-output - <$tmp/pch_wave64.cui &&
+  $LLVM_DIR/bin/clang -cc1 -O3 -emit-pch -triple amdgcn-amd-amdhsa -aux-triple $(uname -m)-unknown-linux-gnu -fcuda-is-device -std=c++17 -fgnuc-version=4.2.1 -o $tmp/hip_wave64.pch -x hip-cpp-output - <$tmp/pch_wave64.cui &&
 
   $LLVM_DIR/bin/llvm-mc -o hip_pch.o $tmp/hip_pch.mcin --filetype=obj &&