Changeset 10994


Ignore:
Timestamp:
Oct 5, 2008, 6:51:50 PM (11 years ago)
Author:
gb
Message:

Build the kernel by invoking the linker directly, so that we have
some control over order of object files. Don't use pei-ia32.x as
a linker script; instead, rely on the fact that x86-spjump32 is
loaded first and that it reserves space for the static area.

After all of the fuss and bogosity about letting the address of
NIL vary on a per-platform basis, wind up putting NIL at the same
address it is on other x8632 platforms. (The problems had to do
with the fact that zero_bits() was clobbering malloc data structures,
not with where the kernel loaded in memory.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/win32/Makefile

    r10926 r10994  
    4242# it's not clear whether or not native win64 libraries use this
    4343# convention (and I'm not sure whether the Cygwin-hosted win64
    44 # toolchain behaves the same was as when hosted on Linux ...
     44# toolchain behaves the same way as when hosted on Linux ...
    4545# The compiler default seems to be to use them; if we want to
    4646# suppress their use, uncomment the following:
     
    5353        $(CC) -c $< $(CDEFINES) $(CDEBUG) $(COPT) ${SUPPRESS_UNDERSCORES} -mno-cygwin -o $@
    5454
    55 SPOBJ = pad.o x86-spjump32.o x86-spentry32.o x86-subprims32.o
     55# order matters: x86-spjump32.o must be first.
     56SPOBJ = x86-spjump32.o x86-spentry32.o x86-subprims32.o
    5657ASMOBJ = x86-asmutils32.o imports.o
    5758
     
    7374all:    ../../wx86cl.exe
    7475
     76# Order matters: libs that provide definitions must follow libs that
     77# reference them.  (It's legal to use -lfoo multiple times to try to
     78# work around this.)
     79OSLIBS = /usr/i686-pc-mingw32/lib/crt2.o -L/usr/lib/w32api \
     80        -L/usr/i686-pc-mingw32/lib  -lm -lpsapi -lws2_32  \
     81        -lmingw32 -lmoldname -lmingwex -lmsvcrt -lkernel32
     82LIBGCC = $(shell gcc -mno-cygwin -print-libgcc-file-name)
     83IMAGE_BASE =--image-base=0x10000
    7584
    76 OSLIBS = -L/usr/lib/w32api -lpsapi -lws2_32 -lkernel32
     85../../wx86cl.exe: $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) Makefile
     86        ld -o ../../wx86cl.exe  $(IMAGE_BASE) \
     87        $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) $(OSLIBS) $(LIBGCC)
    7788
    78 
    79 ../../wx86cl.exe:       $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) Makefile pei-ia32.x
    80         $(CC) -mno-cygwin -Wl,--image-base=0x10000 -Wl,-script=pei-ia32.x  -Wl,-L/usr/lib/w32api $(CDEBUG)  -Wl,--export-dynamic $(HASH_STYLE) -o $@ $(USE_LINK_MAP) $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) $(OSLIBS)
    8189
    8290
     
    8896
    8997cclean:
    90         $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../wx86cl64.exe
     98        $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../wx86cl.exe
    9199
    92100clean:  cclean
Note: See TracChangeset for help on using the changeset viewer.