[PATCH] Make libreplace a no-op on Linux

Andrew Bartlett abartlet at samba.org
Mon Nov 19 17:18:07 MST 2012


Jelmer,

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?

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-lib-replace-Allow-OS-vendor-to-assert-that-getpass-i.patch
Type: text/x-patch
Size: 2331 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20121120/dbd72310/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lib-replace-Do-not-use-STRERROR_R_PROTO_COMPATIBLE-a.patch
Type: text/x-patch
Size: 1458 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20121120/dbd72310/attachment-0001.bin>


More information about the samba-technical mailing list