Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kconfig: remove PICOLIBC_MODULE, introduce PICOLIBC_USE_MODULE #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tejlmand
Copy link

@keith-packard maybe you prefer to take this directly here ? : https://github.com/picolibc/picolibc


Remove PICOLIBC_MODULE as it is not used.
Introduce PICOLIBC_USE_MODULE as a hidden symbol. PICOLIBC_USE_MODULE is the actual Kconfig symbol used in the CMake code to decide if Picolibc should be build.

The symbol is promptless to allow external users of the module, such as Zephyr itself, to setup rules / dependencies as to when Picolibc should be built as a module.

Signed-off-by: Torsten Rasmussen [email protected]

Remove PICOLIBC_MODULE as it is not used.
Introduce PICOLIBC_USE_MODULE as a hidden symbol. PICOLIBC_USE_MODULE
is the actual Kconfig symbol used in the CMake code to decide if
Picolibc should be build.

The symbol is promptless to allow external users of the module, such as
Zephyr itself, to setup rules / dependencies as to when Picolibc should
be built as a module.

Signed-off-by: Torsten Rasmussen <[email protected]>
Copy link
Collaborator

@keith-packard keith-packard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to merge this into the zephyr picolibc repo, get things working, then merge the resulting changes upstream.

keith-packard pushed a commit that referenced this pull request Jan 21, 2024
This ensures that running `b _ctrap; c; bt` inside gdb shows the right
backtrace. If we jump without setting ra gdb gets confused about the
backtrace since we don't have the right cfi directives inside ctrap.
This does not result in any downsides since ra has already been saved.
Previously we had to set a breakpoint just before this jump to get a
correct backtrace, now it's possible to set a breakpoint in _ctrap
instead:

```
Reading symbols from test/test-fopen...
Breakpoint 1 at 0x80000058: file ../../picolibc/picocrt/machine/riscv/crt0.c, line 84.
Remote debugging using :1234
0x0000000000001000 in ?? ()
Continuing.

Breakpoint 1, _ctrap (fault=0x805feee8) at ../../picolibc/picocrt/machine/riscv/crt0.c:84
84              printf("RISCV fault\n");
#0  _ctrap (fault=0x805feee8) at ../../picolibc/picocrt/machine/riscv/crt0.c:84
#1  0x00000000800001c4 in _trap () at ../../picolibc/picocrt/machine/riscv/crt0.c:168
#2  0x00000000800013d0 in fclose (f=0x804008c0) at ../../picolibc/newlib/libc/tinystdio/fclose.c:39
#3  0x0000000080000680 in main () at ../../picolibc/test/test-fopen.c:85
(gdb)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants