How to recompile framework or update it?

Sorry for resurrecting/abducting the post, but I have a similar problem:
I have expanded the project related platformio.ini:

[platformio]
default_envs = wemos_d1_mini32_serial

[common_env_data]
upload_speed = 921600
monitor_speed = 115200

[env:wemos_d1_mini32_serial]
platform = espressif32
board = wemos_d1_mini32
framework = arduino
upload_port = COM*
monitor_speed = 115200
 platform_packages =
    toolchain-xtensa32@~2.80400.0
    platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git

build_flags =
    -DWM_MDNS=1
    -DLWIP_DNS_SUPPORT_MDNS_QUERIES=1
    -DESP32=1
    -DARDUINO_ARCH_ESP32=1
    -DBOARD_HAS_PSRAM
    -std=c++17
    -std=gnu++17

build_unflags =
    -std=gnu++11

Does anyone have a tip, what could be the cause or you can solve this?

PACKAGES:
 - framework-arduinoespressif32 0.0.0+sha.b94b38c
 - tool-esptoolpy 1.30100.210531 (3.1.0)
 - toolchain-xtensa32 2.80400.210211 (8.4.0)
[...]
Linking .pio\build\wemos_d1_mini32_serial\firmware.elf
c:/users/xxx/.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: final link failed: bad value
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\wemos_d1_mini32_serial\firmware.elf] Error 1`