Discussion:
[Apcupsd-users] Link problem on Solaris 11.3
Phil Stracchino
2017-07-17 14:33:01 UTC
Permalink
I'm bringing up a new server, a SunFire X4540 on which I've installed
Solaris 11.3, and I'm attempting to install apcupsd 3.14.4, compiling
using gcc-4.9.4. Very simple basic configuration with no frills:

./configure --prefix=/usr --sysconfdir=/etc --with-log-dir=/var/log

Everything goes fine until link time, when I get an unresolved symbol:

LD src/apcupsd
Undefined first referenced
symbol in file
_Unwind_GetIPInfo
/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/../../../libsupc++.a(eh_personality.o)
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status


Does anyone have any insights on resolving this problem?
--
Phil Stracchino
Babylon Communications
***@caerllewys.net
***@co.ordinate.org
Landline: +1.603.293.8485
Mobile: +1.603.998.6958
Trevor Roydhouse
2017-07-18 00:34:30 UTC
Permalink
Post by Phil Stracchino
I'm bringing up a new server, a SunFire X4540 on which I've installed
Solaris 11.3, and I'm attempting to install apcupsd 3.14.4, compiling
./configure --prefix=/usr --sysconfdir=/etc --with-log-dir=/var/log
LD src/apcupsd
Undefined first referenced
symbol in file
_Unwind_GetIPInfo
/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/../../../libsupc++.a(eh_personality.o)
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
Does anyone have any insights on resolving this problem?
My Google Fu came up with:

_Unwind_GetIPInfo is defined in libgcc_s.so - is that file present in
the same directory as libstdc++.so?

If you add -v to the compilation command it will show you the
directories gcc searches, is libgcc_s.so in any of those directories?
Phil Stracchino
2017-07-18 01:22:46 UTC
Permalink
Post by Trevor Roydhouse
Post by Phil Stracchino
I'm bringing up a new server, a SunFire X4540 on which I've installed
Solaris 11.3, and I'm attempting to install apcupsd 3.14.4, compiling
./configure --prefix=/usr --sysconfdir=/etc --with-log-dir=/var/log
LD src/apcupsd
Undefined first referenced
symbol in file
_Unwind_GetIPInfo
/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/../../../libsupc++.a(eh_personality.o)
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
Does anyone have any insights on resolving this problem?
_Unwind_GetIPInfo is defined in libgcc_s.so - is that file present in
the same directory as libstdc++.so?
I will definitely check for that and give it a try. I hunted for a
reference to where it was defined but couldn't find one.
--
Phil Stracchino
Babylon Communications
***@caerllewys.net
***@co.ordinate.org
Landline: +1.603.293.8485
Mobile: +1.603.998.6958
Phil Stracchino
2017-07-18 13:28:26 UTC
Permalink
Post by Trevor Roydhouse
_Unwind_GetIPInfo is defined in libgcc_s.so - is that file present in
the same directory as libstdc++.so?
If you add -v to the compilation command it will show you the
directories gcc searches, is libgcc_s.so in any of those directories?
Turns out that libgcc_s.so was present everywhere it should be, but
adding -lgcc_s did not resolve the issue. (Or the symbol.)
--
Phil Stracchino
Babylon Communications
***@caerllewys.net
***@co.ordinate.org
Landline: +1.603.293.8485
Mobile: +1.603.998.6958
Phil Stracchino
2017-07-20 14:45:52 UTC
Permalink
Post by Phil Stracchino
Post by Trevor Roydhouse
_Unwind_GetIPInfo is defined in libgcc_s.so - is that file present in
the same directory as libstdc++.so?
If you add -v to the compilation command it will show you the
directories gcc searches, is libgcc_s.so in any of those directories?
Turns out that libgcc_s.so was present everywhere it should be, but
adding -lgcc_s did not resolve the issue. (Or the symbol.)
I tried compiling with Oracle Developer Studio instead of gcc to see if
I could avoid the link problem. Turns out apcupsd won't compile at all
using Sun^WOracle CC.


