Hmm, not quite sure why that would be, works fine for me:
[peter /tmp/avrtest ] 17449 $ cat test.nim
echo "Hello world"
[peter /tmp/avrtest ] 17450 $ cat panicoverride.nim
proc printf(frmt: cstring) {.varargs, importc, header: "<stdio.h>", cdecl.}
proc exit(code: int) {.importc, header: "<stdlib.h>", cdecl.}
{.push stack_trace: off, profiler:off.}
proc rawoutput(s: string) =
printf("%s\n", s)
proc panic(s: string) =
rawoutput(s)
exit(1)
{.pop.}
[peter /tmp/avrtest ] 17451 $ cat nim.cfg
passC = "-Os"
passC = "-DF_CPU=16000000UL"
passC = "-mmcu=atmega328p"
passL = "-mmcu=atmega328p"
passC = "-flto"
passL = "-flto"
cpu = "avr"
gc = "arc"
define = "noSignalHandler"
define = "useMalloc"
deadCodeElim = "on"
exceptions = "quirky"
avr.any.gcc.path = "/usr/bin"
avr.any.gcc.exe = "avr-gcc"
avr.any.gcc.linkerexe = "avr-gcc"
[peter /tmp/avrtest ] 17452 $ nim c -d:danger --os:any test
Hint: used config file '/home/peter/Projects/Nim/config/nim.cfg' [Conf]
Hint: used config file '/home/peter/Projects/Nim/config/config.nims' [Conf]
Hint: used config file '/tmp/avrtest/nim.cfg' [Conf]
....
Hint: [Link]
Hint: 19091 lines; 0.104s; 16.656MiB peakmem; Dangerous Release build;
proj: /tmp/avrtest/test; out: /tmp/avrtest/test [SuccessX]
[peter /tmp/avrtest ] 17453 $ file test
test: ELF 32-bit LSB executable, Atmel AVR 8-bit, version 1 (SYSV),
statically linked, with debug_info, not stripped
[peter /tmp/avrtest ] 17454 $ avr-gcc --version
avr-gcc (GCC) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[peter /tmp/avrtest ] 17455 $ nim --version
Nim Compiler Version 1.4.2 [Linux: amd64]
Compiled at 2021-03-29
Copyright (c) 2006-2020 by Andreas Rumpf
git hash: 3fb5157ab1b666a5a5c34efde0f357a82d433d04
active boot switches: -d:release
Run