Message ID | 20211115082537.381066-1-ilya.lipnitskiy@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7215F3858428 for <patchwork@sourceware.org>; Mon, 15 Nov 2021 08:26:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7215F3858428 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1636964785; bh=NPHYJeZzJsiVLzkOSqq+BAt93wa7rpbkqB5PYPjb/Bk=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=GL0PUs4mSYMnzkqRKTRQ48aoDjgQoGnN/FpHotfA2o3uETF+gFBq9lhGUOJsRfPl0 /4qiAIHHhE2MyQteFRk/OpldwxZitwkzZrAr2uqBGPks5L3tqC73glXVPrVXHh2zqj D4TwBhzCHydrho32vkXPyD16w/jjTCM7Z5mT66Ts= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by sourceware.org (Postfix) with ESMTPS id B14A63857C6F for <gcc-patches@gcc.gnu.org>; Mon, 15 Nov 2021 08:25:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B14A63857C6F Received: by mail-pj1-x1033.google.com with SMTP id o6-20020a17090a0a0600b001a64b9a11aeso13386930pjo.3 for <gcc-patches@gcc.gnu.org>; Mon, 15 Nov 2021 00:25:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NPHYJeZzJsiVLzkOSqq+BAt93wa7rpbkqB5PYPjb/Bk=; b=25874zWM++WxM4gCVjQv9ohlSC3S+BuLYe0Q97a4RsuvqWZl/tbsQ8A66f+Yr8wKz1 HzLphP71wOEb3Ot9wH7x3gJg1uZLJEFAXI6hIHJWtiBxoaG5EqWgXL8iK7Mmk7wHux3D N11wHj995d+3ewVyI80whb0UVlpBXoIZmomkChOg2kvtIpVaF7Q8R1jYZK8NfEJKOgHs lkCJv1U3OpQsZhP4x5n351i1qQnBFQZI90Ayko7OwDVLyuNvgv3tfB0haOw3jlfeN2W4 nCah0Yn8OJoFc6plaOr7y4j3VPJbbZVYaLGsoU6pXaLjhj+MTzgvGgP+8Go9aZX/d1jZ wIkA== X-Gm-Message-State: AOAM531A1uJB69KzHNmr0aNj3fSyN4XrTm37ZfUwjBP+0jxL/RYp3/IR lbSVKPr9Brbyrkhk7SrY7ZGBQN7DSaA= X-Google-Smtp-Source: ABdhPJwXFHvRYKMJCtHzV70s0RvB1QPTEdf1cvuEK9YdziKHmNTUT1ubvLwmkNKER4YDF5RQmTGD6A== X-Received: by 2002:a17:90a:cb98:: with SMTP id a24mr44617120pju.153.1636964744561; Mon, 15 Nov 2021 00:25:44 -0800 (PST) Received: from z640-arch.lan ([2602:61:73aa:e00::9d4]) by smtp.gmail.com with ESMTPSA id q6sm11070821pgn.42.2021.11.15.00.25.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Nov 2021 00:25:44 -0800 (PST) To: gcc-patches@gcc.gnu.org, Dragan Mladjenovic <Dragan.Mladjenovic@syrmia.com> Subject: [PATCH] configure: define TARGET_LIBC_GNUSTACK on musl Date: Mon, 15 Nov 2021 00:25:37 -0800 Message-Id: <20211115082537.381066-1-ilya.lipnitskiy@gmail.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Ilya Lipnitskiy via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com> Cc: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
configure: define TARGET_LIBC_GNUSTACK on musl
|
|
Commit Message
Ilya Lipnitskiy
Nov. 15, 2021, 8:25 a.m. UTC
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 <ilya.lipnitskiy@gmail.com>
---
gcc/configure | 3 +++
gcc/configure.ac | 3 +++
2 files changed, 6 insertions(+)
Comments
On 11/15/2021 1:25 AM, Ilya Lipnitskiy via Gcc-patches 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 If musl has no executable stack support, then wouldn't we want this change to apply to all musl platforms, not just mips? jeff
On Mon, Nov 15, 2021 at 2:50 PM Jeff Law <jeffreyalaw@gmail.com> wrote: > > > > On 11/15/2021 1:25 AM, Ilya Lipnitskiy via Gcc-patches 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 > If musl has no executable stack support, then wouldn't we want this > change to apply to all musl platforms, not just mips? The original change was MIPS-specific[0] and TARGET_LIBC_GNUSTACK is only used by mips code today. We could change both cases to be more generic or keep it MIPS-specific. Dragan, what do you think? I also need to re-spin my change as my case is a more specific match than the first and never executes with my patch. [0]: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=54b3d52c3cca836c7c4c08cc9c02eda6c096372a > > jeff > Ilya
On 11/15/2021 10:10 PM, Ilya Lipnitskiy wrote: > On Mon, Nov 15, 2021 at 2:50 PM Jeff Law <jeffreyalaw@gmail.com> wrote: >> >> >> On 11/15/2021 1:25 AM, Ilya Lipnitskiy via Gcc-patches 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 >> If musl has no executable stack support, then wouldn't we want this >> change to apply to all musl platforms, not just mips? > The original change was MIPS-specific[0] and TARGET_LIBC_GNUSTACK is > only used by mips code today. We could change both cases to be more > generic or keep it MIPS-specific. Dragan, what do you think? Oh yea, I forgot about that older change. Let me take another looksie. jeff
diff --git a/gcc/configure b/gcc/configure index 920868bcd33d..366d6d969f45 100755 --- a/gcc/configure +++ b/gcc/configure @@ -31263,6 +31263,9 @@ if test $glibc_version_major -gt 2 \ gcc_cv_libc_gnustack=yes fi ;; + mips*-*-linux-musl*) + gcc_cv_libc_gnustack=yes + ;; esac if test x$gcc_cv_libc_gnustack = xyes; then diff --git a/gcc/configure.ac b/gcc/configure.ac index 065080a4b399..56d5bb7785a8 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -6950,6 +6950,9 @@ case "$target" in mips*-*-linux*) GCC_GLIBC_VERSION_GTE_IFELSE([2], [31], [gcc_cv_libc_gnustack=yes], ) ;; + mips*-*-linux-musl*) + gcc_cv_libc_gnustack=yes + ;; esac if test x$gcc_cv_libc_gnustack = xyes; then AC_DEFINE(TARGET_LIBC_GNUSTACK, 1,