Subject: pkg/24087: linking of ncurses fails, buildlink3 lossage
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <grant@NetBSD.org>
List: netbsd-bugs
Date: 01/14/2004 09:33:09
>Number:         24087
>Category:       pkg
>Synopsis:       linking of ncurses fails, buildlink3 lossage
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 13 22:34:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     grant beattie
>Release:        SunOS 5.9
>Organization:
>Environment:
System: SunOS u10 5.9 Generic_112233-08 sun4u sparc SUNW,Ultra-5_10
Architecture: sparc
Machine: sparc
>Description:
linking of ncurses fails when using lang/gcc3 due to argument munging
by buildlink3.

the following is the 'make' output of the failed g++ command:

g++ -shared -nostdlib  -L/usr/pkg/gcc-3.3/lib/gcc-lib/sparc-sun-solaris2/3.3 -Wl,-R/usr/pkg/gcc-3.3/lib/gcc-lib/sparc-sun-solaris2/3.3 -L/usr/pkg/gcc-3.3/lib -Wl,-R/usr/pkg/gcc-3.3/lib /usr/pkg/gcc-3.3/lib/gcc-lib/sparc-sun-solaris2/3.3/crti.o /usr/ccs/lib/values-Xa.o /usr/pkg/gcc-3.3/lib/gcc-lib/sparc-sun-solaris2/3.3/crtbegin.o  ../obj_lo/.libs/cursesf.o ../obj_lo/.libs/cursesm.o ../obj_lo/.libs/cursesw.o ../obj_lo/.libs/cursespad.o ../obj_lo/.libs/cursesp.o ../obj_lo/.libs/cursslk.o ../obj_lo/.libs/cursesapp.o ../obj_lo/.libs/cursesmain.o  -Wl,-R -Wl,/usr/pkg/gcc-3.3/lib/. -Wl,-R -Wl,/usr/pkg/gcc-3.3/lib/. -Wl,-R -Wl,/usr/pkg/gcc-3.3/lib  -L/work/pkgbuild/devel/ncurses/work.sol9/.buildlink/lib -L/usr/pkg/gcc-3.3/lib/gcc-lib/sparc-sun-solaris2/3.3 -L/usr/ccs/bin -L/usr/ccs/lib -L/usr/pkg/gcc-3.3/lib/gcc-lib/sparc-sun-solaris2/3.3/../../.. -R/usr/pkg/gcc-3.3/lib /usr/pkg/gcc-3.3/lib/./libstdc++.so -L/work/pkgbuild/lang/gcc3/work.sol9/gcc-3.3/sparc-sun-solaris2/libstdc++-v3/!
 src -L/work/pkgbuild/lang/gcc3/work.sol9/gcc-3.3/sparc-sun-solaris2/libstdc++-v3/src/.libs -L/work/pkgbuild/lang/gcc3/work.sol9/gcc-3.3/gcc -lm -lgcc_s -lc /usr/pkg/gcc-3.3/lib/gcc-lib/sparc-sun-solaris2/3.3/crtend.o /usr/pkg/gcc-3.3/lib/gcc-lib/sparc-sun-solaris2/3.3/crtn.o  -Wl,-h -Wl,libncurses++.so.5 -o .libs/libncurses++.so.5.3
ld: fatal: file /usr/pkg/gcc-3.3/lib/.: unknown file type
ld: fatal: File processing errors. No output written to .libs/libncurses++.so.5.3 
collect2: ld returned 1 exit status

from .work.log, this is the actual command which was run:

/usr/pkg/gcc-3.3/bin/g++ -shared -nostdlib -L/work/pkgbuild/devel/ncurses/work.sol9/.buildlink/gcc-3.3/lib/gcc-lib/sparc-sun-solaris2/3.3 -L/work/pkgbuild/devel/ncurses/work.sol9/.buildlink/gcc-3.3/lib /usr/pkg/gcc-3.3/lib/gcc-lib/sparc-sun-solaris2/3.3/crti.o /usr/ccs/lib/values-Xa.o /usr/pkg/gcc-3.3/lib/gcc-lib/sparc-sun-solaris2/3.3/crtbegin.o ../obj_lo/.libs/cursesf.o ../obj_lo/.libs/cursesm.o ../obj_lo/.libs/cursesw.o ../obj_lo/.libs/cursespad.o ../obj_lo/.libs/cursesp.o ../obj_lo/.libs/cursslk.o ../obj_lo/.libs/cursesapp.o ../obj_lo/.libs/cursesmain.o -Wl,-R -Wl,/usr/pkg/gcc-3.3/lib/. -Wl,/usr/pkg/gcc-3.3/lib/. -Wl,/usr/pkg/gcc-3.3/lib -L/work/pkgbuild/devel/ncurses/work.sol9/.buildlink/lib -L/work/pkgbuild/devel/ncurses/work.sol9/.buildlink/gcc-3.3/lib/gcc-lib/sparc-sun-solaris2/3.3/../../.. -L/work/pkgbuild/devel/ncurses/work.sol9/.buildlink/gcc-3.3/lib/. -lstdc++ -lm -lgcc_s -lc /usr/pkg/gcc-3.3/lib/gcc-lib/sparc-sun-solaris2/3.3/crtend.o /usr/pkg/gcc-3.3/lib/gcc-li!
 b/sparc-sun-solaris2/3.3/crtn.o -Wl,-h -Wl,libncurses++.so.5 -o .libs/libncurses++.so.5.3 -I/work/pkgbuild/devel/ncurses/work.sol9/.buildlink/include

the problem is the following arguments:

-Wl,-R -Wl,/usr/pkg/gcc-3.3/lib/. -Wl,/usr/pkg/gcc-3.3/lib/. -Wl,/usr/pkg/gcc-3.3/lib

the first two arguments are fine, but the next two arguments aren't
valid and are not in the pre-munged command from the 'make' output.

>How-To-Repeat:
set USE_GCC3 in /etc/mk.conf.

cd devel/ncurses; make
>Fix:
unknown.
>Release-Note:
>Audit-Trail:
>Unformatted: