Commit graph

9131 commits

Author SHA1 Message Date
Daniel Kochmański
1bc7189527 cosmetic: fix typo in a comment 2026-05-08 08:55:16 +02:00
Daniel Kochmański
61232008f6 tests: fix braino (missing IS) 2026-05-08 08:03:58 +02:00
Daniel Kochmański
bd1f226f31 tests: mop: add a unit tests for FUNCALLABLE-STANDARD-OBJECT
Test whether it is correctly recognized as the subtype of the function.
2026-05-07 20:58:34 +02:00
Daniel Kochmański
38301ba9e7 Merge branch 'master' into develop 2026-05-05 11:33:01 +02:00
Daniel Kochmański
74780fa2cd Merge branch 'bugfix-rc' 2026-05-05 11:20:39 +02:00
Daniel Kochmański
20d9266664 proclaim-class: use the correct env and don't redefine in bytecmp
PROCLAIM-CLASS in ccmp had the following form in its body:

(ext:with-backend
  :c/c++ (register-in-ccmp)
  :bytecmp (register-globally))

with a clear intention, that CCMP-compiled code should use the first path, and
BCMP-compiled code should use the second. But that's not what this operator
does. This operator caused, that when CCMP was compiled with CCMP, then it
always took (register-in-ccmp) path (even for bytecodes compiler(!)), while when
CCMP was compiled with BCMP (i.e with a flag --disable-shared and compiler is
not builtin), then modifying global instance was always called, disregrading
whether we were compiling with CCMP or BCMP at the moment.

We've replaced this with a more precise statement that decides at runtime which
compiler to chose:

(if *compiler-in-use*
    (register-in-ccmp)
    (register-globally))

The other part of the problem was that registering the class definition globally
in the bytecodes compiler (or in ccmp when --disable-shared was true), could
redefine existing class in runtime environment with a forward-referenced-class,
and that lead to the environment corruption. Consider:

(compile-file "foo.lisp" :load t)   ;defines globally at load time "#<standard-class foo>"
(compile-file "foo.lisp" :load nil) ;defines globally at compile time "#<forward-class foo>"

So after compiling the second file, we don't have the standard class foo, that
we may depend on in later files.

Fixes #843.
2026-05-05 11:00:38 +02:00
Daniel Kochmański
9ec0bef93d Update version number to 26.5.5. 2026-05-04 07:49:05 +02:00
Daniel Kochmański
c9fd019adc news: update the changelog 2026-05-04 07:26:37 +02:00
Daniel Kochmański
d5a026e98a si_load_bytecodes: use the same syntax for all bytecodes forms
Before the last release we've introduced a new dispatch character macro #" that
reads into base strings in the compiler environment, but si_load_bytecodes used
it only for the first read form, something like:

(let ((forms (with-ecl-syntax () (read-forms strm t))))
  (loop for forms = forms then (read-forms strm nil)
        while forms do
          (process forms)))

So if the file had more than one toplevel #Y, the reader broke on #"".

Fixes #842.
2026-05-04 07:26:37 +02:00
Daniel Kochmański
0e7c52f7be news: update the changelog 2026-05-01 23:14:33 +02:00
Daniel Kochmański
727b3f518b si_load_bytecodes: use the same syntax for all bytecodes forms
Before the last release we've introduced a new dispatch character macro #" that
reads into base strings in the compiler environment, but si_load_bytecodes used
it only for the first read form, something like:

(let ((forms (with-ecl-syntax () (read-forms strm t))))
  (loop for forms = forms then (read-forms strm nil)
        while forms do
          (process forms)))

So if the file had more than one toplevel #Y, the reader broke on #"".

Fixes #842.
2026-05-01 23:07:09 +02:00
Daniel Kochmański
dcc3a3c05a boot: allocate first_env dynamically at startup
When mprotect is used as a cheap interrupt protection, the environment must be
page-aligned. For static data we'd need to use a kludge (or alignas that is not
part of C99) -- the simplest thing is to use the same mechanism to allocate the
first environment as the rest. That will ensure page alignment when mprotect is
used (that is, when mmap allocates the environment).

This was not possible before (in !341), because back then, when mmap was not
used, we've been using the garbage collector to allocate th environment, but now
we use the manual allocator.

Fixes #828.
2026-04-26 17:30:31 +02:00
Daniel Kochmański
c12f8c2bc1 symbols: add SI:*BREAK-LOCALS* to the list of symbols available in C 2026-04-26 17:30:19 +02:00
Daniel Kochmański
a077650367 stacks: disable some optimizations on clang (<= 17 +version+ 22)
clang miscompiles some functions since the version 17; we bump the version from
19 to 22, because it was confirmed that it is still the case. Fixes #838.
2026-04-26 17:30:19 +02:00
Stas Boukarev
59c24bec1f Fix base-char-p on known characters
It needs to call ECL_BASE_CHAR_CODE_P.

