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

xtensa-sample_controller_zephyr-elf: qemu_xtensa boot failure with Newlib nano #660

Open
stephanosio opened this issue Apr 11, 2023 · 0 comments
Assignees
Labels
area: Newlib Issues related to Newlib (C Library) bug priority: low Low impact/importance issue

Comments

@stephanosio
Copy link
Member

stephanosio commented Apr 11, 2023

Zephyr fails to boot on qemu_xtensa (using xtensa-sample_controller_zephyr-elf toolchain) when the Newlib nano variant is selected.

Note that this issue is not observed when using the Newlib full variant (i.e. CONFIG_NEWLIB_LIBC_NANO=n).

Apply the following patch to ${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/Kconfig:

--- Kconfig
+++ Kconfig
@@ -2,7 +2,7 @@
 
 config TOOLCHAIN_ZEPHYR_0_16
        def_bool y
-       select HAS_NEWLIB_LIBC_NANO if (ARC || (ARM && !ARM64) || RISCV)
+       select HAS_NEWLIB_LIBC_NANO # if (ARC || (ARM && !ARM64) || RISCV)
 
 config TOOLCHAIN_ZEPHYR_SUPPORTS_THREAD_LOCAL_STORAGE
        def_bool y

To reproduce, run the following command:

west build -p -b qemu_xtensa -T tests/lib/newlib/thread_safety/libraries.libc.newlib_nano.thread_safety

QEMU exits without any useful messages inside memset called from xtensa_stack_init.

p.s. This issue might not be specific to xtensa-sample_controller_zephyr-elf and qemu_xtensa, and may be observed on other Xtensa targets.

@stephanosio stephanosio added bug priority: low Low impact/importance issue area: Newlib Issues related to Newlib (C Library) labels Apr 11, 2023
@stephanosio stephanosio self-assigned this Apr 11, 2023
stephanosio added a commit to stephanosio/zephyr-sdk-ng that referenced this issue Apr 11, 2023
This commit temporarily disables the Newlib nano variant for the Xtensa
architecture because there is a bug in the nano `memset` implementation
causing a system crash (see the GitHub issue zephyrproject-rtos#660).

Revert this commit when zephyrproject-rtos#660 is fixed.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
stephanosio added a commit that referenced this issue Apr 11, 2023
This commit temporarily disables the Newlib nano variant for the Xtensa
architecture because there is a bug in the nano `memset` implementation
causing a system crash (see the GitHub issue #660).

Revert this commit when #660 is fixed.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Newlib Issues related to Newlib (C Library) bug priority: low Low impact/importance issue
Projects
None yet
Development

No branches or pull requests

1 participant