Commit graph

330 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
Daniel Kochmański
c235a57ded Small compatibility fixes
- add a new character name alias Formfeed (for Page) -- sometimes used in the wild
- export asdf:registered-system (exported upstream, some systems use it)
2024-10-07 07:42:22 +02:00
Daniel Kochmański
e79971ced7 asdf: bump to version 3.1.8.9 2024-09-09 10:11:44 +02: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
Daniel Kochmański
e49eafac22 cmpc: get rid of another undocumented feature from FFI:C-INLINE
ffi:c-inline allowed for the xyntax @object (similar to the previous commit),
although only syntax "@(return x) = xxx" is specified in the documentation.
2023-09-25 14:35:14 +02:00
Daniel Kochmański
49668f8dda cmpc: %def-inline: remove an option :inline-or-warn 2023-09-25 14:35:14 +02:00
Daniel Kochmański
f27663bea6 contrib: ecl-cdb: fix invalid type declarations
There is no type :uint32-t nor unsigned-integer.
2023-09-11 16:54:21 +02:00
Marius Gerbershagen
0092cbb695 contrib: cl-simd: remove unnecessary quotes 2023-08-01 17:34:41 +02:00
Marius Gerbershagen
8350f07100 contrib/unicode: improve ucd table generating code
Provide some comments on what the code is doing.

Increase size of integers used in encoding pairs of consecutive words
(needed to encode the current ucd).

Introduce additional bidirectional classes.

Provide new ucd.h header with enums for general-category and
bidirectional class.

Add update-ucd.sh script to automate the updating process.
2021-05-07 21:09:08 +02: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
Michał "phoe" Herda
bb40da9fa6 Fix GET-PROTOCOL-BY-NAME with unknown protocols
The function SB-BSD-SOCKETS:GET-PROTOCOL-BY-NAME did not signal
an error when it was unable to find a protocol. This is fixed now
and an error of type UNKNOWN-PROTOCOL, with an accessor named
UNKNOWN-PROTOCOL-NAME, is being signaled. These two names are also
exported from the package SB-BSD-SOCKETS.

A test case is added.

Several other test cases are fixed with regard to :NO-ERROR clauses
inside HANDLER-CASEs.
2020-11-13 19:43:33 +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
Daniel Kochmański
44299c7221 contrib: serve-event: make serve-event multithreading save
Only call handlers established in the current thread and use atomic
operations to update *descriptor-handlers*.
Closes #588.

Additionally:
- improve the test code
- add a test for the leak
- provide internet machine link for the tutorial
2020-06-20 16:36:32 +02:00
Marius Gerbershagen
c6b4296bb8 cosmetic: fix some compiler warnings 2020-04-29 20:35:37 +02:00
Marius Gerbershagen
beadd585ce sockets: don't return the same address multiple times in get-host-by-name 2020-04-19 10:46:03 +02:00
Marius Gerbershagen
5451f73bb8 sockets: don't call getaddrinfo with AI_ADDRCONFIG
On linux, using AI_ADDRCONFIG causes getaddrinfo to return no ip
address for localhost when only the loopback connection is
active. Also, we only get ipv4 addresses anyway due to specifying
ai_family = AF_INET, therefore the AI_ADDRCONFIG flag in not necessary
anyway.
2020-04-19 10:46:03 +02:00
Marius Gerbershagen
12cac13786 sockets: fix GET-HOST-BY-NAME and GET-HOST-BY-ADDRESS
After the recent refactor of GET-HOST-BY-NAME to use getaddrinfo,
these functions had multiple problems that are fixed in this commit:
- in GET-HOST-BY-NAME, freeaddrinfo was called on an unitialized
  struct addrinfo if getaddrinfo failed
- error handling in GET-HOST-BY-NAME wasn't working, we were still
  trying to use the error handling for gethostbyname
- GET-HOST-BY-ADDRESS still used the deprecated gethostbyaddr function
2020-01-25 17:43:30 +01:00
Daniel Kochmański
ef450d9070 contrib: sockets: fix get-host-by-name
Remove flag AI_V4MAPPED which takes effect only for AF_INET6
family. Currently we do not work at all with ipv6, hence this flag is
a no-op. Moreover Android has no definition for this flag. See !172.

Fix contributed by Polos Ruetz. Closes !172.
2019-12-30 10:39:13 +01:00
Marius Gerbershagen
234a1084d5 contrib: sockets: fix mingw build 2019-12-08 00:22:52 +01:00
Marius Gerbershagen
b94c2f5fe6 contrib: sockets: add missing include
Needed by gai_strerror. Fixes #533.
2019-12-07 21:47:10 +01:00
Daniel Kochmański
de073ef274 sockets: recvfrom: cast sockaddr_in* to sockaddr* explicitly
Apparently CXX compiler needs this. Steps to reproduce the issue:

    ./configure --with-cxx && make

