pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
pkg/37228: pkgsrc reorders -l<lib> relative to -Wl,-Bstatic / -Wl,-Bdynamic
>Number: 37228
>Category: pkg
>Synopsis: pkgsrc reorders -l<lib> relative to -Wl,-Bstatic /
>-Wl,-Bdynamic
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Oct 26 23:25:00 +0000 2007
>Originator: Havard Eidnes
>Release: NetBSD 4.0_RC3 / pkgsrc-current
>Organization:
I try...
>Environment:
System: NetBSD bean.urc.uninett.no 4.0_RC3 NetBSD 4.0_RC3 (GENERIC.MP) #3: Tue
Oct 23 13:25:19 CEST 2007
he%bean.urc.uninett.no@localhost:/usr/obj/sys/arch/i386/compile/GENERIC.MP i386
Architecture: i386
Machine: i386
>Description:
A package I am trying to build is peculiar in that it wants
to link some libraries statically and some dynamically when
building a shared object.
The wrapper system in pkgsrc makes this difficult.
The reason is that the -Wl,-Bstatic / -Wl,-Bdynamic arguments
are left in their place in the compiler command, while all
the libraries referenced via -l<lib> are collected and put at
the end of the command line, thus disrupting the ordering of
the "link dynamically" and "link statically" arguments.
>How-To-Repeat:
Try to package a program which wants to do as specified above;
watch it fail. Turning on WRAPPER_DEBUG=yes in the environment
exposes the problem when the compiler commands are collected in
work/.work.log.
>Fix:
This is a non-portable hack but it mirrors how I tweaked the
package's work/.wrapper/tmp/buildcmd script. It does however
illustrate a working workaround.
Index: buildcmd
===================================================================
RCS file: /u/nb/pkgsrc/mk/wrapper/buildcmd,v
retrieving revision 1.1
diff -u -r1.1 buildcmd
--- buildcmd 21 Sep 2004 15:01:41 -0000 1.1
+++ buildcmd 26 Oct 2007 22:13:59 -0000
@@ -55,6 +55,16 @@
;;
esac
;;
+######################################################################
+# Preserve and duplicate the -Wl,-Bstatic / -Wl,-Bdynamic arguments,
+# but also preserve their presence and order relative to the list
+# of libraries. Someone may want to mix static and dynamic linking.
+######################################################################
+-Wl,-Bdynamic|-Wl,-Bstatic*)
+ shquote "$arg"; arg="$shquoted"
+ cmd="$cmd $arg"
+ libs="$libs $arg"
+ ;;
-l*)
case $libs in
*" "$arg)
Home |
Main Index |
Thread Index |
Old Index