Hi,

I stumbled upon an issue that I'm not sure what the best fix is and
wanted to ask people here for opinions.

There are a couple of packages that have a check in the configure
script that will check for the presence of the pthread_create function.
The check works as far as I understand as follows:
* check whether pthread_create is available without a flag
* check whether pthread_create is available with -lpthread

Now here's the problem: libasan contains a pthread_create function.
Therefore the configure scripts will assume that pthread is available.
However libasan doesn't contain the full pthread functionality, other
functions like pthread_mutex_create aren't available.

Therefore:
* configure script thinks we don't need -lpthread
* application uses pthread functionality that's not in libasan
* compilation fails


I have first encountered this in sqlite, upstream has now fixed this by
checking for a different pthread function (patch came from me):
https://www.sqlite.org/cgi/src/info/9c3a0dc2e8bf202c

Now I wonder - is this a good solution? I know of at least three other
packages (poppler, openldap, p11-kit) that have the same issue and
wonder if I should send similar patches or if there's a better / more
clean solution to this.

(Also I think this stuff should be documented, I'll add this to the FAQ
once we agree what the best way forward is. There's another very common
asan compilation issue with libtool, I'll document that as well.)

-- 
Hanno Böck
http://hboeck.de/

mail/jabber: [email protected]
GPG: BBB51E42

-- 
You received this message because you are subscribed to the Google Groups 
"address-sanitizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Attachment: pgpSYemZwaHDq.pgp
Description: OpenPGP digital signature

Reply via email to