veekays / iphonedevonlinux

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

Cannot Compile Ubuntu 9.10 Karmic #25

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Cannot compile the toolchain as cctools complains about missing printf and
so forth. Below is an example of the sort of messages im getting.

/home/will/ipod/3.1.2/toolchain/src/cctools/ld64/src/ld.cpp:3787:  
instantiated from here
/home/will/ipod/3.1.2/toolchain/src/cctools/ld64/src/MachOWriterExecutable.hpp:2
222:
error: ‘sprintf’ was not declared in this scope
/home/will/ipod/3.1.2/toolchain/src/cctools/ld64/src/MachOWriterExecutable.hpp:
In member function ‘void mach_o::executable::Writer<A>::setLocalNlist(const
ObjectFile::Atom*, macho_nlist<typename A::P>*) [with A = x86]’:
/home/will/ipod/3.1.2/toolchain/src/cctools/ld64/src/MachOWriterExecutable.hpp:2
323:
  instantiated from ‘void
mach_o::executable::Writer<A>::setNlistRange(std::vector<ObjectFile::Atom*,
std::allocator<ObjectFile::Atom*> >&, uint32_t, uint32_t) [with A = x86]’
/home/will/ipod/3.1.2/toolchain/src/cctools/ld64/src/MachOWriterExecutable.hpp:2
367:
  instantiated from ‘void mach_o::executable::Writer<A>::buildSymbolTable()
[with A = x86]’
/home/will/ipod/3.1.2/toolchain/src/cctools/ld64/src/MachOWriterExecutable.hpp:2
077:
  instantiated from ‘void mach_o::executable::Writer<A>::buildLinkEdit()
[with A = x86]’
/home/will/ipod/3.1.2/toolchain/src/cctools/ld64/src/MachOWriterExecutable.hpp:2
059:
  instantiated from ‘uint64_t
mach_o::executable::Writer<A>::write(std::vector<ObjectFile::Atom*,
std::allocator<ObjectFile::Atom*> >&, std::vector<ObjectFile::Reader::Stab,
std::allocator<ObjectFile::Reader::Stab> >&, ObjectFile::Atom*,
ObjectFile::Atom*, ObjectFile::Atom*, bool, bool,
ObjectFile::Reader::CpuConstraint, bool, bool) [with A = x86]’
/home/will/ipod/3.1.2/toolchain/src/cctools/ld64/src/ld.cpp:3787:  
instantiated from here
/home/will/ipod/3.1.2/toolchain/src/cctools/ld64/src/MachOWriterExecutable.hpp:2
222:
error: ‘sprintf’ was not declared in this scope
/home/will/ipod/3.1.2/toolchain/src/cctools/ld64/src/MachOWriterExecutable.hpp:
In member function ‘void mach_o::executable::Writer<A>::setLocalNlist(const
ObjectFile::Atom*, macho_nlist<typename A::P>*) [with A = x86_64]’:
/home/will/ipod/3.1.2/toolchain/src/cctools/ld64/src/MachOWriterExecutable.hpp:2
323:
  instantiated from ‘void
mach_o::executable::Writer<A>::setNlistRange(std::vector<ObjectFile::Atom*,
std::allocator<ObjectFile::Atom*> >&, uint32_t, uint32_t) [with A = x86_64]’
/home/will/ipod/3.1.2/toolchain/src/cctools/ld64/src/MachOWriterExecutable.hpp:2
367:
  instantiated from ‘void mach_o::executable::Writer<A>::buildSymbolTable()
[with A = x86_64]’
/home/will/ipod/3.1.2/toolchain/src/cctools/ld64/src/MachOWriterExecutable.hpp:2
077:
  instantiated from ‘void mach_o::executable::Writer<A>::buildLinkEdit()
[with A = x86_64]’
/home/will/ipod/3.1.2/toolchain/src/cctools/ld64/src/MachOWriterExecutable.hpp:2
059:
  instantiated from ‘uint64_t
