[
https://issues.apache.org/jira/browse/THRIFT-214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12650424#action_12650424
]
Rush Manbert commented on THRIFT-214:
-------------------------------------
My compiler version:
i686-apple-darwin9-g++-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5484)
I traced down the return types and typedefs and pthread_t is just a 64 bit
pointer to a structure.
So this didn't make sense, but I made a test project and defined this:
typedef uint64_t id_t;
and when I built, I got this error:
/Developer/SDKs/MacOSX10.5.sdk/usr/include/sys/wait.h:95: error: 'id_t' has a
previous declaration as 'typedef __darwin_id_t id_t'
which resolves to a uint32_t.
I think this is what's causing the error, and if I change line 273 of
PosixThreadFactory.cpp to this:
return (Thread::id_t)pthread_self();
it works. So it seems that the real change is to make sure the correct type
gets used.
Sorry for the earlier info. Someone else actually ran into this and fixed it as
the original patch shows. They asked me to submit it because I'm the "thrift
liaison" guy here.
If this looks correct to you, do you want a patch?
> PosixThreadFactory.cpp fails 64 bit compile with gcc on Mac OS X 10.5
> ---------------------------------------------------------------------
>
> Key: THRIFT-214
> URL: https://issues.apache.org/jira/browse/THRIFT-214
> Project: Thrift
> Issue Type: Bug
> Components: Library (C++)
> Environment: Mac Os X 10.5 compiling for 64 bit
> Reporter: Rush Manbert
> Attachments: patch.txt
>
>
> We are building quad libraries for the Mac. (32/64 bit PPC/Intel)
> Project was configure this way:
> CFLAGS: -g -O0 -isysroot /Developer/SDKs/MacOSX10.5.sdk
> -mmacosx-version-min=10.4 -arch i386 -arch x86_64 -arch ppc -arch ppc64
> -fvisibility=hidden -DYYLMAX=1048576
> CPPFLAGS:
> CXXFLAGS: -g -O0 -isysroot /Developer/SDKs/MacOSX10.5.sdk
> -mmacosx-version-min=10.4 -arch i386 -arch x86_64 -arch ppc -arch ppc64
> -fvisibility=hidden -DYYLMAX=1048576 -fvisibility-inlines-hidden
> LDFLAGS: -syslibroot,/Developer/SDKs/MacOSX10.5.sdk
> -mmacosx-version-min=10.4 -arch i386 -arch x86_64 -arch ppc -arch ppc64
> -Wl,-dead_strip -no_dead_strip_inits_and_terms -Wl,-search_paths_first
> CONFIGURE_OPTIONS: --without-java --without-py --without-ruby
> --with-boost=/Users/rmanbert/development/trunkHead/client/thirdPartyLibs/sources/thrift/SUBSYS_TOP/thirdPartyLibs/installedMac/individual/boost
>
> --with-zlib=/Users/rmanbert/development/trunkHead/client/thirdPartyLibs/sources/thrift/SUBSYS_TOP/thirdPartyLibs/installedMac/individual/zlib/Debug
>
> --with-libevent=/Users/rmanbert/development/trunkHead/client/thirdPartyLibs/sources/thrift/SUBSYS_TOP/thirdPartyLibs/installedMac/individual/libevent/Debug
> --disable-dependency-tracking --enable-static --disable-shared
> --enable-debug
> --prefix=/Users/rmanbert/development/trunkHead/client/thirdPartyLibs/sources/thrift/SUBSYS_TOP/thirdPartyLibs/installedMac/individual/thrift/Debug
> The compile command line and error output is:
> g++ -DHAVE_CONFIG_H -I. -I../..
> -I/Users/rmanbert/development/trunkHead/client/thirdPartyLibs/sources/thrift/lib/cpp
>
> -I/Users/rmanbert/development/trunkHead/client/thirdPartyLibs/sources/thrift/SUBSYS_TOP/thirdPartyLibs/installedMac/individual/boost/include
>
> -I/Users/rmanbert/development/trunkHead/client/thirdPartyLibs/sources/thrift/lib/cpp/src
> -Wall -g -O0 -isysroot /Developer/SDKs/MacOSX10.5.sdk
> -mmacosx-version-min=10.4 -arch i386 -arch x86_64 -arch ppc -arch ppc64
> -fvisibility=hidden -DYYLMAX=1048576 -fvisibility-inlines-hidden -c
> /Users/rmanbert/development/trunkHead/client/thirdPartyLibs/sources/thrift/lib/cpp/src/concurrency/PosixThreadFactory.cpp
> -o PosixThreadFactory.o
> /Users/rmanbert/development/trunkHead/client/thirdPartyLibs/sources/thrift/lib/cpp/src/concurrency/PosixThreadFactory.cpp:
> In member function 'uint64_t
> facebook::thrift::concurrency::PosixThreadFactory::Impl::getCurrentThreadId()
> const':
> /Users/rmanbert/development/trunkHead/client/thirdPartyLibs/sources/thrift/lib/cpp/src/concurrency/PosixThreadFactory.cpp:273:
> error: cast from '_opaque_pthread_t*' to 'id_t' loses precision
> /Users/rmanbert/development/trunkHead/client/thirdPartyLibs/sources/thrift/lib/cpp/src/concurrency/PosixThreadFactory.cpp:
> In member function 'uint64_t
> facebook::thrift::concurrency::PosixThreadFactory::Impl::getCurrentThreadId()
> const':
> /Users/rmanbert/development/trunkHead/client/thirdPartyLibs/sources/thrift/lib/cpp/src/concurrency/PosixThreadFactory.cpp:273:
> error: cast from '_opaque_pthread_t*' to 'id_t' loses precision
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.