Chameleon

Chameleon Commit Details

Date:2010-12-21 09:11:58 (13 years 4 months ago)
Author:Evan Lojewski
Commit:686
Parents: 685
Message:Module system update / makefile changes. Work in progress.
Changes:
A/branches/meklort/i386/boot2/modules_support.s
M/branches/meklort/i386/modules/MakeInc.dir
M/branches/meklort/i386/boot2/Makefile

File differences

branches/meklort/i386/boot2/modules_support.s
1
2
3
4
#include <architecture/i386/asm_help.h>
LABEL(dyld_stub_binder)
ret
branches/meklort/i386/boot2/Makefile
1919
2020
2121
22
23
2224
23
25
2426
2527
2628
......
2931
3032
3133
32
33
34
35
3436
3537
3638
......
3941
4042
4143
42
43
44
44
4545
4646
4747
48
49
48
49
5050
5151
5252
......
7474
7575
7676
77
77
7878
7979
8080
8181
8282
8383
84
84
8585
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
86102
87103
88
104
89105
90106
91107
......
105121
106122
107123
108
124
109125
110126
111127
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
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 =
# 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)
@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
@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
branches/meklort/i386/modules/MakeInc.dir
2727
2828
2929
30
3130
3231
3332
......
4241
4342
4443
44
45
4546
4647
4748
......
5152
5253
5354
54
5555
5656
5757
......
6464
6565
6666
67
68
6769
6870
6971
7072
71
73
7274
7375
7476
75
77
7678
7779
7880
@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 \
-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
@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 \
-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)/$@"

Archive Download the corresponding diff file

Revision: 686