|
|
|
@ -384,16 +384,17 @@ class CLikeCompiler: |
|
|
|
|
# Select a CRT if needed since we're linking |
|
|
|
|
if mode == 'link': |
|
|
|
|
args += self.get_linker_debug_crt_args() |
|
|
|
|
if mode in {'compile', 'preprocess'}: |
|
|
|
|
# Add CFLAGS/CXXFLAGS/OBJCFLAGS/OBJCXXFLAGS and CPPFLAGS from the env |
|
|
|
|
sys_args = env.coredata.get_external_args(self.for_machine, self.language) |
|
|
|
|
# Apparently it is a thing to inject linker flags both |
|
|
|
|
# via CFLAGS _and_ LDFLAGS, even though the former are |
|
|
|
|
# also used during linking. These flags can break |
|
|
|
|
# argument checks. Thanks, Autotools. |
|
|
|
|
cleaned_sys_args = self.remove_linkerlike_args(sys_args) |
|
|
|
|
args += cleaned_sys_args |
|
|
|
|
elif mode == 'link': |
|
|
|
|
|
|
|
|
|
# Add CFLAGS/CXXFLAGS/OBJCFLAGS/OBJCXXFLAGS and CPPFLAGS from the env |
|
|
|
|
sys_args = env.coredata.get_external_args(self.for_machine, self.language) |
|
|
|
|
# Apparently it is a thing to inject linker flags both |
|
|
|
|
# via CFLAGS _and_ LDFLAGS, even though the former are |
|
|
|
|
# also used during linking. These flags can break |
|
|
|
|
# argument checks. Thanks, Autotools. |
|
|
|
|
cleaned_sys_args = self.remove_linkerlike_args(sys_args) |
|
|
|
|
args += cleaned_sys_args |
|
|
|
|
|
|
|
|
|
if mode == 'link': |
|
|
|
|
# Add LDFLAGS from the env |
|
|
|
|
args += env.coredata.get_external_link_args(self.for_machine, self.language) |
|
|
|
|
|
|
|
|
|