Skip to content

Commit ce7bca1

Browse files
committed
fix(esp32c3): use semihosting _exit for QEMU emulator support
Remove conflicting _exit implementations from libnosys and libgloss to ensure the semihosting version (from semihost-sys_exit.c, added as .o in #1537) is used for ESP32-C3 QEMU emulator. Changes: - Comment out libnosys/_exit.c - Comment out libgloss/riscv/sys_exit.c (3 occurrences) This allows proper exit handling in QEMU emulator via semihosting protocol instead of using the instruction which causes crashes. Related: #1537 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 34b872c commit ce7bca1

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

internal/crosscompile/compile/libc/newlibesp.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ func getNewlibESP32ConfigRISCV(baseDir, target string) compile.CompileConfig {
233233
filepath.Join(baseDir, "libgloss", "riscv", "sys_close.c"),
234234
filepath.Join(baseDir, "libgloss", "riscv", "sys_conv_stat.c"),
235235
filepath.Join(baseDir, "libgloss", "riscv", "sys_execve.c"),
236-
filepath.Join(baseDir, "libgloss", "riscv", "sys_exit.c"),
237236
filepath.Join(baseDir, "libgloss", "riscv", "sys_faccessat.c"),
238237
filepath.Join(baseDir, "libgloss", "riscv", "sys_fork.c"),
239238
filepath.Join(baseDir, "libgloss", "riscv", "sys_fstat.c"),
@@ -1112,7 +1111,6 @@ func getNewlibESP32ConfigXtensa(baseDir, target string) compile.CompileConfig {
11121111
filepath.Join(baseDir, "libgloss", "libnosys", "wait.c"),
11131112
filepath.Join(baseDir, "libgloss", "libnosys", "write.c"),
11141113
filepath.Join(baseDir, "libgloss", "libnosys", "getentropy.c"),
1115-
filepath.Join(baseDir, "libgloss", "libnosys", "_exit.c"),
11161114
filepath.Join(baseDir, "libgloss", "libnosys", "getreent.c"),
11171115
filepath.Join(baseDir, "libgloss", "libnosys", "time.c"),
11181116
filepath.Join(baseDir, "libgloss", "libnosys", "fcntl.c"),

0 commit comments

Comments
 (0)