* [PATCH] scripts/faddr2line: Set LANG=C to enforce ASCII output
@ 2025-03-28 7:38 John Wang
0 siblings, 0 replies; only message in thread
From: John Wang @ 2025-03-28 7:38 UTC (permalink / raw)
To: wangzhiqiang02, Josh Poimboeuf; +Cc: linux-kernel
Force tools like readelf to use the POSIX/C locale by exporting LANG=C
This ensures ASCII-only output and avoids locale-specific
characters(e.g., UTF-8 symbols or translated strings), which could
break text processing utilities like sed in the script
Signed-off-by: John Wang <wangzq.jn@gmail.com>
---
scripts/faddr2line | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/faddr2line b/scripts/faddr2line
index 1fa6beef9f97..1f364fbb0cd8 100755
--- a/scripts/faddr2line
+++ b/scripts/faddr2line
@@ -76,6 +76,10 @@ ADDR2LINE="${UTIL_PREFIX}addr2line${UTIL_SUFFIX}"
AWK="awk"
GREP="grep"
+# Enforce ASCII-only output from tools like readelf
+# ensuring sed processes strings correctly.
+export LANG=C
+
command -v ${AWK} >/dev/null 2>&1 || die "${AWK} isn't installed"
command -v ${READELF} >/dev/null 2>&1 || die "${READELF} isn't installed"
command -v ${ADDR2LINE} >/dev/null 2>&1 || die "${ADDR2LINE} isn't installed"
--
2.34.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-03-28 7:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-28 7:38 [PATCH] scripts/faddr2line: Set LANG=C to enforce ASCII output John Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®