Add explicit -lfoo for libraries that are required because of NEEDED

entries in other libraries.
This avoids a bug in 'ld' which causes it to look in the directory
specified by the RPATH entry (in the library with the NEEDED entry)
without adding the directory supplied by --sysroot.
When the RPATH entry in blindly folloed the link is done w.r.t the
systems own libfoo.so which may be missing some symbols.
(Or might have a wrong sized data area that would need copying
into the programs (or other libraries) data space.)
ld also seems to add a NEEDED entry for these libraries directly
into the program binary - this doesn't seem right to me.
Fixes my build where the installed libX11.so is dated from 2009.
CVS :----------------------------------------------------------------------
This commit is contained in:
dsl 2011-05-23 17:44:41 +00:00
parent fed8f3aa3c
commit 5415722580
2 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.6 2009/12/18 17:28:47 christos Exp $
# $NetBSD: Makefile,v 1.7 2011/05/23 17:44:41 dsl Exp $
.include <bsd.own.mk>
@ -27,7 +27,7 @@ CPPFLAGS.resource.c= \
-DDEF_GREETER_LIB=\"${XDMGREETERLIB}\"
LDADD+= -lXau -lXdmcp -lXft -lXinerama -lXpm
LDADD+= -lXmu -lXt -lSM -lICE -lXext -lX11
LDADD+= -lXmu -lXt -lSM -lICE -lXext -lXrender -lX11
LDADD+= -lcrypt -lfreetype
DPADD+= ${LIBXAU} ${LIBXDMCP} ${LIBXFT} ${LIBXINERAMA} ${LIBXPM}
DPADD+= ${LIBXMU} ${LIBXT} ${LIBSM} ${LIBICE} ${LIBXEXT} ${LIBX11}

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.4 2010/05/22 02:40:55 mrg Exp $
# $NetBSD: Makefile,v 1.5 2011/05/23 17:44:41 dsl Exp $
.include <bsd.own.mk>
@ -8,7 +8,7 @@ SRCS= buttonmap.c feedback.c list.c property.c setint.c setmode.c \
CPPFLAGS+= -DVERSION='"1.4.0"'
LDADD+= -lXi -lm
LDADD+= -lXi -lX11 -lm
DPADD+= ${LIBXI} ${LIBM}
.PATH: ${X11SRCDIR.${PROG}}/src
.PATH: ${X11SRCDIR.${PROG}}/man