davilla / atv-bootloader

Automatically exported from code.google.com/p/atv-bootloader
GNU General Public License v2.0
19 stars 10 forks source link

WIll not build on 10.7.3 #39

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. download current SVN
2. copied installed vmlinuz... and initrd... files from /boot on configured 
Ubuntu 12.04 partition into build folder, named files vmlinuz and initrd.gz
3. Had to alter makefile as such:

else
  CC  := /usr/bin/gcc-4.0

became:

else
  CC  := /usr/bin/gcc

4. run make

What is the expected output? What do you see instead?

I expect to get a custom mach_kernel file, instead I see:

bash-3.2# sudo make
/usr/bin/gcc -c -arch i386 -static -nostdlib -DASSEMBLER -o start.o -c start.s
/usr/bin/gcc -c -arch i386 -static -nostdlib -o vsprintf.o -c vsprintf.c
/usr/bin/gcc -c -arch i386 -static -nostdlib -o console.o -c console.c
/usr/bin/gcc -c -arch i386 -static -nostdlib -o utils.o -c utils.c
/usr/bin/gcc -c -arch i386 -static -nostdlib -o elilo_code.o -c elilo_code.c
/usr/bin/gcc -c -arch i386 -static -nostdlib -o darwin_code.o -c darwin_code.c
/usr/bin/gcc -c -arch i386 -static -nostdlib -o linux_code.o -c linux_code.c
/usr/bin/gcc -c -arch i386 -static -nostdlib -o boot_loader.o -c boot_loader.c
/usr/bin/ld -classic_linker -arch i386 -o mach_kernel start.o vsprintf.o 
console.o utils.o elilo_code.o darwin_code.o linux_code.o boot_loader.o 
vmlinuz.obj initrd.obj \
    -static \
    -force_cpusubtype_ALL \
    -e __start \
    -segalign 0x1000 \
    -segaddr __TEXT 0x2000000 \
    -sectalign __TEXT __text 0x1000 \
    -sectalign __DATA __common 0x1000 \
    -sectalign __DATA __bss 0x1000 \
    -sectcreate __PRELINK __text /dev/null \
    -sectcreate __PRELINK __symtab /dev/null \
    -sectcreate __PRELINK __info /dev/null
ld: warning: using ld_classic
/usr/bin/ld_classic: Undefined symbols:
___stack_chk_fail
___stack_chk_guard
___bzero

What version of the product are you using? On what operating system?
Using latest SVN checkout on Mac OS X 10.7.3, 10.7.4

Please provide any additional information below.

Original issue reported on code.google.com by zjdrinkw...@gmail.com on 24 Jul 2012 at 6:09

GoogleCodeExporter commented 9 years ago
Faced the same problem in 10.8. Guess it is due to lack of support for previous 
OS X versions (ATV is based on 10.4?) in latest Xcode.
I managed to build kernel in linux using this cross-compiler: 
http://biolpc22.york.ac.uk/pub/linux-mac-cross/ 

You have to put it into /opt and add include to gcc in Makefile:
  INC := /opt/mac/lib/gcc/i686-apple-darwin8/4.0.1/include
...
$(CC) -c -arch $(ARCH) -I$(INC) -static -nostdlib -o $@ -c $<

Original comment by dmi...@brigadirov.com on 14 Aug 2012 at 12:37