fangism/hackt

[linking] symbol is defined in DSO... so try adding it to the linker command line

Opened this issue · 0 comments

During build on x86_64-linux using

Linux <hostname> 3.2.0-23-generic #36-Ubuntu SMP 
gcc version 4.9.2 (Ubuntu 4.9.2-0ubuntu1~12.04) 
GNU ld (GNU Binutils for Ubuntu) 2.22

I see linker errors like:

/bin/sh ../libtool  --tag=CXX   --mode=link g++ -pipe -ansi -pedantic-errors -Wold-style-cast -Woverloaded-virtual -W -Wextra -Wall -Wundef -Wshadow -Wno-unused-parameter -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion -Werror -g -O2 -Wno-error=conversion -Wno-error=unused-local-typedefs -Wno-error=float-conversion   -o test_case test/test_case.o libhacktprsim.la -ldl 
libtool: link: g++ -pipe -ansi -pedantic-errors -Wold-style-cast -Woverloaded-virtual -W -Wextra -Wall -Wundef -Wshadow -Wno-unused-parameter -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion -Werror -g -O2 -Wno-error=conversion -Wno-error=unused-local-typedefs -Wno-error=float-conversion -o .libs/test_case test/test_case.o  ./.libs/libhacktprsim.so -ldl -Wl,-rpath -Wl,/ufs/cad/lib/hackt
/usr/bin/ld: test/test_case.o: undefined reference to symbol '_ZN4utillsERSoRKNS_10stacktrace6indentE'
/usr/bin/ld: note: '_ZN4utillsERSoRKNS_10stacktrace6indentE' is defined in DSO /ufs/vlsi/fang/local/src/hackt/builds/marvin-build/src/.libs/libfangutil.so.0 so try adding it to the linker command line
/ufs/vlsi/fang/local/src/hackt/builds/marvin-build/src/.libs/libfangutil.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make: *** [test_case] Error 1

This diagnostic is explained at https://fedoraproject.org/wiki/UnderstandingDSOLinkChange

To summarize, if A depends on a symbol in library C, but only links to B (which links C), that no longer works, A must explicitly link C.