From patchwork Thu Jul 21 11:21:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Eggert X-Patchwork-Id: 13901 Received: (qmail 107425 invoked by alias); 21 Jul 2016 11:21:51 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 107404 invoked by uid 89); 21 Jul 2016 11:21:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=perror, inspired X-HELO: zimbra.cs.ucla.edu Subject: Re: glibc 2.24 -- Release blockers To: Sinny Kumari References: <577EB298.4050903@linaro.org> <95e9ed04-a103-649c-8434-ac589a85a2c2@redhat.com> <578770A9.9070703@cs.ucla.edu> <08ec1982-7bc7-4c38-cf38-9849054748a8@redhat.com> <57883236.3050801@cs.ucla.edu> <5788E12C.9010205@cs.ucla.edu> <57893FF7.30507@cs.ucla.edu> <1663a6c7-7c30-c42b-8f2a-aaa98d35388c@cs.ucla.edu> Cc: Florian Weimer , Andreas Schwab , Adhemerval Zanella , GNU C Library From: Paul Eggert Message-ID: <84081da0-796d-a2be-743e-4be9c1d8bc55@cs.ucla.edu> Date: Thu, 21 Jul 2016 13:21:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: On 07/20/2016 09:03 AM, Sinny Kumari wrote: > Applied this patch and emacs builds fine for Fedora rawhide [1] and > Fedora 24 [2] for > ppc64(le) arches. Thanks for checking. I have one more thing to ask. As can be seen in , an Emacs maintainer had some qualms about the size of the emacs-25 patch I sent you earlier, so I came up with the attached, more-conservative patch instead. Can you please try the revised patch on your ppc64 platform with draft glibc 2.24? If it works for you, I have the OK to install this patch into the emacs-25 branch, and I hope this resolves the pressing compatibility issues between draft glibc 2.24 and Emacs. 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