Commit graph

7800 commits

Author SHA1 Message Date
Daniel Kochmański
b8dfd2784c tests: ffi: add a smoke test for complex float handling 2019-12-16 11:47:36 +01:00
Daniel Kochmański
ad5fe834bb ffi: enable complex floats for ffi
See
https://gitlab.com/embeddable-common-lisp/ecl/merge_requests/149#note_169658319
https://github.com/libffi/libffi/issues/489

complex float support in libffi shipped with my Ubuntu still have
these problems, but when I've built the libffi myself all works fine.

> (ffi:def-function "catanhf" ((x :csfloat)) :returning :csfloat :module :default)
 CATANHF
> (catanhf #C(10.0s0 0.5s0))
 #C(0.10008093 1.5657587)
>
2019-12-16 11:17:47 +01:00
Marius Gerbershagen
5860f42f88 ffi: Update libffi to version 3.3 2019-12-09 19:49:30 +01:00
Marius Gerbershagen
b2f09b4809 ffi: generate abi list from available libffi abis
This is more robust against changes in the abi support in libffi.
We also remove unused struct and enum type definitions (left over from
our own dynamic ffi implementation?).
2019-12-09 19:49:30 +01:00
Daniel Kochmański
f4aa1aa857 Merge branch 'arm64' into 'develop'
Fix #224

Closes #224

See merge request embeddable-common-lisp/ecl!164
2019-12-08 10:01:54 +00:00
Marius Gerbershagen
4f8b4fab8b update CHANGELOG, INSTALL and cross config for iOS 2019-12-08 10:26:52 +01:00
Marius Gerbershagen
0b33cdf6f6 doc: better explanation of ECL_OPT_C_STACK_SIZE boot option 2019-12-08 10:26:52 +01:00
Marius Gerbershagen
e37fafb335 stacks.d: fix several problems with C stack
ecl_cs_set_org and cs_set_size had several problems:
-the size of the stack was estimated to be 1/2 of the actual value,
 which could lead to wrong stack overflow errors. In particular, we
 cannot assume that the stack pointer will always start at the stack
 origin and increase/decrease linearly (counterexamples could
 include callbacks from other threads).
-despite its name, cs_set_size did not actually set the stack size
 even on systems where this is possible at runtime.
-there were several magic numbers used.
2019-12-08 10:26:52 +01:00
Marius Gerbershagen
bc9f75871e cmp: complain when the number of arguments of an exported function is not known
When we don't know how many arguments an exported function takes, we
can't create a correct declaration for the C function in the .eclh
file. To avoid having too many proclamations, we extract this
information from symbols_list.h for ECL core functions defined in
Lisp.
2019-12-08 10:26:52 +01:00
Marius Gerbershagen
a2319d3150 unixsys: check for system() in configure
Don't let a non-available system() function (happens e.g. on iOS)
prevent us from compiling ECL.
2019-12-08 10:26:52 +01:00
Marius Gerbershagen
8a0b9cf8b9 prevent proclamations from influencing setf-expansions, deftypes, ...
Various macros created lambda-blocks with names that could be equal to
names of unrelated functions. The compiler would then try to apply
proclamations for these functions to the lambda-block. Prevent this by
expanding to a (lambda (...) (block name ...)) instead
of (lambda-block name (...) ...).
2019-12-08 10:26:52 +01:00
Marius Gerbershagen
fbdb0a32a8 cmp: check that number of arguments matches the declaration in symbols_list.h
We also use the *in-all-symbols-functions* variable only for
determining which functions are to be exported during the build of ECL
itself. Otherwise, instead of specifying manually, which Lisp
functions are exported and in the core, we use the information from
symbols_list.h (i.e. we let all_symbols.d initialize all core
functions).
2019-12-08 10:26:52 +01:00
Marius Gerbershagen
68ee6fa228 add some missing ecl_va_end statements 2019-12-08 10:26:52 +01:00
Marius Gerbershagen
846cf3f377 dpp: create correct signature for functions with only required arguments 2019-12-08 10:26:52 +01:00
Marius Gerbershagen
32b6f02157 dpp: check if declared and actual number of arguments match 2019-12-08 10:26:52 +01:00
Marius Gerbershagen
18cb1b3552 fix for calling conventions treating fixed and variadic arguments differently
Previously, we assumed that the fixed and variadic arguments of a
variadic function were passed to the function in the same way. The
arm64 calling convention used by iOS breaks this assumption by passing
fixed arguments in registers or on the stack, depending on the
position, while variadic arguments are always passed on the stack.

Solving this problem while still allowing function redefinition at
runtime requires introducing additional dispatch functions. These
dispatch functions take no fixed arguments and pass all their
arguments to the actual function. This dispatch is enabled by passing
-DECL_C_COMPATIBLE_VARIADIC_DISPATCH to the C compiler.

This problem was originally identified and a solution provided by
thewhimer@gmail.com. This commit based on his work with minor
improvements.
2019-12-08 10:26:52 +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
cb269ce407 tests: run-program: add some conditionals for cygwin 2019-12-05 12:01:07 +01:00
Daniel Kochmański
02038d66da complex-float: move functions to externa.h
si_complex_float_p and si_complex_float are referenced in tests, to
allow clean compilation put them in externa.h.
2019-12-04 18:03:53 +01:00
Daniel Kochmański
0a7056da5f ecl_min: symbols list: fix si::complex-float function name
Symbols must be associated with functions following an uniform naming
scheme because si:mangle-name does not return pre-existing string.
See #534 for details. This is a temporary solution.
2019-12-04 17:52:16 +01:00
Marius Gerbershagen
556ad56a09 Merge branch 'fix-sockets-cxx' into 'develop'
sockets: recvfrom: cast sockaddr_in*  to sockaddr* explicitly

See merge request embeddable-common-lisp/ecl!169
2019-12-01 10:14:59 +00: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
Daniel Kochmański
b14dd94821 Merge branch 'thijso/ecl-pr-fix-get-host-by-name' into develop 2019-11-22 08:36:02 +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
Daniel Kochmański
714c8e7ed6 Merge branch 'cas-symbol' into 'develop'
Minor improvements to atomic operations

Closes #460

See merge request embeddable-common-lisp/ecl!165
2019-11-02 17:47:04 +00:00
Marius Gerbershagen
7b388fa00d threading: make atomics work directly on special variables
Allowing e.g. (atomic-incf *foo*) instead of
    requiring (atomic-incf (symbol-value '*foo*)) makes the interface
    easier to use and more consistent with sbcl.
2019-10-31 19:42:51 +01:00
Daniel Kochmański
ee18c5fbdb Merge branch 'pr-fix-make-array-docs' into 'develop'
Fix a couple of minor mixups in the docs

See merge request embeddable-common-lisp/ecl!166
2019-10-30 07:07:51 +00:00
Marius Gerbershagen
12fedc5fe3 multiprocessing: create atomic structure slot accessors by default
Previously we were only creating atomic accessors when explicitely
told so, which is problematic for compatibility reasons, since it
requires compatibility libraries to define their own versions of
defstruct just for ECL. This change is backwards compatible.
2019-10-26 20:05:06 +02:00
thijs
cdc83658ad fix docs 2019-10-25 18:13:47 +02:00
Marius Gerbershagen
6ade6d4491 numbers: fix several bugs in the expt function
-expt of an integer and rational lead to a wrong type error in
 ecl_expt_float
-type contagion of (expt 0 +y) did not work properly
-there were several useless type checks in places where previous
 function calls already ensured that objects were numbers

Fixes #526.
2019-09-29 16:43:39 +02: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
Marius Gerbershagen
bcf1c3bba7 Merge branch 'fix-udp-socket-receive' into 'develop'
Fix socket-receive to match the documentation; set MSG_TRUNC when socket type is :datagram

See merge request embeddable-common-lisp/ecl!162
2019-09-02 19:46:07 +00: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
Daniel Kochmański
b96d28a4f8 Merge branch 'fix-476' into 'develop'
Fix 476

Closes #476

See merge request embeddable-common-lisp/ecl!161
2019-08-26 06:15:51 +00:00
Marius Gerbershagen
574a90a7c3 multithreading: close windows thread handle before releasing exit_barrier in thread_cleanup
Fixes out of memory errors when creating lots of threads on windows,
joining them and then again creating many threads (see e.g. the
atomic-incf/decf tests).
2019-08-25 21:04:29 +02:00
Marius Gerbershagen
0080acd4ce multithreading: fix spinlock in ecl_wait_on_timed
process.woken_up was not set to nil before calling condition. This could
lead to threads not waiting correctly on barriers and consequently to
mp:process-join returning earlier than it should.
2019-08-25 21:03:55 +02:00
Marius Gerbershagen
14a94c2b0e run-program: fix :error :output on windows
The file descriptor for the error output in the parent process was
set to the wrong value.
2019-08-25 21:03:54 +02:00
Marius Gerbershagen
24c93e1537 run-program: fix null stream input/output on windows
The nul file on windows can't be opened with O_TRUNC flag.
2019-08-25 21:03:53 +02:00
Marius Gerbershagen
bd9c590810 ieee-fp: remove _fpreset from si_trap_fpe
This is not needed since windows includes feclearexcept.
Furthermore, it leads to segmentation faults in the ieee-fp tests.
2019-08-25 21:03:53 +02:00
Marius Gerbershagen
5ea9cdf8a4 tests: fix some failing tests on windows 2019-08-25 21:03:38 +02:00
Marius Gerbershagen
25d8bf63ef cmp: fix linker-cc for msvc
linker-cc for other compilers includes the libpath in the linker
options, therefore for consistency we need it here too.
2019-08-20 19:52:25 +02:00
Marius Gerbershagen
2003b7f999 streams: don't return 0 in file-column if column can't be determined
Instead we return an invalid value (-1 for ecl_file_column and nil for
si_file_column). All users of these functions already deal correctly with
invalid values.

Fixes #309.
2019-08-20 15:36:56 +02:00
Marius Gerbershagen
1d0abc9c43 numlib: remove unneeded workaround for msvc 2019-08-20 14:41:53 +02:00
Marius Gerbershagen
2b3f7bb1fd numlib: fix return value of signum for complex zero 2019-08-19 20:26:10 +02:00
Marius Gerbershagen
c1c68bb4fe bytecmp: fix return value of multiple-value-bind with no variable bindings and no body
Statements such as (multiple-value-bind () :foo) returned :foo instead
of nil (see the multiple-value-bind.11-13 tests in the ansi-test
suite).
2019-08-19 19:46:27 +02:00
Marius Gerbershagen
c38739f3bb format: fix addition of fill style newlines in ~< ... ~:@> directive
Only add fill style newline for blanks that don't follow a ~ newline
directive (see the format.logical-block.23 test in the ansi-test
suite).
2019-08-19 18:07:13 +02:00