Hello,
It appears ld is trying to link the static libpcre.a archive file into a shared object which is causing the error.
This has happened to me in the past when there is only a static lib available in the linker search path. In other words, ld couldn’t find a shared object named libpcre and so it falls back to trying to link the static archive.
If this is indeed the cause of the problem for you then you have a few options. You’ll need to either provide a libpcre shared object to link in to your build, build libpcre statically with -fPIC, or configure your streamdevice build to
be static only.
Hope this helps!
Best,
Ryan
From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of
Manoussakis, Adamandios via Tech-talk
Sent: Tuesday, November 17, 2020 12:32 PM
To: tech-talk <tech-talk at aps.anl.gov>
Subject: Building StreamDevice with PCRE failing
Hello,
I have been trying to build streamdevice with PCRE but cannot for the life of me figure out why the compilation keeps failing (using libpcre and libpcre-dev). The release file for streamdevice has PCRE_LIB=/usr/lib and PCRE_INCLUDE=/usr/include/pcre
which seem to be pointing to the correct libraries. I have looked into trying to build PCRE as a standalone epics module as well as stated in the documentation but ran into similar issues using PCRE v8 and v10 from the ftp(didn’t see v7 which is what the
documentation originally built with for standalone). It looks like one of the pcre shared objects is failing to compile and recommends to compile with -fPIC flag but it looks like that flag is already being used. Couldn’t find a ton of info out on the internet
with regards to this type of compilation error except that usually the -fPIC (position independent code) fixes it. Below is my compilation error
/usr/bin/ranlib
libstream.a
/usr/bin/g++
-o libstream.so
-fPIC
-shared
-Wl,-hlibstream.so
-L/home/jetson/myepics/support/asyn/lib/linux-x86_64
-L/home/jetson/myepics/support/stream/lib/linux-x86_64
-L/home/jetson/myepics/base/lib/linux-x86_64
-L/usr/lib
-Wl,-rpath,/home/jetson/myepics/support/asyn/lib/linux-x86_64
-Wl,-rpath,/home/jetson/myepics/support/stream/lib/linux-x86_64
-Wl,-rpath,/home/jetson/myepics/base/lib/linux-x86_64
-Wl,-rpath,/usr/lib
-rdynamic
-m64 DebugInterface.o
DummyInterface.o AsynDriverInterface.o
EnumConverter.o BCDConverter.o
RawConverter.o RawFloatConverter.o
BinaryConverter.o ChecksumConverter.o
MantissaExponentConverter.o TimestampConverter.o
RegexpConverter.o devaoStream.o
devaiStream.o devboStream.o
devbiStream.o devmbboStream.o
devmbbiStream.o devmbboDirectStream.o
devmbbiDirectStream.o devlongoutStream.o
devlonginStream.o devstringoutStream.o
devstringinStream.o devwaveformStream.o
devaaiStream.o devaaoStream.o
devcalcoutStream.o devlsiStream.o
devlsoStream.o devscalcoutStream.o
StreamVersion.o StreamBuffer.o
StreamError.o StreamProtocol.o
StreamFormatConverter.o StreamCore.o
StreamBusInterface.o StreamEpics.o
-lasyn
-ldbRecStd
-ldbCore
-lca
-lCom
-lpcre
-lpthread
-lm
-lrt
-ldl
-lgcc
/usr/bin/ld:
/home/jetson/myepics/base/lib/linux-x86_64/libpcre.a(libpcre_la-pcre_jit_compile.o):
relocation R_X86_64_PC32 against symbol `pcre_callout' can not be used when making a shared object; recompile
with -fPIC
/usr/bin/ld:
final link failed: Bad value
collect2: error:
ld returned 1
exit status
/home/jetson/myepics/base/configure/RULES_BUILD:288:
recipe for target
'libstream.so' failed
make[2]:
***
[libstream.so]
Error 1
make[2]:
Leaving directory '/home/jetson/myepics/support/stream/src/O.linux-x86_64'
/home/jetson/myepics/base/configure/RULES_ARCHS:58:
recipe for target
'install.linux-x86_64' failed
make[1]:
***
[install.linux-x86_64]
Error 2
make[1]:
Leaving directory '/home/jetson/myepics/support/stream/src'
/home/jetson/myepics/base/configure/RULES_DIRS:84:
recipe for target
'src.install' failed
make:
***
[src.install]
Error 2