arduino / Arduino

Arduino IDE 1.x
https://www.arduino.cc/en/software
Other
14.16k stars 7.02k forks source link

Compilation fails on OSX 10.7.5, complaining about liblto_plugin.so and libSystem.B.dylib #7074

Open matthijskooijman opened 6 years ago

matthijskooijman commented 6 years ago

See below for a full log and the error message. It seems ld completely fails, this was while compiling the Blink example, using Arduino 1.8.5. I considered trying the beta build, but that says it needs Mountain Lion (10.8) or higher.

Unfortunately, this was not on my own machine (but someone in a workshop today), so I do not have access to this machine for further testing.

@per1234 previously suggested to downgrade the AVR boards to 1.6.11, which does not have LTO support, which worked on this machine too.

Here's another mention of this issue: https://www.reddit.com/r/arduino/comments/56yn3b/zero_experience_guy_needs_help_im_brand_new_to/

This issue suggests this is because the application is compiled for a too new OSX version. This issue suggests a too old XCode version (but I couldn't try installing or upgrading Xcode).

/Users/leo/Desktop/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Users/leo/Desktop/Arduino.app/Contents/Java/hardware -tools /Users/leo/Desktop/Arduino.app/Contents/Java/tools-builder -tools /Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr -built-in-libraries /Users/leo/Desktop/Arduino.app/Contents/Java/libraries -libraries /Users/leo/Documents/Arduino/libraries -fqbn=arduino:avr:uno -vid-pid=0X2A03_0X0043 -ide-version=10805 -build-path /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439 -warnings=none -build-cache /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_cache_189914 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avrdude.path=/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr -verbose /Users/leo/Desktop/Arduino.app/Contents/Java/examples/01.Basics/Blink/Blink.ino
/Users/leo/Desktop/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Users/leo/Desktop/Arduino.app/Contents/Java/hardware -tools /Users/leo/Desktop/Arduino.app/Contents/Java/tools-builder -tools /Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr -built-in-libraries /Users/leo/Desktop/Arduino.app/Contents/Java/libraries -libraries /Users/leo/Documents/Arduino/libraries -fqbn=arduino:avr:uno -vid-pid=0X2A03_0X0043 -ide-version=10805 -build-path /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439 -warnings=none -build-cache /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_cache_189914 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avrdude.path=/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr -verbose /Users/leo/Desktop/Arduino.app/Contents/Java/examples/01.Basics/Blink/Blink.ino
Using board 'uno' from platform in folder: /Users/leo/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr
Using core 'arduino' from platform in folder: /Users/leo/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr
Detecting libraries used...
"/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "/var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/sketch/Blink.ino.cpp" -o "/dev/null"
Generating function prototypes...
"/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "/var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/sketch/Blink.ino.cpp" -o "/var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/preproc/ctags_target_for_gcc_minus_e.cpp"
"/Users/leo/Desktop/Arduino.app/Contents/Java/tools-builder/ctags/5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "/var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/preproc/ctags_target_for_gcc_minus_e.cpp"
Sketch aan het compileren...
"/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "/var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/sketch/Blink.ino.cpp" -o "/var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/sketch/Blink.ino.cpp.o"
Compiling libraries...
Compiling core...
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/wiring_pulse.S.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/WInterrupts.c.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/hooks.c.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/wiring.c.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/wiring_analog.c.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/wiring_digital.c.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/wiring_pulse.c.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/wiring_shift.c.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/CDC.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/HardwareSerial.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/HardwareSerial0.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/HardwareSerial1.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/HardwareSerial2.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/HardwareSerial3.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/IPAddress.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/PluggableUSB.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/Print.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/Stream.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/Tone.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/USBCore.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/WMath.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/WString.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/abi.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/main.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/new.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/core.a wordt gebruikt.
Archiving built core (caching) in: /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_cache_189914/core/core_arduino_avr_uno_75de3b8f51153cc6fc37d8d7716786a8.a
Linking everything together...
"/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p  -o "/var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/Blink.ino.elf" "/var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/sketch/Blink.ino.cpp.o" "/var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/core.a" "-L/var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439" -lm
/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ld: /Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/../libexec/gcc/avr/4.9.2/liblto_plugin.so: error loading plugin: dlopen(/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/../libexec/gcc/avr/4.9.2/liblto_plugin.so, 2): Symbol not found: _environ
  Referenced from: /Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/../libexec/gcc/avr/4.9.2/liblto_plugin.so
  Expected in: /usr/lib/libSystem.B.dylib

collect2: error: ld returned 1 exit status
exit status 1
Fout bij het compileren voor board Arduino/Genuino Uno
facchinm commented 6 years ago

OSX 10.7 compile target is being deprecated by Apple (and a binary compiled on 10.7 does not run on Sierra/High Sierra). Since clang does not support 10.7 anymore we are going to make 10.8 the minimum compatible version anyway in the next release. The "core" issue is a bit different since you can update it besides the actual IDE version, maybe it could be a good idea to mark AVR core 1.6.11 "sticky" if the OSX version is older than 10.8