[ 
https://issues.apache.org/jira/browse/THRIFT-3090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14500032#comment-14500032
 ] 

Marco Molteni edited comment on THRIFT-3090 at 4/17/15 3:31 PM:
----------------------------------------------------------------

Updated pull request https://github.com/apache/thrift/pull/434.
Kept as small as possible, and enables the build on MacOSX :-)

The MacOSX linker wants to resolve all symbols at shared library creation time, 
while the Linux and FreeBSD linkers are happy to delay resolving until linking 
an executable with the given shared library.

Although it might be possible to ask the MacOSX linker to behave like the 
FreeBSD one (both are using Clang), I don't see a problem in providing all 
symbols at shared library creation time.

Regarding the {{RPATH}}, it is not needed to allow be build to succeed 
(although it is needed at runtime once the Thrift libraries are installed). I 
will post another pull request to enable it for MacOSX.

h4. thriftnb

{noformat}
Linking CXX shared library ../libthriftnb.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
   -std=c++11 -O2 -Wall -Wextra -dynamiclib
   -Wl,-headerpad_max_install_names
   -compatibility_version 1.0.0 -current_version 1.0.0
   -install_name 
/Users/mmolteni/src/thrift.marco.hggit/thebuild/lib/libthriftnb.1.0.0.dylib
   -o ../libthriftnb.1.0.0.dylib
   
   CMakeFiles/thriftnb.dir/src/thrift/server/TNonblockingServer.cpp.o
   CMakeFiles/thriftnb.dir/src/thrift/async/TAsyncProtocolProcessor.cpp.o
   CMakeFiles/thriftnb.dir/src/thrift/async/TEvhttpServer.cpp.o
   CMakeFiles/thriftnb.dir/src/thrift/async/TEvhttpClientChannel.cpp.o
   /opt/local/lib/libssl.dylib
   /opt/local/lib/libcrypto.dylib
   -lpthread
   /opt/local/lib/libevent.dylib 

Undefined symbols for architecture x86_64:

  
"apache::thrift::concurrency::PosixThreadFactory::PosixThreadFactory(apache::thrift::concurrency::PosixThreadFactory::POLICY,
 apache::thrift::concurrency::PosixThreadFactory::PRIORITY, int, bool)", 
referenced from:
      apache::thrift::server::TNonblockingServer::registerEvents(event_base*) 
in TNonblockingServer.cpp.o
{noformat}

h4. thriftqt

{noformat}
Linking CXX shared library ../libthriftqt.dylib
Undefined symbols for architecture x86_64:
  "apache::thrift::TOutput::strerror_s(int)", referenced from:
      
apache::thrift::transport::TTransportException::TTransportException(apache::thrift::transport::TTransportException::TTransportExceptionType,
 std::__1::basic_string<char, std::__1::char_traits<char>, 
std::__1::allocator<char> > const&, int) in TQIODeviceTransport.cpp.o
{noformat}

h4. thriftz

{noformat}
Linking CXX shared library ../libthriftz.dylib
Undefined symbols for architecture x86_64:
  "apache::thrift::GlobalOutput", referenced from:
      apache::thrift::transport::TZlibTransport::initZlib() in 
TZlibTransport.cpp.o
{noformat}



was (Author: marco.molteni):
Updated pull request https://github.com/apache/thrift/pull/434.
Kept as small as possible, and enables the build on MacOSX :-)

The MacOSX linker wants to resolve all symbols at shared library creation time, 
while the Linux and FreeBSD linkers are happy to delay resolving until linking 
an executable with the given shared library.

Although it might be possible to ask the MacOSX linker to behave like the 
FreeBSD one (both are using Clang), I don't see a problem in providing all 
symbols at shared library creation time.

h4. thriftnb

{noformat}
Linking CXX shared library ../libthriftnb.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
   -std=c++11 -O2 -Wall -Wextra -dynamiclib
   -Wl,-headerpad_max_install_names
   -compatibility_version 1.0.0 -current_version 1.0.0
   -install_name 
/Users/mmolteni/src/thrift.marco.hggit/thebuild/lib/libthriftnb.1.0.0.dylib
   -o ../libthriftnb.1.0.0.dylib
   
   CMakeFiles/thriftnb.dir/src/thrift/server/TNonblockingServer.cpp.o
   CMakeFiles/thriftnb.dir/src/thrift/async/TAsyncProtocolProcessor.cpp.o
   CMakeFiles/thriftnb.dir/src/thrift/async/TEvhttpServer.cpp.o
   CMakeFiles/thriftnb.dir/src/thrift/async/TEvhttpClientChannel.cpp.o
   /opt/local/lib/libssl.dylib
   /opt/local/lib/libcrypto.dylib
   -lpthread
   /opt/local/lib/libevent.dylib 

Undefined symbols for architecture x86_64:

  
"apache::thrift::concurrency::PosixThreadFactory::PosixThreadFactory(apache::thrift::concurrency::PosixThreadFactory::POLICY,
 apache::thrift::concurrency::PosixThreadFactory::PRIORITY, int, bool)", 
referenced from:
      apache::thrift::server::TNonblockingServer::registerEvents(event_base*) 
in TNonblockingServer.cpp.o
{noformat}

h4. thriftqt

{noformat}
Linking CXX shared library ../libthriftqt.dylib
Undefined symbols for architecture x86_64:
  "apache::thrift::TOutput::strerror_s(int)", referenced from:
      
apache::thrift::transport::TTransportException::TTransportException(apache::thrift::transport::TTransportException::TTransportExceptionType,
 std::__1::basic_string<char, std::__1::char_traits<char>, 
std::__1::allocator<char> > const&, int) in TQIODeviceTransport.cpp.o
{noformat}

h4. thriftz

{noformat}
Linking CXX shared library ../libthriftz.dylib
Undefined symbols for architecture x86_64:
  "apache::thrift::GlobalOutput", referenced from:
      apache::thrift::transport::TZlibTransport::initZlib() in 
TZlibTransport.cpp.o
{noformat}


> cmake build is broken
> ---------------------
>
>                 Key: THRIFT-3090
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3090
>             Project: Thrift
>          Issue Type: Bug
>         Environment: Mac OS X 10.10.3
> C++ compiler: Apple system compiler (clang), Apple LLVM version 6.0 
> (clang-600.0.57) (based on LLVM 3.5svn)
> boost 1.57
> cmake 3.2.1
>            Reporter: Marco Molteni
>             Fix For: 0.9.3
>
>
> A current version of apache/thrift on github as of 2015-04-10 doesn't build 
> with cmake due to multiple errors:
> - some C++ targets fail to link with missing symbols, because they do not 
> link against the `thrift` library
> - the c_glib test targets fail to build because the reference to `shared_ptr` 
> is considered ambiguous by the compiler (it resolves to both boost and stdlib 
> shared_ptr)
> See pull request https://github.com/apache/thrift/pull/434



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to