From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27088 invoked from network); 16 Nov 2021 21:19:22 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 16 Nov 2021 21:19:22 -0000 Received: (qmail 24573 invoked by uid 550); 16 Nov 2021 21:19:19 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 26253 invoked from network); 16 Nov 2021 17:50:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JnadSoQNN0sHuHP9c7UB87av2cLIxt9FoeuYLUiPB2s=; b=BAwjdFA0PpuF0IlDxgtSlM6KUQKrT0Os1k8IxltBTTUppr5+aAjgYcs5FQoLtHqxd/ 3y4lIImF/OWbHUgcVZGNV2j7YwiZjqoF6p03549fPrWSShZ8kXQN8aMokbf1n/4okpMd L25os5TCUqlI5aS7S3XcwhB2nlkirfHh3U3/zWbUfCDo8iPec9j/dwjmbh8EvAHT5ljb 5Sp+UgPi+y5aBH0kE6FCdKFC9cKR/cWuQp29sQMmRzMWDuHPQFGs2yALmrepxms6KYiJ wBmMo3h3BDVQEpinkxdY2Qe4aUBo7ACQKIAX5m8JRwtP6vHM2RoksY2aBF/ccmSTLn6a AiCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JnadSoQNN0sHuHP9c7UB87av2cLIxt9FoeuYLUiPB2s=; b=NqR134dJRO66d0mTdiEHRe32UO95IPFlJlgHreHpiQBd7TunkmYx304X7F52SuHilV zmKJIY9ct4WPz5P4W20tAdUUo3SXeLNU2ElksWBCmljcm8rgAHijp4Kp9Wp8pkGqwSDq QyKD+PXXE0ZvuT//v2xsGeoR0A30M2/kYIg4uTOmUNz7Dzxbm/UjroUVkQV0d19krYl/ UPJmNyBpv2Ljm5Ov+yzn5jNd49oYX9RtcEI+bl6fPBT9ZaFBQuGYhQi45n5efVrsSn8G ySeYVohlS0Kn2RVMyWWtnrSMiS1RpU4hXFEZx/rfNpwv3QT1KgA3cNEtbg+AQl1TTG9/ yFOw== X-Gm-Message-State: AOAM533lB3DFVTP1Pvjt8dLYKlaG42b9Uvpu/zoQYzFngPGUoYcTEr7L GBEVnu/zhFcaEPmusbtbwDyASnGV1jT2Wi+oyxs= X-Google-Smtp-Source: ABdhPJyH5D1SonQl4GC/pxahj4DNYXG1HsiTkd7O8YqEdldz3AntsJgyZamGswiWXit5C6mxejTwCTiWWcolRRelQT8= X-Received: by 2002:a05:6e02:19c8:: with SMTP id r8mr5942887ill.47.1637085002972; Tue, 16 Nov 2021 09:50:02 -0800 (PST) MIME-Version: 1.0 References: <20211116051323.4900-1-ilya.lipnitskiy@gmail.com> <7cfc5adb-64e8-7259-4c7e-26bb832cd00a@syrmia.com> <20211116162549.GQ7074@brightrain.aerifal.cx> In-Reply-To: <20211116162549.GQ7074@brightrain.aerifal.cx> From: Ilya Lipnitskiy Date: Tue, 16 Nov 2021 09:49:52 -0800 Message-ID: To: Rich Felker Cc: Dragan Mladjenovic , gcc-patches@gcc.gnu.org, Jeff Law , musl@lists.openwall.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [musl] Re: [PATCH v2] configure: define TARGET_LIBC_GNUSTACK on musl On Tue, Nov 16, 2021 at 8:41 AM Rich Felker wrote: > > On Tue, Nov 16, 2021 at 03:40:00PM +0100, Dragan Mladjenovic wrote: > > Hi, > > > > Looks fine to me. If possible, maybe it should even be back-ported > > to stable branches. The change cherry-picks fine onto 10.x and 11.x branches. Should I send out separate patches or can the committer of this patch apply it to 10.x and 11.x? > > > > Not sure if MIPS assembly sources (if any) in musl would need > > explicit ..note.GNU-stack > > > > to complement this? > > What are the actual consequences of making this change, and what is > the goal? I'm concerned that it might produce object files which don't > include annotation that they don't need executable stack, in which > case the final executable file will be marked as executable-stack and > the kernel will load it as such. That would be very bad. It is actually the other way around - for MIPS hard-float targets on non-glibc (or glibc < 2.31) without this change the .note.GNU-stack annotation is not emitted by GCC. Ilya > > Rich > > > > On 16-Nov-21 06:13, Ilya Lipnitskiy wrote: > > >musl only uses PT_GNU_STACK to set default thread stack size and has no > > >executable stack support[0], so there is no reason not to emit the > > >.note.GNU-stack section on musl builds. > > > > > >[0]: https://lore.kernel.org/all/20190423192534.GN23599@brightrain.aerifal.cx/T/#u > > > > > >gcc/ChangeLog: > > > > > > * configure: Regenerate. > > > * configure.ac: define TARGET_LIBC_GNUSTACK on musl > > > > > >Signed-off-by: Ilya Lipnitskiy > > >--- > > > gcc/configure | 3 +++ > > > gcc/configure.ac | 3 +++ > > > 2 files changed, 6 insertions(+) > > > > > >diff --git a/gcc/configure b/gcc/configure > > >index 74b9d9be4c85..7091a838aefa 100755 > > >--- a/gcc/configure > > >+++ b/gcc/configure > > >@@ -31275,6 +31275,9 @@ fi > > > # Check if the target LIBC handles PT_GNU_STACK. > > > gcc_cv_libc_gnustack=unknown > > > case "$target" in > > >+ mips*-*-linux-musl*) > > >+ gcc_cv_libc_gnustack=yes > > >+ ;; > > > mips*-*-linux*) > > > if test $glibc_version_major -gt 2 \ > > >diff --git a/gcc/configure.ac b/gcc/configure.ac > > >index c9ee1fb8919e..8a2d34179a75 100644 > > >--- a/gcc/configure.ac > > >+++ b/gcc/configure.ac > > >@@ -6961,6 +6961,9 @@ fi > > > # Check if the target LIBC handles PT_GNU_STACK. > > > gcc_cv_libc_gnustack=unknown > > > case "$target" in > > >+ mips*-*-linux-musl*) > > >+ gcc_cv_libc_gnustack=yes > > >+ ;; > > > mips*-*-linux*) > > > GCC_GLIBC_VERSION_GTE_IFELSE([2], [31], [gcc_cv_libc_gnustack=yes], ) > > > ;;