Error when compiling the arduinoISP example

i have two arduino leonardos, one original and one from keyestudio. The original one has a broken bootloader, so i followed the tutorial for using an arduino as a programmer for another arduino.
When i go to upload the example to the keyestudio leonardo, it says error compiling for board arduino leonardo with this error message:

Arduino: 1.8.8 (Windows Store 1.8.19.0) (Windows 10), Board: "Arduino Leonardo"

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.19.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino\CDC.cpp: In member function 'available':

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.19.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino\CDC.cpp:187:1: internal compiler error: Segmentation fault

 }

 ^

Please submit a full bug report,

with preprocessed source if appropriate.

See <http://gcc.gnu.org/bugs.html> for instructions.

lto-wrapper.exe: fatal error: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.19.0_x86__mdqgnx93n4wtt\hardware\tools\avr/bin/avr-gcc returned 1 exit status

compilation terminated.

c:/program files/windowsapps/arduinollc.arduinoide_1.8.19.0_x86__mdqgnx93n4wtt/hardware/tools/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/bin/ld.exe: error: lto-wrapper failed

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino Leonardo.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

The ArduinoISP sketch is for uploading to ATmega chips so will not help you with a Leonardo. And it seems not compatible with a Leonardo either.

How would i burn the bootloader onto the original leonardo with a broken bootloader?

Mm, I might be wrong about using it to burn a Leonardo. I was confusing it with a SAM board. If the ArduinoISP sketch works on it, don't know.

What I do see is the use of the AppStore version of the Arduino IDE. And it would not be the first time that version is just messed up / broken... Try uninstalling it and downloading the version from here.

downgrade Arduino AVR board package to 1.6.21. the "Segmention fault error" is an error in a compiler version used in newer packages

im probably gonna use CLion as IDE now

i tried it again with the arduino ide from the website, and it uploaded, but when burning the bootloader it said this:

Arduino: 1.8.8 (Windows 10), Board: "Arduino Leonardo"

avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

Error while burning bootloader.

post a photo of the wiring


this is the wiring

pin 10 of programmer board should be wired to Reset of programmed board

Juraj:
pin 10 of programmer board should be wired to Reset of programmed board

is there a way i can do it without using pin 10 and keeping it wired like it is and only changing stuff in the sketch?

OmegaRogue:
is there a way i can do it without using pin 10 and keeping it wired like it is and only changing stuff in the sketch?

with reset to reset the programmer can't reset the target. what is the problem?

Juraj:
with reset to reset the programmer can't reset the target. what is the problem?

i taped the wires together with electrical tape to make an ICSP to ICSP cable