Fixes #812
2026-04-26 17:30:19 +02:00
Marius Gerbershagen
082d513d65 Merge branch 'dynamic-first-env' into 'develop'
boot: allocate first_env dynamically at startup

Closes #828

See merge request embeddable-common-lisp/ecl!370
2026-04-26 15:07:55 +00:00
Daniel Kochmański
61a14dfc66 boot: allocate first_env dynamically at startup
When mprotect is used as a cheap interrupt protection, the environment must be
page-aligned. For static data we'd need to use a kludge (or alignas that is not
part of C99) -- the simplest thing is to use the same mechanism to allocate the
first environment as the rest. That will ensure page alignment when mprotect is
used (that is, when mmap allocates the environment).

This was not possible before (in !341), because back then, when mmap was not
used, we've been using the garbage collector to allocate th environment, but now
we use the manual allocator.

Fixes #828.
2026-04-26 12:28:21 +02:00
Daniel Kochmański
d3803e7bf6 symbols: add SI:*BREAK-LOCALS* to the list of symbols available in C 2026-04-26 10:27:13 +02:00
Daniel Kochmański
d39cc449f7 stacks: disable some optimizations on clang (<= 17 +version+ 22)
clang miscompiles some functions since the version 17; we bump the version from
19 to 22, because it was confirmed that it is still the case. Fixes #838.
2026-04-26 10:17:50 +02:00
Stas Boukarev
b8f55b1354 Fix base-char-p on known characters
It needs to call ECL_BASE_CHAR_CODE_P.

Fixes #812
2026-04-22 18:12:23 +03:00
Daniel Kochmański
e1bf9c2f36 Merge branch 'drop-msvc' into 'develop'
Drop support for Microsoft Visual Studio Compiler

Closes #809

See merge request embeddable-common-lisp/ecl!369
2026-04-19 17:51:19 +00:00
Daniel Kochmański
5678c21cc3 Drop support for Microsoft Visual Studio Compiler
This compiler is:
- not fully conformant
- hard to obtain (despite free versions existing)
- requires numerous kludges
- requires separate build system so many changes need to be duplicated

Fixes #809.
2026-04-19 19:07:15 +02:00
Daniel Kochmański
6c9926cd56 update the changelog with the fix for #839 2026-04-17 15:58:06 +02:00
Daniel Kochmański
d26d3142fe make-package: don't share conses with the original form
When we have processed local nicknames, we've copied the list, but local
nicknames are an assoc list ((a . b) (c . d)) etc, in other words, conses were
still shared with the original form; calling RPLACA and RPLACD modified the
original form, so when it was loaded back, the bytecodes compiler had problems,
because the list contained a literal package instead of the string.

Fixes #839.
2026-04-17 15:51:15 +02:00
Daniel Kochmański
89c77bca9d tests: test for compiling file that has package with local nicknames
This test trips on bytecodes compiler during the first file compilation because
the object can't be printed readably.
2026-04-17 07:33:03 +02:00
Daniel Kochmański
3d83b00794 tests: add regression test for #827 2026-03-30 10:58:17 +02:00
Daniel Kochmański
75ff4c8f49 shadow: don't add duplicates to PACKAGE-SHADOWING-SYMBOLS
Fixes #827.
2026-03-30 10:37:00 +02:00
Stas Boukarev
98511888b5 compile: don't lose closures from byte compiled functions
Fixes #829
2026-03-29 19:20:54 +03:00
Didier Verna
afb18e47f9 Allow the creation of early classes with the correct size.
2026-02-12  Didier Verna  <didier@didierverna.net>

	* src/clos/boot.lsp (make-empty-standard-class): New argument SIZE.
	Default it to the length of standard class slots. Pass it on to
	SI:ALLOCATE-RAW-INSTANCE.

	* src/clos/hierarchy.lsp (+class-hierarchy+): Set it to the length
	of structure class slots when creating the STRUCTURE-OBJECT class.

Closes !362.
2026-03-27 11:08:18 +01:00
Daniel Kochmański
ed3bf8e521 Merge branch 'develop' into 'master'
ECL 26.3.27

See merge request embeddable-common-lisp/ecl!367
2026-03-27 08:12:03 +00:00
Daniel Kochmański
bab3c5b681 Update version number to 26.3.27 2026-03-27 08:48:06 +01:00
Marius Gerbershagen
8a436de3dc cmp: fix bug in type-specifier=
The function incorrectly compared two member types of unequal lengths
as equal (e.g. (MEMBER T) and (MEMBER T NIL)).
2026-03-26 20:16:09 +01:00
Marius Gerbershagen
7e63eaf3eb cmp: fix compilation of empty file
This regressed after commit ede2f0aaa1
2026-03-24 19:51:58 +01:00
Daniel Kochmański
b74014c2f6 Update version number to 26.3.26 2026-03-20 09:13:07 +01:00
Daniel Kochmański
14603059a9 cosmetic: update changelog 2026-03-20 09:09:18 +01:00
Daniel Kochmański
b765013374 libffi: add a patch for NetBSD/aarch64
The patch is suggested by Stas Boukarev and taken from
https://github.com/NetBSD/pkgsrc/blob/trunk/devel/libffi/patches/patch-src_aarch64_ffi.c

