]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scripts/faddr2line: Set LANG=C to enforce ASCII output
authorJohn Wang <wangzq.jn@gmail.com>
Fri, 28 Mar 2025 07:38:02 +0000 (15:38 +0800)
committerJosh Poimboeuf <jpoimboe@kernel.org>
Tue, 14 Oct 2025 21:45:20 +0000 (14:45 -0700)
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>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
scripts/faddr2line

index 1fa6beef9f978e2c4d776b208fcec9b1cb8fe550..1f364fbb0cd84d270e1ff5ea92c6c44ec4680275 100755 (executable)
@@ -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"