Subject: pkg/28872: gcc34 package fails to build on amd64
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <blymn@internode.on.net>
List: pkgsrc-bugs
Date: 01/05/2005 13:54:00
>Number:         28872
>Category:       pkg
>Synopsis:       gcc34 fails to build, missing libiconv in link
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 05 13:54:00 +0000 2005
>Originator:     Brett Lymn (Master of the Siren)
>Release:        NetBSD 2.99.12
>Organization:
Brett Lymn
>Environment:
System: NetBSD siren 2.99.12 NetBSD 2.99.12 (SIREN.ACPI.MP) #4: Tue Jan 4 22:30:44 CST 2005 blymn@siren:/usr/src/sys/arch/amd64/compile/SIREN.ACPI.MP amd64
Architecture: x86_64
Machine: amd64
>Description:
	Building gcc34 from a recently cvs update'd pkgsrc on my amd64
machine fails in the link stage of the stage1 compile:

stage1/xgcc -Bstage1/ -B/usr/pkg/gcc34/x86_64--netbsd2.99.12/bin/   -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wold-style-definition     -DHAVE_CONFIG_H  -o cc1 \
        c-parse.o c-lang.o c-pretty-print.o stub-objc.o attribs.o c-errors.o c-lex.o c-pragma.o c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o c-opts.o c-format.o c-semantics.o c-incpath.o cppdefault.o c-ppoutput.o c-cppbuiltin.o prefix.o c-objc-common.o c-dump.o c-pch.o libcpp.a  main.o libbackend.a ../libiberty/libiberty.a ../intl/libintl.a  
libcpp.a(cppcharset.o)(.text+0xb7e): In function `convert_using_iconv':
/usr/pkgsrc/lang/gcc34/work.x86_64/gcc-3.4.3/gcc/cppcharset.c:559: undefined reference to `libiconv'
libcpp.a(cppcharset.o)(.text+0xbc7):/usr/pkgsrc/lang/gcc34/work.x86_64/gcc-3.4.3/gcc/cppcharset.c:569: undefined reference to `libiconv'
libcpp.a(cppcharset.o)(.text+0xd43): In function `init_iconv_desc':
/usr/pkgsrc/lang/gcc34/work.x86_64/gcc-3.4.3/gcc/cppcharset.c:647: undefined reference to `libiconv_open'
libcpp.a(cppcharset.o)(.text+0xeb8): In function `_cpp_destroy_iconv':
/usr/pkgsrc/lang/gcc34/work.x86_64/gcc-3.4.3/gcc/cppcharset.c:710: undefined reference to `libiconv_close'
libcpp.a(cppcharset.o)(.text+0x1f36): In function `_cpp_convert_input':
/usr/pkgsrc/lang/gcc34/work.x86_64/gcc-3.4.3/gcc/cppcharset.c:1386: undefined reference to `libiconv_close'
libcpp.a(cppcharset.o)(.text+0xea9): In function `_cpp_destroy_iconv':
/usr/pkgsrc/lang/gcc34/work.x86_64/gcc-3.4.3/gcc/cppcharset.c:712: undefined reference to `libiconv_close'
collect2: ld returned 1 exit status
gmake[2]: *** [cc1] Error 1
gmake[2]: Leaving directory `/usr/pkgsrc/lang/gcc34/work.x86_64/obj/gcc'
gmake[1]: *** [stage2_build] Error 2
gmake[1]: Leaving directory `/usr/pkgsrc/lang/gcc34/work.x86_64/obj/gcc'
gmake: *** [bootstrap] Error 2
*** Error code 2

Stop.
make: stopped in /usr/pkgsrc/lang/gcc34
*** Error code 1

>How-To-Repeat:
	Try building gcc34
>Fix:
	I can work around the problem by commenting out the lines:

CONFIGURE_ARGS+=       --with-libiconv-prefix=${BUILDLINK_PREFIX.iconv}
MAKE_ENV+=             ICONVPREFIX=${BUILDLINK_PREFIX.iconv}

in the pkgsrc Makefile, after doing this a functional compiler is produced.
This is not really a correct solution.  I tried adding libiconv.a into the
.buildlink/lib directory but the build failed with the same error.