Remove kludge: use a fixup for (LAYOUT-OF NIL)
[sbcl.git] / base-target-features.lisp-expr
blobd6d603e599017081f7f718c9506b860ef22a6d50
1 ;;;; -*- Lisp -*-
3 ;;;; tags which are set during the build process and which end up in
4 ;;;; CL:*FEATURES* in the target SBCL, plus some comments about other
5 ;;;; CL:*FEATURES* tags which have special meaning to SBCL or which
6 ;;;; have a special conventional meaning
7 ;;;;
8 ;;;; Note that the recommended way to customize the features of a
9 ;;;; local build of SBCL is not to edit this file, but instead to
10 ;;;; tweak customize-target-features.lisp. (You must create this file
11 ;;;; first; it is not in the SBCL distribution, and is in fact
12 ;;;; explicitly excluded from the distribution in places like
13 ;;;; .cvsignore.) If you define a function in
14 ;;;; customize-target-features.lisp, it will be used to transform the
15 ;;;; target features list after it's read and before it's used. E.g.,
16 ;;;; you can use code like this:
17 ;;;;    (lambda (list)
18 ;;;;      (flet ((enable (x) (pushnew x list))
19 ;;;;             (disable (x) (setf list (remove x list))))
20 ;;;;        #+nil (enable :sb-show)
21 ;;;;        (enable :sb-after-xc-core)
22 ;;;;        #+nil (disable :sb-doc)
23 ;;;;        list))
24 ;;;; By thus editing a local file (one which is not in the source
25 ;;;; distribution, and which is in .cvsignore) your customizations
26 ;;;; will remain local even if you do things like "cvs update",
27 ;;;; will not show up if you try to submit a patch with "cvs diff",
28 ;;;; and might even stay out of the way if you use other non-CVS-based
29 ;;;; methods to upgrade the files or store your configuration.
31 ;;;; This software is part of the SBCL system. See the README file for
32 ;;;; more information.
33 ;;;;
34 ;;;; This software is derived from the CMU CL system, which was
35 ;;;; written at Carnegie Mellon University and released into the
36 ;;;; public domain. The software is in the public domain and is
37 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
38 ;;;; files for more information.
41  ;;
42  ;; features present in all builds
43  ;;
45  ;; our standard
46  :ansi-cl :common-lisp
47  ;; FIXME: Isn't there a :x3jsomething feature which we should set too?
48  ;; No. CLHS says ":x3j13 [...] A conforming implementation might or
49  ;; might not contain such a feature." -- CSR, 2002-02-21
51  ;; our dialect
52  :sbcl
54  ;; Douglas Thomas Crosher's conservative generational GC (the only one
55  ;; we currently support for X86).
56  ;; :gencgc used to be here; CSR moved it into
57  ;; local-target-features.lisp-expr via make-config.sh, as alpha,
58  ;; sparc and ppc ports don't currently support it. -- CSR, 2002-02-21
60  ;;
61  ;; features present in this particular build
62  ;;
64  ;; Setting this enables the compilation of documentation strings
65  ;; from the system sources into the target Lisp executable.
66  ;; Traditional Common Lisp folk will want this option set.
67  ;; I (WHN) made it optional because I came to Common Lisp from
68  ;; C++ through Scheme, so I'm accustomed to asking
69  ;; Emacs about things that I'm curious about instead of asking
70  ;; the executable I'm running.
71  :sb-doc
73  ;; Make more debugging information available (for debugging SBCL
74  ;; itself). If you aren't hacking or troubleshooting SBCL itself,
75  ;; you probably don't want this set.
76  ;;
77  ;; At least two varieties of debugging information are enabled by this
78  ;; option:
79  ;;   * SBCL is compiled with a higher level of OPTIMIZE DEBUG, so that
80  ;;     the debugger can tell more about the state of the system.
81  ;;   * Various code to print debugging messages, and similar debugging code,
82  ;;     is compiled only when this feature is present.
83  ;;
84  ;; Note that the extra information recorded by the compiler at
85  ;; this higher level of OPTIMIZE DEBUG includes the source location
86  ;; forms. In order for the debugger to use this information, it has to
87  ;; re-READ the source file. In an ordinary installation of SBCL, this
88  ;; re-READing may not work very well, for either of two reasons:
89  ;;   * The sources aren't present on the system in the same location that
90  ;;     they were on the system where SBCL was compiled.
91  ;;   * SBCL is using the standard readtable, without the added hackage
92  ;;     which allows it to handle things like target features.
93  ;; If you want to be able to use the extra debugging information,
94  ;; therefore, be sure to keep the sources around, and run with the
95  ;; readtable configured so that the system sources can be read.
96  ; :sb-show
98  ;; Build SBCL with the old CMU CL low level debugger, "ldb". In the
99  ;; ideal world you would not need this unless you are messing with
100  ;; SBCL at a very low level (e.g., trying to diagnose GC problems, or
101  ;; trying to debug assembly code for a port to a new CPU). However,
102  ;; experience shows that sooner or later everyone lose()'s, in which
103  ;; case SB-LDB can at least provide an informative backtrace.
104  :sb-ldb
106  ;; This isn't really a target Lisp feature at all, but controls
107  ;; whether the build process produces an after-xc.core file. This
108  ;; can be useful for shortening the edit/compile/debug cycle when
109  ;; you modify SBCL's own source code, as in slam.sh. Otherwise
110  ;; you don't need it.
111  ; :sb-after-xc-core
113  ;; Enable extra debugging output in the assem.lisp assembler/scheduler
114  ;; code. (This is the feature which was called :DEBUG in the
115  ;; original CMU CL code.)
116  ; :sb-show-assem
118  ;; Compile the C runtime with support for low-level debugging output
119  ;; through FSHOW and FSHOW_SIGNAL.  If enabled, this feature allows
120  ;; users to turn on such debugging output using environment variables at
121  ;; run-time.
122  ; :sb-qshow
124  ;; Setting this makes SBCL more "fluid", i.e. more amenable to
125  ;; modification at runtime, by suppressing various INLINE declarations,
126  ;; compiler macro definitions, FREEZE-TYPE declarations; and by
127  ;; suppressing various burning-our-ships-behind-us actions after
128  ;; initialization is complete; and so forth. This tends to clobber the
129  ;; performance of the system, so unless you have some special need for
130  ;; this when hacking SBCL itself, you don't want this set.
131  ; :sb-fluid
133  ;; Enable code for collecting statistics on usage of various operations,
134  ;; useful for performance tuning of the SBCL system itself. This code
135  ;; is probably pretty stale (having not been tested since the fork from
136  ;; base CMU CL) but might nonetheless be a useful starting point for
137  ;; anyone who wants to collect such statistics in the future.
138  ; :sb-dyncount
140  ;; Enable code for detecting concurrent accesses to the same hash-table
141  ;; in multiple threads. Note that this implementation is currently
142  ;; (2007-09-11) somewhat too eager: even though in the current implementation
143  ;; multiple readers are thread safe as long as there are no writers, this
144  ;; code will also trap multiple readers.
145  ; :sb-hash-table-debug
147  ;; Enabled automatically by make-config.sh for platforms which implement
148  ;; short vector SIMD intrinsics.
149  ;;
150  ; :sb-simd-pack
152  ;; Enabled automatically by make-config.sh for platforms which implement
153  ;; the %READ-CYCLE-COUNTER VOP. Can be disabled manually: affects TIME.
154  ;;
155  ;; FIXME: Should this be :SB-CYCLE-COUNTER instead? If so, then the same goes
156  ;; for :COMPARE-AND-SWAP-VOPS as well, and a bunch of others. Perhaps
157  ;; built-time convenience features like this should all live in eg. SB!INT
158  ;; instead?
159  ;;
160  ; :cycle-counter
162  ;; Allow the main dynamic space to be allocated anywhere
163  ;; by the OS kernel regardless of the configuration-time value
164  ;; of dynamic-space-start.
165  ;; The downside is the potential need for startup-time relocation.
166  ;; Enabled by default if supported
167  ; :relocatable-heap
169  ;; Build with support for an additional dynamic heap
170  ;; differing from the main dynamic heap in two ways:
171  ;;  1. it is guaranteed to reside below 4GB so that all pointers
172  ;;      into it fit in 32 bits. (Only an issue for >32 bit address space)
173  ;;  2. all objects therein are immovable, and space is reclaimed
174  ;;     by a mark-and-sweep collector.
175  ;; That combination of aspects potentially allows various efficiencies
176  ;; in code generation, especially for the x86-64 backend.
177  ;; The extra space has a fixed size which can only be changed by a rebuild,
178  ;; and out-of-space conditions are not easily preventable, so the space
179  ;; is sized rather generously to sidestep the issue.
180  ;; Additionally, it is assumed that for all objects in the immobile heap,
181  ;; speed of allocation of those objects is relatively unimportant.
182  ;; If unexpected performance regressions are observed,
183  ;; consider disabling this feature and reporting a bug.
184  ; :immobile-space
186  ;; Allocate most functions in the immobile space.
187  ;; Enabled by default if supported.
188  ;; The down-side of this feature is that the allocator is significantly
189  ;; slower than the allocator for movable code. If a particular application
190  ;; is performance-constrained by speed of creation of compiled functions
191  ;; (not including closures), the feature can be disabled.
192  ; :immobile-code
194  ;; Combine the layout pointer, instance-length, and widetag of INSTANCE
195  ;; into a single machine word. This represents a space savings of anywhere
196  ;; from 4% to 8% in typical applications. (Your mileage may vary).
197  ; :compact-instance-header
199  ;; Enabled automatically for platforms which implement complex arithmetic
200  ;; VOPs. Such platforms should implement real-complex, complex-real and
201  ;; complex-complex addition and subtractions (for complex-single-float
202  ;; and complex-double-float). They should also also implement complex-real
203  ;; and real-complex multiplication, complex-real division, and
204  ;; sb!vm::swap-complex, which swaps the real and imaginary parts.
205  ;; Finally, they should implement conjugate and complex-real, real-complex
206  ;; and complex-complex CL:= (complex-complex EQL would usually be a good
207  ;; idea).
208  ;;
209  ; :complex-float-vops
211  ;; Enabled automatically for platforms which implement VOPs for EQL
212  ;; of single and double floats.
213  ;;
214  ; :float-eql-vops
216  ;; Enabled automatically for platform that can implement inline constants.
217  ;;
218  ;; Such platform must implement 5 functions, in SB!VM:
219  ;; * canonicalize-inline-constant: converts a constant descriptor (list) into
220  ;;    a canonical description, to be used as a key in an EQUAL hash table
221  ;;    and to guide the generation of the constant itself.
222  ;; * inline-constant-value: given a canonical constant descriptor, computes
223  ;;    two values:
224  ;;     1. A label that will be used to emit the constant (usually a
225  ;;         sb!assem:label)
226  ;;     2. A value that will be returned to code generators referring to
227  ;;         the constant (on x86oids, an EA object)
228  ;; * sort-inline-constants: Receives a vector of unique constants;
229  ;;    the car of each entry is the constant descriptor, and the cdr the
230  ;;    corresponding label. Destructively returns a vector of constants
231  ;;    sorted in emission order. It could actually perform arbitrary
232  ;;    modifications to the vector, e.g. to fuse constants of different
233  ;;    size.
234  ;; * emit-constant-segment-header: receives the vector of sorted constants
235  ;;    and a flag (true iff speed > space). Expected to emit padding
236  ;;    of some sort between the ELSEWHERE segment and the constants, or some
237  ;;    metadata.
238  ;; * emit-inline-constant: receives a constant descriptor and its associated
239  ;;    label. Emits the constant.
240  ;;
241  ;; Implementing this features lets VOP generators use sb!c:register-inline-constant
242  ;; to get handles (as returned by sb!vm:inline-constant-value) from constant
243  ;; descriptors.
244  ;;
245  ; :inline-constants
247  ;; Peter Van Eynde's increase-bulletproofness code for CMU CL
248  ;;
249  ;; Some of the code which was #+high-security before the fork has now
250  ;; been either made unconditional, deleted, or rewritten into
251  ;; unrecognizability, but some remains. What remains is not maintained
252  ;; or tested in current SBCL, but I haven't gone out of my way to
253  ;; break it, either.
254  ;;
255  ; :high-security
256  ; :high-security-support
258  ;; low-level thread primitives support
259  ;;
260  ;; As of SBCL 1.0.33.26, threads are part of the default build on
261  ;; x86oid Linux. Other platforms that support them include
262  ;; x86oid Darwin, FreeBSD, and Solaris.
263  ; :sb-thread
265  ;; futex support
266  ;;
267  ;; While on linux we are able to use futexes for our locking
268  ;; primitive, on other platforms we don't have this luxury.
269  ;;
270  ; :sb-futex
272  ;; On some operating systems the FS segment register (used for SBCL's
273  ;; thread local storage) is not reliably preserved in signal
274  ;; handlers, so we need to restore its value from the pthread thread
275  ;; local storage.
276  ; :restore-fs-segment-register-from-tls
278  ;; On some x86oid operating systems (darwin) SIGTRAP is not reliably
279  ;; delivered for the INT3 instruction, so we use the UD2 instruction
280  ;; which generates SIGILL instead.
281  ; :ud2-breakpoints
283  ;; Support for detection of unportable code (when applied to the
284  ;; COMMON-LISP package, or SBCL-internal pacakges) or bad-neighbourly
285  ;; code (when applied to user-level packages), relating to material
286  ;; alteration to packages or to bindings in symbols in packages.
287  :sb-package-locks
289  ;; Support for the entirety of the 21-bit character space defined by
290  ;; the Unicode consortium, rather than the classical 8-bit ISO-8859-1
291  ;; character set.
292  :sb-unicode
294  ;; Support for a full evaluator that can execute all the CL special
295  ;; forms, as opposed to the traditional SBCL evaluator which called
296  ;; COMPILE for everything complicated.
297  :sb-eval
298  ;; Support for a different evaluator (interpreter) with improved performance.
299  ;; You can't have both.
300  ; :sb-fasteval
302  ;; Record source location information for variables, classes, conditions,
303  ;; packages, etc. Gives much better information on M-. in Slime, but
304  ;; increases core size by about 100kB.
305  :sb-source-locations
307  ;; Record xref data for SBCL internals. This can be rather useful for
308  ;; people who want to develop on SBCL itself because it'll make M-?
309  ;; (slime-edit-uses) work which lists call/expansion/etc. sites.
310  ;; It'll increase the core size by major 5-6mB, though.
311  ; :sb-xref-for-internals
313  ;; We support package local nicknames. No :sb-prefix here as we vainly
314  ;; believe our API is worth copying to other implementations as well.
315  ;; This doesn't affect the build at all, merely declares how things are.
316  :package-local-nicknames
318  ;; This affects the definition of a lot of things in bignum.lisp. It
319  ;; doesn't seem to be documented anywhere what systems it might apply
320  ;; to. It doesn't seem to be needed for X86 systems anyway.
321  ; :32x16-divide
323  ;; This is set in classic CMU CL, and presumably there it means
324  ;; that the floating point arithmetic implementation
325  ;; conforms to IEEE's standard. Here it definitely means that the
326  ;; floating point arithmetic implementation conforms to IEEE's standard.
327  ;; I (WHN 19990702) haven't tried to verify
328  ;; that it does conform, but it should at least mostly conform (because
329  ;; the underlying x86 hardware tries).
330  :ieee-floating-point
332  ;; CMU CL had, and we inherited, code to support 80-bit LONG-FLOAT on the x86
333  ;; architecture. Nothing has been done to actively destroy the long float
334  ;; support, but it hasn't been thoroughly maintained, and needs at least
335  ;; some maintenance before it will work. (E.g. the LONG-FLOAT-only parts of
336  ;; genesis are still implemented in terms of unportable CMU CL functions
337  ;; which are not longer available at genesis time in SBCL.) A deeper
338  ;; problem is SBCL's bootstrap process implicitly assumes that the
339  ;; cross-compilation host will be able to make the same distinctions
340  ;; between floating point types that it does. This assumption is
341  ;; fundamentally sleazy, even though in practice it's unlikely to break down
342  ;; w.r.t. distinguishing SINGLE-FLOAT from DOUBLE-FLOAT; it's much more
343  ;; likely to break down w.r.t. distinguishing DOUBLE-FLOAT from LONG-FLOAT.
344  ;; Still it's likely to be quite doable to get LONG-FLOAT support working
345  ;; again, if anyone's sufficiently motivated.
346  ; :long-float
348  ;; Some platforms don't use a 32-bit off_t by default, and thus can't
349  ;; handle files larger than 2GB. This feature will control whether
350  ;; we'll try to use platform-specific compilation options to enable a
351  ;; 64-bit off_t. The intent is for this feature to be automatically
352  ;; enabled by make-config.sh on platforms where it's needed and known
353  ;; to work, you shouldn't be enabling it manually. You might however
354  ;; want to disable it, if you need to pass file descriptors to
355  ;; foreign code that uses a 32-bit off_t.
356  ; :largefile
358  ;; Enabled automatically on platforms that have VOPs to compute the
359  ;; high half of a full word-by-word multiplication.  When disabled,
360  ;; SB-KERNEL:%MULTIPLY-HIGH is implemented in terms of
361  ;; SB-BIGNUM:%MULTIPLY.
362  ; :multiply-high-vops
364  ;; SBCL has optional support for zlib-based compressed core files.  Enable
365  ;; this feature to compile it in.  Obviously, doing so adds a dependency
366  ;; on zlib.
367  ; :sb-core-compression
369  ;; On certain thread-enabled platforms, synchronization between threads
370  ;; for the purpose of stopping and starting the world around GC can be
371  ;; performed using safepoints instead of signals.  Enable this feature
372  ;; to compile with safepoints and to use them for GC.
373  ;; (Replaces use of SIG_STOP_FOR_GC.)
374  ; :sb-safepoint
376  ;; When compiling with safepoints, the INTERRUPT-THREAD mechanism can
377  ;; also use safepoints to roll the target thread to a point at which it
378  ;; can be interrupted safely, instead of using a signal for this
379  ;; purpose.  Enable this feature in addition to :SB-SAFEPOINT to enable
380  ;; such behaviour.
381  ;; (Replaces use of SIGPIPE, except to wake up syscalls.)
382  ; :sb-thruption
384  ;; When compiling with safepoints and thruptions, the TIMER facility
385  ;; can replace its use of setitimer with a background thread.
386  ;; (Replaces use of SIGALRM.)
387  ; :sb-wtimer
389  ;; This platform implements VOPs for %ash/right, variable-width shift right
390  ; :ash-right-vops
392  ;;
393  ;; miscellaneous notes on other things which could have special significance
394  ;; in the *FEATURES* list
395  ;;
397  ;; Any target feature which affects binary compatibility of fasl files
398  ;; needs to be recorded in *FEATURES-POTENTIALLY-AFFECTING-FASL-FORMAT*
399  ;; (elsewhere).
401  ;; notes on the :NIL and :IGNORE features:
402  ;;
403  ;; #+NIL is used to comment out forms. Occasionally #+IGNORE is used
404  ;; for this too. So don't use :NIL or :IGNORE as the names of features..
406  ;; notes on :SB-XC and :SB-XC-HOST features (which aren't controlled by this
407  ;; file, but are instead temporarily pushed onto *FEATURES* or
408  ;; *TARGET-FEATURES* during some phases of cross-compilation):
409  ;;
410  ;; :SB-XC-HOST stands for "cross-compilation host" and is in *FEATURES*
411  ;; during the first phase of cross-compilation bootstrapping, when the
412  ;; host Lisp is being used to compile the cross-compiler.
413  ;;
414  ;; :SB-XC stands for "cross compiler", and is in *FEATURES* during the second
415  ;; phase of cross-compilation bootstrapping, when the cross-compiler is
416  ;; being used to create the first target Lisp.
418  ;; notes on the :SB-ASSEMBLING feature (which isn't controlled by
419  ;; this file):
420  ;;
421  ;; This is a flag for whether we're in the assembler. It's
422  ;; temporarily pushed onto the *FEATURES* list in the setup for
423  ;; the ASSEMBLE-FILE function. It would be a bad idea
424  ;; to use it as a name for a permanent feature.
426  ;; notes on local features (which are set automatically by the
427  ;; configuration script, and should not be set here unless you
428  ;; really, really know what you're doing):
429  ;;
430  ;; machine architecture features:
431  ;;   :x86
432  ;;      any Intel 386 or better, or compatibles like the AMD K6 or K7
433  ;;   :x86-64
434  ;;      any x86-64 CPU running in 64-bit mode
435  ;;   :alpha
436  ;;      DEC/Compaq Alpha CPU
437  ;;   :sparc
438  ;;      any Sun UltraSPARC (possibly also non-Ultras -- currently untested)
439  ;;   :ppc
440  ;;      any PowerPC CPU
441  ;;   :hppa
442  ;;      any PA-RISC CPU
443  ;;   :mips
444  ;;      any MIPS CPU (in little-endian mode with :little-endian)
445  ;;   :arm
446  ;;      an ARM CPU (details yet to be determined)
447  ;;   :arm64
448  ;;     an ARMv8 AArch64 CPU
449  ;; (CMU CL also had a :pentium feature, which affected the definition
450  ;; of some floating point vops. It was present but not enabled or
451  ;; documented in the CMU CL code that SBCL is derived from, and has
452  ;; now been moved to the backend-subfeatures mechanism.)
453  ;;
454  ;; properties derived from the machine architecture
455  ;;
456  ;;   :64-bit
457  ;;     means (= sb-vm:n-word-bits 64) currently true for x86-64 and arm64
458  ;;
459  ;;   :64-bit-registers
460  ;;     means (= sb-vm:n-machine-word-bits 64) currently true for alpha,
461  ;;     arm64, and x86-64.
462  ;;
463  ;;   :control-stack-grows-downward-not-upward
464  ;;     On the X86, the Lisp control stack grows downward. On the
465  ;;     other supported CPU architectures as of sbcl-0.7.1.40, the
466  ;;     system stack grows upward.
467  ;;   Note that there are other stack-related differences between the
468  ;;   X86 port and the other ports. E.g. on the X86, the Lisp control
469  ;;   stack coincides with the C stack, meaning that on the X86 there's
470  ;;   stuff on the control stack that the Lisp-level debugger doesn't
471  ;;   understand very well. As of sbcl-0.7.1.40 things like that are
472  ;;   just parameterized by #!+X86, but it'd probably be better to
473  ;;   use new flags like :CONTROL-STACK-CONTAINS-C-STACK.
474  ;;
475  ;;   :stack-allocatable-closures
476  ;;     The compiler can allocate dynamic-extent closures on stack.
477  ;;
478  ;;   :alien-callbacks
479  ;;     Alien callbacks have been implemented for this platform.
480  ;;
481  ;;   :compare-and-swap-vops
482  ;;     The backend implements compare-and-swap VOPs.
483  ;;
484  ;;   :memory-barrier-vops
485  ;;     Memory barriers (for multi-threaded synchronization) have been
486  ;;     implemented for this platform.
487  ;;
488  ;; operating system features:
489  ;;   :unix       = We're intended to run under some Unix-like OS. (This is not
490  ;;                 exclusive with the features which indicate which particular
491  ;;                 Unix-like OS we're intended to run under.)
492  ;;   :linux      = We're intended to run under some version of Linux.
493  ;;   :bsd        = We're intended to run under some version of BSD Unix. (This
494  ;;                 is not exclusive with the features which indicate which
495  ;;                 particular version of BSD we're intended to run under.)
496  ;;   :freebsd    = We're intended to run under FreeBSD.
497  ;;   :openbsd    = We're intended to run under OpenBSD.
498  ;;   :netbsd     = We're intended to run under NetBSD.
499  ;;   :dragonfly  = We're intended to run under DragonFly BSD.
500  ;;   :darwin     = We're intended to run under Darwin (including MacOS X).
501  ;;   :sunos      = We're intended to run under Solaris user environment
502  ;;                 with the SunOS kernel.
503  ;;   :hpux       = We're intended to run under HP-UX 11.11 or later
504  ;;   :osf1       = We're intended to run under Tru64 (aka Digital Unix
505  ;;                 aka OSF/1).
506  ;;   :win32      = We're intended to under some version of Microsoft Windows.
507  ;; (No others are supported by SBCL as of 1.0.8, but :hpux or :irix
508  ;; support could be ported from CMU CL if anyone is sufficiently
509  ;; motivated to do so.)