Skip to content

Commit

Permalink
mkproto.sh: export LC_ALL instead of setting in-line
Browse files Browse the repository at this point in the history
Hope that fixes the flatpak-build regression.
  • Loading branch information
stsp committed Sep 14, 2024
1 parent c95a82d commit 8adc19b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/libc/dj64/parsers/mkproto.sh
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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 | xargs $RTAGS -t $TF >&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
Expand Down

0 comments on commit 8adc19b

Please sign in to comment.