c_build_helper: Split cc command line

Optionally the CC/HOSTCC environment variable can hold the command to
invoke the C compiler, however this command can also contain extra
arguments, not only the binary name. In this particular case Python
was treating the whole value as a single binary name, and was trying
to execute as such (e.g. "cc -arg1 -arg2" instead of "cc" and the arguments
separately), which results in failure.

Split the compiler command into its components to invoke it correctly.

Signed-off-by: Gyorgy Sarvari <[email protected]>
This commit is contained in:
Gyorgy Sarvari
2026-04-23 08:54:02 +02:00
parent c6610dde67
commit 178e089683
+1 -1
View File
@@ -98,7 +98,7 @@ def compile_c_file(c_filename, exe_filename, include_dirs):
cc = os.getenv('HOSTCC', None)
if cc is None:
cc = os.getenv('CC', 'cc')
cmd = [cc]
cmd = cc.split()
proc = subprocess.Popen(cmd,
stdout=subprocess.DEVNULL,