From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Daniel Colascione" Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master d826037 3/3: Remove the need for temacs.in Date: Wed, 10 Apr 2019 12:42:32 -0700 Message-ID: <7bd7a4577abcebd089c7aecc253718f2.squirrel@dancol.org> References: <20190409224339.20116.87667@vcs0.savannah.gnu.org> <20190409224342.0DA1F20E54@vcs0.savannah.gnu.org> <86697de6baf024290a9d0b10743ba2b7.squirrel@dancol.org> <9093e1cb-7cad-14df-9428-6229313e8f51@cs.ucla.edu> Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="113479"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: SquirrelMail/1.4.23 [SVN] Cc: Daniel Colascione , emacs-devel@gnu.org To: "Paul Eggert" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 10 21:43:13 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hEJ7n-000TOg-Mh for ged-emacs-devel@m.gmane.org; Wed, 10 Apr 2019 21:43:12 +0200 Original-Received: from localhost ([127.0.0.1]:36939 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hEJ7m-0003td-K0 for ged-emacs-devel@m.gmane.org; Wed, 10 Apr 2019 15:43:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56310) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hEJ7E-0003tN-F0 for emacs-devel@gnu.org; Wed, 10 Apr 2019 15:42:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hEJ7D-0004Eb-Cv for emacs-devel@gnu.org; Wed, 10 Apr 2019 15:42:36 -0400 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:38498) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hEJ7C-0004Dg-OK for emacs-devel@gnu.org; Wed, 10 Apr 2019 15:42:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:To:From:Subject:Date:References:In-Reply-To:Message-ID; bh=g3OzXa+U15xx7cLgbVsnOZJkksdJoNgdpefiEtgXH1g=; b=f7l8HqR2pgV7f1xVjUXRP/ziYbr/1jpjvO8ivF1gDblkH1cK+Ul9uR8E9txv9qN7iU4ErYoIIjkQZJPsqdYe5FqjjAGvB58ykBVAwgn1TgOLllrzQKthmBVFUzgRFrdAE/2oaQR92NebuP7b/GUthLkkdpQlnevWbSJaAFfAXKwBAo+QPH6WadrVpi6JQDuWwoANAWFc8H6zOwKhETeryMxEBc/HhYHSB9pCpNjCJGRNY3LZCAdnODgREa83VeQpjj7WHy5DpNKE3UywzSWucDkXipXF5SKXLMCvFxq+cFEbMsK90Rr5pfV2NzWfIJ8ZeGwfjoYJ5DP6cmHGUoavrw==; Original-Received: from localhost ([127.0.0.1] helo=dancol.org) by dancol.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hEJ7A-00068V-Ok; Wed, 10 Apr 2019 12:42:32 -0700 Original-Received: from 127.0.0.1 (SquirrelMail authenticated user dancol) by dancol.org with HTTP; Wed, 10 Apr 2019 12:42:32 -0700 In-Reply-To: <9093e1cb-7cad-14df-9428-6229313e8f51@cs.ucla.edu> X-Priority: 3 (Normal) Importance: Normal X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2600:3c01::f03c:91ff:fedf:adf3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:235249 Archived-At: > On 4/10/19 11:53 AM, Daniel Colascione wrote: >> Computing a fingerprint over temacs.in factors link >> layout information into the fingerprint hash. Your approach doesn't. >> It's >> possible to link Emacs in different ways from the same object files and >> produce different binaries. > > Computing a fingerprint over temacs.in also omitted layout information. temacs.in's layout is identical to temacs because temacs.in and temacs differ only in the contents of the fingerprint array. They have the same symbols in the same order in the same section. The temacs.in mechanism covers all current and *and unknown future* binary layout modifications. It breaks only if linker symbol arrangement depends on randomness or on the precise content of the fingerprint array, and both of these possibilities are unlikely. The right way to avoid the need for temacs.in is to teach the build system how to find the fingerprint array in the temacs binary and overwrite it *in place* with the hash of temacs. If you want to do that, great --- I suspect some invocation of nm(1) could tell you the file offset of the symbol. This approach would even work in the case of a linker that did randomize symbol locations. Your approach isn't the right one though. Please stop making unsafe changes for the sake of insignificant speedups to local development. > This was particularly true when building position-independent > executables. But even for the non-PIE case the fingerprint did not cover > dynamically-linked libraries. PIE and shared libraries are irrelevant. The whole point of pdumper is to be invariant across different PIE and DSO configurations. Neither PIE relocation nor DSO load addresses affect the *internal* layout of the Emacs binary image *at runtime*, which is what we really care about. With your change, the fingerprint calculation misses important and relevant information. It's unsafe. There's a better way to speed up the build.