]> xenbits.xensource.com Git - unikraft/libs/ruby.git/log
unikraft/libs/ruby.git
5 years agoFix double definition warning and add suppress flag for cleaner build.
Felipe Huici [Fri, 14 Feb 2020 12:33:11 +0000 (13:33 +0100)]
Fix double definition warning and add suppress flag for cleaner build.

Signed-off-by: Felipe Huici <felipe.huici@neclab.eu>
Reviewed-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
5 years agoMakefile.uk: fix compilation warnings for gcc >= 9.0
Stefan Teodorescu [Mon, 16 Dec 2019 14:45:55 +0000 (16:45 +0200)]
Makefile.uk: fix compilation warnings for gcc >= 9.0

In GCC 9.0, a new type of warning was introduced
(-Waddress-of-packed-member), which shows up multiple times in Ruby
code. This was disabled for GCC versions >= 9.0.

Signed-off-by: Stefan Teodorescu <stefanl.teodorescu@gmail.com>
Reviewed-by: Costin Lupu <costin.lupu@cs.pub.ro>
5 years agoREADME.md: Update with info about building and running
Costin Lupu [Mon, 16 Dec 2019 13:47:53 +0000 (15:47 +0200)]
README.md: Update with info about building and running

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Stefan Teodorescu <stefanl.teodorescu@gmail.com>
5 years agoProvide main() function if configured to do so
Costin Lupu [Mon, 16 Dec 2019 13:47:52 +0000 (15:47 +0200)]
Provide main() function if configured to do so

We provide a configurable main() function for running Ruby out-of-the-box and
also for showing an example of such a function to be used by custom
applications. It also sets the necessary Ruby environment variables.

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Stefan Teodorescu <stefanl.teodorescu@gmail.com>
5 years agoMakefile.uk: Add rule for creating root filesystem
Costin Lupu [Mon, 16 Dec 2019 13:47:51 +0000 (15:47 +0200)]
Makefile.uk: Add rule for creating root filesystem

The Ruby interpreter needs a filesystem where to keep its libraries. This patch
creates a root filesystem and installs the Ruby libraries in `/lib/ruby/2.6.0/`
directory. For creating the filesystem the following command has to be run:

$ make ruby-rootfs path=<directory>

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Stefan Teodorescu <stefanl.teodorescu@gmail.com>
5 years agotests: Build tests
Costin Lupu [Mon, 16 Dec 2019 13:47:50 +0000 (15:47 +0200)]
tests: Build tests

The Ruby unit testing depends on both extensions and encodings. We currently
add support for running only the time and file tests. Enabling the rest of the
tests is subject of further work.

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Stefan Teodorescu <stefanl.teodorescu@gmail.com>
5 years agoencodings: Build encodings
Costin Lupu [Mon, 16 Dec 2019 13:47:49 +0000 (15:47 +0200)]
encodings: Build encodings

All encodings are included in a new library, libruby_enc. Given that the
extensions files are generated at build time by the origin build system, we
also have to run `./configure` and `make` for the original build before
building them for Unikraft. This is done once for both extensions and
encodings.

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Stefan Teodorescu <stefanl.teodorescu@gmail.com>
5 years agoextensions: Build extensions
Costin Lupu [Mon, 16 Dec 2019 13:47:48 +0000 (15:47 +0200)]
extensions: Build extensions

All extensions are included in a new library, libruby_ext. Each extension has
its own configuration option and a <extconf.h> header. Given that the
extensions files are generated at build time by the origin build system, we
also have to run `./configure` and `make` for the original build before
building them for Unikraft.

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Stefan Teodorescu <stefanl.teodorescu@gmail.com>
5 years agoextensions/socket: Disable unavailable features
Costin Lupu [Thu, 12 Dec 2019 17:42:33 +0000 (19:42 +0200)]
extensions/socket: Disable unavailable features

