From patchwork Mon Jan 1 11:53:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Bugaev X-Patchwork-Id: 184161 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp3949482dyb; Mon, 1 Jan 2024 04:58:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IGxdaGz+JKWwXgI8Vn9CenGe8uqP401HXju4nDuoP3K7ZHlSjlTKf2XKYN5byuWCq0NywbF X-Received: by 2002:a0c:f705:0:b0:67f:9d8c:7cf7 with SMTP id w5-20020a0cf705000000b0067f9d8c7cf7mr16867538qvn.7.1704113929688; Mon, 01 Jan 2024 04:58:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704113929; cv=pass; d=google.com; s=arc-20160816; b=RjGDHg30vFp4InJEuodJoFjoui7v4gQca6QbKEnQRI/TvCIbbucBNJgcj4UMUnzNQy E6oegkYZrj4MX0aSn5ELqGY19FVfJKr5TvZoBfvOE15eOPFqAcdf3EGGtcJr+X/O4Q7Y ZDuh8k0ds7yw0Cgwg9JTp1BNJKE0TnSwwfgIn0Rc+BD3aA0ABXB/mCMH0I1JVgCw4wr6 FRBoO4d7etsCV+GRrsN/TIwzyfoHPZU3YnAWcXDk5vpp/+sl7I6ztWNxW3GP2fXx3v/u JE8/cNYxlfz7lRfP1R1hDG+Z6zHt34O0025HbaRKAyp6eH2eQeVy0zh6Kax+Nh3f9v5d w+Cw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=Lw0dws/OSqG5c2B3SapQE5v0vPFEokDpxmKvNZNi7Ws=; fh=9bJenRX/cD8CU3PEmvrB+wrE7mB8Fw2pK3nnUaGV76o=; b=Aecloo1bKlhnUWzx2iQetJdqD57ni14OA28huWmRmGeHaglDyhKeDfUVMSrYie/BdN PDvYpX+nbOmD7zBY6Cy2So1NTNf3VuacOqGouZ+J6uWfSHY+xRFvYf+m9Wen1ks0XEMY 5eHmJK8M3CWMMlaFUSd1eFALCyu58jf+ytT68GcWnZIAQLZ/479vE+9gTn1Wx4G/tgNY UGkntzk/aQHqiKF01q6+EFZaQWCk4EX0c+h7vrzN668aw4Ggkml75c9xldZNYz0j+pJ9 nuUmuzLfDBeGyxAZRMHdljjXaU8qujuGQ50N18tdP27vXfg1RSOiJhVhaccpjQsf8kxU qtAA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YB8toBPC; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id y18-20020a0cd992000000b0067f9161d2e0si22382499qvj.423.2024.01.01.04.58.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jan 2024 04:58:49 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YB8toBPC; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 871D83857C76 for ; Mon, 1 Jan 2024 11:55:40 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by sourceware.org (Postfix) with ESMTPS id DEB833858413 for ; Mon, 1 Jan 2024 11:54:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DEB833858413 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DEB833858413 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::233 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704110046; cv=none; b=fIllYFHUCS8qL2hTNkz3p/nk7jHfXpx6vuj9msERad0SYGkKPTkpX8t5Nys83NJymvg3sREk0oN9h1QWaHnM9ghBbC7lix2jfP0BQyMdF3k1RI2o2v/Qp/IaKzdICXQfHaK/Dom/aKO/HIVIZf81+T8GavrmNgDBujehJ5CD+M0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704110046; c=relaxed/simple; bh=AlInNtLePTK1UG4BEyQI6ElUdooy7h+EvxnKTQI8bds=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=gMafTgd1oOwSpUktc4zxYnnpb4eCeQdRToOekDAG1rkAmmGBtGvsJCg9aayCf2loz+NadJqZYCcRa/RuzNcj6c8GuhcAx8kra4zUrsWLAoi0ttBivn2dTPCafZEirnYMYqe+wEZ70KSmQ8gITaYzhuwBCSWNpqe/ScW18ypPwxQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2cc7b9281d1so108657111fa.1 for ; Mon, 01 Jan 2024 03:54:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704110039; x=1704714839; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=Lw0dws/OSqG5c2B3SapQE5v0vPFEokDpxmKvNZNi7Ws=; b=YB8toBPCvv6utHGAdrMtIWe/xpJOwX5Avtad9Im0nroqaOhz8l8nAk1Z3z3f+g9Jp/ QK5gMYE5hUH8RR3uY7aigqPFUtVHcwfD+8wRQrGlIXyCtzpMYbe5VkxyOqZdS7+gwnSf zBcrZyoImvNeClckEBE1e+dewzmVzyqn1ZmM+Rvm+BSd+8RxsGFc/m8QAlBx7vMmXbEa iWq7qWX2rD+YoKBH08UFtGHIa7LlaC3VlLeSklKlBICxrgPc2BWSyFwkpp/rZN8OkGiI Vi2tEwyuMrRR0HYKbprRhcOz5RSsrHZfzZJQJxWpcURowsV7Uprr17PZ2Ykc4p09x4hK 3bQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704110039; x=1704714839; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Lw0dws/OSqG5c2B3SapQE5v0vPFEokDpxmKvNZNi7Ws=; b=vXdWlu3WLVYdf4I7FgavNP6DjS56I8/IlY5zJ556U/G+YwMWjb3eM+v/9xvoF9npXM N4yPowOzjq+iFlMuB+ODI6h+RTOGF2GJc8etTc/8GoER/99vLBxH3RrJfSfXJ8BVmA9b 1h6JImhCPCXnaTAOb9YrpAvWCK7LEeH+DFEIpjWzy9uOb7iEMiez2E6tL+xBB1uUEQa4 I629SHiCrlKNI6zzIQNwEi3nyCDaLH5byA6fGdBGVGrgTDXjNcJSm3tskMw086p4c/WU 1Y+d0vs3q6gRV+AMp/F3LtMv0J4k6v0yCiVNO8vB+uZEe4HPfEHWeLsBURIVbJyBe+/J RS7g== X-Gm-Message-State: AOJu0YyznqrhKd7RWjG/0PHWeOH36WSYPzWH7cJZNZpvMg2RY9qu3P/G V2C3huX25PjZskcqr24OvGjaR/13DzQ= X-Received: by 2002:a05:651c:4cf:b0:2cc:f5fa:28ac with SMTP id e15-20020a05651c04cf00b002ccf5fa28acmr2114854lji.102.1704110038797; Mon, 01 Jan 2024 03:53:58 -0800 (PST) Received: from surface-pro-6.. ([2a00:1370:818c:b32f:8da1:ad5a:e55a:5cb0]) by smtp.gmail.com with ESMTPSA id ce26-20020a2eab1a000000b002ccbc09230csm3682109ljb.97.2024.01.01.03.53.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jan 2024 03:53:58 -0800 (PST) From: Sergey Bugaev To: gcc-patches@gcc.gnu.org, bug-hurd@gnu.org Subject: [PATCH gcc 1/3] Move GNU/Hurd startfile spec from config/i386/gnu.h to config/gnu.h Date: Mon, 1 Jan 2024 14:53:54 +0300 Message-ID: <20240101115356.614446-1-bugaevc@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786892967476648000 X-GMAIL-MSGID: 1786892967476648000 Since it's not i386-specific; this makes it possible to reuse it for other architectures. Also, add a warning for the case gnu.h is specified before gnu-user.h, which would cause gnu-user's version of the spec to override gnu's, and not the other way around as it's intended. The i?86-gnu target currently specifies them in the right order, but it's easy to accidentally put them in a wrong order. Signed-off-by: Sergey Bugaev --- gcc/config/gnu.h | 16 ++++++++++++++++ gcc/config/i386/gnu.h | 11 ----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/gcc/config/gnu.h b/gcc/config/gnu.h index 97baea939..89904cd9b 100644 --- a/gcc/config/gnu.h +++ b/gcc/config/gnu.h @@ -31,3 +31,19 @@ along with GCC. If not, see . builtin_assert ("system=unix"); \ builtin_assert ("system=posix"); \ } while (0) + + +#ifndef GNU_USER_TARGET_STARTFILE_SPEC +# warning This file should be included after gnu-user.h, to override its STARTFILE_SPEC +#endif + +#undef STARTFILE_SPEC +#if defined HAVE_LD_PIE +#define STARTFILE_SPEC \ + "%{!shared: %{pg|p|profile:%{static-pie:grcrt0.o%s;static:gcrt0.o%s;:gcrt1.o%s};static-pie:rcrt0.o%s;static:crt0.o%s;" PIE_SPEC ":Scrt1.o%s;:crt1.o%s}} \ + crti.o%s %{static:crtbeginT.o%s;shared|static-pie|" PIE_SPEC ":crtbeginS.o%s;:crtbegin.o%s}" +#else +#define STARTFILE_SPEC \ + "%{!shared: %{pg|p|profile:%{static:gcrt0.o%s;:gcrt1.o%s};static:crt0.o%s;:crt1.o%s}} \ + crti.o%s %{static:crtbeginT.o%s;shared:crtbeginS.o%s;:crtbegin.o%s}" +#endif diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h index e776144f9..60244bfc8 100644 --- a/gcc/config/i386/gnu.h +++ b/gcc/config/i386/gnu.h @@ -24,17 +24,6 @@ along with GCC. If not, see . #undef GNU_USER_DYNAMIC_LINKER #define GNU_USER_DYNAMIC_LINKER "/lib/ld.so" -#undef STARTFILE_SPEC -#if defined HAVE_LD_PIE -#define STARTFILE_SPEC \ - "%{!shared: %{pg|p|profile:%{static-pie:grcrt0.o%s;static:gcrt0.o%s;:gcrt1.o%s};static-pie:rcrt0.o%s;static:crt0.o%s;" PIE_SPEC ":Scrt1.o%s;:crt1.o%s}} \ - crti.o%s %{static:crtbeginT.o%s;shared|static-pie|" PIE_SPEC ":crtbeginS.o%s;:crtbegin.o%s}" -#else -#define STARTFILE_SPEC \ - "%{!shared: %{pg|p|profile:%{static:gcrt0.o%s;:gcrt1.o%s};static:crt0.o%s;:crt1.o%s}} \ - crti.o%s %{static:crtbeginT.o%s;shared:crtbeginS.o%s;:crtbegin.o%s}" -#endif - #ifdef TARGET_LIBC_PROVIDES_SSP /* i386 glibc provides __stack_chk_guard in %gs:0x14. */ From patchwork Mon Jan 1 11:53:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Bugaev X-Patchwork-Id: 184160 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp3949468dyb; Mon, 1 Jan 2024 04:58:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IFcUXQA6GLu4UCPgSrteU6ILp51H+Y9OPzFgitrm1FNPGwQAp9X34FshOMdNCn92r9c/IyC X-Received: by 2002:a05:620a:5360:b0:781:616a:542f with SMTP id op32-20020a05620a536000b00781616a542fmr8534265qkn.16.1704113928649; Mon, 01 Jan 2024 04:58:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704113928; cv=pass; d=google.com; s=arc-20160816; b=m4pMgjQso6yW1bxyBdBI2ng/ULMk1EqgiASLxn14txKQm289BGDuNpxtVfAzSUCLY/ xeq/1m+hJefLQ4id6j4tUefmpVZQ6BGB7UJh7PZc10894qICfgNG7FZvG+JzvttHhHfw jsJrNnAMltbIkY4jYu/TJ91NzAWm+glY1Xio6bMJcVc8Mh7MUWN4cCo2zfuISDcY+4xo CnPI0K7qnkbqXeiHZZHOkTkQI9chPJXmj6Re9jLePuWEwacbqTRbx1zKqDvDc+zYy0lP STW6+QfgsQAlmm+0+LXxj2Cam9dkapl8d8sSsDMyLrwzW18zlsCCb1zCfTyY7w9Ylqvq 5bQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=REBVuJ9k8Vb3qtcFGfcI5ADkBRLvaXTuz1zIet0PyEM=; fh=9bJenRX/cD8CU3PEmvrB+wrE7mB8Fw2pK3nnUaGV76o=; b=lEEB+2Q2Z87ysQkh1pkAMX+GW+N5Pl0QiQQ5xepMyi+Pu0RggUCmbwM10S3rBRrFw9 3NntGpP3vhxhhAYGyExpDPudoYPIk+JevV6AFxc2sfT4t2l/oWhoPVDCXIfzYHRA5Dst 98WDPm7EUFfPDzr3f1u98swGmVqNoj17OfVMbQqI0uZfkxS9RL/f5OvtjZVIl0GGKa34 0faI/muCTATUB+Euej5zE3QKcdjDQUzpTj0aukB6YJhIiZZnStbS9zIH9tamz7/llvun T0Nqj5UapYw/UNo6SKe8rfsaeGZkWzAYX6Et8F2JltjREH+aNHjoyjdzcln1UESzgEe9 8o3Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=QOfCJmOb; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id de13-20020a05620a370d00b007813eebc6b2si19075382qkb.611.2024.01.01.04.58.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jan 2024 04:58:48 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=QOfCJmOb; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C167F385DC10 for ; Mon, 1 Jan 2024 11:55:41 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by sourceware.org (Postfix) with ESMTPS id 80339385842D for ; Mon, 1 Jan 2024 11:54:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 80339385842D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 80339385842D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::231 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704110047; cv=none; b=B9H/CJ039kBb/l2Fdcuo3Deo4JFPg05H+qQ87Akj4c8wfNQxBatgbpyjbK0apjTG51R1dyaoKQWvdaCjapE9DUHqAQKo74IPm3QAG1OjY7SmUeSDOwU3Yn5PCHpRY1wJ1eo9T5a5TRyCUG/FanDrSivXSdh83Eeg3krb+WCkbHc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704110047; c=relaxed/simple; bh=pK1MKG+FqxcrWRE3NDb7LcOhtDJMNi969X0yE7hYf4k=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=uSOE7LL0muCDdPhGfdRDCFQLKDIyv+HAsNcf3UtTMVfERBXEICwYazcYYzeEN62HAjoSheYpBe+8v+Ckut11/pE9oJmvR/iW45gZ7LrdJcV6Tv9loqkT5Hcw3SwwEDBWP+S9fGkG79XFWE1YpEJn5cK2epxvljUld6Ccjbt5f7o= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2cceb66a986so29179281fa.0 for ; Mon, 01 Jan 2024 03:54:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704110040; x=1704714840; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=REBVuJ9k8Vb3qtcFGfcI5ADkBRLvaXTuz1zIet0PyEM=; b=QOfCJmOb55mlwReATubF9gvlrP0kFCkKlHSbjMyFbeHXaP6kCJYHap3jqFojziNAgL vEbJi71iEk8ISTeMVTKN3tq1yrDTXlmWx4k7tscyGSAU81Obqz0ro2MiUARl/aZ2SjOZ nmYJIj/g6pMhuYhxtPesBWNRH3+p9y34GdP/MfIcjQMZCCo4mKz0Kmq2nOW9g+IBV9YU j/KAU1TrY3hJnfGcxKYIR3w1UiuiOTkleYrGGS88KQ/eKuRCCjIJuvM3dyIlDz4fZA8g +0J01kdBJPSpXSwiSDDyGY1OXbf7WZgzunTB8RCSyNAWM4h8zMyX4NPqE0ZCpzS1vgS8 xzhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704110040; x=1704714840; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=REBVuJ9k8Vb3qtcFGfcI5ADkBRLvaXTuz1zIet0PyEM=; b=wp1go+wm/aI3GDgqV+lOafY+5pXBOwn2qY79S8y8TTeSSTCuKzV8qOsXAlnGeC2Zlr pMICpAynxxOQimH9EqvxbzF1Hme7D8FX/JVC/70251ibcdaNlAwo4WlfS3IHoVGVjDMv bdlzAC+OlGzMIVAoDqPSPlzVC6Nwz9k3WCILqvkTFKVe1UbkR+lySi79Ig6V0a+f9aT3 E1/hz/MFe5a35tB6q2Tz/4E491+89Oc4LIHag+u98WMFG3jHvCIASaPi8AMZgUw2aYP1 9Td0HS7YD0MHVDSQI+6mnM6XyyppA07bwJMYWdvXgVLtAKp6LrkJqISWpTZ2OV2jIbVm 93yA== X-Gm-Message-State: AOJu0YyKdGFHWtMnnIYs+/RLl6/pjEEwu8kzhcqE6kPfEoZNqohtvwRr mr7a2BPGpWqRt2JwarkCxFOmpL/SxPE= X-Received: by 2002:a05:651c:b1f:b0:2cc:fbf7:8669 with SMTP id b31-20020a05651c0b1f00b002ccfbf78669mr1379513ljr.32.1704110039560; Mon, 01 Jan 2024 03:53:59 -0800 (PST) Received: from surface-pro-6.. ([2a00:1370:818c:b32f:8da1:ad5a:e55a:5cb0]) by smtp.gmail.com with ESMTPSA id ce26-20020a2eab1a000000b002ccbc09230csm3682109ljb.97.2024.01.01.03.53.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jan 2024 03:53:59 -0800 (PST) From: Sergey Bugaev To: gcc-patches@gcc.gnu.org, bug-hurd@gnu.org Subject: [PATCH gcc 2/3] aarch64: Add support for aarch64-gnu (GNU/Hurd on AArch64) Date: Mon, 1 Jan 2024 14:53:55 +0300 Message-ID: <20240101115356.614446-2-bugaevc@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240101115356.614446-1-bugaevc@gmail.com> References: <20240101115356.614446-1-bugaevc@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786892966895238260 X-GMAIL-MSGID: 1786892966895238260 Coupled with a corresponding binutils patch, this produces a toolchain that can sucessfully build working binaries targeting aarch64-gnu. Signed-off-by: Sergey Bugaev --- gcc/config.gcc | 6 +++ gcc/config/aarch64/aarch64-gnu.h | 68 ++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 gcc/config/aarch64/aarch64-gnu.h diff --git a/gcc/config.gcc b/gcc/config.gcc index f0676c830..d8dd127ad 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1263,6 +1263,12 @@ aarch64*-*-linux*) done TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'` ;; +aarch64*-*-gnu*) + tm_file="${tm_file} elfos.h gnu-user.h gnu.h glibc-stdint.h" + tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-gnu.h" + tmake_file="${tmake_file} aarch64/t-aarch64" + tm_defines="${tm_defines} TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1" + ;; aarch64*-wrs-vxworks*) tm_file="${tm_file} elfos.h aarch64/aarch64-elf.h" tm_file="${tm_file} vx-common.h vxworks.h aarch64/aarch64-vxworks.h" diff --git a/gcc/config/aarch64/aarch64-gnu.h b/gcc/config/aarch64/aarch64-gnu.h new file mode 100644 index 000000000..ee5494034 --- /dev/null +++ b/gcc/config/aarch64/aarch64-gnu.h @@ -0,0 +1,68 @@ +/* Definitions for AArch64 running GNU/Hurd. + Copyright (C) 2009-2024 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + . */ + +#ifndef GCC_AARCH64_GNU_H +#define GCC_AARCH64_GNU_H + +#define GNU_USER_DYNAMIC_LINKER "/lib/ld-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1" + +#define CPP_SPEC "%{pthread:-D_REENTRANT}" + +#define GNU_TARGET_LINK_SPEC "%{h*} \ + %{static:-Bstatic} \ + %{shared:-shared} \ + %{symbolic:-Bsymbolic} \ + %{!static:%{!static-pie: \ + %{rdynamic:-export-dynamic} \ + %{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}} \ + %{static-pie:-Bstatic -pie --no-dynamic-linker -z text} \ + -X \ + %{mbig-endian:-EB} %{mlittle-endian:-EL} \ + -maarch64gnu%{mabi=ilp32:32}%{mbig-endian:b}" + + +#define LINK_SPEC GNU_TARGET_LINK_SPEC AARCH64_ERRATA_LINK_SPEC + +#define GNU_USER_TARGET_MATHFILE_SPEC \ + "%{Ofast|ffast-math|funsafe-math-optimizations:%{!shared:crtfastmath.o%s}}" + +#undef ENDFILE_SPEC +#define ENDFILE_SPEC \ + GNU_USER_TARGET_MATHFILE_SPEC " " \ + GNU_USER_TARGET_ENDFILE_SPEC + +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + GNU_USER_TARGET_OS_CPP_BUILTINS(); \ + } \ + while (0) + +#define TARGET_ASM_FILE_END aarch64_file_end_indicate_exec_stack + +/* Uninitialized common symbols in non-PIE executables, even with + strong definitions in dependent shared libraries, will resolve + to COPY relocated symbol in the executable. See PR65780. */ +#undef TARGET_BINDS_LOCAL_P +#define TARGET_BINDS_LOCAL_P default_binds_local_p_2 + +/* Define this to be nonzero if static stack checking is supported. */ +#define STACK_CHECK_STATIC_BUILTIN 1 + +#endif /* GCC_AARCH64_GNU_H */ From patchwork Mon Jan 1 11:53:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Bugaev X-Patchwork-Id: 184158 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp3926960dyb; Mon, 1 Jan 2024 03:57:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IEN6vbqe13nRcgs3HM8Go0AuYJ9txm9vsYu7wG34zr//uzgaVSX5MKIIs+NU64UL5vb6G0u X-Received: by 2002:ac8:5713:0:b0:428:247b:ec65 with SMTP id 19-20020ac85713000000b00428247bec65mr1344152qtw.33.1704110227428; Mon, 01 Jan 2024 03:57:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704110227; cv=pass; d=google.com; s=arc-20160816; b=q0NWfTNqTvNaU+/MMMUQrJpLMI2cZNtyKA/lSqdZfR+C5HeKE1+QqTaS17SbFdM2Yi By0NnM+HzVT/+5IcvqDOQuf2u/7g/rQqlFUNduNgtlsFDxg8SuF8WiW25lH9A8gOMd/n w16uQpBpM+4aqJaxMSa4b0F7O760P9UbfF0DvYnERf024vaia9iP3G4cAo3U1cLYzR0u ggNxKN+EkTvYWuD9vpbHEYl5Ho3oOlHjhSvq5kjMpJCsx1A1eTv7i9xVFh3ZpwlgOlhb wKZw84KXV4geRYtABSisquzV3gqBq8ZaknuMZ/Pl5sf+kQHfLAYJxyM7d8mNVfY+PoCt j5lA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=sZsKYM0YpkH8OWMVNx5IJ9Rp7kmnPuafxWy3bDnLUn0=; fh=9bJenRX/cD8CU3PEmvrB+wrE7mB8Fw2pK3nnUaGV76o=; b=PuwkDz0p4b/05CB0NIPzu8kGUFp6aZ1VC5gJZ7ap1ZutL0SHvo/dAuRpANgVxNGR7I 16KE8jBqVF/3FM72rMYxxSKKa7uPKtwURQShYMie3/8j2c4ostRqZKYtas2CS/7tso8F koTWtlzjwwx3OyxK/Iqkqgy4l1iodS+4hqZ3r1lbynsA6R5G7USJUUZy197eHQXqu4Yc iV0ZqDzAz7naPZ2D+RuvQICTyue4NiFLePAfpjCgDZxg+VRmnGjmzDW2kO+13gz01wkh ifO1lxOOrJ4v18LRZ/ZoiltVsH8MUqYQzv7hJ3zIgw5UUe9HfOohVAvbS12gct9xlis7 A5Lw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gcNkAU8i; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id f5-20020a05622a104500b00428248dae2fsi1392743qte.275.2024.01.01.03.57.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jan 2024 03:57:07 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gcNkAU8i; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 66EF6385AC33 for ; Mon, 1 Jan 2024 11:56:50 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by sourceware.org (Postfix) with ESMTPS id 6F2353858282 for ; Mon, 1 Jan 2024 11:54:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6F2353858282 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6F2353858282 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::22b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704110047; cv=none; b=a/jAN28VtSofJm7DGRhoN/bcXYdw+OPa35ZKzgPUxEKRHUnwT25V3wLDWrafN/mpliJsiKAsC3TETC/TTYYMNtfQcyB3qXf6dGtCZWWAY4uRVnF8zq/03S8zgim1pQycbNPa5z5tl7ioo8Ej82kgU2iBZNY0ELOwiiV+UHHOwfw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704110047; c=relaxed/simple; bh=JOSRQP/KfDnWiq034Vw5niWUIZ43lqcD0uBQore8uIA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=WgA7zDoHg5Ytxd5De5dZGEit/uPaVWPVtjAWT1w5fJqQZSiJLe/cmPb6OO31Z4Nwfczqx7wfqx5j+955v7ggTcE5wCCits2K2a89vUqjPiKDyTgGYNpQTzfUf9XdaWh4l0UHs6EW5OzE2wPXwHGmVSxdyUXh2Y3GnUAGX22x2Xw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2ccecef2631so27919641fa.2 for ; Mon, 01 Jan 2024 03:54:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704110040; x=1704714840; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=sZsKYM0YpkH8OWMVNx5IJ9Rp7kmnPuafxWy3bDnLUn0=; b=gcNkAU8iulF6MH7hSHD8jHSlzR4nA1jLJUqDZyGyjSswzUFioUhjBx73SWAdOIn54x zsOKmHWXlnNKP+vZhHx95AhXTZxmWxLi931CfnIgip19iIoWSiLtHyeHkMggCEKCOIUd KWTbS/ttIn38eO+br4EdraPexEUhTp8+HCE2TEyq8xwYSidzTGm/IUSh7Y4zqP1SFCg3 YKMt+T2rLbeIexFEBwT8TfV6x+MpJLwfGjtdAYGVIPHOjeG2jC08jYetzOvb28RGFeHh BoDMiNK5Ygor2KW1kuW4eqJxlZ82gzpJYopVd0n4uZCDOK7FucuyS3vCFvQVrXhD+TxP HBjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704110040; x=1704714840; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sZsKYM0YpkH8OWMVNx5IJ9Rp7kmnPuafxWy3bDnLUn0=; b=blFRonk67E5gqQq7eqrDuaDKQzYWLZh5Y9EXxbrd+u0yC0ZuFZqpFUzSr+7vslCUrG /ojoPB8AhuHAXfVbiZEdjxIVUBl80YWVTZqIlxxFxCVHP5LY64cjYdc61nuJoT5H7hln OPnUMo76RmFA2aH4se9M/BYCteyX2oTbg/Q/yEE7uwIFc2p7L83vaDca6XdbiuO/I/Ig djUoIU2vqV4WXCPkBirkbf7QwmLTZmTgmjli8VjdkuC0WRp9i3FtbLezq4QOUD0lsbni PTixZYUG1G7sCihXF1tqfIo82RfJa5MRu5XnRlCi5E6aQx1L5QEX5iEuD/EK7KGCma64 +FZA== X-Gm-Message-State: AOJu0Yyr1PO3RFQ7/QmnqaGRSP4x3p62xmVqiKCymGJne4pLqneVODy5 Vz0HOzUyjdXOZD9x+4vGSph7gvliw4E= X-Received: by 2002:a2e:9c14:0:b0:2cc:6fe2:4ddc with SMTP id s20-20020a2e9c14000000b002cc6fe24ddcmr6027050lji.3.1704110040478; Mon, 01 Jan 2024 03:54:00 -0800 (PST) Received: from surface-pro-6.. ([2a00:1370:818c:b32f:8da1:ad5a:e55a:5cb0]) by smtp.gmail.com with ESMTPSA id ce26-20020a2eab1a000000b002ccbc09230csm3682109ljb.97.2024.01.01.03.53.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jan 2024 03:53:59 -0800 (PST) From: Sergey Bugaev To: gcc-patches@gcc.gnu.org, bug-hurd@gnu.org Subject: [PATCH gcc 3/3] libgcc: Add basic support for aarch64-gnu (GNU/Hurd on AArch64) Date: Mon, 1 Jan 2024 14:53:56 +0300 Message-ID: <20240101115356.614446-3-bugaevc@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240101115356.614446-1-bugaevc@gmail.com> References: <20240101115356.614446-1-bugaevc@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786889085572562633 X-GMAIL-MSGID: 1786889085572562633 There is currently no unwinding implementation. Signed-off-by: Sergey Bugaev --- libgcc/config.host | 9 +++++++ libgcc/config/aarch64/gnu-unwind.h | 36 +++++++++++++++++++++++++ libgcc/config/aarch64/heap-trampoline.c | 4 +-- 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 libgcc/config/aarch64/gnu-unwind.h diff --git a/libgcc/config.host b/libgcc/config.host index 54d06978a..c5b4df2c5 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -448,6 +448,15 @@ aarch64*-*-linux*) tmake_file="${tmake_file} t-dfprules" tmake_file="${tmake_file} ${cpu_type}/t-heap-trampoline" ;; +aarch64*-*-gnu*) + extra_parts="$extra_parts crtfastmath.o" + md_unwind_header=aarch64/gnu-unwind.h + tmake_file="${tmake_file} ${cpu_type}/t-aarch64" + tmake_file="${tmake_file} ${cpu_type}/t-lse t-slibgcc-libgcc" + tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm" + tmake_file="${tmake_file} t-dfprules" + tmake_file="${tmake_file} ${cpu_type}/t-heap-trampoline" + ;; aarch64*-*-vxworks7*) extra_parts="$extra_parts crtfastmath.o" md_unwind_header=aarch64/aarch64-unwind.h diff --git a/libgcc/config/aarch64/gnu-unwind.h b/libgcc/config/aarch64/gnu-unwind.h new file mode 100644 index 000000000..d9e485a18 --- /dev/null +++ b/libgcc/config/aarch64/gnu-unwind.h @@ -0,0 +1,36 @@ +/* DWARF2 EH unwinding support for GNU Hurd: aarch64. + Copyright (C) 2020-2024 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +Under Section 7 of GPL version 3, you are granted additional +permissions described in the GCC Runtime Library Exception, version +3.1, as published by the Free Software Foundation. + +You should have received a copy of the GNU General Public License and +a copy of the GCC Runtime Library Exception along with this program; +see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +. */ + +/* Always include AArch64 unwinder header file. */ +#include "config/aarch64/aarch64-unwind.h" + +#ifndef inhibit_libc + +#include + +/* + * TODO: support for aarch64 needs to be implemented. + */ + +#endif /* ifndef inhibit_libc */ diff --git a/libgcc/config/aarch64/heap-trampoline.c b/libgcc/config/aarch64/heap-trampoline.c index f22233987..6565584c7 100644 --- a/libgcc/config/aarch64/heap-trampoline.c +++ b/libgcc/config/aarch64/heap-trampoline.c @@ -23,7 +23,7 @@ void *allocate_trampoline_page (void); void __builtin_nested_func_ptr_created (void *chain, void *func, void **dst); void __builtin_nested_func_ptr_deleted (void); -#if defined(__gnu_linux__) +#if defined(__gnu_linux__) || defined(__gnu_hurd__) static const uint32_t aarch64_trampoline_insns[] = { 0xd503245f, /* hint 34 */ 0x580000b1, /* ldr x17, .+20 */ @@ -76,7 +76,7 @@ allocate_trampoline_page (void) { void *page; -#if defined(__gnu_linux__) +#if defined(__gnu_linux__) || defined(__gnu_hurd__) page = mmap (0, getpagesize (), PROT_WRITE | PROT_EXEC, MAP_ANON | MAP_PRIVATE, 0, 0); #elif __APPLE__