NetBSD Problem Report #21848
Received: (qmail 18926 invoked by uid 605); 11 Jun 2003 00:12:53 -0000
Message-Id: <200306110012.h5B0CpW18355@immanent.net>
Date: Tue, 10 Jun 2003 19:12:51 -0500 (CDT)
From: fredb@immanent.net
Sender: gnats-bugs-owner@netbsd.org
Reply-To: fredb@netbsd.org
To: gnats-bugs@gnats.netbsd.org
Subject: gcc3-3.3 has a hidden dependency on libiconv
X-Send-Pr-Version: 3.95
>Number: 21848
>Category: pkg
>Synopsis: gcc3-3.3 has a hidden dependency on libiconv
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: grant
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Jun 11 00:13:00 +0000 2003
>Closed-Date: Sat Nov 03 10:53:07 +0000 2007
>Last-Modified: Sat Nov 03 10:53:07 +0000 2007
>Originator: Frederick Bruckman
>Release: NetBSD 1.6.1
>Organization:
>Environment:
System: NetBSD tautology.immanent.net 1.6.1 NetBSD 1.6.1 (TAUTOLOGY) #42: Mon Apr 28 19:07:25 CDT 2003 fredb@tautology.immanent.net:/s/src-release/sys/arch/i386/compile/TAUTOLOGY i386
Architecture: i386
Machine: i386
>Description:
Some of the java apps in gcc3-3.3 have a hidden dependency on libiconv.
(Same for gcc-3.3nb1, which had a change orthogonal to this problem.):
fredb@tautology-> pwd
/usr/pkg/gcc-3.3/bin
fredb@tautology-> ldd gij jv-convert rmic rmiregistry
gij:
-lgcj.4 => /usr/pkg/gcc-3.3/lib/libgcj.so.4
-lc.12 => /usr/lib/libc.so.12
-lgcc_s.1 => /usr/pkg/gcc-3.3/lib/libgcc_s.so.1
-lm.0 => /usr/lib/libm387.so.0
-lm.0 => /usr/lib/libm.so.0
-liconv.3 => not found
jv-convert:
-lgcj.4 => /usr/pkg/gcc-3.3/lib/libgcj.so.4
-lc.12 => /usr/lib/libc.so.12
-lgcc_s.1 => /usr/pkg/gcc-3.3/lib/libgcc_s.so.1
-lm.0 => /usr/lib/libm387.so.0
-lm.0 => /usr/lib/libm.so.0
-liconv.3 => not found
rmic:
-lgcj.4 => /usr/pkg/gcc-3.3/lib/libgcj.so.4
-lc.12 => /usr/lib/libc.so.12
-lgcc_s.1 => /usr/pkg/gcc-3.3/lib/libgcc_s.so.1
-lm.0 => /usr/lib/libm387.so.0
-lm.0 => /usr/lib/libm.so.0
-liconv.3 => not found
rmiregistry:
-lgcj.4 => /usr/pkg/gcc-3.3/lib/libgcj.so.4
-lc.12 => /usr/lib/libc.so.12
-lgcc_s.1 => /usr/pkg/gcc-3.3/lib/libgcc_s.so.1
-lm.0 => /usr/lib/libm387.so.0
-lm.0 => /usr/lib/libm.so.0
-liconv.3 => not found
>How-To-Repeat:
Build lang/gcc3 with ${PKG_DEVELOPER} set to "YES".
>Fix:
I don't know. I tried adding
".include ../../converters/libiconv/buildlink2.mk", and that adds the
dependendency, of course, but doesn't fix the RPATH.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: pkg-manager->grant
Responsible-Changed-By: grant
Responsible-Changed-When: Wed Jun 11 04:42:32 UTC 2003
Responsible-Changed-Why:
I guess gcc3.3 is my baby, I'll take this.
From: Matthias Drochner <M.Drochner@fz-juelich.de>
To: fredb@netbsd.org
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: pkg/21848: gcc3-3.3 has a hidden dependency on libiconv
Date: Wed, 11 Jun 2003 10:31:58 +0200
Incidentally, I had a pkgsrc gcc3-3.3 (before the nb1) build running last
night.
Although libiconv was installed, the binaries you mention don't depend on it:
$ /usr/sbin/pkg_info -e libiconv
libiconv-1.8nb1
$ ldd /usr/pkg/gcc-3.3/bin/rmic
/usr/pkg/gcc-3.3/bin/rmic:
-lgcj.4 => /usr/pkg/gcc-3.3/lib/libgcj.so.4
-lc.12 => /usr/lib/libc.so.12
-lgcc_s.1 => /usr/pkg/gcc-3.3/lib/libgcc_s.so.1
-lm.0 => /usr/lib/libm387.so.0
-lm.0 => /usr/lib/libm.so.0
$ ldd /usr/pkg/gcc-3.3/bin/rmiregistry
/usr/pkg/gcc-3.3/bin/rmiregistry:
-lgcj.4 => /usr/pkg/gcc-3.3/lib/libgcj.so.4
-lc.12 => /usr/lib/libc.so.12
-lgcc_s.1 => /usr/pkg/gcc-3.3/lib/libgcc_s.so.1
-lm.0 => /usr/lib/libm387.so.0
-lm.0 => /usr/lib/libm.so.0
So just adding a buildlink file would be wrong.
That's on -current/i386.
best regards
Matthias
From: Frederick Bruckman <fredb@netbsd.org>
To: gnats-bugs@gnats.netbsd.org
Cc:
Subject: pr/21848 CVS commit: pkgsrc/lang/gcc3
Date: Wed, 11 Jun 2003 18:20:25 +0000 (UTC)
Module Name: pkgsrc
Committed By: fredb
Date: Wed Jun 11 18:20:24 UTC 2003
Modified Files:
pkgsrc/lang/gcc3: Makefile
Log Message:
Don't gratuitiusly force use of binutil's "ld", as this one evidently
has "${PREFIX}/lib" in it's search path, causing configure to to pick
up libraries it shouldn't (such as "libiconv" -- PR pkg/21848).
To generate a diff of this commit:
cvs rdiff -r1.20 -r1.21 pkgsrc/lang/gcc3/Makefile
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Frederick Bruckman <fredb@immanent.net>
To: Matthias Drochner <M.Drochner@fz-juelich.de>
Cc: David Brownlee <abs@netbsd.org>, gnats-bugs@gnats.netbsd.org
Subject: Re: pkg/21848: gcc3-3.3 has a hidden dependency on libiconv
Date: Wed, 11 Jun 2003 13:41:06 -0500 (CDT)
On Wed, 11 Jun 2003, Matthias Drochner wrote:
> Incidentally, I had a pkgsrc gcc3-3.3 (before the nb1) build running last
> night.
> Although libiconv was installed, the binaries you mention don't depend on it:
Yes, it was my fault. The binutil's "ld" transparently adds
"${PREFIX}/lib to its search path. Since it's only the old "gas"
that has the known bug, I've backed out the part that forces the
new compiler to use binutil's "ld". It wouldn't have affected
current in any case, since that was all conditional on the "as"
in the path being out-of-date.
> So just adding a buildlink file would be wrong.
> That's on -current/i386.
Before we close this, abs mentioned to me that libjava seems to
provide a wrapper for libiconv, and item #20 in the gcc FAQ...
Why does libiconv get linked into jc1 on Solaris?
The Java front end requires iconv. If the compiler used to bootstrap
GCC finds libiconv (because the GNU version of libiconv has been
installed in the same prefix as the bootstrap compiler), but the newly
built GCC does not find the library (because it will be installed with
a different prefix), then a link-time error will occur when building
jc1. This problem does not show up so often on platforms that have
libiconv in a default location (like /usr/lib) because then both
compilers can find a library named libiconv, even though it is a
different library.
Using --disable-nls at configure-time does not prevent this problem
because jc1 uses iconv even in that case. Solutions include
temporarily removing the GNU libiconv, copying it to a default
location such as /usr/lib/, and using --enable-languages at
configure-time to disable Java.
...seems to suggest that disabling Java is an acceptable solution. So
now, I wonder, does anyone use actually use gcc3's Java stuff, and if
so, do they lament the lack of libiconv support?
Frederick
From: Matthias Drochner <M.Drochner@fz-juelich.de>
To: Frederick Bruckman <fredb@immanent.net>
Cc: David Brownlee <abs@netbsd.org>, gnats-bugs@gnats.netbsd.org
Subject: Re: pkg/21848: gcc3-3.3 has a hidden dependency on libiconv
Date: Thu, 12 Jun 2003 12:28:29 +0200
fredb@immanent.net said:
> Before we close this, abs mentioned to me that libjava seems to
> provide a wrapper for libiconv, and item #20 in the gcc FAQ...
Besides that -- when I build gcc3 for eg a "i386--netbsdelf2.0" host
on current, which enables thread support, libjava picks up a
GNU pth header from /usr/pkg if present, which makes the build
fail. There is also a bundled libtool involved; use of USE_LIBTOOL
might be appropriate.
To get a compiler pkg running for people not particulary interested
in Java, I'd suggest splitting out at least libjava if not all
of Java support.
best regards
Matthias
From: Frederick Bruckman <fredb@immanent.net>
To: Matthias Drochner <M.Drochner@fz-juelich.de>
Cc: David Brownlee <abs@netbsd.org>, gnats-bugs@gnats.netbsd.org
Subject: Re: pkg/21848: gcc3-3.3 has a hidden dependency on libiconv
Date: Thu, 12 Jun 2003 09:54:45 -0500 (CDT)
On Thu, 12 Jun 2003, Matthias Drochner wrote:
> fredb@immanent.net said:
> > Before we close this, abs mentioned to me that libjava seems to
> > provide a wrapper for libiconv, and item #20 in the gcc FAQ...
>
> Besides that -- when I build gcc3 for eg a "i386--netbsdelf2.0" host
> on current, which enables thread support, libjava picks up a
> GNU pth header from /usr/pkg if present, which makes the build
> fail.
I'm trying that now with "USE_BUILDLINK2=YES" commented out, as that
doesn't appear to serve any useful purpose here, anyhow. (It does add
CPPFLAGS=-I/usr/pkg/include to configure's environment, though.)
> There is also a bundled libtool involved; use of USE_LIBTOOL
> might be appropriate.
I doubt that. gcc-3.x builds and runs fine on NetBSD out-of-the-box.
The issue is to get it to build and run under the package system.
> To get a compiler pkg running for people not particulary interested
> in Java, I'd suggest splitting out at least libjava if not all
> of Java support.
The most straightforward way, would be to set --with-lang='c c++',
then make seperate packages for fortran, objective C and java, if
anyone even asks for them.
Frederick
From: Matthias Drochner <M.Drochner@fz-juelich.de>
To: Frederick Bruckman <fredb@immanent.net>
Cc: David Brownlee <abs@netbsd.org>, grant beattie <grant@netbsd.org>,
gnats-bugs@gnats.netbsd.org
Subject: Re: pkg/21848: gcc3-3.3 has a hidden dependency on libiconv
Date: Thu, 12 Jun 2003 17:12:46 +0200
This is a multipart MIME message.
--==_Exmh_22454574822680
Content-Type: text/plain; charset=us-ascii
USE_LIBTOOL does indeed not work - our libtool seems to
mess up "xgcc" calls in the build process.
I've got the build to pick up the right pthread header using
the appended patch.
(Translation of NetBSD-current to 2.0 is necessary to
activate thread support, and building of crt*.o stuff.)
> The most straightforward way, would be to set --with-lang='c c++',
> then make seperate packages for fortran, objective C and java, if
> anyone even asks for them.
I'd appreciate that - the libjava build takes a looong time,
and I don't need it at all.
best regards
Matthias
--==_Exmh_22454574822680
Content-Type: text/plain ; name="gcc3.txt"; charset=us-ascii
Content-Description: gcc3.txt
Content-Disposition: attachment; filename="gcc3.txt"
Index: lang/gcc3/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/lang/gcc3/Makefile,v
retrieving revision 1.21
diff -u -r1.21 Makefile
--- lang/gcc3/Makefile 2003/06/11 18:20:23 1.21
+++ lang/gcc3/Makefile 2003/06/12 15:01:03
@@ -21,7 +21,16 @@
USE_GMAKE= YES
HAS_CONFIGURE= YES
+.include "../../mk/bsd.prefs.mk"
+.if ${OPSYS} == "NetBSD" && !empty(OS_VERSION:M1.6[A-Z]*)
+CONFIGURE_ARGS= --host=i386--netbsdelf2.0
+PTHREAD_OPTS+= require native
+.include "../../mk/pthread.buildlink2.mk"
+CPPFLAGS+= -I${BUILDLINK_DIR}/include
+CFLAGS+= -I${BUILDLINK_DIR}/include
+.else
CONFIGURE_ARGS= --host=${MACHINE_GNU_PLATFORM}
+.endif
CONFIGURE_ARGS+= --infodir=${PREFIX}/info
CONFIGURE_ARGS+= --prefix=${GCC_PREFIX}
UNLIMIT_RESOURCES= datasize
--==_Exmh_22454574822680--
From: Frederick Bruckman <fredb@immanent.net>
To: Matthias Drochner <M.Drochner@fz-juelich.de>
Cc: David Brownlee <abs@netbsd.org>, grant beattie <grant@netbsd.org>,
gnats-bugs@gnats.netbsd.org
Subject: Re: pkg/21848: gcc3-3.3 has a hidden dependency on libiconv
Date: Thu, 12 Jun 2003 14:19:58 -0500 (CDT)
On Thu, 12 Jun 2003, Matthias Drochner wrote:
> I've got the build to pick up the right pthread header using
> the appended patch.
> (Translation of NetBSD-current to 2.0 is necessary to
> activate thread support, and building of crt*.o stuff.)
I think the buildlink thing is not appropriate for this package. As
you may already know, buildlink attempts to intercept all invocations
of any installed tools, by the means of putting it's own scripts of
the same name ahead in the path. It doesn't intercept "./xgcc" though,
so for this package at least, it's worse than useless.
Simply not using buildlink seems to do the right thing. This patch
also strips out the non-essential compilers, attempts to use the
installed libz on current, and permits the user to specify flags with
which to optimize the compiler itself. I'm also trying a novel thing,
which is to embed the name of the submodel options used to compile the
package in the filename of the tarball. [I would not be committing
that part; it's commented out in the patch.]
What d'ya'll think?
Frederick
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/lang/gcc3/Makefile,v
retrieving revision 1.21
diff -u -r1.21 Makefile
--- Makefile 2003/06/11 18:20:23 1.21
+++ Makefile 2003/06/12 18:58:04
@@ -2,7 +2,8 @@
#
DISTNAME= gcc-3.3
-PKGREVISION= 1
+PKGREVISION= 2
+#PKGFILE= ${PKGREPOSITORY}/${PKGNAME}${GCC3_CFLAGS:M-march=*:S/march=//}${PKG_SUFX}
PKGNAME= ${DISTNAME:C|gcc|gcc3|}
CATEGORIES= lang
MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-3.3/}
@@ -16,12 +17,11 @@
NOT_FOR_PLATFORM= Darwin-*-*
-USE_BUILDLINK2= YES
USE_PKGINSTALL= YES
USE_GMAKE= YES
HAS_CONFIGURE= YES
-CONFIGURE_ARGS= --host=${MACHINE_GNU_PLATFORM}
+CONFIGURE_ARGS= --enable-languages="c,c++"
CONFIGURE_ARGS+= --infodir=${PREFIX}/info
CONFIGURE_ARGS+= --prefix=${GCC_PREFIX}
UNLIMIT_RESOURCES= datasize
@@ -32,10 +32,18 @@
TEXINFO_REQD= 4.2
-INFO_FILES= cpp.info g77.info gcc.info gcj.info
+INFO_FILES= cpp.info cppinternals.info gcc.info gccint.info
.include "../../mk/bsd.prefs.mk"
+.if ${OPSYS} == "NetBSD" && (!empty(OS_VERSION:M1.6[T-Z]*) || !empty(OS_VERSION:M2.0*))
+USE_BINUTILS= NO
+CONFIGURE_ARGS+= --host=i386--netbsdelf2.0
+CONFIGURE_ARGS+= --with-system-zlib
+.else
+CONFIGURE_ARGS+= --host=${MACHINE_GNU_PLATFORM}
+.endif
+
.ifndef USE_BINUTILS
AS_VERSION!= ${AS} --version | ${AWK} '{ \
split($$3, v, /[.]/); \
@@ -48,7 +56,6 @@
.if ${USE_BINUTILS} == YES
DEPENDS= binutils>=2.13.2.1:../../devel/binutils
CONFIGURE_ARGS+= --with-as=${PREFIX}/${MACHINE_GNU_PLATFORM}/bin/as
-#. include "../../devel/binutils/buildlink2.mk"
.endif
.if ${OPSYS} == "NetBSD" || ${OPSYS} == "Linux"
@@ -64,6 +71,12 @@
. endif
.endif
+# Permit ${GCC3_CFLAGS} environment variable to affect build.
+.ifdef GCC3_CFLAGS
+BUILD_DEFS+= GCC3_CFLAGS
+ALL_TARGET= BOOT_CFLAGS="${GCC3_CFLAGS}" bootstrap
+.endif
+
# as this is named gcc3, use DISTNAME instead.
GCC_PREFIX= ${PREFIX}/${DISTNAME}
PLIST_SRC= ${WRKDIR}/PLIST_DYNAMIC
@@ -98,23 +111,3 @@
# Make bootstrap with compiler != gcc possible.
CONFIGURE_ENV+= LDFLAGS="${_STRIPFLAG_CC}"
MAKE_ENV+= GCC_PREFIX="${GCC_PREFIX}"
-
-# On NetBSD, the gcc-2.95.3 for:
-#
-# alpha
-#
-# have an optimization bug when compiling with -O2 that is tickled by:
-#
-# java/parse.o
-#
-# note that we don't override CFLAGS and CPPFLAGS because we want the
-# crosscompiled compiler to be build with optimization. This only
-# disables optimization for the stage 1 build.
-#
-.if ${OPSYS} == "NetBSD"
-. if ${MACHINE_ARCH} == "alpha"
-CONFIG_CFLAGS= ${CFLAGS:C/-O[0-9]*//g}
-CONFIG_CPPFLAGS= ${CPPFLAGS:C/-O[0-9]*//g}
-CONFIGURE_ENV+= CFLAGS="${CONFIG_CFLAGS}" CPPFLAGS="${CONFIG_CPPFLAGS}"
-. endif
-.endif
Index: PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/lang/gcc3/PLIST,v
retrieving revision 1.4
diff -u -r1.4 PLIST
--- PLIST 2003/06/05 00:26:02 1.4
+++ PLIST 2003/06/12 18:58:04
@@ -1,23 +1,15 @@
@comment $NetBSD: PLIST,v 1.4 2003/06/05 00:26:02 jschauma Exp $
@unexec ${INSTALL_INFO} --delete %D/info/cpp.info %D/info/dir
-info/cpp.info
-@unexec ${INSTALL_INFO} --delete %D/info/fastjar.info %D/info/dir
-info/fastjar.info
-@exec ${INSTALL_INFO} %D/info/cpp.info %D/info/dir
-@unexec ${INSTALL_INFO} --delete %D/info/g77.info %D/info/dir
-info/g77.info
-@exec ${INSTALL_INFO} %D/info/g77.info %D/info/dir
+@unexec ${INSTALL_INFO} --delete %D/info/cppinternals.info %D/info/dir
@unexec ${INSTALL_INFO} --delete %D/info/gcc.info %D/info/dir
-info/gcc.info
-@exec ${INSTALL_INFO} %D/info/gcc.info %D/info/dir
@unexec ${INSTALL_INFO} --delete %D/info/gccint.info %D/info/dir
-info/gccint.info
-@exec ${INSTALL_INFO} %D/info/gccint.info %D/info/dir
-@unexec ${INSTALL_INFO} --delete %D/info/cppinternals.info %D/info/dir
+info/cpp.info
info/cppinternals.info
+info/gcc.info
+info/gccint.info
+@exec ${INSTALL_INFO} %D/info/cpp.info %D/info/dir
@exec ${INSTALL_INFO} %D/info/cppinternals.info %D/info/dir
-@unexec ${INSTALL_INFO} --delete %D/info/gcj.info %D/info/dir
-info/gcj.info
-@exec ${INSTALL_INFO} %D/info/gcj.info %D/info/dir
+@exec ${INSTALL_INFO} %D/info/gcc.info %D/info/dir
+@exec ${INSTALL_INFO} %D/info/gccint.info %D/info/dir
share/examples/gcc/mk.conf
@dirrm share/examples/gcc
Index: buildlink2.mk
===================================================================
RCS file: /cvsroot/pkgsrc/lang/gcc3/buildlink2.mk,v
retrieving revision 1.4
diff -u -r1.4 buildlink2.mk
--- buildlink2.mk 2003/06/02 15:57:47 1.4
+++ buildlink2.mk 2003/06/12 18:58:05
@@ -75,15 +75,8 @@
BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}${_GCC_ARCHSUBDIR}/specs
BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}${MACHINE_GNU_PLATFORM}/include/*
BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}${MACHINE_GNU_PLATFORM}/include/*/*
-BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}lib/lib-org-w3c-dom.*
-BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}lib/lib-org-xml-sax.*
-BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}lib/libffi*
-BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}lib/libfrtbegin.*
-BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}lib/libg2c.*
BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}lib/libgcc_s.*
-BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}lib/libgcj.*
BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}lib/libiberty.*
-BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}lib/libobjc.*
BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}lib/libstdc++.*
BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}lib/libsupc++.*
State-Changed-From-To: open->closed
State-Changed-By: rillig@netbsd.org
State-Changed-When: Sat, 03 Nov 2007 10:53:07 +0000
State-Changed-Why:
In current pkgsrc, this doesn't seem to be a problem anymore. gcc3 builds
fine with the buildlink3 framework. If you still have problems with that,
please raise your voice.
>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.