This is an example of disabling features in the <extconf.h> header of an
extension. Here we disable the flags for `accept4()` and `ifaddrs` structure
and its associated functions.

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Stefan Teodorescu <stefanl.teodorescu@gmail.com>
5 years agoextensions: Add generated files
Costin Lupu [Thu, 12 Dec 2019 17:42:32 +0000 (19:42 +0200)]
extensions: Add generated files

Each extensions has its own <extconf.h> header, which is generated based on the
build system configuration. We choose to add this header for `socket` extension
into the glue code because we need to change some of its configurations in the
next patch. All the extensions are registered in the `extinit.c` file.

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Stefan Teodorescu <stefanl.teodorescu@gmail.com>
5 years agopatches: Limit all memory allocations to maximum 4K bytes
Andrei Gogonea [Fri, 6 Dec 2019 18:14:56 +0000 (20:14 +0200)]
patches: Limit all memory allocations to maximum 4K bytes

We currently do not support allocations greater than 4K and that is because we
do not have a proper page tables implementation yet and a complete mmap()
implementation. Therefore this patch should be removed when we will have these
in Unikraft.

Signed-off-by: Andrei Gogonea <andrei.gogonea09@gmail.com>
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Stefan Teodorescu <stefanl.teodorescu@gmail.com>
5 years agocore: Add thread related definitions
Costin Lupu [Sat, 7 Dec 2019 08:29:37 +0000 (10:29 +0200)]
core: Add thread related definitions

With pthread-embedded library, special care has to be taken when dealing with
conversions from `pthread_t` to scalar values. Therefore we have to define our
own conversion functions.

We also copy `ruby_fill_thread_id_string()` function from origin to glue in
order to avoid patching the origin code. The function is copied here because of
a bug in the Ruby implementation, which only defines it if THREAD_DEBUG is
enabled. When this bug is fixed in Ruby, this is no long necessary.

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Stefan Teodorescu <stefanl.teodorescu@gmail.com>
5 years agocore: Build core functionality
Andrei Gogonea [Sat, 7 Dec 2019 06:25:01 +0000 (08:25 +0200)]
core: Build core functionality

With these changes we only build the Ruby interpreter. In the following patches
we will add Ruby extensions and encodings as well. The original Ruby build
provides what is called 'miniruby' - the minimalistic variant of the Ruby
intepretor and which doesn't have any extensions. We used the same idea to
provide a minimalistic version for Unikraft when the mini configuration is
checked via menuconfig.

Some of the sources need to be generated by the origin build system, that's why
we are running both `./configure` and `make` on the origin code before building
for Unikraft.

Signed-off-by: Andrei Gogonea <andrei.gogonea09@gmail.com>
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Stefan Teodorescu <stefanl.teodorescu@gmail.com>
5 years agoruby/config.h: Disable features unavailable in Unikraft
Andrei Gogonea [Sun, 8 Dec 2019 09:54:54 +0000 (11:54 +0200)]
ruby/config.h: Disable features unavailable in Unikraft

Signed-off-by: Andrei Gogonea <andrei.gogonea09@gmail.com>
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Stefan Teodorescu <stefanl.teodorescu@gmail.com>
5 years agoruby/config.h: Introduce generated configuration file
Andrei Gogonea [Sun, 8 Dec 2019 09:54:53 +0000 (11:54 +0200)]
ruby/config.h: Introduce generated configuration file

Signed-off-by: Andrei Gogonea <andrei.gogonea09@gmail.com>
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Stefan Teodorescu <stefanl.teodorescu@gmail.com>
5 years agoIntroduce library skeleton
Andrei Gogonea [Sun, 8 Dec 2019 09:54:52 +0000 (11:54 +0200)]
Introduce library skeleton

We use the BSD-3 license.

Signed-off-by: Andrei Gogonea <andrei.gogonea09@gmail.com>
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Stefan Teodorescu <stefanl.teodorescu@gmail.com>
5 years agoInitial commit (empty)
Andrei Gogonea [Sun, 17 Nov 2019 12:27:37 +0000 (14:27 +0200)]
Initial commit (empty)

Signed-off-by: Andrei Gogonea <andrei.gogonea09@gmail.com>