@@ -1039,26 +1039,35 @@ def configure_substitutions(self):
1039
1039
if self .target_info .is_darwin ():
1040
1040
# Do not pass DYLD_LIBRARY_PATH to the compiler, linker, etc. as
1041
1041
# these tools are not meant to exercise the just-built libraries.
1042
- tool_env += 'env DYLD_LIBRARY_PATH=""'
1042
+ tool_env += 'env DYLD_LIBRARY_PATH="" '
1043
1043
1044
1044
sub = self .config .substitutions
1045
+ cxx_path = tool_env + pipes .quote (self .cxx .path )
1045
1046
# Configure compiler substitutions
1046
- sub .append (('%{cxx}' , '{} {}' . format ( tool_env , pipes . quote ( self . cxx . path )) ))
1047
+ sub .append (('%{cxx}' , cxx_path ))
1047
1048
sub .append (('%{libcxx_src_root}' , self .libcxx_src_root ))
1048
1049
# Configure flags substitutions
1049
- sub .append (('%{flags}' , ' ' .join (map (pipes .quote , self .cxx .flags ))))
1050
- sub .append (('%{compile_flags}' , ' ' .join (map (pipes .quote , self .cxx .compile_flags ))))
1051
- sub .append (('%{link_flags}' , ' ' .join (map (pipes .quote , self .cxx .link_flags ))))
1050
+ flags_str = ' ' .join ([pipes .quote (f ) for f in self .cxx .flags ])
1051
+ compile_flags_str = ' ' .join ([pipes .quote (f ) for f in self .cxx .compile_flags ])
1052
+ link_flags_str = ' ' .join ([pipes .quote (f ) for f in self .cxx .link_flags ])
1053
+ all_flags = '%s %s %s' % (flags_str , compile_flags_str , link_flags_str )
1054
+ sub .append (('%{flags}' , flags_str ))
1055
+ sub .append (('%{compile_flags}' , compile_flags_str ))
1056
+ sub .append (('%{link_flags}' , link_flags_str ))
1052
1057
if self .cxx .isVerifySupported ():
1053
- sub .append (('%{verify}' , ' ' .join (self .cxx .verify_flags )))
1054
- # Add compile and build shortcuts
1055
- sub .append (('%{compile}' , '%{cxx} -o %t.o %s -c %{flags} %{compile_flags}' ))
1056
- sub .append (('%{build}' , '%{cxx} -o %t.exe %s %{flags} %{compile_flags} %{link_flags}' ))
1058
+ verify_str = ' ' + ' ' .join (self .cxx .verify_flags ) + ' '
1059
+ sub .append (('%{verify}' , verify_str ))
1060
+ # Add compile and link shortcuts
1061
+ compile_str = (cxx_path + ' -o %t.o %s -c ' + flags_str
1062
+ + ' ' + compile_flags_str )
1063
+ build_str = cxx_path + ' -o %t.exe %s ' + all_flags
1057
1064
if self .cxx .use_modules :
1058
- sub .append (('%{build_module}' , '%{build}' ))
1065
+ sub .append (('%{build_module}' , build_str ))
1059
1066
elif self .cxx .modules_flags is not None :
1060
- sub .append (('%{build_module}' , '%{{build}} {}' .format (' ' .join (self .cxx .modules_flags ))))
1061
-
1067
+ modules_str = ' ' .join (self .cxx .modules_flags ) + ' '
1068
+ sub .append (('%{build_module}' , build_str + ' ' + modules_str ))
1069
+ sub .append (('%{compile}' , compile_str ))
1070
+ sub .append (('%{build}' , build_str ))
1062
1071
# Configure exec prefix substitutions.
1063
1072
# Configure run env substitution.
1064
1073
codesign_ident = self .get_lit_conf ('llvm_codesign_identity' , '' )
@@ -1068,11 +1077,13 @@ def configure_substitutions(self):
1068
1077
'--dependencies %%{file_dependencies} --env %s -- ' % \
1069
1078
(pipes .quote (sys .executable ), pipes .quote (run_py ),
1070
1079
codesign_ident , env_vars )
1080
+ run_str = exec_str + '%t.exe'
1071
1081
sub .append (('%{exec}' , exec_str ))
1072
- sub .append (('%{run}' , '%{exec} %t.exe' ))
1082
+ sub .append (('%{run}' , run_str ))
1073
1083
# Configure not program substitutions
1074
1084
not_py = os .path .join (self .libcxx_src_root , 'utils' , 'not.py' )
1075
- sub .append (('%{not}' , '{} {}' .format (pipes .quote (sys .executable ), pipes .quote (not_py ))))
1085
+ not_str = '%s %s ' % (pipes .quote (sys .executable ), pipes .quote (not_py ))
1086
+ sub .append (('%{not} ' , not_str ))
1076
1087
if self .get_lit_conf ('libcxx_gdb' ):
1077
1088
sub .append (('%{libcxx_gdb}' , self .get_lit_conf ('libcxx_gdb' )))
1078
1089
0 commit comments