veekays / iphonedevonlinux

Automatically exported from code.google.com/p/iphonedevonlinux
0 stars 0 forks source link

Compiling gcc-4.2-iphone fails with gcc-4.4 and iPhone OS 3.1.2 #23

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I am attempting to build the toolchain using iPhone OS 3.1.2 and gcc-4.4.
Everything works fine (that's relative, I had to add a few includes) until
gcc-4.2-iphone which fails with the following error:

{{{
ld: library not found for -lc
collect2: ld returned 1 exit status
make[3]: *** [libgcc_s.dylib] Error 1
make[3]: Leaving directory
`/home/jamal/devel/iphone/toolchain/toolchain/bld/gcc-4.2-iphone/gcc'
make[2]: *** [stmp-multilib] Error 2
make[2]: Leaving directory
`/home/jamal/devel/iphone/toolchain/toolchain/bld/gcc-4.2-iphone/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory
`/home/jamal/devel/iphone/toolchain/toolchain/bld/gcc-4.2-iphone'
make: *** [all] Error 2
}}}

Here's some info on my setup:
{{{
$ gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
4.4.1-4ubuntu8' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared
--enable-multiarch --enable-linker-build-id --with-system-zlib
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4
--enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc
--disable-werror --with-arch-32=i486 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu8) 

$ uname -a
Linux jfhome 2.6.31-13-generic #43-Ubuntu SMP Fri Oct 9 17:41:46 UTC 2009
x86_64 GNU/Linux
}}}

Thanks for your help.

Original issue reported on code.google.com by jfanaian on 22 Oct 2009 at 1:11

GoogleCodeExporter commented 8 years ago
Guess the issue tracker doesn't follow the wiki styles, sorry!

Original comment by jfanaian on 22 Oct 2009 at 1:13

GoogleCodeExporter commented 8 years ago
Get the same problem at ubuntu 9.04 with gcc 4.3.3, 
can any one fix it?

Original comment by kvnk...@gmail.com on 23 Oct 2009 at 12:27

GoogleCodeExporter commented 8 years ago
I resolved *this* issue, although I got stuck somewhere else. Basically, the 
script
wasn't copying the Leopard SDK correctly. I'm not exactly sure why but all I 
did was
manually copy the usr/lib/ from within the MacOSX10.5.sdk to the sys directory. 

To do this, from the trunk directory (where toolchain.sh is):

cp -r sdks/MacOSX10.5.sdk/usr/lib/ toolchain/sys/usr/lib/

Original comment by jfanaian on 23 Oct 2009 at 4:19

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I get same errors after cp usr/lib to the system directory, attaching my 
make.log file.
There are many "/./" in the path names, so I guess maybe the changed we make to
toolchain.sh cases these errors.

Original comment by kvnk...@gmail.com on 24 Oct 2009 at 3:25

Attachments:

GoogleCodeExporter commented 8 years ago
Hi,

I did the cp -r suggested by jfanaian, but it wasn't enough. I finally got it 
to go
further after I copied everything from MacOSX10.5.sdk into toolchain/sys. After 
that,
I got into another issue: seems I had replaced some iPhone files by MacOSX 
files. So
I was getting linking errors, especially on libc.dylib.
libc.dylib points to libSystem.B.dylib so I replaced the libSystem.B files I 
had with
the ones from iPhoneOS3.1.2.sdk. Then the toolchain was built correctly.
Afterwards, when trying to build the Hellotoolchain app, it couldn't find 
UIKit. So I
copied that from the iPhoneOS3.1.2.sdk, and then did the same for 
CoreFoundation and
Foundation.
Now the Hellotoolchain.app is on my iPhone. But I'm pretty sure that if I use 
other
Frameworks I'll have problems.
I'll try to start from the beginning and copy the files from the SDKs and the
firmware manually. I think I should do it in these order: iPhone framework, than
iPhone SDK and finally MacOSX SDK without replacing files.

Hope all this will help you guys.

Original comment by fsaft...@gmail.com on 8 Nov 2009 at 8:56

GoogleCodeExporter commented 8 years ago
fsaftoiu, no need to copy or link anything just don't let the toolchain.sh 
clean the
build after you finish and then add this to your LDFLAGS:

LDFLAGS=  -isysroot ../../sdks/iPhoneOS3.1.2.sdk/ -lobjc 

Original comment by FreeLanc...@gmail.com on 15 Nov 2009 at 11:55