Force the locale when executing ld gold
authorSylvestre Ledru <sylvestre@debian.org>
Mon, 31 Aug 2015 07:10:05 +0000 (07:10 +0000)
committerSylvestre Ledru <sylvestre@debian.org>
Mon, 31 Aug 2015 07:10:05 +0000 (07:10 +0000)
Summary:
If run with other locales (like French),
the decode operation might fail

Reviewers: rafael

Differential Revision: http://reviews.llvm.org/D12432

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246421 91177308-0d34-0410-b5e6-96231b3b80d8

test/lit.cfg

index 38a2ec20ec8d6b4f4b61edd70a32f44bc5aff0e2..70a14a7648f5720888c3face1619429f3c21c877 100644 (file)
@@ -353,7 +353,7 @@ def have_ld_plugin_support():
     if not os.path.exists(os.path.join(config.llvm_shlib_dir, 'LLVMgold.so')):
         return False
 
-    ld_cmd = subprocess.Popen([config.gold_executable, '--help'], stdout = subprocess.PIPE)
+    ld_cmd = subprocess.Popen([config.gold_executable, '--help'], stdout = subprocess.PIPE, env={'LANG': 'C'})
     ld_out = ld_cmd.stdout.read().decode()
     ld_cmd.wait()
 
@@ -374,7 +374,7 @@ def have_ld_plugin_support():
     if 'elf32ppc' in emulations:
         config.available_features.add('ld_emu_elf32ppc')
 
-    ld_version = subprocess.Popen([config.gold_executable, '--version'], stdout = subprocess.PIPE)
+    ld_version = subprocess.Popen([config.gold_executable, '--version'], stdout = subprocess.PIPE, env={'LANG': 'C'})
     if not 'GNU gold' in ld_version.stdout.read().decode():
         return False
     ld_version.wait()