Commit Graph

29 Commits

Author SHA1 Message Date
Ehmry - 88ffe8c1f2 libc: add sigwait to symbols 2020-05-27 16:24:18 +05:30
Christian Helmuth 4ab990ad5b libc: provide C++ runtime symbols in ABI
This commit puts all C++ runtime/support symbols of ld.lib.so in a
dedicated section of base/lib/symbols/ld and mirrors the section to
libports/lib/symbols/libc. So, the libc ABI resolves potential C++
runtime dependencies of base-ABI-agnostic components at link time. The
runtime resolution is done by the linker by symbol lookup in ld.lib.so.

Issue #3720
2020-04-17 12:40:13 +02:00
Pirmin Duss 6f1357c6f8 libc: add symbol used by protobuf
Issue #3692
2020-04-17 12:39:32 +02:00
Piotr Tworek 139f390317 libc: Expose timespec_get symbol.
The function is exposed in libc headers provided by Genode, the code for
the function is being compiled and actually works, but the symbol is
missing from the symbols file resulting in linking failures. Add it to
the libc symbols file.

Fixes #3676
Fixes #3677
2020-03-26 11:38:53 +01:00
Christian Prochaska 597098845c libc: support pthread cleanup handlers
Fixes #3642
2020-02-20 12:08:16 +01:00
Christian Helmuth ff5175ec76 libc: synchronization primitives based on monitor
The libc monitor facility enables the execution of monitor jobs by the
main thread when the monitor pool was charged. In comparison to the
current suspend/resume_all mechanism the main thread iterates over all
job functions in contrast to waking up all threads to check their
conditions by themselves. Threads are only woken up if the completion
condition was met.

This commit is the result of a collaboration with Christian Prochaska.
Many thanks for your support, Christian.

Fixes #3550
2020-02-10 14:21:47 +01:00
Norman Feske 648bcd1505 libc: unify use of namespaces
This patch unifies the patterns of using the 'Genode' and 'Libc'
namespaces.

Types defined in the 'internal/' headers reside in the 'Libc'
namespace. The code in the headers does not need to use the
'Libc::' prefix.

Compilation units import the 'Libc' namespace after the definition of
local types. Local types reside in the 'Libc' namespace (and should
eventually move to an 'internal/' header).

Since the 'Libc' namespace imports the 'Genode' namespace, there is
no need to use the 'Genode::' prefix. Consequently, code in the
compilation units rarely need to qualify the 'Genode' or 'Libc'
namespaces.

There are a few cases where the 'Libc', the 'Genode', and the global
(libc) namespaces are ambigious. In these cases, an explicit
clarification is needed:

- 'Genode::Allocator' differs from 'Libc::Allocator'.
- 'Genode::Env' differs from 'Libc::Env'.
- Genode's string functions (strcmp, memcpy, strcpy) conflict
  with the names of the (global) libc functions.
- There exist both 'Genode::uint64_t' and the libc'c 'uint64_t'.

Issue #3497
2019-11-19 14:10:55 +01:00
Ehmry - 36111a2edf Libc: implement getifaddrs
Implement getifaddrs and freeifaddrs within the libc using socket
control files at the VFS. Add an "address" and "netmask" file to the
lwIP plugin.

Only a single IPv4 address is initially supported, and the broadcast
address returned will never be valid.

Fixes #3439
2019-09-02 16:36:07 +02:00
Ehmry - 863654d188 Libc: update port to Freebsd 12
Fix #3289
2019-05-27 14:46:53 +02:00
Josef Söntgen 5bab5f4cca libc: extent vbox specific pthread_create API
Make it possible to adopt normal Genode::Threads for use within in a
pthread environment.

Issue #3164.
2019-02-19 11:12:13 +01:00
Christian Helmuth 8236a18260 Revert "Use strictly-typed Microseconds for Libc timeout scheduling"
This reverts commit 4808565a28afe9ff248fb5c98aceb6f8d3e791c1.
2019-01-07 12:25:44 +01:00
Ehmry - 8a3b0ebea9 Use strictly-typed Microseconds for Libc timeout scheduling
Fix #3050
2019-01-07 12:25:42 +01:00
Ehmry - 7a11384177 Merge pthread into libc library
The pthread API is considered a standard feature of libc so better to
simply merge it with the libc. Pthreads are in fact already a part of
the libc in the form of weak symbols. This merger is also a prerequisite
for better integrating pthreads with the libc I/O task.

