]> xenbits.xensource.com Git - unikraft/libs/libcxx.git/log
unikraft/libs/libcxx.git
20 months agoMakefile.uk: Suppress noisy warnings
Andrei Tatar [Tue, 27 Jun 2023 16:17:58 +0000 (18:17 +0200)]
Makefile.uk: Suppress noisy warnings

This change adds several warning suppression flags, some
compiler-specific or language-specific.

Signed-off-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #30

23 months agoAdd compiler dependency to some warnings
Marco Schlumpp [Fri, 12 May 2023 09:32:49 +0000 (11:32 +0200)]
Add compiler dependency to some warnings

Clang and GCC support a different set of warnings.

Signed-off-by: Marco Schlumpp <marco.schlumpp@gmail.com>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #28

23 months agopatches: Backport upstream fix for __is_convertible
Andrei Tatar [Thu, 4 May 2023 14:20:31 +0000 (16:20 +0200)]
patches: Backport upstream fix for __is_convertible

Replicate upstream commit 484e64f7e7b2c0494d7b2dbfdd528bcd707ee652.
libcxx previously used the `__is_convertible_to` builtin which wasn't
supported by GCC; this patch adds support for `__is_convertible` which
is available as of GCC 13.

Signed-off-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #28

23 months agoUse unikraft syscalls for futex
Marco Schlumpp [Thu, 6 Apr 2023 16:56:16 +0000 (18:56 +0200)]
Use unikraft syscalls for futex

Signed-off-by: Marco Schlumpp <marco@unikraft.io>
Signed-off-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #28

23 months agoUpdate to LLVM 14.0.6
Andrei Tatar [Fri, 5 May 2023 18:19:26 +0000 (20:19 +0200)]
Update to LLVM 14.0.6

Co-authored-by: Marco Schlumpp <marco@unikraft.io>
Signed-off-by: Marco Schlumpp <marco@unikraft.io>
Signed-off-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #28

23 months agoMakefile.uk: Sort library sources
Andrei Tatar [Fri, 5 May 2023 19:47:11 +0000 (21:47 +0200)]
Makefile.uk: Sort library sources

Signed-off-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #28

2 years agopatches: Remove hash templates for `pthread_t` RELEASE-0.12.0 RELEASE-0.13.0 RELEASE-0.13.1
Tu Dinh Ngoc [Mon, 19 Dec 2022 22:37:51 +0000 (23:37 +0100)]
patches: Remove hash templates for `pthread_t`

Musl defines `pthread_t` as `unsigned long`. This type already has a
hash template, causing a redefinition error on builds with C++
atomics/threads enabled.

Remove the offending patch.

Signed-off-by: Tu Dinh Ngoc <dinhngoc.tu@irit.fr>
Reviewed-by: Radu Nichita <radunichita99@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #26

2 years agopatches: Add patch with signature for vasprintf RELEASE-0.11.0
Maria Sfiraiala [Mon, 14 Nov 2022 10:30:39 +0000 (12:30 +0200)]
patches: Add patch with signature for vasprintf

Compilation step for __bsd_locale_fallbacks.h requires having a
signature for vasprintf.

This commit provides a patch that adds the needed function signature in
include/support/musl/xlocale.h, which will be included in
__bsd_locale_fallbacks.h.

Signed-off-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #23

2 years agoinclude/math.h: Add libcxx math.h header
Stefan Jumarea [Fri, 4 Nov 2022 10:41:28 +0000 (12:41 +0200)]
include/math.h: Add libcxx math.h header

When building `libcxx` with musl, some undefined functions errors appear
because the musl math.h header is used.

`cmath` looks for some funtions defined in an anonymous namespace, but they
are defined as macros within the `musl` headers. This leads to errors since
the macros can not match the required functions.

The functions are defined in `libcxx` headers, but they are not processed
since the `musl` headers are prioritised. We cannot prioritise the `libcxx`
headers since it leads to a lot of issues similar to this one.

Signed-off-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #22

2 years agopatches: Include the first stddef header file
Stefan Jumarea [Sat, 29 Oct 2022 10:27:50 +0000 (13:27 +0300)]
patches: Include the first stddef header file

When using Musl, the build breaks because the `include_next` cannot find
a new `stddef.h` header file.

