Commit graph

1698 commits

Author SHA1 Message Date
Chris Friedt
ac52bd629d posix: deprecated: remove new options without deprecation
A few previously deprecated Kconfig options have not yet been
present for 1 release cycle and can (theoretically) just be
removed, without deprecation (see next commit).

* GETENTROPY
* POSIX_CONFSTR
* POSIX_ENV
* POSIX_SYSLOG

For dependency information, please see
https://docs.zephyrproject.org/3.6.0/kconfig.html#kconfig-search

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-07-18 16:28:02 -04:00
Gerard Marull-Paretas
28a515982c lib: libc: errno: remove non-existing c_std_lib doxygen group
Some groups were being added to a non-existing group: c_std_lib

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-07-18 09:23:33 -04:00
Yong Cong Sin
0155c6f87f lib/libc: minimal: remove deprecated headers
This headers have been deprecated for > 2 releases,
remove them.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-07-12 20:38:20 -04:00
Evgeniy Paltsev
89f3d220d4 tests: posix: headers: fix build error when minimal libc is used
The `tests/posix/headers/portability.posix.headers.without_posix_api`
test fails to build in case of toolchain which uses minimal libc by
default (for example ARC MWDT toolchain).

It can be easily fixed by providing sighal.h handler in minimal libc

Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2024-07-12 05:49:28 -04:00
Evgeniy Paltsev
d8929b5dc6 posix: shm: fix build error with minimal libc
In `lib/posix/options/shm.c` we don't include stdio.h
header but use standard SEEK_xxx definitions (i.e. `SEEK_SET`)
which cause build issues (if the minimal libc is used).

Fix that.

Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2024-07-10 14:40:48 +02:00
Yong Cong Sin
f87539081d lib/libc: picolibc: select its source with Kconfig choice
Implement the selection of the picolibc source in a Kconfig
choice as they are mutually exclusive.

The following table represents the possible choices, where 'X'
means that `PICOLIBC_SUPPORTED=n` and is guarded in the parent
level as `PICOLIBC=n`, so we do not need to care.

Module  Toolchain    C++   |       Choice
  0         0         0    |          X
  0         0         1    |          X
  0         1         0    |    Toolchain only
  0         1         1    |    Toolchain only
  1         0         0    |      Module only
  1         0         1    |          X
  1         1         0    |   Toolchain/Module
  1         1         1    |    Toolchain only

The current implementation favors `PICOLIBC_USE_TOOLCHAIN` over
`PICOLIBC_USE_MODULE` whenever possible, that preference is
maintained in this implementation as well - the TOOLCHAIN
source will be the default choice when the toolchain supports
it or when the C++ is enabled. Otherwise, fallback to MODULE.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-07-09 17:29:12 -04:00
Mykyta Poturai
3afd9429c0 json: Fix alignment calculation for nested objects
Currently, json array macros are passing the outer "container" struct
to the Z_JSON_ELEMENT_DESCR macro, causing the alignment to be calculated
from the outer struct which may be incorrect. Fix this by using the
biggest shift from the nested objects to calculate the alignment as the
struct size is calculated based on the biggest alignment of it's members.

Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
2024-07-09 19:02:25 +02:00
Krzysztof Chruściński
47df73e51b lib: os: mpsc_pbuf: Do not use sem when CONFIG_MULTITHREADING=n
When multithreading is off packet buffer should not use feature which
allows waiting for available buffer.

mpsc_pbuf is used by logging which can work in deferred mode in
no multithreading build.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-07-08 14:58:32 -04:00
Yong Cong Sin
89bf4b2ad9 lib/libc: select PICOLIBC_SUPPORTED if toolchain has it or module exists
Currently, `PICOLIBC_SUPPORTED` could be enabled even when
neither the toolchain has picolibc nor the picolibc module is
present, this can be the case when Zephyr is built with
external toolchain (non-Zephyr SDK) + external build system
where PICOLIBC module doesn't exist.

Fix this by having `PICOLIBC_SUPPORTED` depends on either
toolchain OR module, while taking the libc++ into
consideration.

Here's the full logic table of when the PICOLIBC should
be marked as supported.

libc++  TOOLCHAIN       MODULE          PICOLIBC_SUPPORTED
  0         0             0                     0
  0         0             1                     1
  0         1             0                     1
  0         1             1                     1
  1         0             0                     0
  1         0             1                     0
  1         1             0                     1
  1         1             1                     1

