Permission denied while compiling (Arduino/ESP)

Hi,

I'm using a Mac with macOS 13.1 Ventura. When I want to compile a sketch I get the following error message:

Arduino: 1.8.19 (Mac OS X), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 16KB cache + 48KB IRAM (IRAM), Use pgm_read macros for IRAM/PROGMEM, 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, All Flash Contents, 921600"

fork/exec /Applications/Arduino.app/Contents/Java/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/xtensa-lx106-elf-g++: permission denied
Fehler beim Kompilieren für das Board NodeMCU 1.0 (ESP-12E Module).

The folder "portable" contains the ArduBlock stuff and it worked 2 years ago but now it cannot be accessed. I tried going around gatekeeper, I checked the permissions with CMD+I on the files but I have r/w access.

Is there someone who can help with this?

Wishes

Can you change the privileges to the app/folder causing the permission issue? (maybe you want uninstall and reinstall as "user.")

I tried it for the file mentioned in the error message but the message didn't change.

Try changing permissions to the folder.

I changed the way I checked the permissions: I used the terminal with "ls -l" and changed the permissions via terminal as well (sudo chmod -R 755 /Applications/Arduino.app/Contents/Java/portable/).

Very nice that the cmd+I shows not the whole permissions of files and folders. Anyway, I have another error message that isn't clear to me:

/Applications/Arduino.app/Contents/Java/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld: /Applications/Arduino.app/Contents/Java/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../libexec/gcc/xtensa-lx106-elf/10.3.0/liblto_plugin.so: error loading plugin: dlopen(/Applications/Arduino.app/Contents/Java/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../libexec/gcc/xtensa-lx106-elf/10.3.0/liblto_plugin.so, 0x0002): tried: '/Applications/Arduino.app/Contents/Java/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../libexec/gcc/xtensa-lx106-elf/10.3.0/liblto_plugin.so' (not a mach-o file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Arduino.app/Contents/Java/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../libexec/gcc/xtensa-lx106-elf/10.3.0/liblto_plugin.so' (no such file), '/Applications/Arduino.app/Contents/Java/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../libexec/gcc/xtensa-lx106-elf/10.3.0/liblto_plugin.so' (not a mach-o file), '/Applications/Arduino.app/Contents/Java/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/libexec/gcc/xtensa-lx106-elf/10.3.0/liblto_plugin.so' (not a mach-o file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Arduino.app/Contents/Java/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/libexec/gcc/xtensa-lx106-elf/10.3.0/liblto_plugin.so' (no such file), '/Applications/Arduino.app/Contents/Java/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/libexec/gcc/xtensa-lx106-elf/10.3.0/liblto_plugin.so' (not a mach-o file)
collect2: error: ld returned 1 exit status

exit status 1
Fehler beim Kompilieren für das Board NodeMCU 1.0 (ESP-12E Module).

This (link) describes this error, and maybe the solution.

FYI: When pasting computer output, enclose it in the code tag </> for easier reading.

Hi,
thanks for the link. The links in the thread are dead so it wasn't directly helpful. I got some new words for a google research but it wasn't helping as well.

Even an empty sketch like

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

cannot be compiled. The error message is the same as I get for my sketch.

Wishes & happy new year

I upgraded to Arduino 2.* and tried to compile a simple hello world sketch I had and got the same error:

fork/exec /Users/lj/Library/Arduino15/packages/smartwatch-boards/hardware/nRF5/0.1.3/tools/adafruit-nrfutil/adafruit-nrfutil: permission denied

Compilation error: fork/exec /Users/lj/Library/Arduino15/packages/smartwatch-boards/hardware/nRF5/0.1.3/tools/adafruit-nrfutil/adafruit-nrfutil: permission denied
1 Like

Did a chmod -R 777 Arduino15 which solved the problem

1 Like

You should make sure to update the adafruit-nrfutil tool you distribute with your "smartwatch-boards" platform so that it has the required executable permissions when installed. That way, the users won't suffer from the same error.

Yes, this is what I did to solve the permission problem. The GUI of macOS is not giving you full permission control or at least on a more basic level compared to the past.

Anyway, anybody knows something about this "mach-o file" error message?

xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/libexec/gcc/xtensa-lx106-elf/10.3.0/liblto_plugin.so' (not a mach-o file) collect2: error: ld returned 1 exit status exit status 1

I see you are using a fairly outdated version of the ESP8266 boards platform. The problem may have been solved in a later version, which uses a newer xtensa-lx106-elf-gcc compiler.

Unless you are using that version of the ESP8266 boards platform for a specific reason, I recommend you update to the latest version:

  1. Select Tools > Board > Boards Manager from the Arduino IDE menus.
  2. Wait for the updates to finish.
  3. Scroll down through the list of boards platforms until you see the "esp8266 by ESP8266 Community" entry. Click on it.
  4. Click the Update button.
  5. Wait for the update to finish.
  6. Click the Close button.

Now try compiling your sketch again. Hopefully the error will no longer occur.

Hi,
thanks, that helped. I didn't check it and well, you are right. Thanks.

You are welcome. I'm glad it is working now.

Regards,
Per

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.