Scope it to the outermost compilation-unit that didn't use :OVERRIDE.
It's still inadequate but at least it doesn't hold on to all function names
thereby causing garbage to be retained.
Rev e483e8c6ce claimed that to do this correctly, the loader must participate
in determining missed optimizations, perhaps by having %define-compiler-macro
examine which fdefns (now linkage cells) were looked up.
On top of all else, I can't see how make-genesis-2 could ever have reported
anything given that the entire cross-compiler state was reset at that point.
There were/are limitations with the mechanism, e.g. compiling "file_a"
which could have benefited from a compiler-macro in "file_b", then
quitting and retarting lisp before compiling "file_b" should somehow warn.
This is particularly a problem for sandboxed builds where each
build executor compiles 1 file.
To do it, info about missed optimizations has to be part of the fasl.
I was able to get either the existing regression tests to pass, or the
warnings from genesis to be right, but not both. I left it where
the tests pass, but I gave up for the moment on doing it right.
If nothing else, this rectifies the poor decision of using globaldb for
the compiler's dynamic data. It meant that COMPILE on the simplest of
functions could touch a ton of GC cards for no particularly good reason,
as each mentioned symbol might accrete a new PACKED-INFO instance.
Keeping them in obj/ makes for hard-to-interpret reports of
differences between cross-compiler hosts, because of different
interpretations of *print-readably* with (hopefully) no effect
on the final artifacts.
Files which are part of the build framework, namely "make-*.lisp" and anything
under src/cold except for src/cold/warm always interpret #+/- as host features,
which is obvious. In those files, the reader can't parse target feature sexprs,
but the value of SB-XC:*FEATURES* may be tested with code.
Files which are sources, namely everything else, can _only_ refer to target
features in "#+"/"#-" (sans #\!) expressions, unless within a #+(host-feature)
escape. Thus it is identical, for the time being, to using #!+ or #!-.
As far as implementation, the default *READTABLE* never has its macros changed,
so you can't just slurp a file containing target feature conditionals -
instead *READTABLE* must be bound from *XC-READTABLE*. You may continue to use
the features named :sb-xc-host and :sb-xc with either the bang or non-bang
conditional syntax. So ultimately, "#!" syntax serves no purpose at all,
and we can replace every occurrence with normal syntax.
Note also that DO-STEMS-AND-FLAGS requires a third argument to indicate whether
the flags pertain to make-host-1 or -2 which avoid erroneous injection of
the :IGNORE-FAILURE-P flag when it is intended for the host. I don't love it,
but lacking proof that the CMUCL workaround isn't needed, I preserved the
behavior while improving upon it as well.
- Remove :NOT-GENESIS flag, *TARGET-OBJECT-FILE-NAMES*, and
don't create "output/object-filenames-for-genesis.lisp-expr"
- Remove warn-when-cl-snapshot-diff. Self-hosted build proves that
we don't touch CL (if our own package locks are believed to work).
* Remove :preload-file keyword from genesis, load all asm files up front.
* Resolve :assembly-routine fixups right away rather than deferring.
* Remove *assembler-routines* from static symbols, make its value
the single code object rather than a hashtable.
* Hang the name->addr table off %code-debug-info for that object
and store entry points as relative offsets, not addresses.
* Remove magic in coreparse to fix the hashtable on relocation.
* Eliminate potential confusion betweeen FIND-ASSEMBLER-ROUTINE and
FIND-ASSEMBLY-ROUTINE by removing the latter.
* These are the two "tricky" trampolines, in that genesis needs
to know where they are in order to cold-load fasls, and where
undefined_tramp in particular is in order to even prepare to
cold-load fasls.
* Add a concept of a "preload file" to genesis, to be loaded
after creating NIL but before creating any FDEFN objects.
* Use a target feature to switch genesis to using an assembler
routine instead of a foreign symbol for the trampolines.
* And use our new :NOT-GENESIS build flag to set up a file that
will contain the new trampolines, and arrange for it to be loaded
as the preload file, again under the same target feature.
* As far as it goes, all this works, but it almost certainly has
some rough edges to it. It probably isn't quite ready for
upstream yet.
Moved flag processing as far "inward" as possible when dealing with
compile-stem, reducing the amount of redundant code for parsing out and
passing along boolean keywords based on the presence or absence of a
flag and eliminating some of the keyword arguments to compile-stem.
Added a "mode" parameter to compile-stem to enable determining the
correct compile-file function based on the combination of mode and
flags, further simplifying the interface.
Added new functions for determining the source and object pathnames
for a stem, fixing a longstanding KLUDGE in host-load-stem,
consolidating the three instances of code to compute an object pathname
and the two instances of code to compute a source pathname and
eliminating the rest of the keyword arguments to compile-stem.
Beginnings of a Win32 merge.
... rearrange the build scripts to use input from files rather
than <<HERE documents.
... (no other changes; just working to get the meaty changes
isolated from the fluff)