NetBSD Problem Report #49686

From www@NetBSD.org  Sun Feb 22 19:49:20 2015
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 25D8FA582D
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 22 Feb 2015 19:49:20 +0000 (UTC)
Message-Id: <20150222194918.926A5A65B6@mollari.NetBSD.org>
Date: Sun, 22 Feb 2015 19:49:18 +0000 (UTC)
From: tnn@NetBSD.org
Reply-To: tnn@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: pkgtools/cwrappers does not work correctly with PREFER.pkgsrc=sqlite3
X-Send-Pr-Version: www-1.0

>Number:         49686
>Category:       pkg
>Synopsis:       pkgtools/cwrappers does not work correctly with PREFER.pkgsrc=sqlite3
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 22 19:50:00 +0000 2015
>Closed-Date:    Tue Mar 17 00:49:45 +0000 2015
>Last-Modified:  Tue Mar 17 00:49:45 +0000 2015
>Originator:     Tobias Nygren
>Release:        the bleeding edge
>Organization:
>Environment:
7.99.5 amd64
MKLLVM=yes
HAVE_LLVM=yes
MKGCC=no
PKGSRC_COMPILER=clang
CLANGBASE=/usr
USE_CWRAPPERS=yes

>Description:
There is some problem related to appearance of -L/usr/lib on the command line, which causes different sqlite3 libraries to be linked in (in some cases, but not always). I see it with for example net/gupnp and www/firefox.

>How-To-Repeat:
=========== Actual outcome
USE_CWRAPPERS=yes
PREFER.pkgsrc=sqlite3

$ cd /usr/pkgsrc/net/gupnp && make install
[...]
$ ldd /usr/pkg/lib/libgupnp-1.0.so  | grep sqlite3
        -lsqlite3.0 => /usr/pkg/lib/libsqlite3.so.0
        -lsqlite3.1 => /usr/lib/libsqlite3.so.1

=========== Expected outcome

USE_CWRAPPERS=no
PREFER.pkgsrc=sqlite3

$ cd /usr/pkgsrc/net/gupnp && make install
[...]
$ ldd /usr/pkg/lib/libgupnp-1.0.so  | grep sqlite3
tnn@t3610:gupnp> ldd /usr/pkg/lib/libgupnp-1.0.so  | grep sqlite3
        -lsqlite3.0 => /usr/pkg/lib/libsqlite3.so.0

=========== Linker command line from work.log in case of USE_CWRAPPERS=yes

/usr/bin/clang -shared -fPIC -DPIC .libs/gupnp-acl.o .libs/gupnp-context.o .libs/gupnp-context-manager.o .libs/gupnp-control-point.o .libs/gupnp-device.o .libs/gupnp-device-info.o .libs/gupnp-device-proxy.o .libs/gupnp-error.o .libs/gupnp-resource-factory.o .libs/gupnp-root-device.o .libs/gupnp-service.o .libs/gupnp-service-info.o .libs/gupnp-service-proxy.o .libs/gupnp-service-introspection.o .libs/gupnp-xml-doc.o .libs/gupnp-white-list.o .libs/gupnp-types.o .libs/http-headers.o .libs/gupnp-unix-context-manager.o .libs/gupnp-simple-context-manager.o .libs/gvalue-util.o .libs/xml-util.o .libs/gupnp-marshal.o -Wl,-rpath,/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib -L/usr/lib -L/usr/pkg/lib -lgssdp-1.0 -lsoup-2.4 -lsqlite3 -lpthread -lgio-2.0 -lgmodule-2.0 -lgobject-2.0 -lffi -lglib-2.0 -lpcre -lintl -lxml2 -lz -llzma -lm -pthread -O2 -march=core-avx-i -Wl,-rpath,/usr/lib -Wl,-rpath,/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib -Wl,--export-dynamic -pthread -Wl,-rpath,/usr/pkg/lib -Wl,-rpath,/u
 sr/pkg/lib -Wl,-rpath,/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib -pthread -Wl,-soname -Wl,libgupnp-1.0.so.4 -o .libs/libgupnp-1.0.so.4.0.0 -Qunused-arguments -I/tmp/pkgsrc-obj/net/gupnp/work/.buildlink/include