With this fix the problem is gone.
2019-11-25 15:40:28 +01:00
thijs
5747fddee9 contrib: get-host-by-name: use getaddrinfo instead of gethostbyname
- this improvement was suggested before in the comment
- fix print-object for descriptors which are not bound
2019-11-22 08:28:25 +01:00
Marius Gerbershagen
b067063c94 cmp: prevent inline information from getting lost while compiling ECL itself
C inline information is saved in +default-machine+, which was
previously a constant. However, the value assigned to
+default-machine+ is recomputed during load and compile
time. Technically, assigning a constant a new value which is not eql
to the old one is undefined behaviour in the ANSI standard. What ECL
did was simply to reassign the constant when compiling
cmpc-machine.lsp. However, this meant that the inline information
which was added to +default-machine+ when loading sysfun.lsp was
lost. Thus, all ECL source files compiled after cmpc-machine.lsp were
compiled without inline information. We prevent this by using an
ordinary variable *default-machine* instead of a constant.
2019-11-17 19:58:53 +01:00
Marius Gerbershagen
51b68e8b2a contrib: cl-simd: fix def-inline macro
Fixes #527.
2019-11-16 20:10:56 +01:00
Marius Gerbershagen
a08f26cc27 Merge branch 'fix-socket-receive-to-return-remote-addr' of https://gitlab.com/thijso/ecl into develop 2019-09-02 21:52:13 +02:00
thijs
98afe7cbd0 Fix socket-receive to match the documentation; return the address of the peer that sent a message 2019-08-31 16:28:16 +02:00
thijs
87a2076384 Fix socket-receive to match the documentation; set MSG_TRUNC when socket type is :datagram 2019-08-31 16:20:28 +02:00
Marius Gerbershagen
944805cbf5 contrib: defsystem: (hopefully) finally remove all old package names
Fixes #480.
2019-03-20 21:20:28 +01:00
Daniel Kochmański
20fdd44b79 contrib: defsystem: fix packages 2019-03-15 20:38:39 +01:00
Daniel Kochmanski
9096514cff extensions: put ext:package-locked-p in core module. 2019-02-07 13:27:12 +01:00
Marius Gerbershagen
0b6311b399 contrib: remove use of legacy names 2019-01-14 21:29:34 +01: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 Kochmanski
c771b46c5f feature: export make-stream-from-fd interface 2017-10-11 10:25:59 +02:00
Daniel Kochmanski
4915f8bc33 bump asdf 2017-09-30 16:07:10 +02:00
Daniel Kochmanski
270450a660 asdf: update to version 3.1.8.7
This version fixes mal-handling of :if-feature clauses which correct
loading of systems using it.
2017-09-30 11:12:29 +02:00
Daniel Kochmanski
54f7f9c424 sb-bsd-sockets: socket-receive: add default element-type 2017-09-30 11:12:00 +02:00
Daniel Kochmanski
f2473ade5b asdf: update to 3.1.8.6
this version allows specifying init-name
2017-07-21 19:30:19 +02:00
Daniel Kochmański
da4669d792 cdb: fix declaration 2017-04-28 11:13:24 +02:00
Kris Katterjohn
de661f580a Add ABORT keyword argument to SB-BSD-SOCKETS:SOCKET-CLOSE
This keyword argument was added in SBCL in 2010 and is used to pass
ABORT to CL:CLOSE.

The absence of this would obviously cause errors when code expects
this to be available.  For example, this happens in usocket's
SOCKET-CONNECT and would cause several errors in their test suite
with obscure error messages like

  Wrong number of arguments passed to function #<compiled-function 0000000003562e80>.

This is untested on Windows.
2017-02-11 19:18:50 -06:00
Daniel Kochmański
35328d09d7 asdf: preserve program-system default
no-uiop is t for all but program-system.
2017-02-03 00:17:09 +01:00
Daniel Kochmański
99e70ede04 asdf: update to 3.1.8.4
Fixes problem with creating executables.
2017-02-02 22:31:44 +01:00
Daniel Kochmański
d9d6afeba3 asdf: bring back old package nicknames 2016-12-13 15:34:55 +01:00
Daniel Kochmański
3203a373be update asdf to 3.1.8.1 2016-12-12 08:02:45 +01:00
Daniel Kochmański
fd24c923d3 update asdf to 3.1.8
To avoid confusion we create a separate numeric branch from 3.1.7 (ASDF
3.2.0 release is on its way).

This change backports fix for static-library builds. Fixes #177.
2016-12-06 08:59:52 +01:00
Daniel Kochmański
4e4e07eaed asdf: backport some upstream changes 2016-12-05 20:30:32 +01:00
Daniel Kochmański
c90e874437 Update ASDF to 3.1.7.26 derivative
It seems that we have to fork here for now due to some arbitrary
decisions.

See:
https://bugs.launchpad.net/asdf/+bug/1493031
https://gitlab.common-lisp.net/asdf/asdf/merge_requests/34

Fixes #196.
2016-11-27 11:02:24 +01:00
Daniel Kochmański
6892db8849 asdf: bump asdf to 3.1.7.35 development version 2016-11-19 10:29:59 +01:00
Daniel Kochmański
1b7c839d70 Move package-locks interface to contrib/ 2016-11-11 09:30:50 +01:00