Fixes #817.
2026-03-20 08:58:00 +01:00
Daniel Kochmański
3116592d16 Update vendored libffi to v3.5.2 2026-03-20 08:47:34 +01:00
Daniel Kochmański
00713f97ff Merge branch 'cl-bench-regressions' into 'develop'
Fix performance regressions identified by cl-bench

See merge request embeddable-common-lisp/ecl!365
2026-03-20 07:42:44 +00:00
Marius Gerbershagen
66c1bd9b40 cmp: better handling of type declarations in let forms
We were dropping type information in some cases.

First, let bindings are implemented by first assigning the result of
evaluating the initialization forms to temporary variables and then
setting the real variables once all initialization forms have been
evaluated. If type declarations for the variables in the let form were
present, we were not applying them to the temporary variables. This is
particularly problematic for variables which are later on found to be
constant. The compiler has become slightly smarter now and will
eliminate the variables, leaving only the temporary variables and
forgetting the type information in the process.

Second, if the type was declared to be read-only, then we were not
taking into account type declarations and only relying on the inferred
type of the initalization form.
2026-03-15 17:10:25 +01:00
Marius Gerbershagen
5426270f8b cmp: resurrect a previously removed optimization
The optimization allows the compiler to use more precise type
information. This can be used to remove unnecessary boxing of
variables, see e.g. the disassembly of the following code:

(lambda (i)
  (declare (fixnum i))
  (code-char (mod i 128)))

The optimization was removed in commit
c7da5bc919. The promised FCALL-ARG
destination has not been implemented so far, thus we restore the old
implementation for now.
2026-03-14 15:39:52 +01:00
Daniel Kochmański
202a2e14ae doc: update install for macos 2026-03-13 19:22:36 +01:00
Marius Gerbershagen
109aa3d265 apply workaround for clang bug more broadly
Xcode 26 distributes a clang version which identifies itself with
__clang_major__=17 and that is also affected by the bug for which the
workaround in commit 2fbdd292af was
added.

Closes #825.
2026-03-13 19:14:02 +01:00
Daniel Kochmański
8efdd3757f doc: fix typo 2026-03-11 08:39:29 +01:00
Daniel Kochmański
88a53fe73b doc: add MacOS/arm64 -specific section to INSTALL
Contributed by Polos Ruetz.
2026-03-10 20:09:37 +01:00
Daniel Kochmański
79cbfc23fb doc: document that fixnum, bignum, *-float are built-in classes
Fixes #109.
2026-03-10 09:16:46 +01:00
Daniel Kochmański
8dec95f282 cmp: remove unsused config optiosn cc-format and ld-format
Closes #51.
2026-03-10 08:42:40 +01:00
Daniel Kochmański
cc0bb43eb4 update asdf to 3.1.8.11
See https://gitlab.common-lisp.net/asdf/asdf/-/merge_requests/246 for context.
This effectively unbreaks haiku builds.
2026-03-09 15:42:41 +01:00
Daniel Kochmański
e39d6574ce sockets: put the package in the same file as the implementation
build-module on rebuild reloads only files that have changes, so if we had
updated only sockets.lisp, then the package is not defined when the file is
recompiled and loaded.
2026-03-09 12:37:42 +01:00
Marius Gerbershagen
c20a53921e cmp: don't handle floats as immediate values for inlining purposes
This introduces unneeded boxing of constant values, e.g. in

> (disassemble (lambda (x) (< x 4.0)))

/* function definition for GAZONK                                             */
/* optimize speed 3, debug 0, space 0, safety 2                               */
static cl_object L1c__gazonk(cl_object v1x)
{
 cl_object env0 = ECL_NIL;
 const cl_env_ptr cl_env_copy = ecl_process_env();
 cl_object value0;
 ecl_cs_check(cl_env_copy,value0);
L1:;
 value0 = ecl_make_bool(ecl_lower(v1x,ecl_make_single_float((float)    4.    )));
 cl_env_copy->nvalues = 1;
 return value0;
}

The same would apply to complex floats if we were to handle them in
the same manner.
2026-03-07 17:41:27 +01:00
Marius Gerbershagen
b58eb33283 disable floating point exceptions on android 2026-03-07 16:20:05 +01:00