source: trunk/source/lisp-kernel/linuxppc/Makefile @ 11580

Last change on this file since 11580 was 11580, checked in by gb, 12 years ago

Set executable_start to 64K (not 4K). Some Linux kernels get upset
by the presence of code < 64K, and only calm down if the vm.mmap_min_addr
sysctl variable is set to 0. If we move code out of the low 64K (and
remap_spjump() at startup), the sysctl variable can be set to 4K, which
offers some protection against theoretical exploits.

Disable format warnings.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 KB
Line 
1#
2#   Copyright (C) 1994-2001 Digitool, Inc
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
17VPATH = ../
18RM = /bin/rm
19# Versions of GNU as >= 2.9.1 all seem to work
20# AS = gas-2.9.1
21AS = as
22M4 = m4
23ASFLAGS = -mregnames -mppc32 -maltivec
24M4FLAGS = -DLINUX -DPPC
25CDEFINES = -DLINUX -DPPC -D_REENTRANT -D_GNU_SOURCE
26CDEBUG = -g
27COPT = -O2
28# Once in a while, -Wformat says something useful.  The odds are against that,
29# however.
30WFORMAT = -Wno-format
31
32# If the linker supports a "--hash-style=" option, use traditional
33# Sysv hash tables.  (If it doesn't support that option, assume
34# that traditional hash tables will be used by default.)
35ld_has_hash_style = $(shell $(LD) --help | grep "hash-style=")
36ifeq ($(ld_has_hash_style),)
37HASH_STYLE=
38else
39HASH_STYLE="-Wl,--hash-style=sysv"
40endif
41
42# The only version of GCC I have that supports both ppc32 and ppc64
43# compilation uses the -m32 option to target ppc32.  This may not be
44# definitive; there seem to be a bewildering array of similar options
45# in other GCC versions.  It's assumed here that if "-m32" is recognized,
46# it's required as well.
47
48PPC32 = $(shell ($(CC) --help -v 2>&1 | grep -q -e "-m32 ") && /bin/echo "-m32")
49
50# Likewise, some versions of GAS may need a "-a32" flag, to force the
51# output file to be 32-bit compatible.
52
53A32 = $(shell ($(AS) --help -v 2>&1 | grep -q -e "-a32") && /bin/echo "-a32")
54
55.s.o:
56        $(M4) $(M4FLAGS) -I../ $< | $(AS) $(A32) $(ASFLAGS) -o $@
57.c.o:
58        $(CC) -c $< $(CDEFINES) $(CDEBUG) $(COPT) $(WFORMAT) $(PPC32) -o $@
59
60SPOBJ = pad.o ppc-spjump.o ppc-spentry.o ppc-subprims.o
61ASMOBJ = ppc-asmutils.o imports.o
62
63COBJ  = pmcl-kernel.o gc-common.o ppc-gc.o bits.o  ppc-exceptions.o \
64        image.o thread_manager.o lisp-debug.o memory.o unix-calls.o
65
66DEBUGOBJ = lispdcmd.o plprint.o plsym.o plbt.o ppc_print.o
67KERNELOBJ= $(COBJ) ppc-asmutils.o  imports.o
68
69SPINC = lisp.s m4macros.m4 ppc-constants.s ppc-macros.s errors.s ppc-uuo.s ppc-constants32.s
70
71CHEADERS = area.h bits.h ppc-constants.h lisp-errors.h gc.h lisp.h \
72        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
73        Threads.h ppc-constants32.h ppc-exceptions.h
74
75# Subprims linked into the kernel ?
76# Yes:
77
78KSPOBJ = $(SPOBJ)
79all:    ../../ppccl
80
81
82# No:
83
84# KSPOBJ=
85# all:  ../../ppccl ../../subprims.so
86
87OSLIBS = -ldl -lm -lpthread
88
89
90../../ppccl:    $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ)
91        $(CC) $(PPC32) $(CDEBUG)  -Wl,--export-dynamic $(HASH_STYLE) -o $@ -T ./elf32ppclinux.x $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) $(OSLIBS)
92
93
94$(SPOBJ): $(SPINC)
95$(ASMOBJ): $(SPINC)
96$(COBJ): $(CHEADERS)
97$(DEBUGOBJ): $(CHEADERS) lispdcmd.h
98
99
100cclean:
101        $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../ppccl
102
103clean:  cclean
104        $(RM) -f $(SPOBJ)
105
106strip:  ../../ppccl
107        strip -g ../../ppccl
Note: See TracBrowser for help on using the repository browser.