cURL / Mailing Lists / curl-library / Single Mail


RE: OpenSSL thread-safety callbacks on AIX

From: Andrei Tarassov <>
Date: Mon, 3 Oct 2005 08:59:59 +0200

Seems that I've managed to solve the problem. I'am not sure, which of my
steps helped, so I will give them all:

1. Used -pthread for openssl config: ./config threads ... -pthread

2. OpenSSL builds static libraries, i.e. archive (ar) with object files.
I manually linked shared libraries with:
gcc *.o -o lib{crypto,ssl} -shared -pthread ...

3. Rebuilt curl so that it would use correct thread-safe libraries:
./configure ... LDFLAGS=-pthread

-----Original Message-----
[] On Behalf Of Andrei Tarassov
Sent: Saturday, October 01, 2005 22:12
To: libcurl development
Subject: RE: OpenSSL thread-safety callbacks on AIX

I tried asking this question in the openssl mailing list, but did not
get any answer. Seems that the openssl team is not much interested in
AIX. But maybe somebody has experienced the same problems when using

In order to link with libgcc_s_pthread.a, you should be using the
-pthread option of gcc.

-----Original Message-----
[] On Behalf Of Daniel Stenberg
Sent: Saturday, October 01, 2005 21:02
To: libcurl development
Subject: Re: OpenSSL thread-safety callbacks on AIX

On Sat, 1 Oct 2005, Andrei Tarassov wrote:

> I am setting the callback functions, which should make openssl stuff
> thread-safe as described by
> , but these functions just do not seem to be called on AIX. At the
> same time, the same test program works correctly (i.e. the callbacks
> are called) on Linux. Because of these problems our application
> crashes sometimes when downloading files from https servers in a
multi-threaded environment.
> Any ideas why this could happen?

I have no idea why. I never heard of this before. I would suggest that
you ask in a openssl-related forum as the question is about openssl

> BTW, we've noticed that libcurl is linked to libgcc_s.a, while for
> thread safety it should be linked with libgcc_s_pthread.a. We tried to

> relink the library, but it did not help to solve the above mentioned

Hm, you have any idea why it linked with the wrong one or what we should
do to make it link with the "proper" one by default?

  Commercial curl and libcurl Technical Support:
Received on 2005-10-03