Skip to content

Commit a265eb3

Browse files
committed
Fix libomp.a copy logic to handle multiple glob matches
Iterate over expanded glob patterns and select the first regular file to avoid "cp: target 'libomp.a' is not a directory" errors when multiple GCC versions are present.
1 parent 5ee9fae commit a265eb3

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/quickjs/dune

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,12 @@
6363
/usr/lib/gcc/aarch64-redhat-linux/*/libgomp.a
6464
\"
6565
for p in $PAWTHS; do
66-
if ls $p >/dev/null 2>&1; then
67-
cp $p \"$OUT\"
68-
exit 0
69-
fi
66+
for matched_path in $p; do
67+
if [ -f "$matched_path" ]; then
68+
cp "$matched_path" "$OUT"
69+
exit 0
70+
fi
71+
done
7072
done
7173
echo \"Error: Could not find libomp.a or libgomp.a\" >&2
7274
exit 1

0 commit comments

Comments
 (0)