xdm getpwnam pwd.h conflict

Jeremy Huddleston jeremyhu at freedesktop.org
Sun Feb 24 14:41:10 PST 2008


Hi Alan,

When compiling a recent version of xdm, I noticed the following  
linking failure when linking libXdmGreet (on darwin):
ld: duplicate symbol ___xdm_getpwnam in .libs/greet.o and .libs/Login.o

I git-bisect'd it down to this commit of yours (specifically, the  
inclusion of <pwd.h> in this patch):
http://cgit.freedesktop.org/xorg/app/xdm/commit/?id=6e2362e825dfec6df73f1338088a850225ed92d2

The following exists in our <pwd.h>:
struct passwd   *getpwnam(const char *);

However, looking at the pre-processed C, this gets pre-processed into:
struct passwd *(*__xdm_getpwnam)(const char *);

due to this:
greet.h:#define	getpwnam	(*__xdm_getpwnam)

Simply #include-ing <pwd.h> at the top of greet.h allows it to be  
processes first, thus compilation/linking succeeds...  but while  
that's good enough for a workaround, it isn't the best solution.

What are your thoughts?

--Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3040 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20080224/4213ac1a/attachment.bin>


More information about the xorg mailing list