[
https://issues.apache.org/jira/browse/THRIFT-4112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15906215#comment-15906215
]
James E. King, III commented on THRIFT-4112:
--------------------------------------------
Interesting, so here's the command being used to link the thrift library:
{noformat}
root@27ce3756fc88:/thrift/src/lib/cpp# g++ -fPIC -DPIC -shared -nostdlib
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o
/usr/lib/gcc/x86_64-linux-gnu/4.8/crtbeginS.o
src/thrift/.libs/TApplicationException.o src/thrift/.libs/TOutput.o
src/thrift/.libs/VirtualProfiling.o src/thrift/async/.libs/TAsyncChannel.o
src/thrift/async/.libs/TConcurrentClientSyncInfo.o
src/thrift/concurrency/.libs/ThreadManager.o
src/thrift/concurrency/.libs/TimerManager.o src/thrift/concurrency/.libs/Util.o
src/thrift/processor/.libs/PeekProcessor.o
src/thrift/protocol/.libs/TDebugProtocol.o
src/thrift/protocol/.libs/TJSONProtocol.o
src/thrift/protocol/.libs/TBase64Utils.o
src/thrift/protocol/.libs/TMultiplexedProtocol.o
src/thrift/protocol/.libs/TProtocol.o
src/thrift/transport/.libs/TTransportException.o
src/thrift/transport/.libs/TFDTransport.o
src/thrift/transport/.libs/TFileTransport.o
src/thrift/transport/.libs/TSimpleFileTransport.o
src/thrift/transport/.libs/THttpTransport.o
src/thrift/transport/.libs/THttpClient.o
src/thrift/transport/.libs/THttpServer.o src/thrift/transport/.libs/TSocket.o
src/thrift/transport/.libs/TPipe.o src/thrift/transport/.libs/TPipeServer.o
src/thrift/transport/.libs/TSSLSocket.o
src/thrift/transport/.libs/TSocketPool.o
src/thrift/transport/.libs/TServerSocket.o
src/thrift/transport/.libs/TSSLServerSocket.o
src/thrift/transport/.libs/TTransportUtils.o
src/thrift/transport/.libs/TBufferTransports.o
src/thrift/server/.libs/TConnectedClient.o src/thrift/server/.libs/TServer.o
src/thrift/server/.libs/TServerFramework.o
src/thrift/server/.libs/TSimpleServer.o
src/thrift/server/.libs/TThreadPoolServer.o
src/thrift/server/.libs/TThreadedServer.o src/thrift/concurrency/.libs/Mutex.o
src/thrift/concurrency/.libs/Monitor.o
src/thrift/concurrency/.libs/PosixThreadFactory.o -L/usr/lib/x86_64-linux-gnu
-L/usr/local/lib -lssl -lcrypto -lrt -lpthread
-L/usr/lib/gcc/x86_64-linux-gnu/4.8
-L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu
-L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib -L/lib/x86_64-linux-gnu
-L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../..
-lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/4.8/crtendS.o
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crtn.o -O2
-Wl,-soname -Wl,libthrift-1.0.0-dev.so -o .libs/libthrift-1.0.0-dev.so
root@27ce3756fc88:/thrift/src/lib/cpp# ldd .libs/libthrift-1.0.0-dev.so
linux-vdso.so.1 => (0x00007ffc8297c000)
libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0
(0x00007f424a21c000)
libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
(0x00007f4249e40000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007f4249c21000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(0x00007f424991d000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4249558000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
(0x00007f4249341000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f424913d000)
/lib64/ld-linux-x86-64.so.2 (0x0000565419eaf000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4248e37000)
{noformat}
As you can see, libssl-1.0.0 was taken from the OS lib directory, not the newer
one from /usr/local/lib.
I changed the syntax slightly to use: {{-l:libssl.so.1.1 -l:libcrypto.so.1.1}}
and this changed the result:
{noformat}
root@27ce3756fc88:/thrift/src/lib/cpp# g++ -fPIC -DPIC -shared -nostdlib
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o
/usr/lib/gcc/x86_64-linux-gnu/4.8/crtbeginS.o
src/thrift/.libs/TApplicationException.o src/thrift/.libs/TOutput.o
src/thrift/.libs/VirtualProfiling.o src/thrift/async/.libs/TAsyncChannel.o
src/thrift/async/.libs/TConcurrentClientSyncInfo.o
src/thrift/concurrency/.libs/ThreadManager.o
src/thrift/concurrency/.libs/TimerManager.o src/thrift/concurrency/.libs/Util.o
src/thrift/processor/.libs/PeekProcessor.o
src/thrift/protocol/.libs/TDebugProtocol.o
src/thrift/protocol/.libs/TJSONProtocol.o
src/thrift/protocol/.libs/TBase64Utils.o
src/thrift/protocol/.libs/TMultiplexedProtocol.o
src/thrift/protocol/.libs/TProtocol.o
src/thrift/transport/.libs/TTransportException.o
src/thrift/transport/.libs/TFDTransport.o
src/thrift/transport/.libs/TFileTransport.o
src/thrift/transport/.libs/TSimpleFileTransport.o
src/thrift/transport/.libs/THttpTransport.o
src/thrift/transport/.libs/THttpClient.o
src/thrift/transport/.libs/THttpServer.o src/thrift/transport/.libs/TSocket.o
src/thrift/transport/.libs/TPipe.o src/thrift/transport/.libs/TPipeServer.o
src/thrift/transport/.libs/TSSLSocket.o
src/thrift/transport/.libs/TSocketPool.o
src/thrift/transport/.libs/TServerSocket.o
src/thrift/transport/.libs/TSSLServerSocket.o
src/thrift/transport/.libs/TTransportUtils.o
src/thrift/transport/.libs/TBufferTransports.o
src/thrift/server/.libs/TConnectedClient.o src/thrift/server/.libs/TServer.o
src/thrift/server/.libs/TServerFramework.o
src/thrift/server/.libs/TSimpleServer.o
src/thrift/server/.libs/TThreadPoolServer.o
src/thrift/server/.libs/TThreadedServer.o src/thrift/concurrency/.libs/Mutex.o
src/thrift/concurrency/.libs/Monitor.o
src/thrift/concurrency/.libs/PosixThreadFactory.o -L/usr/lib/x86_64-linux-gnu
-L/usr/local/lib -l:libssl.so.1.1 -l:libcrypto.so.1.1 -lrt -lpthread
-L/usr/lib/gcc/x86_64-linux-gnu/4.8
-L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu
-L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib -L/lib/x86_64-linux-gnu
-L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../..
-lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/4.8/crtendS.o
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crtn.o -O2
-Wl,-soname -Wl,libthrift-1.0.0-dev.so -o .libs/libthrift-1.0.0-dev.so
root@27ce3756fc88:/thrift/src/lib/cpp# ldd .libs/libthrift-1.0.0-dev.so
linux-vdso.so.1 => (0x00007ffc18996000)
libssl.so.1.1 => /usr/local/lib/libssl.so.1.1 (0x00007fb8b30f7000)
libcrypto.so.1.1 => /usr/local/lib/libcrypto.so.1.1 (0x00007fb8b2c74000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007fb8b2a55000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(0x00007fb8b2751000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb8b238c000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
(0x00007fb8b2175000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fb8b1f71000)
/lib64/ld-linux-x86-64.so.2 (0x0000563000cfa000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fb8b1c6b000)
{noformat}
So it looks like you need to replace the openssl library installed into your
base OS, or build in a container with the new openssl, but autoconf and
pkg-config don't seem to have to options to make things specific. I'm going to
reoslve this as "Won't Fix" as you can get around it by a number of means, such
as:
* Building with cmake might work, where you can specify OPENSSL_ROOT, etc.
* Building in a docker container that has only the openssl version you want
> undefined openssl symbols when building with with openssl-1.1.0e and autoconf
> -----------------------------------------------------------------------------
>
> Key: THRIFT-4112
> URL: https://issues.apache.org/jira/browse/THRIFT-4112
> Project: Thrift
> Issue Type: Bug
> Components: Build Process, C++ - Library
> Affects Versions: 0.10.0
> Environment: Arch Linux x64
> Reporter: Drystan Mazur
>
> Hello,
> I am trying to compile thrift from source and I am getting the following
> issue.
> /hs2client/thirdparty/thrift-0.10.0/lib/cpp/.libs/libthrift-0.10.0.so:
> undefined reference to `OPENSSL_sk_pop_free'
> /hs2client/thirdparty/thrift-0.10.0/lib/cpp/.libs/libthrift-0.10.0.so:
> undefined reference to `OPENSSL_sk_value'
> /hs2client/thirdparty/thrift-0.10.0/lib/cpp/.libs/libthrift-0.10.0.so:
> undefined reference to `OPENSSL_sk_num'
> /hs2client/thirdparty/thrift-0.10.0/lib/cpp/.libs/libthrift-0.10.0.so:
> undefined reference to `OPENSSL_init_ssl'
> /hs2client/thirdparty/thrift-0.10.0/lib/cpp/.libs/libthrift-0.10.0.so:
> undefined reference to `TLS_method'
> /hs2client/thirdparty/thrift-0.10.0/lib/cpp/.libs/libthrift-0.10.0.so:
> undefined reference to `SSL_CTX_set_options'
> I used the following ./configure options
> --with-openssl=<somedir>/hs2client/thirdparty/openssl-1.1.0e --without-lua
> --without-csharp --without-php --without-nodejs
> I confirmed that the symbols were in libssl.so eg 'U
> OPENSSL_sk_pop_free@@OPENSSL_1_1_0'
> There are some cases of the following in config.log
> configure:23495: g++ -o conftest -g -O2 conftest.cpp -lrt -lpthread >&5
> conftest.cpp:23:0: warning: "BISON_VERSION" redefined
> #define BISON_VERSION 3.0.
> Unsure if it is related
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)