From owner-freebsd-questions@FreeBSD.ORG Fri Jul 13 11:08:35 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BEF591065673 for ; Fri, 13 Jul 2012 11:08:35 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirj.bris.ac.uk (dirj.bris.ac.uk [137.222.10.78]) by mx1.freebsd.org (Postfix) with ESMTP id 7509F8FC16 for ; Fri, 13 Jul 2012 11:08:35 +0000 (UTC) Received: from ncsc.bris.ac.uk ([137.222.10.41]) by dirj.bris.ac.uk with esmtp (Exim 4.72) (envelope-from ) id 1Spdje-00052w-Oz; Fri, 13 Jul 2012 12:08:34 +0100 Received: from mech-cluster241.men.bris.ac.uk ([137.222.187.241]) by ncsc.bris.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Spdjd-00071a-Rx; Fri, 13 Jul 2012 12:08:34 +0100 Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.5/8.14.5) with ESMTP id q6DB8XlW084649; Fri, 13 Jul 2012 12:08:33 +0100 (BST) (envelope-from mexas@bris.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.5/8.14.5/Submit) id q6DB8WFD084648; Fri, 13 Jul 2012 12:08:32 +0100 (BST) (envelope-from mexas@bris.ac.uk) X-Authentication-Warning: mech-cluster241.men.bris.ac.uk: mexas set sender to mexas@bris.ac.uk using -f Date: Fri, 13 Jul 2012 12:08:32 +0100 From: Anton Shterenlikht To: Robert Bonomi Message-ID: <20120713110832.GA84618@mech-cluster241.men.bris.ac.uk> Mail-Followup-To: Robert Bonomi , freebsd-questions@freebsd.org References: <20120712223130.GA58047@mech-cluster241.men.bris.ac.uk> <201207130212.q6D2CWAU046010@mail.r-bonomi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201207130212.q6D2CWAU046010@mail.r-bonomi.com> User-Agent: Mutt/1.4.2.3i Cc: freebsd-questions@freebsd.org Subject: Re: profiling library smaller than non-profiling, while it contains more symbols. Why? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2012 11:08:35 -0000 On Thu, Jul 12, 2012 at 09:12:32PM -0500, Robert Bonomi wrote: > > From owner-freebsd-questions@freebsd.org Thu Jul 12 17:34:12 2012 > > Date: Thu, 12 Jul 2012 23:31:31 +0100 > > From: Anton Shterenlikht > > To: freebsd-questions@freebsd.org > > Subject: profiling library smaller than non-profiling, > > while it contains more symbols. Why? > > > > While updating my port (math/slatec) to use > > the new OPTIONS framework, I did some > > experiments with the profiling library. > > > > I don't know much about this, so what surprised me > > is that the profiling library is smaller: > > > > # ls -al lib*a > > -rw-r--r-- 1 root wheel 6582354 Jul 12 22:56 libslatec.a > > -rw-r--r-- 1 root wheel 6555122 Jul 12 23:02 libslatec_p.a > > # > > It it possible that libslatac.a has debggingn symbols, and the profiling > library does not? > > Or that the profiling library was compiled with a lower degree of > optimization ? (many of the 'higher'-level optimizations cause > _larger_, albeit faster, code to be generated) > > Any other differences in compilation flags? No, the compilation is very straightforward for this library: ===> Building for slatec-4.1 Warning: Object directory not changed from original /usr/ports/math/slatec/work/src gfortran46 -O -Wl,-rpath=/usr/local/lib/gcc46 -c aaaaaa.f *skip ~1400 other files* gfortran46 -O -Wl,-rpath=/usr/local/lib/gcc46 -c zwrsk.f building static slatec library /usr/local/bin/ranlib libslatec.a gfortran46 -pg -O -Wl,-rpath=/usr/local/lib/gcc46 -o aaaaaa.po -c aaaaaa.f *skip ~1400 other files* gfortran46 -pg -O -Wl,-rpath=/usr/local/lib/gcc46 -o zwrsk.po -c zwrsk.f building profiled slatec library /usr/local/bin/ranlib libslatec_p.a gfortran46 -fpic -DPIC -O -Wl,-rpath=/usr/local/lib/gcc46 -o aaaaaa.So -c aaaaaa.f *skip ~1400 other files* gfortran46 -fpic -DPIC -O -Wl,-rpath=/usr/local/lib/gcc46 -o zwrsk.So -c zwrsk.f building shared library libslatec.so.1 # That's all there is. As I mentioned in the original email, the only difference, according to nm(1), between the non-profiling and the profiling library, is that the profiling library contains symbol .mcount (or _mcount, depending on the arch) for each object file. All other symbols are identical. -- Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 331 5944 Fax: +44 (0)117 929 4423