Signed-off-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #18

2 years agopatches: Define strtof_l and strtod_l in locale
Maria Sfiraiala [Sun, 30 Oct 2022 18:22:23 +0000 (20:22 +0200)]
patches: Define strtof_l and strtod_l in locale

When compiled for Aarch64, apps using libcxx fail due to strtof_l and
strtod_l not being defined in include/locale.

This commit adds a patch which includes the header that contains
the definitions in include/locale.

It also modifies Makefile.uk to add the file in the build process.

Signed-off-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #10

2 years agoMakefile.uk: Add support headers for Musl
Stefan Jumarea [Sat, 29 Oct 2022 07:47:51 +0000 (10:47 +0300)]
Makefile.uk: Add support headers for Musl

When building with Musl, we need the headers located in the
`include/support/musl` directory of `libcxx` origin source code.

Without adding the headers in the include path, the build fails with
"xlocale.h not found".

Signed-off-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #10

2 years agoinclude: Add location of features.h file for Musl
Stefan Jumarea [Sat, 29 Oct 2022 07:38:04 +0000 (10:38 +0300)]
include: Add location of features.h file for Musl

When using Musl, the `features.h` header is not placed within the `sys/`
directory, so the build fails.

Signed-off-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #9

2 years agoglue.c: Remove multiple definitions when using Musl
Stefan Jumarea [Sat, 29 Oct 2022 10:05:50 +0000 (13:05 +0300)]
glue.c: Remove multiple definitions when using Musl

Musl provides the `catclose`, `catopen` and `catgets` functions, so when
building `libcxx` with Musl the linking fails.

This commit only defines the needed functions when `LIBMUSL` is not selected.

Signed-off-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #17

2 years agopatches: Define strtoll_l and strtoull_l in `locale`
Stefan Jumarea [Sat, 29 Oct 2022 09:41:26 +0000 (12:41 +0300)]
patches: Define strtoll_l and strtoull_l in `locale`

The `strtoull_l` and `strtoll_l` functions are needed by `locale` and
are defined as inlines in `xlocale.h`.

Signed-off-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #14

