From owner-freebsd-current Mon May 13 7:55:48 2002 Delivered-To: freebsd-current@freebsd.org Received: from corbulon.video-collage.com (corbulon.video-collage.com [64.35.99.179]) by hub.freebsd.org (Postfix) with ESMTP id A44B637B64A for ; Mon, 13 May 2002 07:53:56 -0700 (PDT) Received: from misha (250-217.customer.cloud9.net [168.100.250.217]) by corbulon.video-collage.com (8.12.2/8.12.2) with ESMTP id g4DErq5D054395 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=OK); Mon, 13 May 2002 10:53:54 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) X-Authentication-Warning: corbulon.video-collage.com: Host 250-217.customer.cloud9.net [168.100.250.217] claimed to be misha Content-Type: text/plain; charset="iso-8859-1" From: Mikhail Teterin Organization: Virtual Estates, Inc. To: Terry Lambert , Marcel Moolenaar Subject: Re: does the order of .a files matter? Date: Mon, 13 May 2002 10:52:36 -0400 X-Mailer: KMail [version 1.4] Cc: current@FreeBSD.ORG References: <200205101233.g4ACXctb041093@corbulon.video-collage.com> <20020512220007.GA21019@dhcp01.pn.xcllnt.net> <3CDF57EF.443F3BE7@mindspring.com> In-Reply-To: <3CDF57EF.443F3BE7@mindspring.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200205131052.36927.mi+mx@aldan.algebra.com> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Monday 13 May 2002 02:06 am, Terry Lambert wrote: = > If you think that providing bits on the link line in dependency = > order is a natural way of linking and the "proper" way of doing = > it, how do you explain our improper use of putting object files in = > lexical order in libraries and how do you resolve the contradiction = > that from a build point of view the lexical order is the proper = > way of building and we only get away with that because the = > linker doesn't require object files in archive libraries to be = > in dependency order (or we manually correct the situation by = > duplication)? = I explain the lexical ordering by way of the following commands when = exiting the Makefile in "vi" in command mode: = = !!ls *.c = JJJJJJJJJJJJJJJJJ[...] = ISRCS= = = 8-). This does not explain anything. Whatever the joke was, I did not get it. The question stands -- why can the object files be given to the linker in arbitrary order, but the the static libraries must be carefully ordered -- possibly even listed multiple times! There is nothing apparent in the .a format, that forces such behaviour. All of our Makefiles list objects in the alphabetical order -- why not sort them once with lorder/tsort and skip the lorder/tsort step from the library build (in bsd.lib.mk)? That would also speed up world-building... = Linking fewer object files into an executable makes the executable = smaller. Smaller executables are better than larger executables from a = putatively "smarter" linker (personally, I measure linker intelligence = as inversely proportional to the resulting executable size, relative = to the idealized executable size). Terry, NONE of this is relevant to the subject. Nobody is criticizing our linker for not putting UNNEEDED objects into the executables. The gaping hole in the linker, that is the subject of this thread, is the linker's inability to find NEEDED objects, which are right in front of its nose. = I had a big gripe, complete with examples involving famous names, = ready to go. But I will replace it with a much smaller response: = = "A craftsman must know his tools". And always seek to improve them. -mi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message