source: trunk/source/lisp-kernel/darwinx8664/Makefile @ 12601

Last change on this file since 12601 was 12601, checked in by gb, 10 years ago

darwinx8664/Makefile: Don't set DARWIN_GS_HACK in m4flags/cdefines.

Do set the new conditional TCR_IN_GPR.

m4macros.m4: equate_if_defined TCR_IN_GPR.

x86-asmutils64.s: move some empty functions around, to keep Apple's

Piece Of Crap linker from getting confused.

x86-constant64.s: use %r11/%save3 for TCR if TCR_IN_GPR is defined

(not just on Win64).

x86-exceptions.c: allocation sequence instructions conditionalized on

TCR_IN_GPR, not on WINDOWS. (Todo: check to ensure that opcodes are
correct.)

x86-spentry64.s,x86-subprims64.s: conditionalize on TCR_IN_GPR.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
1#
2#   Copyright (C) 2005 Clozure Associates and contributors.
3#   This file is part of OpenMCL. 
4#
5#   OpenMCL is licensed under the terms of the Lisp Lesser GNU Public
6#   License , known as the LLGPL and distributed with OpenMCL as the
7#   file "LICENSE".  The LLGPL consists of a preamble and the LGPL,
8#   which is distributed with OpenMCL as the file "LGPL".  Where these
9#   conflict, the preamble takes precedence. 
10#
11#   OpenMCL is referenced in the preamble as the "LIBRARY."
12#
13#   The LLGPL is also available online at
14#   http://opensource.franz.com/preamble.html
15
16
17
18
19MDYNAMIC_NO_PIC = $(shell ($(CC) --help -v 2>&1 | grep -q -e "-mdynamic-no-pic") && /bin/echo "-mdynamic-no-pic")
20
21
22VPATH = ..
23RM = /bin/rm
24LD = ld
25CC=gcc-4.0
26
27### Current ld64 bugs include the claim that 0x1000 isn't a power of 2.
28### Gosh.  I always thought that it was.  Go know, right ?
29LDFLAGS = -macosx_version_min 10.4 -arch x86_64 -dynamic  -o $@ -e start -pagezero_size 0x11000 -seg1addr 0x00011000
30
31
32AS = as
33M4 = gm4
34###
35### DARWIN_GS_HACK enables some awful, dangerous, and slow workarounds
36### for the fact that early versions of x86-64 Darwin don't provide
37### working mechanisms for threads to address thread-local-data
38### relative to a spare segment register.  We instead use the
39### undocumented mechanism which the pthreads library uses to
40### keep pthread data in %gs, and switch %gs between pthread data
41### when running foreign code and lisp tcr data when running lisp
42### code.  Hopefully, we won't have to do this for very long.
43###
44### (Things like i386_set_ldt() are defined, but not implemented
45### correctly on the libc side and not implemented at all on the
46### Mach kernel side.)
47###
48### Apple never
49M4FLAGS = -DDARWIN -DX86 -DX8664 -DTCR_IN_GPR
50ASFLAGS = -arch x86_64 -g
51CDEFINES = -DDARWIN -DX86 -DX8664 -DTCR_IN_GPR
52CDEBUG = -g
53COPT = -O2
54
55.s.o:
56        $(M4) $(M4FLAGS) -I../ $< | $(AS) $(ASFLAGS) -o $@
57.c.o:
58        $(CC) -c $< -arch x86_64 -m64 $(CDEFINES) $(CDEBUG) $(COPT) $(MDYNAMIC_NO_PIC) -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -o $@
59
60SPOBJ = x86-spjump64.o x86-spentry64.o x86-subprims64.o
61ASMOBJ = x86-asmutils64.o imports.o
62
63COBJ  = pmcl-kernel.o gc-common.o x86-gc.o bits.o  x86-exceptions.o \
64        thread_manager.o lisp-debug.o image.o memory.o unix-calls.o
65
66DEBUGOBJ = lispdcmd.o plprint.o plsym.o xlbt.o x86_print.o
67KERNELOBJ= imports.o $(COBJ) x86-asmutils64.o
68
69SPINC = lisp.s m4macros.m4 x86-constants.s x86-macros.s errors.s x86-uuo.s \
70        x86-constants64.s
71
72CHEADERS = area.h bits.h x86-constants.h lisp-errors.h gc.h lisp.h \
73        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
74        Threads.h lisptypes.h x86-constants64.h x86-exceptions.h
75
76# Subprims linked into the kernel ?
77# Yes:
78
79KSPOBJ= $(SPOBJ)
80all:    ../../dx86cl64
81
82
83# No:
84
85# KSPOBJ=
86
87OSEARLYLIBS = -lcrt1.o
88OSLATELIBS = -lSystem
89
90OSMIDDLELIBS = 
91
92
93OSLIBS = $(OSEARLYLIBS) $(OSMIDDLELIBS) $(OSLATELIBS)
94
95../../dx86cl64:  $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) Makefile
96        $(LD) $(LDFLAGS) $(KSPOBJ) $(KERNELOBJ)  $(DEBUGOBJ) $(OSLIBS)
97
98
99$(SPOBJ): $(SPINC)
100$(ASMOBJ): $(SPINC)
101$(COBJ): $(CHEADERS)
102$(DEBUGOBJ): $(CHEADERS) lispdcmd.h
103
104
105thread_manager.o: thread_manager.c
106
107cclean:
108        $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../dx86cl64
109
110# Some earlier versions of this Makefile built "subprims_r.o". 
111# (That file is now defunct.)
112clean:  cclean
113        $(RM) -f $(SPOBJ) $(KSPOBJ) subprims_r.o
114
115strip:  ../../dx86cl64
116        strip -s retain ../../dx86cl64
Note: See TracBrowser for help on using the repository browser.