asgard:root:~/build/apcupsd-3.14.14:46 # gmake
src
src/lib
CXX src/lib/apcconfig.c
CC: Warning: Option -x passed to ld, if ld is invoked, ignored otherwise
CC: Warning: GCC option -fno-rtti ignored
"/root/build/apcupsd-3.14.14/include/getopt.h", line 111: Error: Only
one of a set of overloaded functions can be extern "C".
"/root/build/apcupsd-3.14.14/include/struct.h", line 66: Warning:
Identifier expected instead of "}".
"/root/build/apcupsd-3.14.14/include/struct.h", line 73: Warning:
Identifier expected instead of "}".
"/root/build/apcupsd-3.14.14/include/struct.h", line 79: Warning:
Identifier expected instead of "}".
"/root/build/apcupsd-3.14.14/include/drivers.h", line 110: Warning: cmd
is defined but not used.
"/root/build/apcupsd-3.14.14/include/drivers.h", line 110: Warning: data
is defined but not used.
"/root/build/apcupsd-3.14.14/include/drivers.h", line 111: Warning: cmd
is defined but not used.
"/root/build/apcupsd-3.14.14/include/drivers.h", line 111: Warning: data
is defined but not used.
"apcconfig.c", line 603: Warning: cfgfile hides the same name in an
outer scope.
"apcconfig.c", line 672: Warning: Too few arguments in macro Error_abort.
"apcconfig.c", line 709: Warning: Too few arguments in macro Error_abort.
"apcconfig.c", line 717: Warning: Too few arguments in macro Error_abort.
1 Error(s) and 11 Warning(s) detected.
gmake[3]: *** [.obj/apcconfig.o] Error 2
gmake[2]: *** [all] Error 2
gmake[1]: *** [lib_DIR] Error 2
gmake: *** [src_DIR] Error 2
--
Phil Stracchino
Babylon Communications
***@caerllewys.net
***@co.ordinate.org
Landline: +1.603.293.8485
Mobile: +1.603.998.6958
Ted Mittelstaedt
2017-07-23 18:48:22 UTC
Permalink
Phil,

Do you have LD_LIBRARY_PATH defined to put perhaps an older or different
library ahead of the correct library?

It looks to me like maybe you have multiple compiler versions on that
machine and the library path search order is fubared.

Ted
Post by Phil Stracchino
Post by Phil Stracchino
Post by Trevor Roydhouse
_Unwind_GetIPInfo is defined in libgcc_s.so - is that file present in
the same directory as libstdc++.so?
If you add -v to the compilation command it will show you the
directories gcc searches, is libgcc_s.so in any of those directories?
Turns out that libgcc_s.so was present everywhere it should be, but
adding -lgcc_s did not resolve the issue. (Or the symbol.)
I tried compiling with Oracle Developer Studio instead of gcc to see if
I could avoid the link problem. Turns out apcupsd won't compile at all
using Sun^WOracle CC.
asgard:root:~/build/apcupsd-3.14.14:46 # gmake
src
src/lib
CXX src/lib/apcconfig.c
CC: Warning: Option -x passed to ld, if ld is invoked, ignored otherwise
CC: Warning: GCC option -fno-rtti ignored
"/root/build/apcupsd-3.14.14/include/getopt.h", line 111: Error: Only
one of a set of overloaded functions can be extern "C".
Identifier expected instead of "}".
Identifier expected instead of "}".
Identifier expected instead of "}".
"/root/build/apcupsd-3.14.14/include/drivers.h", line 110: Warning: cmd
is defined but not used.
"/root/build/apcupsd-3.14.14/include/drivers.h", line 110: Warning: data
is defined but not used.
"/root/build/apcupsd-3.14.14/include/drivers.h", line 111: Warning: cmd
is defined but not used.
"/root/build/apcupsd-3.14.14/include/drivers.h", line 111: Warning: data
is defined but not used.
"apcconfig.c", line 603: Warning: cfgfile hides the same name in an
outer scope.
"apcconfig.c", line 672: Warning: Too few arguments in macro Error_abort.
"apcconfig.c", line 709: Warning: Too few arguments in macro Error_abort.
"apcconfig.c", line 717: Warning: Too few arguments in macro Error_abort.
1 Error(s) and 11 Warning(s) detected.
gmake[3]: *** [.obj/apcconfig.o] Error 2
gmake[2]: *** [all] Error 2
gmake[1]: *** [lib_DIR] Error 2
gmake: *** [src_DIR] Error 2
Phil Stracchino
2017-07-23 19:30:19 UTC
Permalink
Post by Ted Mittelstaedt
Phil,
Do you have LD_LIBRARY_PATH defined to put perhaps an older or different
library ahead of the correct library?
It looks to me like maybe you have multiple compiler versions on that
machine and the library path search order is fubared.
Hmm .... now that you mention it, it is *possible* the linker is
picking up the system's libgcc_s instead of the C compiler's. It
*SHOULDN'T* be doing so, but...

I gave up fighting the link problem a few days ago and installed
OpenCSW's apcupsd package, and that sees to be working fine. The link
problem hasn't occurred with anything else I've built.
--
Phil Stracchino
Babylon Communications
***@caerllewys.net
***@co.ordinate.org
Landline: +1.603.293.8485
Mobile: +1.603.998.6958
Loading...