File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -930,16 +930,25 @@ def available_platforms() -> List[Platform]:
930930 '&& python3 "${COMPILER_DIR}"/modern-asn64.py mips-linux-gnu-as "$OUTPUT".s -G0 -EB -mtune=vr4300 -march=vr4300 -mabi=32 -O1 --no-construct-floats -o "$OUTPUT"' ,
931931)
932932
933+ # Python alternative to the printf/xargs approach for quoted flags
934+ PYTHON_SHLEX = """[[ -n "${COMPILER_FLAGS}" ]] && mapfile -t FLAGS < <(python3 -c "import shlex,sys; print(*shlex.split(sys.argv[1]), sep='\\ n')" "${COMPILER_FLAGS}"); """
935+
933936EGCS1124 = GCCCompiler (
934937 id = "egcs_1.1.2-4" ,
935938 platform = N64 ,
936- cc = 'printf "%s" "${COMPILER_FLAGS}" | COMPILER_PATH="${COMPILER_DIR}" xargs -- "${COMPILER_DIR}"/mips-linux-gcc -c -G 0 -fno-PIC -mgp32 -mfp32 -mcpu=4300 -nostdinc "${INPUT}" -o "${OUTPUT}"' ,
939+ cc = (
940+ PYTHON_SHLEX
941+ + 'COMPILER_PATH="${COMPILER_DIR}" "${COMPILER_DIR}/mips-linux-gcc" -c -G 0 -fno-PIC -mgp32 -mfp32 -mcpu=4300 -nostdinc "${FLAGS[@]}" "${INPUT}" -o "${OUTPUT}"'
942+ ),
937943)
938944
939945EGCS1124C = GCCCompiler (
940946 id = "egcs_1.1.2-4c" ,
941947 platform = N64 ,
942- cc = 'printf "%s" "${COMPILER_FLAGS}" | COMPILER_PATH="${COMPILER_DIR}" xargs -- "${COMPILER_DIR}"/gcc -c -G 0 -fno-PIC -mgp32 -mfp32 -mcpu=4300 -nostdinc "${INPUT}" -o "${OUTPUT}"' ,
948+ cc = (
949+ PYTHON_SHLEX
950+ + 'COMPILER_PATH="${COMPILER_DIR}" "${COMPILER_DIR}/gcc" -c -G 0 -fno-PIC -mgp32 -mfp32 -mcpu=4300 -nostdinc "${FLAGS[@]}" "${INPUT}" -o "${OUTPUT}"'
951+ ),
943952)
944953
945954GCC440MIPS64ELF = GCCCompiler (
You can’t perform that action at this time.
0 commit comments