scons: fix build failed caused by Non-ASCII directory path
This path fix build failed when gem5's path contains Non-ASCII characters. build_tools/marshal.py embed "abspath" and "modpath" into the generated c++ file. However, if either of them contains Non-ASCII characters, marshal.py will throw an exception. This can be fixed if we set a suitable $LANG for gem5py. For example, we can simply set $LANG=en_US.UTF-8 in src/SConscript to fix this. This patch fixes this bug by passing the host's $LANG environment variable to gem5py. Because for users who may use Non-ASCII characters, their $LANG is generally set to their native language (e.g. zh_CN.UTF-8, en_US.UTF-8, etc.), which contains Non-ASCII characters. Also, it is more reasonable to use the host $LANG than to directly hard-code the $LANG used by gem5py into a language that supports non-ASCII characters. Change-Id: Ia0343cbd6995af3a9e43bf217ad3f186d5633fed Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/58369 Reviewed-by: Gabe Black <gabe.black@gmail.com> Maintainer: Gabe Black <gabe.black@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -48,7 +48,7 @@ def EnvDefaults(env):
|
|||||||
'LIBRARY_PATH', 'PATH', 'PKG_CONFIG_PATH', 'PROTOC',
|
'LIBRARY_PATH', 'PATH', 'PKG_CONFIG_PATH', 'PROTOC',
|
||||||
'PYTHONPATH', 'RANLIB', 'TERM', 'PYTHON_CONFIG',
|
'PYTHONPATH', 'RANLIB', 'TERM', 'PYTHON_CONFIG',
|
||||||
'CCFLAGS_EXTRA', 'GEM5PY_CCFLAGS_EXTRA',
|
'CCFLAGS_EXTRA', 'GEM5PY_CCFLAGS_EXTRA',
|
||||||
'GEM5PY_LINKFLAGS_EXTRA', 'LINKFLAGS_EXTRA'])
|
'GEM5PY_LINKFLAGS_EXTRA', 'LINKFLAGS_EXTRA', 'LANG'])
|
||||||
|
|
||||||
use_prefixes = [
|
use_prefixes = [
|
||||||
"ASAN_", # address sanitizer symbolizer path and settings
|
"ASAN_", # address sanitizer symbolizer path and settings
|
||||||
|
|||||||
Reference in New Issue
Block a user