Date: Tue, 18 Sep 2001 14:38:43 -0400 (EDT) From: Brian Dean <bsd@freebsd.org> To: FreeBSD-gnats-submit@freebsd.org Subject: ports/30652: [patch] XFree86-4: can't link both libXt and libXp due to multiple definitions of _Xpw_copyPasswd Message-ID: <200109181838.f8IIcht68645@neutrino.bsdhome.com>
next in thread | raw e-mail | index | archive | help
>Number: 30652 >Category: ports >Synopsis: [patch] XFree86-4: can't link both libXt and libXp due to multiple definitions of _Xpw_copyPasswd >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Sep 18 11:40:00 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Brian Dean >Release: FreeBSD 4.4-STABLE i386 >Organization: >Environment: System: FreeBSD neutrino.bsdhome.com 4.4-STABLE FreeBSD 4.4-STABLE #3: Fri Sep 14 22:51:10 EDT 2001 root@neutrino.bsdhome.com:/usr/obj/usr/src/sys/NEUTRINO i386 XFree86-4 libraries Xt, Xp, probably others. >Description: Within Xos_r.h, _Xpw_copyPasswd() is defined as an __inline__ function. It needs to be declared static, otherwise, one can end up unable to link a program that uses both libXt.a and libXp.a, depending on the functions called. >How-To-Repeat: Nonsensical test program which demostrates the problem: #include <stdio.h> int main() { XtScreenDatabase(); XpStartJob(); } Compile this with: cc -static -pthread -o xtest xtest.c -L/usr/X11R6/lib -lXp -lXt -lX11 -lXext -lSM -lICE /usr/X11R6/lib/libXt.a(Initialize.o): In function `_Xpw_copyPasswd': Initialize.o(.text+0x0): multiple definition of `_Xpw_copyPasswd' /usr/X11R6/lib/libXp.a(XpJob.o)(.text+0x0): first defined here >Fix: Add this patch as patch-k to /usr/ports/x11/XFree86-4/files: --- include/Xos_r.h.orig Tue Sep 18 10:46:06 2001 +++ include/Xos_r.h Tue Sep 18 10:46:26 2001 @@ -249,7 +249,7 @@ */ #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) -__inline__ void _Xpw_copyPasswd(_Xgetpwparams p) +static __inline__ void _Xpw_copyPasswd(_Xgetpwparams p) { memcpy(&(p).pws, (p).pwp, sizeof(struct passwd)); This will fix the libraries on FreeBSD, though, NetBSD and OpenBSD are also affected, so ultimiately this patch should go back to the XFree folks. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200109181838.f8IIcht68645>