Co-authored-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-07-05 12:30:42 +02:00
Yong Cong Sin
7950638e53 lib/libc: picolibc: cleanup PICOLIBC_USE_TOOLCHAIN dependencies
Since `PICOLIBC_USE_TOOLCHAIN` is available only if
`PICOLIBC` is enabled, it doesn't need to depend on the latter
again.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-07-05 12:30:42 +02:00
Alberto Escolar Piedras
846556fa09 Revert "fdtable: read, write, close: only execute methods if non-NULL"
This reverts commit a9a909c558.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Alberto Escolar Piedras
97e925e57d Revert "posix: device_io: require a full libc for c89 functions"
This reverts commit 6f62292d42.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Alberto Escolar Piedras
61e81a7ba8 Revert "posix: device_io: provide stdin, stdout, stderr variables"
This reverts commit 86b92934cc.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Alberto Escolar Piedras
c69ff543ed Revert "posix: device_io: implement pread() and pwrite()"
This reverts commit 2d72966516.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Alberto Escolar Piedras
1df86af309 Revert "net: sockets: move poll implementation to zvfs"
This reverts commit 93973e2ead.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Alberto Escolar Piedras
14e4de6415 Revert "net: sockets: move select() implementation to zvfs"
This reverts commit 49ac1912b2.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Alberto Escolar Piedras
1a2d508e68 Revert "posix: device_io: implement pselect()"
This reverts commit 305ec62a6b.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Alberto Escolar Piedras
a111cec63d Revert "posix: device_io: implement fdopen()"
This reverts commit 581a0f56e6.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Alberto Escolar Piedras
9f38377a66 Revert "posix: device_io: implement fileno()"
This reverts commit 48dff5562c.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Alberto Escolar Piedras
ade54b35ca Revert "posix: device_io: use mode argument correctly in open()"
This reverts commit 499a633976.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Alberto Escolar Piedras
db5266caa4 Revert "posix: kconfig: remove select y from non-user-selectable help"
This reverts commit b82b5b0734.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Alberto Escolar Piedras
9a02561406 Revert "posix: procN: add missing alias for getpid()"
This reverts commit be086f174c.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Alberto Escolar Piedras
772ba464f7 Revert "posix: add stubs for signal.h functions that need process support"
This reverts commit b2243af32d.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Alberto Escolar Piedras
72e2787e70 Revert "posix: fd_mgmt: implement dup(), dup2(), fseeko(), and ftello()"
This reverts commit b18cad15b9.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Pisit Sawangvonganan
94b752d2b4 lib: smf: use while (true) in get_child_of for better clarity
Replace the condition-less `for` loop (`;;`) in `get_child_of` with
a `while (true)` loop and remove the redundant `return NULL;`
at the end, which is never reached.

This change aims to enhance readability since `while (true)` is better
suited for this scenario.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-07-01 16:08:05 -04:00
Krzysztof Chruściński
0bb25d2e17 lib: os: spsc_pbuf: Clarify using cache management in the module
Packet buffer can be used for sharing data between cores. In that
case when any core has data cache then data cache handling must
be enabled in the module. However, it shall never be enabled when
the packet buffer is used on a single core. Adding that information
to the documentation.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-07-01 16:07:30 -04:00
Nikolay Agishev
80fe531119 ARCMWDT: Fix issues with posix types
Fix posix pid_t type redifiniton (zephyr vs arcmwdtlib).
Add omitted in arcmwdtlib type sigevent.

This Fixes https://github.com/zephyrproject-rtos/zephyr/issues/75105

Signed-off-by: Nikolay Agishev <agishev@synopsys.com>
2024-07-01 18:14:34 +02:00
Ederson de Souza
d83a649a67 lib/posix: Get uptime in ticks instead of cycles
__z_clock_nanosleep function was getting current time in cycles, via
k_cycle_get_32(), to perform its time calculations. However, when calling
k_sleep() to actually sleep, times are measured in ticks.

This causes a problem when there's a big skew between the uptime
measured in cycles vs uptime measured in ticks: in some platforms, the
system clock maybe up for a long time already when Zephyr starts
counting ticks, for instance, while downloading an image via PXE. In
this case, the calculations done inside __z_clock_nanosleep end up
measuring a much bigger current time than expected, thus sleeping too
much, basically all the time since system clock initialization.

This patch fixes that by avoiding the cycle trip: stick to ticks,
instead. They start counting from Zephyr initialization instead, which
is the expected uptime.

