I think it should be possible to build without pthreads if you just make a
few minor tweaks. I fiddled around with this a little bit and got something
that seems to mostly work on a branch here (though I have not really tested
it): https://github.com/acozzette/protobuf/tree/without-pthread

I mostly just had to do the following:
- Update configure.ac to unset HAVE_PTHREAD
- Update stubs/common.cc to provide a no-op implementation of the Mutex
class.

Of course this assumes that your application will be single-threaded; if
you were to build the code in this configuration and then use threads
anyway, things would go wrong because you have data races caused by the
lack of real locking.

On Wed, Nov 23, 2016 at 1:26 AM, Sam Van den Steen <samvandenst...@gmail.com
> wrote:

> Dear all,
>
> I'm developing some binary instrumentation tools where I use protobuf to
> save the output. I wrote a Pintool using this and everything works fine.
> However, I wanted to try DynamoRIO because Pin cannot be used to instrument
> ARM code. Apparently DynamoRIO cannot be linked against libpthread which
> protobuf needs.
>
> Is it possible to compile a version of protobuf without pthreads so I
> don't have to link against it? I found at least one project where it seemed
> to work, but sadly, the modifications he made to the code are not available
> anymore.
>
> http://arachnism.blogspot.be/2010/03/compiling-google-
> protobuf-without.html
>
> I also found multiple > five year old threads in this discussion group
> (detailing it seemed to be impossible), but I was wondering if it was
> possible to compile without pthreads for the newer protobuf 3?
>
> Kind regards,
> Sam Van den Steen
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to