base: fix build errors with gcc 12

Fixes #4829
This commit is contained in:
Christian Prochaska 2023-05-02 09:40:21 +02:00 committed by Christian Helmuth
parent 98bf2dadb8
commit eab8db228b
3 changed files with 3 additions and 2 deletions

View File

@ -30,7 +30,7 @@ namespace Genode {
static inline Parent_capability parent_cap() static inline Parent_capability parent_cap()
{ {
Cap_index::id_t const local_name = (Cap_index::id_t)_parent_cap; Cap_index::id_t const local_name = (Cap_index::id_t)_parent_cap[0];
static Cap_index *i = cap_map().insert(local_name, Foc::PARENT_CAP); static Cap_index *i = cap_map().insert(local_name, Foc::PARENT_CAP);
/* /*

View File

@ -111,6 +111,7 @@ namespace Genode {
/** /**
* Return length of null-terminated string in bytes * Return length of null-terminated string in bytes
*/ */
__attribute((optimize("no-tree-loop-distribute-patterns")))
inline size_t strlen(const char *s) inline size_t strlen(const char *s)
{ {
size_t res = 0; size_t res = 0;

View File

@ -41,6 +41,6 @@ extern unsigned char _initial_stack_base[];
* capability prior the execution of the main thread. It corresponds to the * capability prior the execution of the main thread. It corresponds to the
* '_parent_cap' symbol defined in 'src/ld/genode.ld'. * '_parent_cap' symbol defined in 'src/ld/genode.ld'.
*/ */
extern unsigned long _parent_cap; extern unsigned long _parent_cap[];
#endif /* _INCLUDE__BASE__CRT0_H_ */ #endif /* _INCLUDE__BASE__CRT0_H_ */