Fixes #69608

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2024-06-28 21:01:54 -04:00
Nikolay Agishev
5d92abeaec ARCMWDT: Fix cbprintf issue with omitted function prototype
MWDT requires function to be declared with argument types.
This PR provides explisitly type cast for out routine
inside z_cbvprintf_impl().

This PR also actual to LLVM-based compilers with strict
rules of compilation. It covers warnings generated with
additional flag -Wincompatible-function-pointer-types-strict.

This fixes https://github.com/zephyrproject-rtos/zephyr/issues/74562

Signed-off-by: Nikolay Agishev <agishev@synopsys.com>
2024-06-28 07:21:11 -04:00
Chris Friedt
b18cad15b9 posix: fd_mgmt: implement dup(), dup2(), fseeko(), and ftello()
Implement the remaining functions from the POSIX_FD_MGMT Option
Group that are part of POSIX, and add the
CONFIG_REQUIRES_FULL_LIBC dependency to CONFIG_POSIX_FD_MGMT, to
pull in the remaining C89 functions.

The POSIX_FD_MGMT Option Group is required for PSE52, PSE53, and
PSE54 Subprofiling Option Groups.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-27 15:17:56 -04:00
Chris Friedt
b2243af32d posix: add stubs for signal.h functions that need process support
Since Zephyr itself does not currently support processes, but
conformant applications should still be able to link, add stubs
for the remaining POSIX functions in the POSIX_SIGNALS Option
Group.

The POSIX_SIGNALS Option Group is required for PSE51, PSE52,
PSE53, PSE54, and likely many other POSIX Subprofiles.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-27 15:16:50 -04:00
Chris Friedt
be086f174c posix: procN: add missing alias for getpid()
Newlib requires an alias for the getpid() function. There was
a Kconfig already present for doing so, but the actual alias
was missing.

So this is technically a bugfix.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-27 15:16:50 -04:00
Chris Friedt
b82b5b0734 posix: kconfig: remove select y from non-user-selectable help
Several help prompts for non-user-selectable Kconfig options
included the phrase "select 'y' here", which does not make
any sense in this situation.

Adjust the help sections to use more appropriate language.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-27 09:01:23 -04:00
Chris Friedt
499a633976 posix: device_io: use mode argument correctly in open()
Previously, we had only used the flags field and ignored mode
with the open() function.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-27 09:01:23 -04:00
Chris Friedt
48dff5562c posix: device_io: implement fileno()
Implement fileno() as required by the POSIX_DEVICE_IO Option
Group.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-27 09:01:23 -04:00
Chris Friedt
581a0f56e6 posix: device_io: implement fdopen()
Implement fdopen(), as required by the POSIX_DEVICE_IO Option
Group.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-27 09:01:23 -04:00
Chris Friedt
305ec62a6b posix: device_io: implement pselect()
Implement pselect() as it's required by POSIX_DEVICE_IO

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-27 09:01:23 -04:00
Chris Friedt
49ac1912b2 net: sockets: move select() implementation to zvfs
Move the implementation of zsock_select() to zvfs_select(). This
allows other types of file descriptors to also make use of
select() functionality even when the network subsystem is not
enabled.

Additionally, it partially removes a dependency cycle between
posix and networking by moving functionality into a mutual
dependency.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-27 09:01:23 -04:00
Chris Friedt
93973e2ead net: sockets: move poll implementation to zvfs
Move the implementation of zsock_poll to zvfs_poll. This allows
other types of file descriptors to also make use of poll()
functionality even when the network subsystem is not enabled.

Additionally, it partially removes a dependency cycle between
posix and networking by moving functionality into a mutual
dependency.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-27 09:01:23 -04:00
Chris Friedt
2d72966516 posix: device_io: implement pread() and pwrite()
Add pread() and pwrite() implementations, which are nearly
identical to read() and write() but differ in that they do not
update the file-descriptor offset and instead read from a
specific file offset.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-27 09:01:23 -04:00
Chris Friedt
86b92934cc posix: device_io: provide stdin, stdout, stderr variables
Create a compatibility Kconfig option for libc's that provide
their own stdin, stdout, stderr variables.

These are POSIX variables, so eventually we may want to
consider defaulting this option to 'y' and maybe providing
some zvfs abstraction for them.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-27 09:01:23 -04:00
Chris Friedt
6f62292d42 posix: device_io: require a full libc for c89 functions
The POSIX_DEVICE_IO Option Group requires a number of c89
functions mainly from stdio.h .

