Go Down

Topic: Mac OS compile error: Symbol not found: _environ (Read 7154 times) previous topic - next topic

bulldogsask

Nov 21, 2016, 07:21 pm Last Edit: Nov 22, 2016, 12:08 am by bulldogsask
Arduino: 1.6.13 Hourly Build 2016/11/11 10:12 (Mac OS X), Board: "Arduino/Genuino Uno"

/Applications/Arduino 2.app/Contents/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ar: dlopen(/Applications/Arduino 2.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 2.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.

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


I read through troubleshooting guide, and updated FTDI chip driver.  I keep getting collect2 error. Mac OS X Lion 10.7.5.

Thank you

DrAzzy

#1
Nov 21, 2016, 07:27 pm Last Edit: Nov 21, 2016, 07:30 pm by DrAzzy
Enable verbose compile output in settings, try a compile, and post the full text of the error here. I have never seen that error before.

Please enclose it in code tags using the </> button so it's easier for people to read (per how to use this forum thread - see that for more info if needed)

Does the error occur with 1.6.12? I see that you're using an hourly build - if you want the IDE to work, you should use a released version, not the hourly builds. The hourly builds are frequently busted.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

bulldogsask

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

Code: [Select]
[code]
/Users/alexlyon/Desktop/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware -tools /Users/alexlyon/Desktop/Arduino.app/Contents/Java/tools-builder -tools /Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/tools/avr -built-in-libraries /Users/alexlyon/Desktop/Arduino.app/Contents/Java/libraries -libraries /Users/alexlyon/Documents/Arduino/libraries -fqbn=arduino:avr:uno -vid-pid=0X2341_0X0043 -ide-version=10612 -build-path /var/folders/mw/4yn08lt15q19qvq5b8txy71m0000gn/T/arduino_build_526103 -warnings=none -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avr-gcc.path=/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/tools/avr -verbose /Applications/Arduino 2.app/Contents/Java/examples/01.Basics/Blink/Blink.ino

Detecting libraries used...
"/Users/alexlyon/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=10612 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "/var/folders/mw/4yn08lt15q19qvq5b8txy71m0000gn/T/arduino_build_526103/sketch/Blink.ino.cpp" -o "/dev/null"
Generating function prototypes...
"/Users/alexlyon/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=10612 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "/var/folders/mw/4yn08lt15q19qvq5b8txy71m0000gn/T/arduino_build_526103/sketch/Blink.ino.cpp" -o "/var/folders/mw/4yn08lt15q19qvq5b8txy71m0000gn/T/arduino_build_526103/preproc/ctags_target_for_gcc_minus_e.cpp"
"/Users/alexlyon/Desktop/Arduino.app/Contents/Java/tools-builder/ctags/5.8-arduino10/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "/var/folders/mw/4yn08lt15q19qvq5b8txy71m0000gn/T/arduino_build_526103/preproc/ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"/Users/alexlyon/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=10612 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "/var/folders/mw/4yn08lt15q19qvq5b8txy71m0000gn/T/arduino_build_526103/sketch/Blink.ino.cpp" -o "/var/folders/mw/4yn08lt15q19qvq5b8txy71m0000gn/T/arduino_build_526103/sketch/Blink.ino.cpp.o"
Compiling libraries...
Compiling core...
"/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc" -c -g -x assembler-with-cpp -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10612 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/wiring_pulse.S" -o "/var/folders/mw/4yn08lt15q19qvq5b8txy71m0000gn/T/arduino_build_526103/core/wiring_pulse.S.o"
"/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc" -c -g -Os -w


"/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/var/folders/mw/4yn08lt15q19qvq5b8txy71m0000gn/T/arduino_build_526103/core/core.a" "/var/folders/mw/4yn08lt15q19qvq5b8txy71m0000gn/T/arduino_build_526103/core/WInterrupts.c.o"
/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ar: dlopen(/Users/alexlyon/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/alexlyon/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


/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ar: /var/folders/mw/4yn08lt15q19qvq5b8txy71m0000gn/T/arduino_build_526103/core/WInterrupts.c.o: plugin needed to handle lto object
"/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/var/folders/mw/4yn08lt15q19qvq5b8txy71m0000gn/T/arduino_build_526103/core/core.a" "/var/folders/mw/4yn08lt15q19qvq5b8txy71m0000gn/T/arduino_build_526103/core/hooks.c.o"
/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ar: dlopen(/Users/alexlyon/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/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/../libexec/gcc/avr/4.9.2/liblto_plugin.so
"/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/var/folders/mw/4yn08lt15q19qvq5b8txy71m0000gn/T/arduino_build_526103/core/core.a" "/var/folders/mw/4yn08lt15q19qvq5b8txy71m0000gn/T/arduino_build_526103/core/wiring.c.o"  Expected in: /usr/lib/libSystem.B.dylib



/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ar: WInterrupts.c.o: plugin needed to handle lto object
/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ar: /var/folders/mw/4yn08lt15q19qvq5b8txy71m0000gn/T/arduino_build_526103/core/hooks.c.o: plugin needed to handle lto object
/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ar: dlopen(/Users/alexlyon/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/alexlyon/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


/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ar: WInterrupts.c.o: plugin needed to handle lto object
/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ar: hooks.c.o: plugin needed to handle lto object
/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ar: /var/folders/mw/4yn08lt15q19qvq5b8txy71m0000gn/T/arduino_build_526103/core/wiring.c.o: plugin needed to handle lto object
"/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar" rcs  "/var/folders/mw/4yn08lt15q19qvq5b8txy71m0000gn/T/arduino_build_526103/core/core.a" "/var/folders/mw/4yn08lt15q19qvq5b8txy71m0000gn/T/arduino_build_526103/core/wiring_analog.c.o"
/Users/alexlyon/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ar: dlopen(/Users/alexlyon/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/alexlyon/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
Error compiling for board Arduino/Genuino Uno.[/code]



Reply:  yes error is still present with 1.6.12.  I also enabled verbose as requested.  Hope I have included all that is required. 

Thank you

DrAzzy

#3
Nov 21, 2016, 11:29 pm Last Edit: Nov 21, 2016, 11:39 pm by DrAzzy
Weird - the compiler's choking as it tries to load the lto plugin, complaining of missing symbol.

I would suggest editing title of thread to something like:

Mac OS compile error: Symbol not found: _environ


The issue has a distinct and unusual error message, and it has nothing to do with uploading - that's the compiler barfing. People generally aren't inclined to help someone with a generic "it won't upload" thread - 9 times out of ten, you click it and they've got a sync error and no clue (because it's their first arduino) - trying to help people with that is rarely a rewarding experience. But your error is a weird one, certainly more interesting - and probably something that has a single solution that we can give the next guy.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

bulldogsask


dtsw

Have the same issue with this version on MacOS 10.7.5.
So i downloaded an older version of Arduino IDE 10.6.3 which runs okay.

gmillerd

Same issue error: OSX, 1.8.0 IDE, AAVR 1.6.16, compiling the default void/void sketch

JayPatelRags94


pcarew

I'm on 10.7.5 and  need to compile 'Marlin' reprap code.

Marlin *requires* Arduino IDE >=1.6.8, however 1.6.8+ doesn't compile on Lion.
It has the error identified above.

Has anyone found any solutions to this issue yet?
Thanks.
Paul.



Tesko

Having the same issue Mac OS X 10.7.5 with unoR3. Did anyone find a solution for this problem?

quietthomas

#10
Nov 03, 2017, 09:08 am Last Edit: Nov 03, 2017, 01:53 pm by quietthomas
I found an answer:

You should be able to fix this by:
  • Tools > Board > Boards Manager > Arduino AVR Boards(click on it) > select 1.6.11 from the "select version" drop down menu > Install
  • Wait for the installation to complete and then click the "Close" button


As to the actual cause of the issue I don't know. The LTO stuff that's causing the issue was added in Arduino AVR Boards 1.6.12, this is why you need to go back to Arduino AVR Boards 1.6.11 to fix it.

Go Up