From owner-freebsd-ports Tue May 30 10:56:08 1995 Return-Path: ports-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id KAA01949 for ports-outgoing; Tue, 30 May 1995 10:56:08 -0700 Received: from gloworm.Stanford.EDU (gloworm.Stanford.EDU [36.2.0.100]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id KAB01931 for ; Tue, 30 May 1995 10:56:05 -0700 Received: from localhost.Stanford.EDU (localhost.Stanford.EDU [127.0.0.1]) by gloworm.Stanford.EDU (8.6.10/8.6.10) with SMTP id KAA11918; Tue, 30 May 1995 10:56:02 -0700 Message-Id: <199505301756.KAA11918@gloworm.Stanford.EDU> X-Authentication-Warning: gloworm.Stanford.EDU: Host localhost.Stanford.EDU didn't use HELO protocol To: asami@CS.Berkeley.EDU cc: FreeBSD-Ports@FreeBSD.org Subject: c++filt In-reply-to: Your message of "Tue, 30 May 1995 03:48:06 PDT." <199505301048.DAA10608@silvia.HIP.Berkeley.EDU> Date: Tue, 30 May 1995 10:56:01 -0700 From: Dan Yergeau Sender: ports-owner@FreeBSD.org Precedence: bulk Hi Satoshi, >Sure, why not? We can make the port fetch binutils-*.tar.gz and >extract only c++filt, this kind of thing is easy now with the variable >EXTRACT_AFTER_ARGS. Most of guts for c++filt is in cplus-dem.c, which is included with GNU liberty. If you look at the Makefiles and the source... cplus-dem.o: $(BASEDIR)/libiberty/cplus-dem.c $(INCDIR)/getopt.h $(CC) -c -DMAIN $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CFLAGS) $(BASEDIR)/libiberty/cplus-dem.c $(DEMANGLER_PROG): cplus-dem.o $(LIBIBERTY) underscore.o version.o $(CC) $(CFLAGS) $(LDFLAGS) -o $(DEMANGLER_PROG) cplus-dem.o $(LIBIBERTY) $(EXTRALIBS) underscore.o version.o The "-DMAIN" turns on the compilation of main() in cplus-dem.c. underscore.o adds "int prepends_underscore = ", and version.o is self-explanatory. Instead of dragging in the large binutils package and throwing 99.9% away, it may be better to rewrite the liberty Makefile to generate c++filt, or write an equivalent main() driver and link with with -liberty. >"_RasterRect__9ivPainterP8ivCanvasiiP8ivRaster" >P.S. BTW, my guess for the one above is: "Painter::RasterRect(Canvas, > int, int, Raster)".... :) Actually, it is ivPainter::RasterRect(ivCanvas *, int, int, ivRaster *) And, yes, the "iv" prefixes are very important, at least for picky utilities like ld. :^) Dan