Alexander Jung [Tue, 11 Jul 2023 21:25:56 +0000 (21:25 +0000)]
Introduce `Library.uk`
This new file represents the first step towards proper versioning support of
external microlibrary in Unikraft. The file itself acts as mechanism for
holding metadata-only values about the microlibrary. This metadata is designed
to be compatible with GNU Make whilst simultaneously being human-readable and
readable by programs that are not GNU Make (e.g. tools such as KraftKit).
An important feature of this file is the inclusion of microlibrary versions.
In a later step, once relevant integrations have been made to Unikrat's core
build system and to relevant tools such as KraftKit, the user will be able to
see and select from different versions of the microlibrary.
In this initial commit, the relevant metadata is absorbed from both Makefile.uk,
Config.uk, but also includes new information such as SPDX License identifier.
The `ukarch_tls_tcb_reserve` call in `Makefile.uk` should only be made
when Newlib is selected (i.e. when `CONFIG_LIBNEWLIBC` is set to `y`).
Otherwise, if `newlib` is downloaded in the build directory, but is
*not* selected in the configuration, a build error occurs:
```
LD simple_qemu-x86_64.dbg
/usr/bin/ld: [...]/build/libcontext.o: in function `ukarch_tls_area_init':
[...]/unikraft/arch/x86/x86_64/tls.c:201: undefined reference to `ukarch_tls_tcb_init'
```
Add an `ifeq` / `endif` wrapper to the call to `ukarch_tls_tcb_reserve`,
such that the call is made only when Newlib is selected for
configuration.
Signed-off-by: Razvan Deaconescu <razvand@unikraft.io> Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com> Approved-by: Eduard Vintilă <eduard.vintila47@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #35
Makefile.uk: Use -ffreestanding as internal build option
As a standard C library (libc), newlib is to be built in a freestanding
environment (i.e. not relying on a libc). For that, build internal
newlib source code files with the `-ffreestanding` option. Otherwise, a
hosted environment will be used; in a hosted environment, certain
optimizations may be enabled by the compiler, and they may cause issues
(such as an infinite set of calls).
Signed-off-by: Razvan Deaconescu <razvand@unikraft.io> Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com> Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com> Approved-by: Marc Rittinghaus <marc.rittinghaus@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #33
Stefan Jumarea [Thu, 11 May 2023 11:36:51 +0000 (14:36 +0300)]
include: Add `*_OK` flags in fcntl.h header
The `*_OK` flags are defined in `fcntl.h` in both musl and nolibc. Add
them here in newlib to prevent any eventual conflicts that may appear.
Signed-off-by: Stefan Jumarea <stefanjumarea02@gmail.com> Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com> Approved-by: Eduard Vintilă <eduard.vintila47@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #32
Eduard Vintilă [Wed, 7 Dec 2022 12:07:41 +0000 (14:07 +0200)]
Add LWIP-compatible interface
This commit brings back source files which were previously defined in
`lib-lwip`, but deleted as part of the Musl compatibility effort in
order to avoid redefinition. The functions need to be implemented by
the libc, so we reintroduce them in the `lib-newlib` repo to retain
compatibility with lwip.
Signed-off-by: Eduard Vintilă <eduard.vintila47@gmail.com> Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com> Reviewed-by: Teodor Tiron <teotiron@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #28
Eduard Vintilă [Wed, 23 Nov 2022 18:34:46 +0000 (20:34 +0200)]
Adapt to the latest changes in Unikraft core
This commit updates various headers to match the latest posix-time
interface from Unikraft core, while also introducing new glue code
(`__uk_init_tls.c`) to adapt the library to the new TCB/TLS layout.
Checkpatch-Ignore: EMBEDDED_FUNCTION_NAME Signed-off-by: Eduard Vintilă <eduard.vintila47@gmail.com> Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com> Reviewed-by: Teodor Tiron <teotiron@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #28
Maria Sfiraiala [Wed, 3 Aug 2022 15:59:43 +0000 (18:59 +0300)]
Define O_DIRECTORY with different value
Previous fix regarding confusion between O_NONBLOCK and O_DIRECTORY
values changed O_NONBLOCK to a different number, therefore it drifted
away from FNONBLOCK (for which it was an alias) and caused a blocking
socket.
This commit simply changes the value of O_DIRECTORY, without being
necessary to redefine O_NONBLOCK or FNONBLOCK.
Fixes: 58f9f3a3f7b5 ("include/fcntl.h: Replace O_NONBLOCK with new one
on arm")
Signed-off-by: Maria Sfiraiala <maria.sfiraiala@gmail.com> Reviewed-by: Sergiu Moga <sergiu.moga@protonmail.com> Reviewed-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro> Approved-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #21
Marc Rittinghaus [Thu, 11 Aug 2022 06:50:01 +0000 (08:50 +0200)]
Remove inclusion of uk/user.h
Currently, we include uk/user.h from the core's posix-user library to
declare signatures for get/setresuid and get/setresgid. However,
these definitions should be part of the C library and not Unikraft.
This commit removes the dependency on the uk/user.h header
and moves the function declaration into the unistd.h directly. It also
adds the missing _GNU_SOURCE guard.
Signed-off-by: Marc Rittinghaus <marc.rittinghaus@kit.edu> Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com> Reviewed-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro> Approved-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #22
Marc Rittinghaus [Tue, 29 Mar 2022 11:40:33 +0000 (13:40 +0200)]
Remove mprotect stub
This commit removes the stub for mprotect as it has been introduced as
stubbed system call in ukmmap.
Signed-off-by: Marc Rittinghaus <marc.rittinghaus@kit.edu> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com> Approved-by: Alexander Jung <alex@unikraft.org> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #16
Daniel Dinca [Wed, 10 Mar 2021 10:21:30 +0000 (12:21 +0200)]
include/syscall.h: add cpp macros
Make the syscall header compatible with C++ compiler.
Signed-off-by: Daniel Dinca <dincadaniel97@gmail.com> Reviewed-by: Gabriel Mocanu <gabi.mocanu98@gmail.com> Approved-by: Alexander Jung <a.jung@lancs.ac.uk> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #3
Razvan Virtan [Mon, 4 Oct 2021 16:50:18 +0000 (19:50 +0300)]
Add missing symbols to the uksignal interface
The Go runtime requires some symbols related to signals that are not
currently defined in `signal.h` (after the uksignal support was added).
Changes brought in this commit:
- add missing fields to `siginfo_t`
- declare `sigaltstack` (the stub implementation is added to uksignal
in a separate pull request, part of the core Unikraft repository)
- add symbols for `ss_flags` values
Signed-off-by: Răzvan Vîrtan <virtanrazvan@gmail.com> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #11
Simon Kuenzer [Tue, 13 Jul 2021 19:10:23 +0000 (21:10 +0200)]
Correct license headers introduced by University Politehnica of Bucharest
This commit removes the additional clause
"THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY"
from BSD license headers that got introduced by mistake
with the following commits: 949e761 - Use our own <time.h> and <sys/time.h> headers (Costin Lupu) b2192bd - Add device related stubs (Vlad-Andrei BĂDOIU (78692)) 2c79cd5 - Introduce <sys/unistd.h> for including both newlib and Unikraft definitions (Costin Lupu) 04f03ec - Add WCOREDUMP and WIFCONTINUED (Costin Lupu) d901960 - Add sys/signal.h header (Mihai Pogonaru) 9287428 - Add mntent.c stubs (Costin Lupu) 20ab046 - Introduce <uk/_types.h> header for basic types defined by Unikraft (Costin Lupu)
On the one hand, this additional clause is redundant because
the BSD license already states that it must remain and the
copyright notice must be kept.
On the other hand, the clause freezes the file header
and prohibits future contributors from extending the
copyright notice for their contributions. This additional
clause is not part of the official BSD 3-clause.
The original author(s) or an authorized representative from
the author's affiliation consents to the change with a
`Reviewed-by` tag to this commit.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #8
Simon Kuenzer [Tue, 13 Jul 2021 19:10:23 +0000 (21:10 +0200)]
Correct license headers introduced by NEC Laboratories Europe GmbH
This commit removes the additional clause
"THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY"
from BSD license headers that got introduced by mistake
with the following commits: 2db987a - Add dl_iterate_phdr() stub (Charalampos Mainas) db39aae - Initial public release: configuration and build files (Florian Schmidt) fd30736 - Initial public release: glue code (Florian Schmidt) a4f6ac2 - update newlib glue for use with vfscore (Yuri Volchkov) d757c96 - Expose getline (Felipe Huici)
On the one hand, this additional clause is redundant because
the BSD license already states that it must remain and the
copyright notice must be kept.
On the other hand, the clause freezes the file header
and prohibits future contributors from extending the
copyright notice for their contributions. This additional
clause is not part of the official BSD 3-clause.
The original author(s) or an authorized representative from
the author's affiliation consents to the change with a
`Reviewed-by` tag to this commit.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #7
Simon Kuenzer [Sun, 22 Nov 2020 00:00:03 +0000 (01:00 +0100)]
Enable per-library allocator statistics
Instruments the library so that per-library allocator statistics are
possible. We make sure that code that uses `malloc()`, `free()`, and
company will resolve `uk_alloc_get_default()` within their compilation
scope so that the individual wrapper allocators can be used.
For this purpose, we declare the allocator functions as `static inline`
within the corresponding headers (like `<stdlib.h>`). Since the libc
headers are modified, we apply the new behavior only when
`CONFIG_LIBUKALLOC_IFSTATS` is switched on.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com>
Alexander Jung [Tue, 11 Aug 2020 16:27:23 +0000 (18:27 +0200)]
Makefile.uk: Include unix basename and dirname
This commit adds basename() and dirname() into the newlib build
for Unikraft. Both functions have only dependencies to <string.h>
making them easily compatible.
Signed-off-by: Alexander Jung <alexander.jung@neclab.eu> Reviewed-by: Razvan Virtan <virtanrazvan@gmail.com>
Using Clang results in compilation errors regarding the `__bswapXY` and
`__builtin_bswapXY` functions. There are simultaneously a definition of
a macro `__bswapXY` and a definition of a function `__bswapXY`; GCC
doesn't complain, but Clang does.
This is happening in Unikraft because the Unikraft core libraries are
using a minimized Unikraft newlib library[4], while the Unikraft app is
using the upstream (complete) newlib library[5]. In the end there are
two `endian.h` files: one in the Unikraft newlib[6], another one in the
upstream newlib (<repo>/newlib/libc/include/machine/endian.h). The
Unikraft newlib version of `endian.h` defines `__bswapXY` as inline
functions, whereas the upstream newlib defines them as macros. This
results in an error from Clang; GCC doesn't mind, though it's an issue
having multiple definitions for the same thing (even if one is a macro
or one is a function).
This commit fixes the issue. It removes the `__bswapXY` parts from the
Unikraft version of `endian.h` and includes the upstream version of
`endian.h`.
Jia He [Wed, 20 May 2020 09:56:03 +0000 (17:56 +0800)]
include/fcntl.h: Replace O_NONBLOCK with new one on arm
in newlib _default_fcntl.h, it defines O_NONBLOCK as follows:
\#define _FNONBLOCK 0x4000 /* non blocking I/O (POSIX style) */
But it is different from linux definition(04000=0x800):
\#define O_NONBLOCK 00004000
This difference confused virtio-9p open() syscall. If you open a
file with O_NONBLOCK(is 0x4000 in newlib) and sys_open will regard
it as O_DIRECTORY. At last it returns a ENOTDIR error.
Signed-off-by: Jia He <justin.he@arm.com> Reviewed-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Felipe Huici [Thu, 16 Apr 2020 19:49:39 +0000 (21:49 +0200)]
Define tzname
Currently, tzname is defined as an extern, which results in a
undefined reference linker error when attempting to use
it. This patch maps tzname to _tzanme, which *is*
defined. newlib does this mapping in OS-specific files that we
don't compile in, so this is a way to mimic that behavior.
Signed-off-by: Felipe Huici <felipe.huici@neclab.eu> Reviewed-by: Sharan Santhanam <sharan.santhanam@neclab.eu>
Felipe Huici [Thu, 12 Mar 2020 14:39:17 +0000 (15:39 +0100)]
Config.uk: remove imply of shim layer library
Currently, Config.uk sets imply LIBSYSCALL_SHIM, which for all intents
and purposes forces all images built with newlib to include the
syscall shim even when it's not needed. While "imply" still allows
users to manually deselect the option, one has to know about this
possiblity, and kraft-driven builds will not do this by default.
For applications that *do* need the shim library, this should be set
explicitly in their Config.uk files, or in their respective kraft.yaml
file.
Signed-off-by: Felipe Huici <felipe.huici@neclab.eu> Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
Simon Kuenzer [Mon, 17 Feb 2020 19:06:24 +0000 (20:06 +0100)]
Makefile.uk: -Wno-char-subscripts as global flag
Exposes the GCC suppress flag `-Wno-char-subscripts` globally. The
header <ctype.h> is causing the warning to appear when the
macros islower, isupper, tolower, toupper are used.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
Simon Kuenzer [Fri, 7 Feb 2020 13:26:38 +0000 (14:26 +0100)]
Provide `syscall()` symbol
Provides the `syscall()` function symbol (some language runtimes link
to the symbol directly). The function is calling `uk_syscall()` when
lib/syscall_shim is enabled. Otherwise, `syscall()` returns always
`-1` and sets `errno` to `ENOSYS`.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
LDBL_EQ_DBL is used by newlib to protect the definitions of the long
double math functions(e.g. cosl) as wrappers over long math
functions(e.g. cos). In this patch we define the symbol on ARM64 since
it was already defined under x86_64.
Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@stud.acs.upb.ro> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
Jia He [Fri, 20 Dec 2019 04:54:24 +0000 (12:54 +0800)]
Makefile.uk: enable wcstold_l in build
newlib's strtold.c compile-guards the definitinon of wcstold_l (needed
by wcstold.c) with _HAVE_LONG_DOUBLE. We set this flag to fix the
corresponding undefined reference linker error.
Signed-off-by: Jia He <justin.he@arm.com> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
Santiago Pagani [Thu, 19 Dec 2019 11:20:26 +0000 (12:20 +0100)]
Fix newlib ARM64 support
At the moment newlib compiles for ARM64 but fails at runtime. This
patch changes some generic newlib files for the machine specific
newlib files for ARM64.
Signed-off-by: Santiago Pagani <santiagopagani@gmail.com> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
Currently, including stdatomic.h causes the compilation to fail due to
the now obsolate definitions of atomic_* functions. We adapt the existing
implementations via a patch to fix this.
Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@stud.acs.upb.ro> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
Since utimes (and other related functions) have been implemented, this
stub doesn't make sense anymore. Deleting it to prevent double
definition, which produced a linker error.
Signed-off-by: Stefan Teodorescu <stefanl.teodorescu@gmail.com> Reviewed-by: Costin Lupu <costin.lupu@cs.pub.ro>
Costin Lupu [Wed, 27 Nov 2019 14:22:31 +0000 (16:22 +0200)]
Adapt crypt code to Unikraft
We tried to keep the changes of the original code to a minimum. For this
purpose, we used the C preprocessor in order to disable the 'hidden' musl
qualifier. We also had to rename the <crypt.h> header in
`musl-imported/src/include` to <_crypt.h> because, being a private header, we
could not add its directory at the top of the include paths list to include it
before the <crypt.h> header in `musl-imported/include` (the latter being
a public include path).
The restrict keyword doesn't exist in C++. Including headers that use
this keyword causes compilation errors. We replace the keyword with
the __restrict__ extension from GCC.
Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@stud.acs.upb.ro> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
Costin Lupu [Sat, 16 Nov 2019 22:06:48 +0000 (00:06 +0200)]
sys/poll.h: Declare poll() even if CONFIG_LWIP_SOCKET is defined
We need the poll() declaration even when CONFIG_LWIP_SOCKET is defined. We
disable only the macros values if CONFIG_LWIP_SOCKET is defined because lwip
comes with its own values.
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro> Reviewed-by: Stefan Teodorescu <stefanl.teodorescu@gmail.com>
Costin Lupu [Sun, 13 Oct 2019 13:37:32 +0000 (16:37 +0300)]
Introduce <sys/unistd.h> for including both newlib and Unikraft definitions
The ukunistd internal lib defines mostly user related functions. Some of them
are not declared by newlib headers. For those ones we will use the <uk/user.h>
from the ukunistd lib.
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
Costin Lupu [Sun, 13 Oct 2019 13:37:31 +0000 (16:37 +0300)]
Provide our own <timespec.h> and <_timespec.h> headers
Newlib uses <timespec.h> and <_timespec.h> headers for defining itimerspec and
timespec types, respectively. However, these definitions are not protected with
preprocessing guards in case they were previously defined, which happens for us
because we define these types in uktime internal lib. Therefore the solution is
to skip using newlib's headers and provide our own.
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
Costin Lupu [Sun, 13 Oct 2019 13:37:30 +0000 (16:37 +0300)]
Use our own <time.h> and <sys/time.h> headers
The uktime internal library provides the headers with the time related
definitions that we need. Given that newlib does not provide guard macros for
most of its definitions (and consequently we get errors because of duplicated
definitions), we decided to skip using its time headers.
In these glue headers we add only those definitions and inclusions that are
needed by newlib. For example, newlib's <sys/time.h> includes <sys/reent.h>, so
we will do the same here. In <time.h> we added the time zone/locale definitions
needed by newlib.
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
Costin Lupu [Sun, 13 Oct 2019 13:37:29 +0000 (16:37 +0300)]
Introduce <uk/_types.h> header for basic types defined by Unikraft
Newlib defines some fundamental data types in its <sys/_types.h> header. We need
to overwrite those definitions that are provided by Unikraft so we introduce the
<uk/_types.h> header. In order to use both our <uk/_types.h> and Newlib's
<sys/_types.h> we use an intermediary <sys/_types.h> header in which we can also
overwrite some other type definitions (e.g. _CLOCK_T_ in this patch).
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
Simon Kuenzer [Wed, 18 Sep 2019 12:23:46 +0000 (14:23 +0200)]
Remove umask, fchown, lchown, rename
Removes the stubs `umask`, `fchown`, and `lchown` from the the glue
code, since these functions are now provided by libvfscore. Further,
libfscore now provides an implementation of `rename`; as a result, we
no longer build newlibc's version of it.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
This patch adds support for enabling the following extensions:
* IO C99 formats enable more options for formatting output. We need this to
support "%z" in Python 3
* Linux errno extensions define more error numbers. We need this to support
ESHUTDOWN in Python 3
struct sigaltstack is already defined from newlib's sys/signal.h which
is included from ucontext.h. To avoid redinition error while compiling,
struct sigaltstack definition is disabled. We also disable the SA_* and SIG*
definitions since they are already defined in newlib's origin code.
Since we are using the fcntl() implementation in vfscore, we don't use newlib's
any more. This patch also adds some flags that are needed by fcntl() and that
were copied from musl, just like the previous ones from fcntl.h.
This patch revisits the functions in process.c, redistributes some of them and
implements the others. The remaining functions may very well be moved into an
internal "process" related library, but we will do this at another time. It's
worth saying that we set the PID of the unikernel to 1, saving the PID 0 for its
"parent", an invisibile process that is also not shown on Linux.
Redistributed functions:
- kill() and killpg() are moved to signal.c
- times() is moved to time.c
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
Actually the openpty() and forkpty() stubs should return errors, because
otherwise the callee will try to use the amaster and aslave file descriptors
returned by the functions.
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
Files imported from musl should have the same location, relative to
musl-imported/ subdirectory. However, this was not applied when syslog.c was
imported.
The OSv implementation, where we took this from, dropped the setlogmask()
function. We bring it back from the musl implementation because it is needed by
Python 3.
Costin Lupu [Thu, 22 Aug 2019 10:10:56 +0000 (13:10 +0300)]
patches: Allow including custom malloc.h headers
We found this while porting Go runtime. The libgo library had its own malloc.h
header which it tried to include, but because of global include paths it
included the malloc.h of newlib. We workaround this by defining
_INCLUDE_MALLOC_H_ guard before including newlib's malloc.h and including our
own malloc.h next.
Costin Lupu [Thu, 22 Aug 2019 10:10:55 +0000 (13:10 +0300)]
Fix signal related issues
1. We enable _POSIX_REALTIME_SIGNALS preprocessing flag in order to use
siginfo_t definition.
2. We extend the siginfo_t definition with si_addr field by patching original
code. Further more, we use the same definition of struct sigaction as in the
case of RTEMS.
3. We have a circular inclusion cycle in the original code, where time.h
includes signal.h and viceversa. We fix this by using forward declaration in the
original code (again, by patching).