From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11311 invoked by uid 1002); 17 Nov 2002 13:51:35 -0000 Mailing-List: contact gentoo-dev-help@gentoo.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Received: (qmail 11295 invoked from network); 17 Nov 2002 13:51:35 -0000 From: Stefan Jones To: gentoo-core , gentoo-dev Content-Type: text/plain Organization: Gentoo Linux Message-Id: <1037541053.25487.58.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.0 Date: 17 Nov 2002 13:50:53 +0000 Content-Transfer-Encoding: 7bit Subject: [gentoo-dev] Prelinking in Gentoo and interactions with portage X-Archives-Salt: d3cc1ff4-bb38-4a2f-b59c-8047a58bcd81 X-Archives-Hash: f8fc8dad0799ff94dd09671e34baa661 DISCLAIMER: Prelink is experimental and ^may^ break EVERYTHING ( having said this I have suffered no serious breakages, but others have) Recently I have started working on prelinking in gentoo. When a shared executable is run all the references to functions in shared libraries have to be cross referenced and offsets applied to the function pointers. Prelink modifies the executables so that this work is done before the binary is run. This speeds start up times by a large factor (up to 50% for some applications like mozilla and KDE). To use prelink you need a prelink enabled glibc (2.3.1 satisfies this), and a new version of binutils (2.13.90.0.10 will do). I have put a masked prelink ebuild into portage, this provides the tool that modifies the binaries. Emerge it and read "man prelink" for more details. Now the portage details: Prelink needs to be rerun on shared librarys and executables every time their dependant librarys get modified. So when you upgrade a library prelink needs to be rerun on the executables. This means the md5sum of a binary will change from the portage digest. There is a work around for that, prelink has the ability to spool out the original binary's contents to stdout. This can be harnessed by portage. The details how to do so follow: On Install: 1) The MD5sun is first calculated for the CONTENTS file 2) The files are merged (installed) into the filesystem 3) prelink is run on all the installed binaries and libraries On Uninstall: * If the file is an executable / library pipe it though prelink when calculating the MD5sum. All the above would be ifdefed out if some PRELINK_ENABLE variable was not set somewhere (eg. make.global), so there will be no slowdown for ppl not using prelink. Note: the prelink command cannot be put in /usr/lib/portage/bin/prepallstrip as prelink may have to be rerun on the file causing the MD5sum to change again. Also some small bash script needs to be made to allow the user to re-prelink files after a library upgrade. Prelinking doesn't take long, prelinking from scratch /usr/bin only takes a few minutes. This could be in a cron-job or manually run by the user though a new portage command. Note: re-prelinking a file is very quick, so it may be feasible to prelink all dependants in emerge after the library install. But this would require reverse dependency checking. Once the details are fixed, I will happing code this up and submit the patches. Food for thought, Stefan -- Stefan Jones Gentoo Linux -- gentoo-dev@gentoo.org mailing list