[compiler-rt] 0541ce4 - [CRT][LIT] build the target_cflags for Popen properly

Jinsong Ji via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 19 08:40:34 PDT 2021


Author: Jinsong Ji
Date: 2021-08-19T15:39:53Z
New Revision: 0541ce4ef9cae2176dc80d32fd5225208f2059e3

URL: https://github.com/llvm/llvm-project/commit/0541ce4ef9cae2176dc80d32fd5225208f2059e3
DIFF: https://github.com/llvm/llvm-project/commit/0541ce4ef9cae2176dc80d32fd5225208f2059e3.diff

LOG: [CRT][LIT] build the target_cflags for Popen properly

We recently enabled crt for powerpc in
https://reviews.llvm.org/rGb7611ad0b16769d3bf172e84fa9296158f8f1910.

And we started to see some unexpected error message when running
check-runtimes.

eg:
https://lab.llvm.org/buildbot/#/builders/57/builds/9488/steps/6/logs/stdio
line 100 - 103:

"
clang-14: error: unknown argument: '-m64 -fno-function-sections'
clang-14: error: unknown argument: '-m64 -fno-function-sections'
clang-14: error: unknown argument: '-m64 -fno-function-sections'
clang-14: error: unknown argument: '-m64 -fno-function-sections'
"

Looks like we shouldn't strip the space at the beginning,
or else the command line passed to subprocess won't work well.

Reviewed By: phosek, MaskRay

Differential Revision: https://reviews.llvm.org/D108329

Added: 
    

Modified: 
    compiler-rt/test/crt/lit.cfg.py

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/crt/lit.cfg.py b/compiler-rt/test/crt/lit.cfg.py
index 68e7eda7d59ba..b4bbbfcf03064 100644
--- a/compiler-rt/test/crt/lit.cfg.py
+++ b/compiler-rt/test/crt/lit.cfg.py
@@ -23,8 +23,8 @@
 
 def get_library_path(file):
     cmd = subprocess.Popen([config.clang.strip(),
-                            config.target_cflags.strip(),
-                            '-print-file-name=%s' % file],
+                            '-print-file-name=%s' % file] +
+                           [config.target_cflags],
                            stdout=subprocess.PIPE,
                            env=config.environment,
                            universal_newlines=True)
@@ -39,8 +39,8 @@ def get_library_path(file):
 
 def get_libgcc_file_name():
     cmd = subprocess.Popen([config.clang.strip(),
-                            config.target_cflags.strip(),
-                            '-print-libgcc-file-name'],
+                            '-print-libgcc-file-name'] +
+                           [config.target_cflags],
                            stdout=subprocess.PIPE,
                            env=config.environment,
                            universal_newlines=True)


        


More information about the llvm-commits mailing list