From: John Wang <wangzq.jn@gmail.com>
To: wangzhiqiang02@ieisystem.com, Josh Poimboeuf <jpoimboe@kernel.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] scripts/faddr2line: Set LANG=C to enforce ASCII output
Date: Fri, 28 Mar 2025 15:38:02 +0800 [thread overview]
Message-ID: <20250328073802.3391960-1-wangzq.jn@gmail.com> (raw)
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
reply other threads:[~2025-03-28 7:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250328073802.3391960-1-wangzq.jn@gmail.com \
--to=wangzq.jn@gmail.com \
--cc=jpoimboe@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wangzhiqiang02@ieisystem.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®