Command line SCons:GCC-c

Command line SCons:GCC-c,command-line,gcc,arguments,scons,Command Line,Gcc,Arguments,Scons,我正在使用一个基于MinGW的GCC交叉编译器来编译一个使用SCons作为构建系统的项目 Python是本机2.6.2版本,不是专门为MinGW(或Cygwin)编译的 但是,我在构建时遇到了一个问题: F:/pedigree/compilers/bin/i686-elf-gcc -o build\src\user\applications\apptest\ma in.obj -c -std=gnu99 -march=i486 -fno-builtin -m32 -g0 -O3 -Wno-lon

我正在使用一个基于MinGW的GCC交叉编译器来编译一个使用SCons作为构建系统的项目

Python是本机2.6.2版本,不是专门为MinGW(或Cygwin)编译的

但是,我在构建时遇到了一个问题:

F:/pedigree/compilers/bin/i686-elf-gcc -o build\src\user\applications\apptest\ma
in.obj -c -std=gnu99 -march=i486 -fno-builtin -m32 -g0 -O3 -Wno-long-long -Wnest
ed-externs -Wall -Wextra -Wpointer-arith -Wcast-align -Wwrite-strings -Wno-long-
long -Wno-variadic-macros -Wno-unused -Wno-unused-variable -Wno-conversion -Wno-
format -Wno-empty-body -fno-stack-protector -DTHREADS -DDEBUGGER -DDEBUGGER_QWER
TY -DSERIAL_IS_FILE -DECHO_CONSOLE_TO_SERIAL -DKERNEL_NEEDS_ADDRESS_SPACE_SWITCH
 -DADDITIONAL_CHECKS -DBITS_32 -DKERNEL_STANDALONE -DVERBOSE_LINKER -DX86 -DX86_
COMMON -DLITTLE_ENDIAN -D__UD_STANDALONE__ -DINSTALLER -Isrc\subsys\posix\includ
e -Ibuild\src\user\applications\apptest -Isrc\user\applications\apptest src\user
\applications\apptest\main.c
f:/pedigree/compilers/bin/../lib/gcc/i686-elf/4.4.1/../../../../i686-elf/bin/ld.
exe: crt0.o: No such file: No such file or directory
如果我将-c添加到CFLAGS中,就会得到一个名为“main.obj-c”的编译对象(obj和-c之间有一个空格)


有人知道发生了什么吗?我能做些什么来解决这个问题吗?

该项目使用POSIX平台来强制执行Program和对象文件扩展名,但是SCons中的POSIX平台定义了一个函数“escape”:

当它逃避反斜杠时,它会对Windows环境造成严重破坏。更改为中立平台并显式指定扩展可以解决此问题

def escape(arg):
    "escape shell special characters"
    slash = '\\'
    special = '"$()'

    arg = string.replace(arg, slash, slash+slash)
    for c in special:
        arg = string.replace(arg, c, slash+c)

    return '"' + arg + '"'