NetBSD Problem Report #46130
From he@vipe.uninett.no Fri Mar 2 22:45:59 2012
Return-Path: <he@vipe.uninett.no>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
by www.NetBSD.org (Postfix) with ESMTP id 9089163B952
for <gnats-bugs@gnats.NetBSD.org>; Fri, 2 Mar 2012 22:45:59 +0000 (UTC)
Message-Id: <20120302224600.B2D4541783D@vipe.uninett.no>
Date: Fri, 2 Mar 2012 23:46:00 +0100 (CET)
From: he@NetBSD.org
Reply-To: he@NetBSD.org
To: gnats-bugs@gnats.NetBSD.org
Subject: Partial fix/workaround for "the libpixman problem"
X-Send-Pr-Version: 3.95
>Number: 46130
>Category: pkg
>Synopsis: Partial fix/workaround for "the libpixman problem"
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: pkg-manager
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Mar 02 22:50:01 +0000 2012
>Closed-Date: Wed Mar 07 14:23:14 +0000 2012
>Last-Modified: Wed Mar 07 14:23:14 +0000 2012
>Originator: Havard Eidnes
>Release: NetBSD 5.1
>Organization:
None
>Environment:
System: NetBSD vipe.uninett.no 5.1 NetBSD 5.1 (VIPE) #1: Mon Jan 16 10:01:42 CET 2012 he@vipe.uninett.no:/usr/obj/sys/arch/amd64/compile/VIPE amd64
Architecture: x86_64
Machine: amd64
>Description:
David Holland analyzed this problem. The start of his message
to tech-pkg@NetBSD.org of February 20 sums up the problem:
People using -5 have become all too familiar with this:
.../work/.x11-buildlink/lib/libcairo.so: undefined reference to `pixman_image_set_destroy_function'
.../work/.x11-buildlink/lib/libcairo.so: undefined reference to `pixman_image_composite32'
.../work/.x11-buildlink/lib/libcairo.so: undefined reference to `pixman_image_fill_boxes'
*** Error 1
I finally got direct access to it while failing last night, and here's
what happens at least in the case I found:
(1) Something in the victim package's config logic adds
-L/usr/X11R7/lib -R/usr/X11R7/lib to LDFLAGS or LIBS.
(2) This gets added *before* the -Wl,-R/usr/pkg/lib -Wl,-R/usr/X11R7/lib
that comes from pkg-config.
(3) The wrappers remove -L/usr/X11R7/lib but leave the
-R/usr/X11R7/lib alone and print:
WARNING: [transform-gcc] passing unknown option -R/usr/X11R7/lib
(4) Thus the link line ends up with an rpath that has /usr/X11R7/lib
before /usr/pkg/lib. This is wrong, and the rest follows on a
predictable downhill path.
It is our GCC which puts -R at the front of the ld invocation.
I experienced this problem with the graphics/gnuplot package.
In that case, the -L/usr/X11R7/lib and -R/usr/X11R7/lib come
from LIBRARIES_FOR_X, which comes from X_LIBS, which again
comes from autoconf's AC_PATH_XTRA, so in a sense this isn't
really a bug in the package which experiences the problem.
>How-To-Repeat:
Try to build graphics/gnuplot from pkgsrc-current.
>Fix:
It is possible to partly work around this by converting
any -R<dir> option into -Wl,-R<dir>, which will not be
re-ordered relative to other -Wl,-R<dir> options. This
can be done by the pkgsrc wrapper system, like this:
Index: mk/wrapper/transform-gcc
===================================================================
RCS file: /cvsroot/pkgsrc/mk/wrapper/transform-gcc,v
retrieving revision 1.25
diff -u -r1.25 transform-gcc
--- mk/wrapper/transform-gcc 6 Feb 2012 13:03:55 -0000 1.25
+++ mk/wrapper/transform-gcc 2 Mar 2012 22:19:25 -0000
@@ -132,6 +132,11 @@
-fgnu-runtime |\
-fconstant-string-class=* ) transform_pass ;;
+# Old-style rpath specifier; gcc places -R args passed to gcc first in
+# the linker invocation, which messes up the search order among the
+# other -Wl,-R specifiers given to GCC
+-R* ) transform_to "-Wl,$arg" ;;
+
# Other compiler's options that have corresponding GCC options.
-Kpic |\
-kpic |\
It is confirmed that this fixes the build of gnuplot on
NetBSD 5.1.
>Release-Note:
>Audit-Trail:
From: "Jeremy C. Reed" <reed@reedmedia.net>
To: gnats-bugs@gnats.netbsd.org
Cc:
Subject: Re: pkg/46130
Date: Mon, 5 Mar 2012 09:13:47 -0600 (CST)
I don't think there is anyone responsible to assign this ticket too.
I didn't read the thread, but was the fix and okay for it there too?
From: Havard Eidnes <he@NetBSD.org>
To: reed@reedmedia.net
Cc: gnats-bugs@NetBSD.org
Subject: Re: pkg/46130
Date: Mon, 05 Mar 2012 18:43:52 +0100 (CET)
> I don't think there is anyone responsible to assign this ticket too.=
Hmm, ok.
> I didn't read the thread, but was the fix and okay for it there too?=
David Holland said "sounds like the right general approach", and
"let it rest for a few days (to give a chance to others to
respond) and then commit".
Regards,
- H=E5vard
From: "Havard Eidnes" <he@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/46130 CVS commit: pkgsrc/mk/wrapper
Date: Wed, 7 Mar 2012 12:55:53 +0000
Module Name: pkgsrc
Committed By: he
Date: Wed Mar 7 12:55:53 UTC 2012
Modified Files:
pkgsrc/mk/wrapper: transform-gcc
Log Message:
Rewrite any -R<dir> into -Wl,-R<dir>. -R is the old form of -Wl,-R,
but our gcc re-orders them so that all -R args come at the front
of the "ld" invocation. This messes up the relative search order,
and is at least partly responsible for "the pixman problem"
experienced on (at least) NetBSD 5.1. This is as close as a general
fix as I can think of, and should fix PR#46130, although it possibly
doesn't fix every instance of this more general problem.
To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 pkgsrc/mk/wrapper/transform-gcc
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: wiz@NetBSD.org
State-Changed-When: Wed, 07 Mar 2012 14:23:14 +0000
State-Changed-Why:
he committed it
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.