Date: Mon, 8 Apr 2002 11:36:37 +0300 From: Ruslan Ermilov <ru@FreeBSD.org> To: Peter Wemm <peter@wemm.org> Cc: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>, "M. Warner Losh" <imp@village.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/gnu/usr.bin/gperf Makefile src/gnu/usr.bin/groff/src/devices/grodvi Makefile src/gnu/usr.bin/groff/src/devices/grohtml Makefile src/gnu/usr.bin/groff/src/devices/grolbp Makefile sr Message-ID: <20020408083637.GB53790@sunbay.com> In-Reply-To: <20020408063937.EAE793810@overcee.wemm.org> References: <Pine.BSF.4.44.0204080648390.76282-100000@naos.dbai.tuwien.ac.at> <20020408063937.EAE793810@overcee.wemm.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Sun, Apr 07, 2002 at 11:39:37PM -0700, Peter Wemm wrote:
> Gerald Pfeifer wrote:
> > On Sun, 7 Apr 2002, M. Warner Losh wrote:
> > > Peter Wemm <peter@FreeBSD.org> writes:
> > >: Add -lstdc++ to the link args for these C++ tools so that they can be
> > >: compiled with gcc-3.1. Somebody thought it was a good idea to move
> > >: the implementation of new and delete from libgcc to libstdc++. This
> > >: change doesn't harm the current compiler in the tree.
> > > Is this a band-aid until the compiler can be fixed, or a real solution
> > > long term?
> >
> > If I'm right, the problem is that the gcc driver is used to compile these
> > C++ sources.
> >
> > One of the differences between gcc and g++ is that the latter automagically
> > links in libstdc++ while the former does not. This has been the case since
> > (at least GCC 2.95), but we did get away with it because, as Peter observed,
> > new/delete have been in libgcc which got linked in anyway.
> >
> > GCC 3.0 and 3.1, however, have new/delete in libstdc++; the proper fix
> > long-term would be using the g++ driver instead of the gcc driver for
> > these C++ sources.
>
> The .cc files are compiled with 'c++' as expected. The problem is that
> the final link phase uses 'cc'. Our makefiles have no way to signal that
> the final link should be done with c++ instead since it just sees a bunch
> of .o files that need to be linked into an executable.
>
OK, how about backing these out and committing this instead?
%%%
Index: bsd.prog.mk
===================================================================
RCS file: /home/ncvs/src/share/mk/bsd.prog.mk,v
retrieving revision 1.105
diff -u -r1.105 bsd.prog.mk
--- bsd.prog.mk 7 Apr 2002 14:58:12 -0000 1.105
+++ bsd.prog.mk 8 Apr 2002 08:34:58 -0000
@@ -32,7 +32,12 @@
OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
${PROG}: ${OBJS}
+.if ${SRCS:M*.cc} != "" || ${SRCS:M*.C} != "" || ${SRCS:M*.cpp} != "" || \
+ ${SRCS:M*.cxx} != ""
+ ${CXX} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDDESTDIR} ${LDADD}
+.else
${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDDESTDIR} ${LDADD}
+.endif
.else !defined(SRCS)
%%%
Cheers,
--
Ruslan Ermilov Sysadmin and DBA,
ru@sunbay.com Sunbay Software AG,
ru@FreeBSD.org FreeBSD committer,
+380.652.512.251 Simferopol, Ukraine
http://www.FreeBSD.org The Power To Serve
http://www.oracle.com Enabling The Information Age
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org
iD8DBQE8sVaVUkv4P6juNwoRAk5mAJ9mQkBqAT3bqaeLJPgk4tZDAAFzCgCfYn2k
T8DfXGZlAesVAI4XqngD5zM=
=7tSD
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020408083637.GB53790>
