[PATCH] Make libreplace a no-op on Linux

Jelmer Vernooij jelmer at samba.org
Thu Nov 22 08:22:24 MST 2012


On Tue, Nov 20, 2012 at 11:18:07AM +1100, Andrew Bartlett wrote:
> I know for a long time you have been trying to make libreplace a no-op
> on Linux.  This came up for me recently when on Debian Wheezy and Ubuntu
> 12.04 my build of Samba 4.0 using this configure command failed:
> 
> ./configure --builtin-libraries=replace,ccan
> --bundled-libraries=pytevent,iniparser
> 
> The errors were due to something not working in the conversion of
> libreplace into a builtin library, but this seems to be both the correct
> and simpler fix.
> 
> [3388/3906] Linking default/source4/heimdal_build/libkrb5-samba4.so
> default/source4/heimdal/lib/krb5/auth_context_55.o: In function
> `krb5_auth_con_genaddrs':
> auth_context.c:(.text+0x5d0): undefined reference to `rep_strerror_r'
> auth_context.c:(.text+0x6ea): undefined reference to `rep_strerror_r'
> default/source4/heimdal/lib/krb5/fcache_55.o: In function `_krb5_xlock':
> fcache.c:(.text+0x12e): undefined reference to `rep_strerror_r'
> default/source4/heimdal/lib/krb5/fcache_55.o: In function
> `_krb5_xunlock':
> fcache.c:(.text+0x21a): undefined reference to `rep_strerror_r'
> default/source4/heimdal/lib/krb5/fcache_55.o: In function `fcc_open':
> fcache.c:(.text+0xb5e): undefined reference to `rep_strerror_r'
> default/source4/heimdal/lib/krb5/fcache_55.o:fcache.c:(.text+0xf32):
> more undefined references to `rep_strerror_r' follow
> collect2: ld returned 1 exit status
> 
> The first patch should ensure we only replace strerror_r (which is only
> used by Heimdal anyway) on systems that really need it, and we have a
> way to override our preference for our replacement getpass().  The
> STRERROR_R_PROTO_COMPATIBLE is only set by roken.h, not configure. 
> 
> I'm not totally happy with adding --without-getpass-replacement, but it
> seems the best way can do for now.
> 
> With these fixes, libreplace really does become just the dummy function.
> 
> What do you think?
I think we should properly check the prototype and keep the
STRERROR_R_PROTO_COMPATIBLE define . The problem is that strerror_r
returns a char * on some platforms (notably, glibc) and an int on
others. Heimdal relies on the int version as far as I can tell.

See http://daniel.haxx.se/projects/portability/

Cheers,

Jelmer


More information about the samba-technical mailing list