Error compiling Blink program

Hello,

I'm brand new to programming and to Arduino and I have an error message at my very first attempt to compile program (the "Blink" example)

Have searched elsewhere on the Internet but cannot find exact issue

I have an Arduino / Genuino Uno.
Running Mac OSX 10.7.5
Have checked that I'm running latest version of Java ((Version 8 Update 144) [since the error message mentions Java]
Have checked in Tools that the correct board and Port are selected

Issue log below - would appreciate any advice

Arduino: 1.8.5 (Mac OS X), Board: "Arduino/Genuino Uno"

/Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/rich/Documents/Arduino/libraries -fqbn=arduino:avr:uno -vid-pid=0X2A03_0X0043 -ide-version=10805 -build-path /var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539 -warnings=none -build-cache /var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_cache_794683 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avr-gcc.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avrdude.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -verbose /Applications/Arduino.app/Contents/Java/examples/01.Basics/Blink/Blink.ino
/Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/rich/Documents/Arduino/libraries -fqbn=arduino:avr:uno -vid-pid=0X2A03_0X0043 -ide-version=10805 -build-path /var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539 -warnings=none -build-cache /var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_cache_794683 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avr-gcc.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avrdude.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -verbose /Applications/Arduino.app/Contents/Java/examples/01.Basics/Blink/Blink.ino
Using board 'uno' from platform in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr
Using core 'arduino' from platform in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr
Detecting libraries used...
"/Applications/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/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "/var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539/sketch/Blink.ino.cpp" -o "/dev/null"
Generating function prototypes...
"/Applications/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/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "/var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539/sketch/Blink.ino.cpp" -o "/var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539/preproc/ctags_target_for_gcc_minus_e.cpp"
"/Applications/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/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539/preproc/ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"/Applications/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/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "/var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539/sketch/Blink.ino.cpp" -o "/var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539/sketch/Blink.ino.cpp.o"
Compiling libraries...
Compiling core...
Using precompiled core
Linking everything together...
"/Applications/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/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539/Blink.ino.elf" "/var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539/sketch/Blink.ino.cpp.o" "/var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539/../arduino_cache_794683/core/core_arduino_avr_uno_51f02b7210b938436b779d1c032618e1.a" "-L/var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539" -lm
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ld: /Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/../libexec/gcc/avr/4.9.2/liblto_plugin.so: error loading plugin: dlopen(/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/../libexec/gcc/avr/4.9.2/liblto_plugin.so, 2): Symbol not found: _environ
Referenced from: /Applications/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
Error compiling for board Arduino/Genuino Uno.

would appreciate any advice

Start by reinstalling the IDE

A bunch of people have had IDE problems, including IDE crashes and bizarre compile errors, when they install a new version of the IDE. At least some of those problems seem to be caused by incompatible executables and preference files that the IDE saves outside the IDE installation directory. Perhaps that is what is causing your particular problem. In such cases it appears that the fix is to delete or rename the old “Arduino15” directory and re-install the new IDE.

On Mac OS X:
/Users/(username)/Library/Arduino15 (a.k.a. ~/Library/Arduino15)
(Note: The ‘Library’ folder is greyed out in Finder. The folder can’t be opened with a double-click. To browse the contents of ‘Library’, ctrl-click on it and select “Open in New Tab” from the pop-up menu.)

On Windows delete or rename both:
Arduino IDE 1.6.5r5 and previous: C:\Users(username)\AppData\Roaming\Arduino15
Arduino IDE 1.6.6 and later: C:\Users(username)\AppData\Local\Arduino15

On Linux:
/home/(username)/.arduino15 (a.k.a. ~/.arduino15)
(Note: file/folder names starting with ‘.’ are not normally shown in directory listings. Use ‘ls -a’ to get a directory listing that includes the hidden files.)

I seem to have solved the issue by installing this experimental version of the Arduino IDE 1.6.1
https://www.arduino.cc/en/Guide/IDEonRecentMacOSX

Arduino is blinking away

Thanks for advice