From 8b41e44528e10e26d7db6761ec2e295ad18784b5 Mon Sep 17 00:00:00 2001 From: Stas Sergeev Date: Sat, 14 Sep 2024 19:22:36 +0300 Subject: [PATCH] mkproto.sh: export LC_ALL instead of setting in-line Hope that fixes the flatpak-build regression. --- src/libc/dj64/parsers/mkproto.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/libc/dj64/parsers/mkproto.sh b/src/libc/dj64/parsers/mkproto.sh index 08bc4649..de940432 100755 --- a/src/libc/dj64/parsers/mkproto.sh +++ b/src/libc/dj64/parsers/mkproto.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -o pipefail +set -x if [ $# -lt 5 ]; then echo "generate thunk prototypes compatible with fdpp's thunk_gen & plt" @@ -43,13 +44,20 @@ extr_proto() { } list_syms() { - LC_ALL=C nm -A "$1" | grep " $2 " | tr -s '[:blank:]' | cut -d " " -f 3 | \ + saved_LA=$LC_ALL + export LC_ALL=C + nm -A "$1" | grep " $2 " | tr -s '[:blank:]' | cut -d " " -f 3 | \ sed 's/^_//' + echo nm returned $? + export LC_ALL=$saved_LA } list_syms2() { - LC_ALL=C nm -A "$1" | grep -E " $2 "\|" $3 " | tr -s '[:blank:]' | cut -d " " -f 3 | \ + saved_LA=$LC_ALL + export LC_ALL=C + nm -A "$1" | grep -E " $2 "\|" $3 " | tr -s '[:blank:]' | cut -d " " -f 3 | \ sed 's/^_//' + export LC_ALL=$saved_LA } TF=/tmp/tagsxx @@ -72,6 +80,8 @@ export RTAGS list_syms $TL T | xargs -I '{}' bash -c "extr_proto $TF '{}' ASMFUNC" | nl -n ln -v 0 >$1 list_syms $TL U | xargs -I '{}' bash -c "extr_proto $TF '{}' ASMCFUNC" | nl -n ln -v 0 >$2 echo "#define THUNK_INCS 1" >$3 +list_syms2 $TL U T >&2 +echo THAT >&2 list_syms2 $TL U T | xargs $RTAGS -t $TF | expand | tr -s '[:blank:]' | \ cut -d " " -f 2 | sort | uniq | \ sed -E 's/.*(include)\/(.*)/#\1 "\2"/' >>$3