Commit graph

30 commits

Author SHA1 Message Date
Marius Gerbershagen
fb321885db cmp: easier cross-compilation of user code
The procedure works as follows. First, cross compile ECL itself. In
this step, we dump the configuration of the compiler. This
configuration can then be later restored to put the host compiler into
cross compilation mode using a new option to WITH-COMPILATION-UNIT.

The following changes to the public interface are introduced:

- WITH-COMPILATION-UNIT now takes a new :target keyword
- New functions C:WRITE-TARGET-INFO, C:READ-TARGET-INFO to dump and
  restore the config
- The environment parameters to TYPEP and SUBTYPEP are no longer
  unused. User macros can query type relationships in the target
  environment using these parameters.

Internal changes in the compiler include:

- Target dependent variables in the compiler are defined using a new
  DEFCONFIG macro. C:WRITE-TARGET-INFO simply writes the value of
  these variables to a file.
- The distinction between target types and host types already exists
  in the compiler. In this commit, we just register the target types in
  the compiler environment when we change the compiler configuration.
2025-11-21 19:08:14 +01:00
Marius Gerbershagen
3d6880b075 bytecmp: fix bugs in handling output-file option for compile-file
Always load the output file with the bytecodes loader and (as
specified) return the truename of the output-file.
2024-03-10 19:19:52 +01:00
Marius Gerbershagen
b730412ebc bytecmp: preserve the identity for literal objects
When a literal appears in the file multiple times its identity should be
preserved.

CLHS 3.2.4.4:

> If two literal objects appearing in the source code for a single
> file processed with the file compiler are the identical, the
> corresponding objects in the compiled code must also be the identical.

Previously, every bytecode object created during ext::bc-compile-file
had its own vector of constants making it impossible to satisfy this
constraint. Thus, we change ext::bc-compile-file to use the same
constants vector for all bytecode objects from the same file. The
simplest way to achieve this is to use the same compiler environment
for all of the compilation process and push the read-compile loop
into the si_bc_compile_from_stream function implemented in C.
2020-12-27 19:04:00 +01:00
Marius Gerbershagen
4e1847f775 clos: don't call make-load-form in the code walker for defmethod
Fixes #594.
2020-09-18 21:22:32 +02:00
Marius Gerbershagen
c6b4296bb8 cosmetic: fix some compiler warnings 2020-04-29 20:35:37 +02:00
Marius Gerbershagen
c7a0b753c9 bytecmp: fix compilation of closures
Extract function name for bclosures in guess_environment and
    signal an error when attempting to compile a cclosure
2018-06-23 21:37:15 +02:00
Daniel Kochmanski
fd183e575f Better error messages, bc-compile improvements
bc-compile is more conforming now (we validate definition and name, also our
closure compilation is a bit better, still broken though).

Also improve some error messages and add periods at the end.
2018-02-13 12:43:32 +01:00
Marius Gerbershagen
c279138bb2 bytecmp.lisp: allow T for :output-file in bc-compile-file. Fixes #393 2017-11-03 20:29:09 +01:00
Daniel Kochmański
7feed6c6f4 contrib: call provide uniformly
Various contrib modules called provide with varying syntax from "module"
through 'module to '#:module. The last one is picked:

(provide '#:module)
2015-10-23 18:18:58 +02:00
Daniel Kochmański
d75552027a compiler: bind lexically *readtable* when file is compiled
Both byte and C compilers didn't bind lexically *readtable*, what lead
to pollution of other compiled packages. Fixes #95 and #59.

Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
2015-07-28 14:25:29 +02:00
Juan Jose Garcia Ripoll
c44265c163 The version of COMPILE-FILE in the bytecodes compiler did not support :EXTERNAL-FORMAT keyword 2012-10-14 11:09:14 +02:00
Juan Jose Garcia Ripoll
c7faea1db0 Remove debugging code from bytecmp.lsp 2012-08-14 22:31:11 +02:00
Juan Jose Garcia Ripoll
b06c17717a INSTALL-C-COMPILER is now part of the core, even without loading :CMP 2012-07-22 18:26:03 +02:00
Juanjo Garcia-Ripoll
92983005ed In the bytecodes compiler, export some symbols which are used in the ANSI test suite 2012-04-18 22:39:30 +02:00
Juan Jose Garcia Ripoll
24debdf161 Fix additional warnings about unused variables and variables which are assumed global in the compiler. 2011-12-26 17:59:16 +01:00
Juan Jose Garcia Ripoll
7a2d30770b Add IGNORE declarations and remove some unused variables. 2011-12-23 15:38:37 +01:00
Juan Jose Garcia Ripoll
532a9fbe5c Added DISASSEMBLE to the bytecodes compiler (bytecmp.lsp) 2011-07-30 15:51:19 +02:00
Juan Jose Garcia Ripoll
2c8c8abfbc *compile-file-{pathname,truename}* were not properly bound in bytecmp.lsp 2011-07-30 12:26:28 +02:00
Juan Jose Garcia Ripoll
7beaadc5ce Remove debug statements from BYTECMP 2011-07-29 15:02:25 +02:00
Juan Jose Garcia Ripoll
61f199f2d7 The bytecodes compiler used ECL's syntax also for reading in the sources. 2011-07-29 14:46:38 +02:00
Juan Jose Garcia Ripoll
dab8f7e7a6 Fix typo that prevented installation of bytecodes compiler 2011-07-16 21:56:21 +02:00
Juan Jose Garcia Ripoll
45434f51ba Activate the bytecodes compiler when statically linking ECL 2011-07-14 18:05:53 +02:00
Juan Jose Garcia Ripoll
151e5fc188 The bytecodes compiler (bytecmp.lsp) now defines its own functions, with prefix bc-... 2011-07-14 17:54:29 +02:00
Juan Jose Garcia Ripoll
6b00c54dd3 Save locations also in bytecompiled code 2011-06-05 15:20:55 +02:00
Juan Jose Garcia Ripoll
1801c64bff Dedicated function for loaded bytecompiled files 2011-06-05 12:35:35 +02:00
Juan Jose Garcia Ripoll
1fe0166889 The bytecodes compiler used the wrong extension and did not honr the :ouptut-file argument to compile-file. 2011-06-04 16:21:42 +02:00
Juan Jose Garcia Ripoll
1523ae8a5c EXT package created containing the original set of symbols (not yet filtered) and re-exported from SYS 2011-02-27 23:20:12 +01:00
Juan Jose Garcia Ripoll
65c1dbb06f Missing arguments to several warnings (S. Bourakev). 2010-01-25 09:09:10 +01:00
Juan Jose Garcia Ripoll
d52383c27e Add feature marking the use of the bytecodes compiler instead of the native compiler 2009-04-02 15:20:55 +02:00
Juan Jose Garcia Ripoll
005dc07061 Added the possibility of bytecompiling forms and saving them. New module bytecmp uses this to implement COMPILE and COMPILE-FILE. 2009-04-01 02:29:48 +02:00