1937452e888597126aafda5d69d84cac7265761c
[sbcl.git] / src / runtime / Config.x86-darwin
1 # -*- makefile -*- for the C-level run-time support for SBCL
2
3 # This software is part of the SBCL system. See the README file for
4 # more information.
5 #
6 # This software is derived from the CMU CL system, which was
7 # written at Carnegie Mellon University and released into the
8 # public domain. The software is in the public domain and is
9 # provided with absolutely no warranty. See the COPYING and CREDITS
10 # files for more information.
11
12 CFLAGS = -g -Wall -O2 -fdollars-in-identifiers
13 OS_SRC = bsd-os.c x86-bsd-os.c darwin-os.c x86-darwin-os.c ppc-darwin-dlshim.c x86-darwin-langinfo.c
14 OS_LIBS = -lSystem -lc -ldl
15 OS_OBJS = x86-darwin-rospace.o
16
17 CC = gcc
18
19 ASSEM_SRC = x86-assem.S ldso-stubs.S
20 ARCH_SRC = x86-arch.c
21
22 CPPFLAGS += -no-cpp-precomp
23
24 # KLUDGE: in OS X 10.3, Apple started putting the heap right where we
25 # expect our read-only space mapped. This hack causes the linker to
26 # place a zero-fill-on-demand segment in the same place and size as
27 # read-only-space, which is the only thing capable of keeping malloc
28 # out of this range.
29 LINKFLAGS += -dynamic `cat x86-darwin-link-flags` -twolevel_namespace -bind_at_load
30
31 GC_SRC = gencgc.c
32
33 OS_CLEAN_FILES += x86-darwin-mkrospace x86-darwin-fix-rospace x86-darwin-link-flags
34
35 x86-darwin-mkrospace: x86-darwin-mkrospace.c
36         $(CC) -g -Wall -pedantic -o $@ $<
37
38 x86-darwin-fix-rospace: x86-darwin-fix-rospace.c
39         $(CC) -g -Wall -pedantic -o $@ $<
40
41 x86-darwin-rospace.o x86-darwin-link-flags: x86-darwin-mkrospace
42         ./x86-darwin-mkrospace > x86-darwin-link-flags
43
44 .PHONY: after-grovel-headers
45
46 # Fix the sbcl runtime to avoid Panther placing the heap where
47 # it wants read only space (in the first 32 megabytes, where it
48 # can be absolute-branched to with BA.)  Must be done after 
49 # grovel-headers, because Apple's nm is broken.
50 after-grovel-headers: x86-darwin-fix-rospace
51         ./x86-darwin-fix-rospace
52
53 # Fortunatly make-target-1.sh does a make clean all the time.
54 # Otherwise we would have to make sure that sbcl gets rebuilt without
55 # the readonlyspace hack before groveling headers again.