gen-posix-lock-obj for iOS

Werner Koch wk at gnupg.org
Fri Sep 19 17:04:22 CEST 2014


On Thu, 18 Sep 2014 20:01, chris at chatsecure.org said:
> Great! Could you briefly explain why these are needed in the first place?
> All I can gather is that it's needed for some very low level threading

This is for the portable mutex API.  To avoid extra dependencies for
single threaded applications it is useful to avoid build time
dependencies to pthread.h and, if possible, runtime dependencies on
libpthread.  This information hiding method will also enable us to
change the concrete mutex implementation while keeping a stable API and
ABI.

> Another note, when compiling for all of these architectures I "lipo" the
> libraries together, but choose only one of the header files, so usually I

This is about these fat binaries, right?  I have no experience myself
withit but I know that you need to use some build tricks.

> am building other code against the i386 version of the header. Perhaps it
> would be best to concatenate the architecture-specific code into the single
> header file with #ifdefs based on architecture?

I don't like that.  The whole cpp based detection is not as robust as
the configure based one.  Right, it may happen that you use a wrong
header file but then something is wrong with your toolchain setup
anyway.  The autoconf macros we use actually detect a wrong use and
print a warning if you use a header for a different cpu-vendor-os.  We
can only do a warning because there are many aliases for the same
system.


Salam-Shalom,

   Werner

-- 
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.




More information about the Gcrypt-devel mailing list