Subject: pkg/29706: buildlink3 incorrectly reorders link objects
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <lex-pr-2005-03-16@wennmacher.org>
List: pkgsrc-bugs
Date: 03/16/2005 10:28:00
>Number:         29706
>Category:       pkg
>Synopsis:       buildlink3 incorrectly reorders link objects
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 16 10:28:00 +0000 2005
>Originator:     Lex Wennmacher
>Release:        NetBSD 1.6.1
>Organization:
>Environment:
System: NetBSD mail.wennmacher.org 1.6.1 NetBSD 1.6.1 (MAIL) #0: Sun Jul 13 22:22:21 MEST 2003 wennmach@mail.wennmacher.org:/usr/src/sys/arch/i386/compile/MAIL i386
Architecture: i386
Machine: i386
>Description:
Consider the following libtool command:

libtool --mode link cc -o test test.o -lfoo libbar.a

The buildlink3 infrastructure processes and reorders this to:
${WRKSRC}/.gcc/bin/gcc -o test test.o libbar.a -L${WRKSRC}.buildlink/lib \
-I${WRKSRC}.buildlink/include -lfoo

Note that the order of the libraries has changed. This can cause
unresolved externals.

Notably net/arla suffers from this as the Makefiles of this package
use both alternatives, "../../lib/foo/libfoo.a" and "-L../../lib/foo -lfoo"
to specify libraries.

>How-To-Repeat:
Try to build net/arla without the numerous patches to work around this.

>Fix:
Not provided.

>Unformatted:
 pkgsrc as of 2005-03-16