Subject: pkg/34108: Wrong rpath order in BUILDLINK_LDFLAGS
To: None <,,>
From: None <>
List: pkgsrc-bugs
Date: 07/29/2006 04:15:01
>Number:         34108
>Category:       pkg
>Synopsis:       Wrong rpath order in BUILDLINK_LDFLAGS
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 29 04:15:00 +0000 2006
>Originator:     Min Sik Kim
>Release:        pkgsrc-current
	Linux 2.6.12-10-amd64-xeon
After adding LIBABISUFFIX for amd64 in mk/platform/, packages are
linked against native libraries instead of pkgsrc ones.

% cd textproc/libxml2
% bmake show-var VARNAME=PREFIX
% bmake show-var PKG_PHASE=build VARNAME=BUILDLINK_LDFLAGS -L/usr/lib64 -Wl,-R/usr/lib64 -Wl,-R/home/msk/pkg/lib
% bmake install
% ldd /home/msk/pkg/bin/xmlcatalog => /usr/lib64/ (0x00002aaaaabc3000) => /lib/ (0x00002aaaaadfe000) => /usr/lib64/ (0x00002aaaaaf02000) => /lib/ (0x00002aaaab018000) => /lib/ (0x00002aaaab19e000)
       /lib64/ (0x00002aaaaaaab000)

Because of /usr/lib64 in BUILDLINK_LDFLAGS, xmlcatalog (installeld by
libxml2) uses /usr/lib64/ instead of
${PREFIX}/, and /usr/lib64/ instead of

Build a package depending on a pkgsrc library of which an older,
incompatible version is in /usr/lib64.

Change the order in BUILDLINK_LDFLAGS so that ${PREFIX}/lib always
preceds /usr/lib64.