aboutsummaryrefslogtreecommitdiff
path: root/ports/ffmpeg/0017-Patch-for-ticket-9019-CUDA-Compile-Broken-Using-MSVC.patch
blob: c80e51ad75797198b8198cf2e9f7d21f81999710 (plain)
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
35
36
37
38
39
40
41
42
43
44
From 6dd12a7210fb4cf2e69b6c83628021d83ba132c3 Mon Sep 17 00:00:00 2001
From: "Don C. Bigler" <don.bigler@framatome.com>
Date: Fri, 4 Dec 2020 12:39:55 -0500
Subject: [PATCH] Patch for ticket #9019 CUDA Compile Broken Using MSVC

Signed-off-by: Don C. Bigler <don.bigler@framatome.com>
---
 compat/cuda/ptx2c.sh | 7 ++++---
 configure            | 1 +
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/compat/cuda/ptx2c.sh b/compat/cuda/ptx2c.sh
index 48452379c2..1c486dc30e 100755
--- a/compat/cuda/ptx2c.sh
+++ b/compat/cuda/ptx2c.sh
@@ -26,9 +26,10 @@ OUT="$1"
 IN="$2"
 NAME="$(basename "$IN" | sed 's/\..*//')"
 
-printf "const char %s_ptx[] = \\" "$NAME" > "$OUT"
+printf "const char %s_ptx[] = {\\" "$NAME" > "$OUT"
 echo >> "$OUT"
-sed -e "$(printf 's/\r//g')" -e 's/["\\]/\\&/g' -e "$(printf 's/^/\t"/')" -e 's/$/\\n"/' < "$IN" >> "$OUT"
-echo ";" >> "$OUT"
+xxd -i < "$IN" >> "$OUT"
+echo "  ,0x00" >> "$OUT"
+echo "};" >> "$OUT"
 
 exit 0
diff --git a/configure b/configure
index 1b1b140d6f..048e02355f 100755
--- a/configure
+++ b/configure
@@ -1050,6 +1050,7 @@ test_nvcc(){
     tmpo_=$TMPO
     [ -x "$(command -v cygpath)" ] && tmpcu_=$(cygpath -m $tmpcu_) && tmpo_=$(cygpath -m $tmpo_)
     test_cmd $nvcc $nvccflags "$@" $NVCC_C $(nvcc_o $tmpo_) $tmpcu_
+    test_cmd xxd
 }
 
 check_nvcc() {
-- 
2.26.2.windows.1