Skip to content

Commit 6f38a94

Browse files
authored
Merge pull request #4028 from catap/mktemp-fix
Do not requires GNU mktemp
2 parents 29c7170 + b1781ad commit 6f38a94

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

c_check

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ fi
168168

169169
no_msa=0
170170
if [ "$architecture" = "mips" ] || [ "$architecture" = "mips64" ]; then
171-
tmpd="$(mktemp -d)"
171+
tmpd=$(mktemp -d 2>/dev/null || mktemp -d -t 'OBC')
172172
tmpf="$tmpd/a.c"
173173
code='"addvi.b $w0, $w1, 1"'
174174
msa_flags='-mmsa -mfp64 -mload-store-pairs'
@@ -208,7 +208,7 @@ esac
208208

209209
no_avx512=0
210210
if [ "$architecture" = "x86" ] || [ "$architecture" = "x86_64" ]; then
211-
tmpd=`mktemp -d`
211+
tmpd=$(mktemp -d 2>/dev/null || mktemp -d -t 'OBC')
212212
tmpf="$tmpd/a.c"
213213
code='"vbroadcastss -4 * 4(%rsi), %zmm2"'
214214
printf "#include <immintrin.h>\n\nint main(void){ __asm__ volatile(%s); }\n" "$code" >> "$tmpf"
@@ -229,7 +229,7 @@ fi
229229

230230
no_rv64gv=0
231231
if [ "$architecture" = "riscv64" ]; then
232-
tmpd=`mktemp -d`
232+
tmpd=$(mktemp -d 2>/dev/null || mktemp -d -t 'OBC')
233233
tmpf="$tmpd/a.c"
234234
code='"vsetvli zero, zero, e8, m1\n"'
235235
printf "int main(void){ __asm__ volatile(%s); }\n" "$code" >> "$tmpf"
@@ -245,7 +245,7 @@ fi
245245

246246
no_sve=0
247247
if [ "$architecture" = "arm64" ]; then
248-
tmpd=`mktemp -d`
248+
tmpd=$(mktemp -d 2>/dev/null || mktemp -d -t 'OBC')
249249
tmpf="$tmpd/a.c"
250250
printf "#include <arm_sve.h>\n\n int main(void){}\n">> "$tmpf"
251251
args=" -march=armv8-a+sve -c -o $tmpf.o $tmpf"
@@ -261,7 +261,7 @@ fi
261261
c11_atomics=0
262262
case "$data" in
263263
*HAVE_C11*)
264-
tmpd=`mktemp -d`
264+
tmpd=$(mktemp -d 2>/dev/null || mktemp -d -t 'OBC')
265265
tmpf="$tmpd/a.c"
266266
printf "#include <stdatomic.h>\nint main(void){}\n" >> "$tmpf"
267267
args=" -c -o $tmpf.o $tmpf"

0 commit comments

Comments
 (0)