Проблемы с инструментальной цепочкой iPhone

Я создал цепочку инструментов для iPhone в Ubuntu на основе указаний на http://www.saurik.com/id/4. . Когда я пытаюсь скомпилировать что-то простое, например:

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

Это происходит как для crt1.o из iPhone SDK, так и для http://code.google.com/p/iphone-dev/wiki/Building . Используя -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

person gvl    schedule 22.02.2011    source источник


Ответы (1)


Неважно, оказалось, что я забыл скомпилировать llvm вместе с ним, и я не понимал, что llvm-gcc явно потребуется llvm для правильной работы.

person gvl    schedule 05.03.2011