Index: branches/meklort/i386/boot2/modules_support.s =================================================================== --- branches/meklort/i386/boot2/modules_support.s (revision 0) +++ branches/meklort/i386/boot2/modules_support.s (revision 686) @@ -0,0 +1,4 @@ +#include + +LABEL(dyld_stub_binder) + ret \ No newline at end of file Index: branches/meklort/i386/boot2/Makefile =================================================================== --- branches/meklort/i386/boot2/Makefile (revision 685) +++ branches/meklort/i386/boot2/Makefile (revision 686) @@ -19,8 +19,10 @@ SYMDIR = $(SYMROOT) LIBSADIR = ../libsa LIBSAIODIR = ../libsaio +KLIBCDIR = ../klibc + UTILDIR = ../util -INC = -I. -I.. -I$(SYMDIR) -I$(LIBSADIR) -I$(LIBSAIODIR) -I$(UTILDIR) +INC = -I. -I.. -I$(SYMDIR) -I$(LIBSADIR) -I$(LIBSAIODIR) -I$(UTILDIR) -I$(KLIBCDIR) ifneq "" "$(wildcard /bin/mkdirs)" MKDIRS = /bin/mkdirs else @@ -29,8 +31,8 @@ AS = as LD = gcc # LIBS= -lc_static -LIBS= -L$(SYMDIR) -lsaio -lsa -LIBDEP= $(SYMDIR)/libsaio.a $(SYMDIR)/libsa.a +LIBS= -L$(SYMDIR) -lsaio -lsa -lklibc +LIBDEP= $(SYMDIR)/libsaio.a $(SYMDIR)/libsa.a $(SYMDIR)/libklibc.a OTHER_FILES = @@ -39,14 +41,12 @@ # The ordering is important; # boot2.o must be first. -OBJS = boot2.o boot.o graphics.o drivers.o prompt.o options.o lzss.o mboot.o \ - ramdisk.o resume.o bmdecompress.o modules.o -# button.o browser.o scrollbar.o == NOTYET +OBJS = boot2.o boot.o modules.o modules_support.o UTILDIR = ../util SFILES = boot2.s -CFILES = boot.c graphics.c drivers.c prompt.c options.c mboot.c -HFILES = boot.h appleClut8.h mboot.h multiboot.h +CFILES = boot.c graphics.c drivers.c prompt.c options.c +HFILES = boot.h appleClut8.h multiboot.h OTHERFILES = Makefile ALLSRC = $(FOREIGNSRC) $(FOREIGNBIN) $(SFILES) $(CFILES) \ $(HFILES) $(OTHERFILES) @@ -74,18 +74,34 @@ @echo "\t[LD] boot.sys" @$(LD) -static -Wl,-preload -Wl,-segaddr,__INIT,$(BOOT2ADDR) \ -nostdlib -arch i386 -Wl,-segalign,20 \ - -o $(SYMROOT)/boot.sys $(filter %.o,$^) $(LIBS) -lcc_kext + -o $(SYMROOT)/boot.sys $(filter %.o,$^) $(LIBS) @make Symbols.dylib @echo "\t[LD] boot_embeded.sys" @$(LD) -static -Wl,-preload -Wl,-segaddr,__INIT,$(BOOT2ADDR) \ -nostdlib -arch i386 -Wl,-segalign,20 \ -Wl,-sectcreate,__DATA,__Symbols,$(SYMROOT)/Symbols.dylib \ - -o $(SYMROOT)/boot_embeded.sys $(filter %.o,$^) $(LIBS) -lcc_kext + -o $(SYMROOT)/boot_embeded.sys $(filter %.o,$^) $(LIBS) + @ld -arch i386 \ + -undefined dynamic_lookup \ + -dylib -read_only_relocs suppress \ + -S -x -Z -dead_strip_dylibs \ + -no_uuid \ + -final_output Symbols.dylib \ + -L$(OBJROOT)/ \ + -L$(OBJROOT)/../ \ + -L$(OBJROOT)/../*/ \ + -L$(SYMROOT)/ \ + $(filter %.o,$^) $(LIBS) \ + -weak_library $(SYMROOT)/boot.sys \ + -o $(SYMROOT)/Symbols_NOTE_linker_use_only.dylib + + + @make embed_symbols # this is done in a sub process after boot.sys exists so the strings are populated correctly - @##${RM} $(SYMROOT)/${SYMBOLS_MODULE} + @${RM} $(SYMROOT)/${SYMBOLS_MODULE} @##size $(SYMROOT)/boot.sys @ls -l $(SYMROOT)/boot @@ -105,7 +121,7 @@ @echo ******* Patching at $(PATCH_ADDR) ****** @stat -f%z $(SYMROOT)/boot | perl -ane "print pack('V',@F[0]);" | dd conv=notrunc of=${SYMROOT}/boot_embeded.sys bs=1 count=4 seek=$(PATCH_ADDR) &> /dev/null @echo "\t[MACHOCONV] boot_embeded" - @$(SYMROOT)/machOconv $(SYMROOT)/boot_embeded.sys $(SYMROOT)/boot_embeded + @$(SYMROOT)/machOconv $(SYMROOT)/boot_embeded.sys $(SYMROOT)/boot prompt.o: vers.h Index: branches/meklort/i386/modules/MakeInc.dir =================================================================== --- branches/meklort/i386/modules/MakeInc.dir (revision 685) +++ branches/meklort/i386/modules/MakeInc.dir (revision 686) @@ -27,7 +27,6 @@ @if [ -f "$(SYMROOT)/uClibc++.dylib" ]; then if [ x"$(shell nm $(OBJROOT)/*.o 2>/dev/null | grep " __Z")" == x"" ]; then mv $(SYMROOT)/uClibc++.dylib $(SYMROOT)/../uClibc++.dylib; fi; fi; @ld -arch i386 \ - -undefined dynamic_lookup \ -alias $(MODULE_START) start \ -dylib -read_only_relocs suppress \ -S -x -Z -dead_strip_dylibs \ @@ -42,6 +41,8 @@ -weak_library $(SYMROOT)/*.dylib \ -o $(SYMROOT)/$(MODULE_NAME).dylib + @cp -rf include/* ../module_includes/ &> /dev/null || true + @if [ -f "$(SYMROOT)/../uClibc++.dylib" ]; then if [ x"$(shell nm $(OBJROOT)/*.o 2>/dev/null | grep " __Z")" == x"" ]; then mv $(SYMROOT)/../uClibc++.dylib $(SYMROOT)/uClibc++.dylib; fi; fi; else @@ -51,7 +52,6 @@ @rm -rf $(SYMROOT)/$(MODULE_NAME).dylib #ensure module doesn't link with old version of self @echo "\t[LD] $(MODULE_NAME).dylib" @ld -arch i386 \ - -undefined dynamic_lookup \ -alias $(MODULE_START) start \ -dylib -read_only_relocs suppress \ -S -x -Z -dead_strip_dylibs \ @@ -64,15 +64,17 @@ -L$(SYMROOT)/ \ $(OBJROOT)/*.o \ -o $(SYMROOT)/$(MODULE_NAME).dylib + + @cp -rf include/* ../module_includes/ &> /dev/null || true endif %.o: %.c @echo "\t[CC] $<" - @$(CC) $(CPPFLAGS) $(CFLAGS) -I../include/ -D__KLIBC__ $(DEFINES) -c "$<" $(INC) -o "$(OBJROOT)/$@" + @$(CC) $(CPPFLAGS) $(CFLAGS) -I../include/ -Iinclude/ -I../module_includes/ -D__KLIBC__ $(DEFINES) -c "$<" $(INC) -o "$(OBJROOT)/$@" %.o: %.cpp @echo "\t[CPP] $<" - @$(CPP) $(CPPFLAGS) $(CFLAGS) -I../include/ -D__KLIBC__ $(DEFINES) -c "$<" $(INC) -o "$(OBJROOT)/$@" + @$(CPP) $(CPPFLAGS) $(CFLAGS) -I../include/ -Iinclude/ -I../module_includes/ -D__KLIBC__ $(DEFINES) -c "$<" $(INC) -o "$(OBJROOT)/$@"