Bug 234585

Summary: devel/avr-gcc: /usr/local/libexec/gcc/avr/5.4.0/liblto_plugin.so: error loading plugin: Service unavailable collect2: error: ld returned 1 exit status
Product: Ports & Packages Reporter: Niko <niko>
Component: Individual Port(s)Assignee: Joerg Wunsch <joerg>
Status: New ---    
Severity: Affects Only Me CC: joerg, niko
Priority: --- Flags: linimon: maintainer-feedback? (joerg)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
the irrelevant AVR CPP code none

Description Niko 2019-01-02 23:28:59 UTC
/usr/local/lib/gcc/avr/5.4.0/../../../../avr/bin/ld: /usr/local/libexec/gcc/avr/5.4.0/liblto_plugin.so: error loading plugin: Service unavailable
collect2: error: ld returned 1 exit status

libto_plugin.so shits the bed with arduino, arduino16, arduino18. Sketch compilations fail.

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.
Arduino: 1.0.6 (FreeBSD), Board: "Arduino Uno"
/usr/local/lib/gcc/avr/5.4.0/../../../../avr/bin/ld: /usr/local/libexec/gcc/avr/5.4.0/liblto_plugin.so: error loading plugin: Service unavailable
collect2: error: ld returned 1 exit status
Comment 1 Niko 2019-01-02 23:31:48 UTC
Created attachment 200732 [details]
the irrelevant AVR CPP code
Comment 2 Joerg Wunsch freebsd_committer 2019-03-03 20:18:28 UTC
Cannot reproduce that myself.

However, just got a hint from someone having a similar problem with the ARM toolchain. He updated and rebuilt the binutils port, and the problem was gone. The issue was that apparently, at some point in time, various binutils ports had been built with static linking, so the linker was then unable to dlopen() the LTO shared lib.

Bottom line, please see whether this problem vanishes after refreshing the avr-binutils installation.