diff options
author | Tao Huang <huangtao@rock-chips.com> | 2018-10-09 14:40:26 +0800 |
---|---|---|
committer | Tao Huang <huangtao@rock-chips.com> | 2018-10-09 14:43:04 +0800 |
commit | c7f27e053c9f8b4094bac7786ef25920c96a8c55 (patch) | |
tree | b24df7c22c1eab4aec56dfc7c2fb26006ff54e2f /scripts | |
parent | 43ab68e6c6ef2da67a6b711ba741b408fe8ae3bd (diff) |
rk: gcc-wrapper.py: set LC_ALL=C when run gcc
Make sure messages are not affected by locale environment variables.
Change-Id: Id5606c1a8e1f7a8f09d4e14c4531daebaceef2bf
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/gcc-wrapper.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/scripts/gcc-wrapper.py b/scripts/gcc-wrapper.py index 8b60b8370a5f..f78df1d27a17 100755 --- a/scripts/gcc-wrapper.py +++ b/scripts/gcc-wrapper.py @@ -37,9 +37,6 @@ import os import sys import subprocess -# Note that gcc uses unicode, which may depend on the locale. TODO: -# force LANG to be set to en_US.UTF-8 to get consistent warnings. - allowed_warnings = set([ "posix-cpu-timers.c:1268", # kernel/time/posix-cpu-timers.c:1268:13: warning: 'now' may be used uninitialized in this function "af_unix.c:1036", # net/unix/af_unix.c:1036:20: warning: 'hash' may be used uninitialized in this function @@ -93,7 +90,9 @@ def run_gcc(): compiler = sys.argv[0] try: - proc = subprocess.Popen(args, stderr=subprocess.PIPE) + env = os.environ.copy() + env['LC_ALL'] = 'C' + proc = subprocess.Popen(args, stderr=subprocess.PIPE, env=env) for line in proc.stderr: print (line.decode("utf-8"), end="") interpret_warning(line.decode("utf-8")) |