iPhone工具链问题

iPhone工具链问题,iphone,toolchain,Iphone,Toolchain,我在Ubuntu上建立了一个iPhone工具链。当我试图编译一些简单的东西时: int main () { return 4; } 它给了我这个: Undefined symbols: "_main", referenced from: _main$non_lazy_ptr in crt1.o ld: symbol(s) not found collect2: ld returned 1 exit status iPhone SDK中的crt1.o和。使用-save

我在Ubuntu上建立了一个iPhone工具链。当我试图编译一些简单的东西时:

int main () {
    return 4;
}
它给了我这个:

Undefined symbols:
  "_main", referenced from:
      _main$non_lazy_ptr in crt1.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
iPhone SDK中的crt1.o和。使用-save temps,我发现cc1命令没有输出。为什么呢?我的规格文件有问题吗

Using built-in specs.
Target: arm-apple-darwin10
Configured with: ../llvm-gcc-4.2-2.8.source/configure --target=arm-apple-darwin10 --prefix=/home/kevin/it --with-sysroot=/home/kevin/is --enable-languages=c,c++,objc,obj-c++ --with-as=/home/kevin/it/bin/arm-apple-darwin10-as --with-ld=/home/kevin/it/bin/arm-apple-darwin10-ld --enable-wchar_t=no --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658)
 /home/kevin/it/libexec/gcc/arm-apple-darwin10/4.2.1/cc1 -quiet -v -D__DYNAMIC__ test.c -miphoneos-version-min=3.0 -fPIC -fno-builtin-strcat -fno-builtin-strcpy -quiet -dumpbase test.c -auxbase test -version -o /tmp/ccyVHwhV.s
ignoring nonexistent directory "/home/kevin/is/usr/local/include"
ignoring nonexistent directory "/home/kevin/is/home/kevin/it/lib/gcc/arm-apple-darwin10/4.2.1/../../../../arm-apple-darwin10/include"
ignoring nonexistent directory "/home/kevin/is/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /home/kevin/it/lib/gcc/arm-apple-darwin10/4.2.1/include
 /home/kevin/is/usr/include
 /home/kevin/is/System/Library/Frameworks (framework directory)
End of search list.
GNU C version 4.2.1 (Based on Apple Inc. build 5658) (arm-apple-darwin10)
    compiled by GNU C version 4.4.5.
GGC heuristics: --param ggc-min-expand=150 --param ggc-min-heapsize=131072
Compiler executable checksum: 47b826ed9d7049d0b0acd26e928e4c9e
 /home/kevin/it/bin/arm-apple-darwin10-as -arch arm -force_cpusubtype_ALL -o /tmp/cck3gviA.o /tmp/ccyVHwhV.s
ERROR: ld.so: object '/etc/override.so' from /etc/ld.so.preload cannot be preloaded: ignored.
ERROR: ld.so: object '/etc/override.so' from /etc/ld.so.preload cannot be preloaded: ignored.
 /home/kevin/it/libexec/gcc/arm-apple-darwin10/4.2.1/collect2 -dynamic -arch arm -force_cpusubtype_ALL -iphoneos_version_min 3.0 -syslibroot /home/kevin/is -weak_reference_mismatches non-weak -o test -lcrt1.o -L/home/kevin/is/usr/lib -L/home/kevin/it/lib/gcc/arm-apple-darwin10/4.2.1 -L/home/kevin/it/lib/gcc/arm-apple-darwin10/4.2.1/../../../../arm-apple-darwin10/lib /tmp/cck3gviA.o -lgcc -lSystem
ERROR: ld.so: object '/etc/override.so' from /etc/ld.so.preload cannot be preloaded: ignored.
ld warning: unknown option to -iphoneos_version_min, not 1.x or 2.x
Undefined symbols:
  "_main", referenced from:
      _main$non_lazy_ptr in crt1.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
使用内置规格。
目标:arm-apple-darwin10
配置为:/LVVM GC-4.2-2.8源/配置-Talm=ARM- APPL-DARWIN 10--前缀=/home /凯文/IT-使用C++语言,C语言,C++,Objc,Obj-C++ + -AS=/home /凯文/IT/BI/ARM- APAR-DARWI10-10 AS -LD=/HON/凯文/IT/BI/ARM-APPL-DARWI10-LD-EnabyWaCaltht=NO - GXX包括DIR=/Ur/Ic/C++/4.2.1
线程模型:posix
gcc版本4.2.1(基于Apple Inc.build 5658)
/home/kevin/it/libexec/gcc/arm-apple-darwin10/4.2.1/cc1-quiet-v-D\uu DYNAMIC\uuuu test.c-miphoneos version min=3.0-fPIC-fno内置strcat-fno内置strcpy-quiet-dumpbase test.c-auxbase test-version-o/tmp/ccyVHwhV.s
忽略不存在的目录“/home/kevin/is/usr/local/include”
忽略不存在的目录“/home/kevin/is/home/kevin/it/lib/gcc/arm-apple-darwin10/4.2.1/../../../../../../arm-apple-darwin10/include”
忽略不存在的目录“/home/kevin/is/Library/Frameworks”
#包括“…”搜索从这里开始:
#包括搜索从这里开始:
/home/kevin/it/lib/gcc/arm-apple-darwin10/4.2.1/include
/home/kevin/is/usr/include
/home/kevin/is/System/Library/Frameworks(框架目录)
搜索列表结束。
GNU C版本4.2.1(基于Apple Inc.build 5658)(arm-Apple-darwin10)
由GNUC版本4.4.5编译。
GGC启发式:--param GGC min expand=150--param GGC min heapsize=131072
编译器可执行校验和:47b826ed9d7049d0b0acd26e928e4c9e
/home/kevin/it/bin/arm-apple-darwin10-as-arch-arm-force_cpusubtype_ALL-o/tmp/cck3gviA.o/tmp/ccyVHwhV.s
错误:无法预加载/etc/ld.so.preload中的ld.so:object'/etc/override.so'。
错误:无法预加载/etc/ld.so.preload中的ld.so:object'/etc/override.so'。
/home/kevin/it/libexec/gcc/arm-apple-darwin10/4.2.1/collect2-dynamic-arch-arm-force\u cpusubtype\u ALL-iphoneos\u version\u min 3.0-syslibroot/home/kevin/is-弱参考\u不匹配非弱-o测试-lcrt1.o-L/home/kevin/is/usr/lib-L/home/kevin/it/lib/gcc/arm-apple-darwin10/4.2.1-L/home/kevin/it/lib/gcc/arm-apple-darwin10/4.2.1/../../../../../../../arm-apple-darwin10/lib/tmp/cck3gviA.o-lgcc-lSystem
错误:无法预加载/etc/ld.so.preload中的ld.so:object'/etc/override.so'。
ld警告:未知选项-iphoneos_version_min,而不是1.x或2.x
未定义的符号:
“_main”,引用自:
_crt1.o中的主$non_lazy_ptr
ld:找不到符号
collect2:ld返回了1个退出状态

没关系,结果是我忘了同时编译llvm,我没有意识到llvm gcc显然需要llvm才能正常工作