=========== Linker command line from work.log in case of USE_CWRAPPERS=no


/usr/bin/clang -shared -fPIC -DPIC .libs/gupnp-acl.o .libs/gupnp-context.o .libs/gupnp-context-manager.o .libs/gupnp-control-point.o .libs/gupnp-device.o .libs/gupnp-device-info.o .libs/gupnp-device-proxy.o .libs/gupnp-error.o .libs/gupnp-resource-factory.o .libs/gupnp-root-device.o .libs/gupnp-service.o .libs/gupnp-service-info.o .libs/gupnp-service-proxy.o .libs/gupnp-service-introspection.o .libs/gupnp-xml-doc.o .libs/gupnp-white-list.o .libs/gupnp-types.o .libs/http-headers.o .libs/gupnp-unix-context-manager.o .libs/gupnp-simple-context-manager.o .libs/gvalue-util.o .libs/xml-util.o .libs/gupnp-marshal.o -Wl,-rpath,/usr/pkg/lib -L/tmp/pkgsrc-obj/net/gupnp/work/.buildlink/lib -pthread -O2 -march=core-avx-i -Wl,-R/usr/pkg/lib -Wl,--export-dynamic -pthread -pthread -Wl,-soname -Wl,libgupnp-1.0.so.4 -o .libs/libgupnp-1.0.so.4.0.0 -Qunused-arguments -I/tmp/pkgsrc-obj/net/gupnp/work/.buildlink/include  -lgssdp-1.0 -lsoup-2.4 -lsqlite3 -lpthread -lgio-2.0 -lgmodule-2.0 -lgobject
 -2.0 -lffi -lglib-2.0 -lpcre -lintl -lxml2 -lz -llzma -lm
>Fix:
Don't use cwrappers on affected packages.

>Release-Note:

>Audit-Trail:
From: Tobias Nygren <tnn@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/49686: pkgtools/cwrappers does not work correctly with
 PREFER.pkgsrc=sqlite3
Date: Sun, 22 Feb 2015 21:11:06 +0100

 That should read PREFER.sqlite3=pkgsrc.

 The difference is that the wrapper for the "libtool" command
 in the non-cwrappers case eats the -L/usr/lib -Wl,-R/usr/lib
 whereas in the cwrappers case it passes them along.

From: "Joerg Sonnenberger" <joerg@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49686 CVS commit: pkgsrc/mk
Date: Sun, 15 Mar 2015 19:23:26 +0000

 Module Name:	pkgsrc
 Committed By:	joerg
 Date:		Sun Mar 15 19:23:26 UTC 2015

 Modified Files:
 	pkgsrc/mk: cwrappers.mk
 	pkgsrc/mk/buildlink3: bsd.buildlink3.mk

 Log Message:
 PR 49686: Drop -I and -L options references the built-in search
 directories of the compiler/linker when using cwrappers. Command line
 flags will often put them before the corresponding flags for
 PREFIX/include and PREFIX/lib, so the version from outside .buildlink
 would be prefered. The other way around is much less likely to be a
 problem and normally the expected case. Bump required cwrappers version
 for the necessary exact-match feature.


 To generate a diff of this commit:
 cvs rdiff -u -r1.20 -r1.21 pkgsrc/mk/cwrappers.mk
 cvs rdiff -u -r1.232 -r1.233 pkgsrc/mk/buildlink3/bsd.buildlink3.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: tnn@NetBSD.org
State-Changed-When: Tue, 17 Mar 2015 00:49:45 +0000
State-Changed-Why:
After some pkg_rolling-replace it seems to work now.
Thank you.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.