mach_o::executable::Writer<A>::write(std::vector<ObjectFile::Atom*,
std::allocator<ObjectFile::Atom*> >&, std::vector<ObjectFile::Reader::Stab,
std::allocator<ObjectFile::Reader::Stab> >&, ObjectFile::Atom*,
ObjectFile::Atom*, ObjectFile::Atom*, bool, bool,
ObjectFile::Reader::CpuConstraint, bool, bool) [with A = x86_64]’
/home/will/ipod/3.1.2/toolchain/src/cctools/ld64/src/ld.cpp:3787:  
instantiated from here
/home/will/ipod/3.1.2/toolchain/src/cctools/ld64/src/MachOWriterExecutable.hpp:2
222:
error: ‘sprintf’ was not declared in this scope
make[1]: *** [ld.o] Error 1
make[1]: Leaving directory
`/home/will/ipod/3.1.2/toolchain/bld/cctools-iphone/ld64'

This repeats for 100's of lines. Also its compiling ld64 and im not using a
64 bit system. So i replace --enable-ld64 with --disable-ld64 and remove
the lines making ld64 the default. Now cctools compiles. Now when i try to
compile gcc it runs for around 10 minutes and then i get this error:

/home/will/ipod/3.1.2/toolchain/pre/bin/arm-apple-darwin9-ld:
/home/will/ipod/3.1.2/toolchain/sys/usr/lib/libc.dylib unknown flags (type)
of section 4 (__TEXT,__dof_magmalloc) in load command 0
collect2: ld returned 1 exit status
make[3]: *** [libgcc_s.dylib] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory
`/home/will/ipod/3.1.2/toolchain/bld/gcc-4.2-iphone/gcc'
make[2]: *** [stmp-multilib] Error 2
rm fsf-funding.pod gcov.pod gfdl.pod cpp.pod gpl.pod gcc.pod
make[2]: Leaving directory
`/home/will/ipod/3.1.2/toolchain/bld/gcc-4.2-iphone/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/home/will/ipod/3.1.2/toolchain/bld/gcc-4.2-iphone'
make: *** [all] Error 2

I have looked around everywhere but cannot find a solution please help.

Original issue reported on code.google.com by willh1...@gmail.com on 3 Dec 2009 at 8:25

GoogleCodeExporter commented 8 years ago
Also forgot to add im using 3.1.2 with 3.1.2 iPhone 3G firmware and GCC is:

will@will-desktop-ubuntu:~/ipod/3.1.2$ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.4-5ubuntu1'
--with-bugurl=file:///usr/share/doc/gcc-4.3/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 --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr
--enable-targets=all --with-tune=generic --enable-checking=release
--build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.3.4 (Ubuntu 4.3.4-5ubuntu1)

Original comment by willh1...@gmail.com on 3 Dec 2009 at 8:26

GoogleCodeExporter commented 8 years ago
/home/will/ipod/3.1.2/toolchain/src/cctools/ld64/src/MachOWriterExecutable.hpp:2
222:
error: ‘sprintf’ was not declared in this scope

you need to add the stdio header file to MachOWriterExecutable.hpp. I 
succesfully
compiled the toolchain on ubuntu karmic and found a lot of errors like those 
mostly
"stderr was not declared","sprintf was not declared",etc. I solved all of them 
by
including header files needed.

Original comment by diegoal...@gmail.com on 3 Dec 2009 at 9:41

GoogleCodeExporter commented 8 years ago
I just don't feel like trudging through lots of files and inserting headers. 
I've
downgraded to 9.04 and it compiled perfectly so this is obviously a bug to do 
with
9.10 packages.

Original comment by willh1...@gmail.com on 3 Dec 2009 at 10:29

GoogleCodeExporter commented 8 years ago
Ubuntu Karmic uses gcc 4.4 by default - and that won't work. In toolchain.sh, 
you can
change

 CFLAGS="-m32" LDFLAGS="-m32" "${CCTOOLS_DIR}"/configure \
         --target="${TARGET}" \
         --prefix="$PREFIX" \
         --enable-ld64

to

 CFLAGS="-m32" LDFLAGS="-m32" CC="gcc-4.3" CXX="g++-4.3" "${CCTOOLS_DIR}"/configure \
         --target="${TARGET}" \
         --prefix="$PREFIX" \
         --enable-ld64

That worked for me.

Original comment by zla...@gmail.com on 19 Feb 2010 at 1:04

GoogleCodeExporter commented 8 years ago
My solution on Ubuntu 10.04 was to add these 2 lines

#include <stdio.h>
#include <stdlib.h> 

to these 4 files:

/home/user/Projects/iphone/toolchain/toolchain/src/cctools/ld64/src/MachOReaderD
ylib.hpp
/home/user/Projects/iphone/toolchain/toolchain/src/cctools/ld64/src/MachOWriterE
xecutable.hpp
/home/user/Projects/iphone/toolchain/toolchain/src/cctools/ld64/src/MachOReaderR
elocatable.hpp
/home/user/Projects/iphone/toolchain/toolchain/src/cctools/ld64/src/Options.cpp

Afterwards, the toolchain compiled without complaints.

Original comment by michael....@googlemail.com on 24 May 2010 at 9:50