Fix #3054
2018-11-29 11:46:01 +01:00
Ehmry - 874ba409ca Libc: single-user getpwent implementation
Implement the passwd database subroutines with single-user database.
This database is populated with a <passwd/> sub-node of the libc
configuration node. All fields of the "passwd" struct may be specified
with reasonable defaults provided for a "root" user. This allows a
libc-based component to spoof user information for the sake of porting
existing Unix software.

A test is provided at run/libc_getpwent.

Fix #2919
2018-09-13 15:21:10 +02:00
Johannes Schlatow 4ae47c3f38 libc: add clock_getres (required by python 3) 2018-06-29 10:44:56 +02:00
Christian Helmuth a6e0fdd505 libc: support syscall(SYS_thr_self,...)
This syscall returns the thread ID / light-weight PID of the calling
thread under FreeBSD.

Issue #2791
2018-05-30 13:36:07 +02:00
Sebastian Sumpf 8605e15b4f libc: add suspend and resume_all to symbol map
This commit enables the pthread library to hook into the libc execution
model and can be reverted after #2812 is fixed.

Issue #2791
2018-05-30 13:36:05 +02:00
Alexander Senier ac42670a0e Add fstatfs to libc ABI symbols
Fixes #2721
2018-03-29 14:59:05 +02:00
Christian Helmuth b7fffb1b24 abi: remove duplicates and internal symbols, fix sizes
The most important part of this patch are symbol-size changes, which
potentially lead to data corruption.

Issue #2639
2018-01-17 12:14:42 +01:00
Emery Hemingway 8ca63d4a6e libc: reintegrate libc_resolv library
Remove getaddrinfo and freeaddrinfo from the Libc::Plugin and get rid of
the extra libc_resolv library. Remove getaddrinfo/freeaddrinfo symbol
hiding patch for FreeBSD sources. Remove libc_resolv from Makefiles and
run scenarios.

Fix #2273
2017-10-05 17:40:04 +02:00
Emery Hemingway 604ff9ca2c msync and Sytem V semaphore dummies
Ref #2467
2017-08-30 09:59:57 +02:00
Sebastian Sumpf c1029dd556 libc: add '__fpclassifyf' to libc symbol map
issue #2488
2017-08-28 16:49:42 +02:00
Christian Prochaska 58f2088d3e gcc: update to version 6.3.0
Issue #2372
2017-05-31 13:15:49 +02:00
Christian Prochaska a62f09e87e libc: add 'Libc::Component::stack_size()' to the ABI symbol file
Fixes #2354
2017-05-02 15:28:52 +02:00
Christian Helmuth eab477370f libc: select support for components
Libc components cannot use regular calls to select() as this may suspend
their execution. In this case incoming RPCs will be deferred until
select() returns and the component returns to the entrypoint dispatch
loop. The Libc::Signal_handler solves this problem with a its select()
that either returns the currently ready file descriptors immediately or
calls the registered handler function during libc resume.
2017-02-28 12:59:17 +01:00
Norman Feske 3a65f0bba3 libc: 'with_libc' mechanism to enter libc runtime
This commit extends an easy-to-use mechanism to allow Genode component
code to enter/leave the libc application context. This is needed
whenever low-level component code (like signal handlers or RPC
functions) need to interact with potentially blocking libc I/O
functions.

Please note that this commit contains the API-level design only. The
actual context switching code 'execute_in_application_context' is
missing.
2017-02-28 12:59:16 +01:00
Emery Hemingway 745eb89237 lib/component: pass extended Libc::Env
Libc::Env is the Genode::Env interface extended to cover access
to the XML content of the 'config' ROM and a VFS instance. This
deduplicates the burden of components to attain and manage
these resources.

Fix #2217
Ref #1987
2017-01-13 13:07:01 +01:00
Norman Feske 3d7b92ea50 Generalize ABI mechanism to shared objects
This patch make the ABI mechanism available to shared libraries other
than Genode's dynamic linker. It thereby allows us to introduce
intermediate ABIs at the granularity of shared libraries. This is useful
for slow-moving ABIs such as the libc's interface but it will also
become handy for the package management.

To implement the feature, the build system had to be streamlined a bit.
In particular, archive dependencies and shared-lib dependencies are now
handled separately, and the global list of 'SHARED_LIBS' is no more.
Now, the variable with the same name holds the per-target list of shared
libraries used by the target.
2017-01-13 13:06:54 +01:00
Norman Feske eb6f7e74cc libports: add libc symbols 2017-01-13 13:06:54 +01:00