ESP-IDF on Raspberry pi 4

I have been using ESP-IDF platform on my ubuntu 22.04 machine successfuly
I had the great idea i could use a raspberry pi 4 remotely with vscode to compile and upload via the raspberry usb ports. I copied my esp-idf project folders to the default location on the raspberry pi. The raspberry pi operating system is Raspbian GNU/Linux 11 (bullseye).
platformio updated the system for esp-idf. When i opened one of my projects and tried to compile there was an error.
The first error inthe cmake error log is
– Check for working C compiler: /home/ian/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc – broken
– Configuring incomplete, errors occurred!

Iv googled the fault but am unable to resolve this issue. It appears that i should use esp-idf version 4.3 but would loose support for the usb ports.

is there someone who has had this problem and resolved it

Many thanks Ian