3 years agoCorrect license headers introduced by University Politehnica of Bucharest RELEASE-0.10.0 RELEASE-0.6 RELEASE-0.7.0 RELEASE-0.8.0 RELEASE-0.9.0
Simon Kuenzer [Tue, 13 Jul 2021 19:13:13 +0000 (21:13 +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:
 3602034 - Initial port of libcxx to Unikraft (Vlad-Andrei BĂDOIU (78692))

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>
5 years agoFix crash due to atomics on bare-metal arm64 RELEASE-0.5
Felipe Huici [Tue, 28 Jan 2020 12:55:45 +0000 (13:55 +0100)]
Fix crash due to atomics on bare-metal arm64

At the moment atomic operations are working on ARM64 for KVM; however,
they are not working on baremetal on ARM64 (i.e., on the Raspberry Pi
3B+).  This can be most likely be solved by enabling the caches and
setting up a compatible memory configuration.  In the meantime, these
patches allow us to have functionally-equivalent non-atomic
implementations of the gcc builtins working on baremetal on ARM64.
Once the issue is fixed this workaround can be removed.

Signed-off-by: Felipe Huici <felipe.huici@neclab.eu>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoAdd suppress flags for cleaner build. RELEASE-0.4
Felipe Huici [Thu, 13 Feb 2020 20:44:12 +0000 (21:44 +0100)]
Add suppress flags for cleaner build.

Signed-off-by: Felipe Huici <felipe.huici@neclab.eu>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoAdd ARM64 support
Vlad-Andrei BĂDOIU (78692) [Tue, 14 Jan 2020 16:02:58 +0000 (16:02 +0000)]
Add ARM64 support

In order to compile under ARM64 we remove the definitions of __x86_64__
and __FLT16_MANT_DIG__.

Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@stud.acs.upb.ro>
Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
5 years agoConfig.uk: Make CXX_THREADS depend on LIBCXXABI_THREADS
Costin Lupu [Wed, 4 Dec 2019 11:17:27 +0000 (13:17 +0200)]
Config.uk: Make CXX_THREADS depend on LIBCXXABI_THREADS

... because LIBCXX depends on LIBCXXABI.

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@stud.acs.upb.ro>
5 years agoRemove strtold_l external symbol from stdlib.h
Vlad-Andrei BĂDOIU (78692) [Mon, 18 Nov 2019 15:23:32 +0000 (15:23 +0000)]
Remove strtold_l external symbol from stdlib.h

Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@stud.acs.upb.ro>
Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
5 years agoRemove external symbols definitions
Vlad-Andrei BĂDOIU (78692) [Fri, 8 Nov 2019 12:15:47 +0000 (12:15 +0000)]
Remove external symbols definitions

The latest newlib patch, 05b35a729f9, enables the definitions of the
long double math functions. This patch solves the conflicts by removng
their external definitions from libcxx.

Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@stud.acs.upb.ro>
Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
5 years agoMakefile.uk: Rename SUPPRESS_FLAGS to LIBCXX_SUPPRESS_FLAGS
Costin Lupu [Sat, 12 Oct 2019 12:29:19 +0000 (15:29 +0300)]
Makefile.uk: Rename SUPPRESS_FLAGS to LIBCXX_SUPPRESS_FLAGS

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
5 years agoRemove exportsyms.uk
Vlad-Andrei BĂDOIU (78692) [Sun, 6 Oct 2019 21:29:38 +0000 (21:29 +0000)]
Remove exportsyms.uk

We remove the exportsyms.uk file due to issues with name mangling.

Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@stud.acs.upb.ro>
Reviewed-by: Costin Lupu <costin.lupu@cs.pub.ro>
5 years agoEnable threads support
Costin Lupu [Tue, 4 Jun 2019 20:54:39 +0000 (23:54 +0300)]
Enable threads support

This patch defines the macros and adds the hashtable template required for
enabling threads support in cxx library.

Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@stud.acs.upb.ro>
Signed-off-by: Teodora Serbanescu <teo.serbanescu16@gmail.com>
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
5 years agoExport __dso_handle
Costin Lupu [Sun, 2 Jun 2019 15:11:22 +0000 (18:11 +0300)]
Export __dso_handle

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
5 years agoFix some of the compiling warnings
Costin Lupu [Sun, 2 Jun 2019 13:46:16 +0000 (16:46 +0300)]
Fix some of the compiling warnings

This patch removes the "unused-parameter" warnings generated by the origin code
and the multiple definition warnings for _LIBCPP_BUILDING_LIBRARY and
_LIBCPPABI_VERSION macros.

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
5 years agoAdd features.h
Costin Lupu [Sat, 1 Jun 2019 20:16:49 +0000 (23:16 +0300)]
Add features.h

When threads are enabled, cxx library includes a 'features.h' header in its
'include/__config' header from origin. The header introduced by this patch
includes the 'sys/features.h' header from newlib.

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
6 years agoAdd exported symbols
Vlad-Andrei BĂDOIU (78692) [Wed, 10 Apr 2019 12:26:30 +0000 (12:26 +0000)]
Add exported symbols

This patch adds the mangled functions to the
exportsyms.uk. Due to the high number of symbols
this is a separate patch.

Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@stud.acs.upb.ro>
Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
6 years agoInitial port of libcxx to Unikraft
Vlad-Andrei BĂDOIU (78692) [Wed, 10 Apr 2019 12:26:29 +0000 (12:26 +0000)]
Initial port of libcxx to Unikraft

This is our initial port of libcxx to Unikraft as an external
library. Libc is requiered for it to work. The dependency list
should contain: ...:$(UK_LIBS)/libunwind:
$(UK_LIBS)/compiler-rt:$(UK_LIBS)/libcxxabi:$(UK_LIBS)/libcxx:
$(UK_LIBS)/newlib:...

Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@stud.acs.upb.ro>
Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
6 years agoAdd .gitignore
Vlad-Andrei BĂDOIU (78692) [Wed, 10 Apr 2019 12:26:28 +0000 (12:26 +0000)]
Add .gitignore

Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@stud.acs.upb.ro>
Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
6 years agoInitial commit (empty)
Vlad-Andrei Badoiu [Thu, 28 Mar 2019 17:20:10 +0000 (19:20 +0200)]
Initial commit (empty)