lists.arthurdejong.org
RSS feed

Re: cross compiling

[Date Prev][Date Next] [Thread Prev][Thread Next]

Re: cross compiling



On Fri, 2015-02-27 at 10:48 +0000, Mark Dodgson wrote:
> I have been trying to cross compile nss-pam-ldap for use on an
> embedded device. Unfortunately it seems that the gcc tools we are
> using was not built with support for TLS (thread local storage). 
> 
> The build is failing when compiling nss/aliases.c because TLS is now
> not defined. Other files that reference TLS use ifdefs to get around
> this issue.

Which version of nss-pam-ldapd are you using?

The reason that the fallback to pthreads can be used in nslcd/log.c is
because that binary is ending up being linked to the phthreads library
(I believe that is a requirement for the thread-local storage).

I think the NSS module cannot easily be linked with pthreads because it
would interfere with pthreads or other threading-implementations
provided by libc that may already be loaded and used by the application
when loading the NSS module. It was a long time ago that I went over the
details of this, so please correct me if I'm wrong.

The ugly hack would be to just
  #define TLS
if it is not defined to get it to compile. This will result in the
get**ent_r()-like functions no longer being reentrant. Glibc contains
this in the getpwent_r() manual page:

  The function  getpwent_r() is not really reentrant since it shares the
  reading position in the stream with all other threads.

Hope this helps. If you can find a nicer solution, please provide
patches ;)

-- 
-- arthur - arthur@arthurdejong.org - http://arthurdejong.org/ --
-- 
To unsubscribe send an email to
nss-pam-ldapd-users-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-users/