From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#24033: Porting emacs-25 to GNU/Linux ppc64 with draft glibc 2.24 Date: Wed, 20 Jul 2016 19:09:40 +0200 Message-ID: <1424f04d-88b6-b760-8da0-afa30c082eb2@cs.ucla.edu> References: <83poq8z774.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------C37D21A683199D290D3CB726" X-Trace: ger.gmane.org 1469034629 15004 80.91.229.3 (20 Jul 2016 17:10:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Jul 2016 17:10:29 +0000 (UTC) Cc: 24033@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 20 19:10:17 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bPv0g-00051g-RZ for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Jul 2016 19:10:15 +0200 Original-Received: from localhost ([::1]:35930 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPv0g-0004D2-27 for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Jul 2016 13:10:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPv0X-00048E-RL for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2016 13:10:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPv0U-00086I-6n for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2016 13:10:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46532) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPv0U-00086E-3p for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2016 13:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bPv0T-0005FU-SM for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2016 13:10:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Jul 2016 17:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24033 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 24033-submit@debbugs.gnu.org id=B24033.146903459820159 (code B ref 24033); Wed, 20 Jul 2016 17:10:01 +0000 Original-Received: (at 24033) by debbugs.gnu.org; 20 Jul 2016 17:09:58 +0000 Original-Received: from localhost ([127.0.0.1]:58869 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPv0P-0005F3-VF for submit@debbugs.gnu.org; Wed, 20 Jul 2016 13:09:58 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:40157) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPv0O-0005El-Rt for 24033@debbugs.gnu.org; Wed, 20 Jul 2016 13:09:57 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 00D1416117E; Wed, 20 Jul 2016 10:09:50 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id EfhfGYejqRfp; Wed, 20 Jul 2016 10:09:50 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id F3337161177; Wed, 20 Jul 2016 10:09:49 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id hiccnxsx9VDr; Wed, 20 Jul 2016 10:09:49 -0700 (PDT) Original-Received: from [192.168.1.52] (AMontpellier-656-1-291-239.w90-0.abo.wanadoo.fr [90.0.119.239]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 9971F161127; Wed, 20 Jul 2016 10:09:48 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 In-Reply-To: <83poq8z774.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:121323 Archived-At: This is a multi-part message in MIME format. --------------C37D21A683199D290D3CB726 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 07/20/2016 04:59 PM, Eli Zaretskii wrote: > > Would it be possible to tweak the patch so that it doesn't change the > code on platforms other than PPC64? Sure, something like the attached patch perhaps? If so, I can ask my PPC64 correspondent to try it. --------------C37D21A683199D290D3CB726 Content-Type: text/x-patch; name="0001-Port-to-glibc-2.24-pre-release-ppc64.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Port-to-glibc-2.24-pre-release-ppc64.patch" >From 37bc57cf803f2ab0b7a7844730ebc17eb43e942d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 19 Jul 2016 15:23:14 +0200 Subject: [PATCH] Port to glibc 2.24 (pre-release) + ppc64 Backport from master (Bug#24033). Inspired by a suggestion by Florian Weimer in: https://sourceware.org/ml/libc-alpha/2016-07/msg00425.html * src/emacs.c (main) [__PPC64__]: Special case for __PPC64__, which needs ASLR disabled in dumped Emacs too. --- src/emacs.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/emacs.c b/src/emacs.c index 5c187e7..2480dfc 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -674,6 +674,26 @@ main (int argc, char **argv) stack_base = &dummy; +#if defined HAVE_PERSONALITY_LINUX32 && defined __PPC64__ + /* This code partly duplicates the HAVE_PERSONALITY_LINUX32 code + below. This duplication is planned to be fixed in a later + Emacs release. */ +# define ADD_NO_RANDOMIZE 0x0040000 + int pers = personality (0xffffffff); + if (! (pers & ADD_NO_RANDOMIZE) + && 0 <= personality (pers | ADD_NO_RANDOMIZE)) + { + /* Address randomization was enabled, but is now disabled. + Re-execute Emacs to get a clean slate. */ + execvp (argv[0], argv); + + /* If the exec fails, warn the user and then try without a + clean slate. */ + perror (argv[0]); + } +# undef ADD_NO_RANDOMIZE +#endif + #ifndef CANNOT_DUMP might_dump = !initialized; #endif @@ -784,7 +804,7 @@ main (int argc, char **argv) dumping = !initialized && (strcmp (argv[argc - 1], "dump") == 0 || strcmp (argv[argc - 1], "bootstrap") == 0); -#ifdef HAVE_PERSONALITY_LINUX32 +#if defined HAVE_PERSONALITY_LINUX32 && !defined __PPC64__ if (dumping && ! getenv ("EMACS_HEAP_EXEC")) { /* Set this so we only do this once. */ @@ -801,7 +821,7 @@ main (int argc, char **argv) /* If the exec fails, try to dump anyway. */ emacs_perror (argv[0]); } -#endif /* HAVE_PERSONALITY_LINUX32 */ +#endif #if defined (HAVE_SETRLIMIT) && defined (RLIMIT_STACK) && !defined (CYGWIN) /* Extend the stack space available. Don't do that if dumping, -- 2.5.5 --------------C37D21A683199D290D3CB726--