From a11240ba97da53e5ad6c7bc53adab1c1102202c4 Mon Sep 17 00:00:00 2001 From: Tim Pambor Date: Tue, 30 Sep 2025 15:33:44 +0200 Subject: [PATCH 1/2] boards: native_sim: Workaround race condition in glibc Explicitly link with libgcc_s to work around a race condition in glibc when dynamically loading libgcc_s in multiple threads. The race condition was observed when running native_sim with CONFIG_REBOOT=y and CONFIG_NATIVE_SIM_REBOOT=y and rebooting quickly from main(). Signed-off-by: Tim Pambor --- boards/native/native_sim/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/boards/native/native_sim/CMakeLists.txt b/boards/native/native_sim/CMakeLists.txt index 613b7df4f8234..d8fb1fa9e18a2 100644 --- a/boards/native/native_sim/CMakeLists.txt +++ b/boards/native/native_sim/CMakeLists.txt @@ -16,6 +16,10 @@ zephyr_library_sources( if(CONFIG_NATIVE_SIM_REBOOT) zephyr_library_sources(reboot.c) target_sources(native_simulator INTERFACE reboot_bottom.c) + + # Explicitly link with libgcc_s to work around a race condition in glibc when + # dynamically loading libgcc_s in multiple threads. + target_link_options(native_simulator INTERFACE "-lgcc_s") endif() zephyr_include_directories( From 085b7cd2b4fdb55526a32599013367f2d6428e84 Mon Sep 17 00:00:00 2001 From: Tim Pambor Date: Tue, 30 Sep 2025 15:33:44 +0200 Subject: [PATCH 2/2] tests native_sim reset_hw_info: Re-enable test" The issue has been fixed, so re-enable the test. This reverts commit 8d7c2e115a79924283c6465daf7fe41c4629b429. Signed-off-by: Tim Pambor --- tests/boards/native_sim/reset_hw_info/testcase.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/boards/native_sim/reset_hw_info/testcase.yaml b/tests/boards/native_sim/reset_hw_info/testcase.yaml index dfafd2c029498..00d5601483e16 100644 --- a/tests/boards/native_sim/reset_hw_info/testcase.yaml +++ b/tests/boards/native_sim/reset_hw_info/testcase.yaml @@ -1,6 +1,5 @@ tests: boards.native_sim.reset_hw_info: - skip: true platform_allow: - native_sim - native_sim/native/64