Namely,

clearerr(), fclose(), feof(), ferror(), fflush(), fetc(),
fgets(), fprintf(), fputc(), fputs(), fread(), freopen(),
fscanf(), fwrite(), getc(), getchar(), gets(), perror(),
printf(), putc(), putchar(), puts(), scanf(), setbuf(),
setvbuf(), ungetc(), vfprintf(), vfscanf(), vfprintf(), and
vscanf().

These should be provided by any conformant C library
(not by the POSIX API).

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-27 09:01:23 -04:00
Chris Friedt
a9a909c558 fdtable: read, write, close: only execute methods if non-NULL
Only invoke vtable methods read, write, and close if they are
non-NULL.

The close() vtable method is optional, so that should not return
an error if zvfs_close() is called and that method is
unimplemented.

Otherwise, if zvfs_read() or zvfs_write() are called and the
corresponding vtable method is unimplemented, fail setting
errno to EIO.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-27 09:01:23 -04:00
Emil Gydesen
4cf00a6125 zephyr: Add zero-len check for utf8_trunc
The function did not check if the provided string had a zero
length before starting to truncate, which meant that last_byte_p
could possible have pointed to the value before the string.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-06-27 08:48:31 -04:00
Chris Friedt
fa9e93382c posix: allow for external implementation of option groups
Make it easier for external C libraries, toolchains, and
integrators to override Zephyr's implementation of functions and
sybmols on a per-Option-Group basis.

This change adds a number of non-user-configurable Kconfig
options that block internal Cmake rules from building Zephyr's
C sources corresponding to the particular option.

This is useful, for example, if a specific C library has a smaller,
or faster, or more secure  version of some symbols belonging to a
a particular option group.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-26 13:08:21 -04:00
Maochen Wang
e309f781ff libc: common: Fix init hang issue
In device init phase, it will call _mbedtls_init before malloc_prepare
as mbedtls has higher priority defined in SYS_INIT..
_mbedtls_init() will call psa_crypto_init() and malloc buffer,
but z_malloc_heap is not initialized, which will cause device hang.
Should call malloc_prepare() before _mbedtls_init to fix this issue,
so add new Kconfig to increase the priority of libc to deafult 30.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-06-26 13:07:02 -04:00
Paul He
88d27ccf62 posix: pthread: correct log info of new stack address
When a new stack is allocated successfully in pthread_attr_setstacksize,
the new address should be printed not the original one.

Signed-off-by: Paul He <pawpawhe@gmail.com>
2024-06-26 13:06:28 -04:00
Lars-Ove Karlsson
49979fcace libc: minimal: Removed unnecessary casts
Remove two casts since the type was already the same.
Otherwise, the casts caused a warning with IAR tools.

Signed-off-by: Lars-Ove Karlsson <lars-ove.karlsson@iar.com>
2024-06-26 09:00:13 -04:00
Chris Friedt
9ada52f060 fdtable: replace z_ prefix with zvfs_ for fdtable.h functions
For each of the fdtable.h functions listed below, convert the
z_ prefixed semi-private functions to use the zvfs_ prefix.

ZVFS stands for Zephyr Virtual File System and
is intended to be a common library used by the C library,
POSIX API, Networking, Filesystem, and other areas.

There are already a few functions in fdtable.h that use the
zvfs_ prefix, so this change is mostly about unifying them in
a way that uses a suitable prefix ("namespace") so that it can
be considered a public API.

- z_alloc_fd
- z_fdtable_call_ioctl
- z_finalize_fd
- z_finalize_typed_fd
- z_free_fd
- z_get_fd_obj
- z_get_fd_obj_and_vtable
- z_get_obj_lock_and_cond
- z_reserve_fd

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-26 12:33:02 +02:00
Alberto Escolar Piedras
6e977ae2d5 lib c/cpp: Move .ctor .init_array handling from C++ to kernel
* Move ctors and init_array from the CPP library
  to the kernel library, as this is common for both C
  and C++ and it is the kernel who is running it.
* Rename the hidden kconfig option CPP_STATIC_INIT_GNU
  STATIC_INIT_GNU instead.
* If STATIC_INIT_GNU is not selected verify there is
  constructors left behind.
* Rename common-rom-cpp.ld to common-rom-init.ld
* Rename z_cpp_init_static to z_init_static,
  and have the kernel always call it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Signed-off-by: Keith Packard <keithp@keithp.com>
2024-06-25 19:14:37 -04:00