Unable to strip symbols from .elf with post action or dynamic build flag

I would like to strip symbols from my binary using ~/.platformio/packages/toolchain-riscv32-esp/bin/riscv32-esp-elf-strip after compiling.

However I have been unable to figure out the correct commands and interpolations for either an extra script or simply a dynamic build flag.

Any pointers appreciated

platform = espressif32
board = esp32dev
framework = arduino
extra_scripts = strip_elf.py
from os.path import join
# figure out correct name of strip tool, differs per ESP32 type
platform = env.PioPlatform()
board = env.BoardConfig()
mcu = board.get("build.mcu", "esp32")
toolchain_arch = "xtensa-%s" % mcu
if mcu == "esp32c3":
    toolchain_arch = "riscv32-esp"
strip_tool = "%s-elf-strip" % toolchain_arch
# add post action to ELF
    env.VerboseAction(" ".join([
        strip_tool, "$BUILD_DIR/${PROGNAME}.elf"
    ]), "Stripping $BUILD_DIR/${PROGNAME}.elf")

xtensa-esp32-elf-g++ -o .pio\build\esp32dev\firmware.elf -T esp32_out.ld -nostdlib -Wl,-static -u call_user_start_cpu0 -Wl,–undefined=uxTopUsedPriority -Wl,–gc-sections -Wl,-EL -T esp32.project.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.libgcc.ld -T esp32.rom.spiram_incompatible_fns.ld -u ld_include_panic_highint_hdl -u __cxa_guard_dummy -u __cxx_fatal_exception .pio\build\esp32dev\src\main.cpp.o -L.pio\build\esp32dev -LC:\Users\Max.platformio\packages\framework-arduinoespressif32\tools\sdk\lib -LC:\Users\Max.platformio\packages\framework-arduinoespressif32\tools\sdk\ld -Wl,–start-group .pio\build\esp32dev\libFrameworkArduinoVariant.a .pio\build\esp32dev\libFrameworkArduino.a -lgcc[…] -Wl,–end-group

xtensa-esp32-elf-strip C:\Users\Max\temp\esp32\.pio\build\esp32dev/firmware.elf

([“checkprogsize”], [".pio\build\esp32dev\firmware.elf"])
MethodWrapper([“checkprogsize”], [".pio\build\esp32dev\firmware.elf"])
Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
RAM: [ ] 4.0% (used 13224 bytes from 327680 bytes)
Flash: [== ] 15.4% (used 201212 bytes from 1310720 bytes)

>file .pio\build\esp32dev\firmware.elf
.pio\build\esp32dev\firmware.elf; ELF 32-bit LSB executable, Tensilica Xtensa, version 1 (SYSV), statically linked, stripped