From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id C6F273858D37 for ; Wed, 24 May 2023 05:31:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C6F273858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-306dbad5182so192868f8f.1 for ; Tue, 23 May 2023 22:31:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1684906300; x=1687498300; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=KWP5j6ilhiTJ8inK+noiFlCoLWpZT5AI8zGrCICsO6c=; b=W0S1LVoVuzOFqFixSbTdKSaYThuXeh75f42LVXqyjqEMmQph2EwuiAi4QLr708pXgU LKv5iqngNidXOtC/3lXVTRxpzWKUM1EbbDh+Q01zTUbwSPe2KzKILpgNmAg+4nXjnL8r udA2wNE7MD0o6IKx02lpKwGwtXz+VxubWBA1tKKSO6WgBsfvyfz/4/6iX0U4jeUqa3me 8XDKIXkjuWfWIQmxEy6EZJiZ5sdHOgaYpv6RxEnEzjNpNWN16raWoEyIkuahSfGDe9EB nrIaQke4LkyY0gJPOWnusLlzR9RvnDrCuogcORO0yUzG3lNoSfshdBNGLH9fvDBog8bE rxCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684906300; x=1687498300; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KWP5j6ilhiTJ8inK+noiFlCoLWpZT5AI8zGrCICsO6c=; b=kS2but5p1LAk/vuy6MTLX0g6T7lcTGiuLbs1bTahTVQVy7X7I64lcCwjD9Kb3B/o9J JCiZhC6hveSkla5AW8UqIxknDZ4AU0F2b75OEX018qJGDxbv6UVx0vjg00y74KxXwtY2 NW4Npe/td/5F4EiUkLu6RfbqwXg8Mh6+nfFNSui8zWK4B1BQIfijdvwUArXct3GwS76C auD2GwDpvgYi3p/tGGj3TTTeYe+7Y5xX6BSev9SgrybrqvQwzMOh/YMmPom1Rq3bkK50 aYF1K0UAI7Pedx4ci05PNqyUdEzs6reAI5DblMz8mE0u/hB8hTiIwV+8rfx0dd0pgvLZ ppvg== X-Gm-Message-State: AC+VfDyfJswUDUGHZzgg7ueRigIl3xDVsYPFksAmSEOpO9Xifqq1QWwe zcMU7lLkd8URh3BuEFjWJ3rcMA== X-Google-Smtp-Source: ACHHUZ6i6zYDc+6UheKI7C9Yrx3FfU5kZ4JAGMgkkKyWvNy7b9nXZuVzFBiukkX9b1CAW/tW6JGy5A== X-Received: by 2002:a5d:65d0:0:b0:309:4ed5:b458 with SMTP id e16-20020a5d65d0000000b003094ed5b458mr10419646wrw.30.1684906300005; Tue, 23 May 2023 22:31:40 -0700 (PDT) Received: from smtpclient.apple (2a01cb0009e13900ac13dd0a38cd070b.ipv6.abo.wanadoo.fr. [2a01:cb00:9e1:3900:ac13:dd0a:38cd:70b]) by smtp.gmail.com with ESMTPSA id u9-20020a5d5149000000b0030aa8f15c57sm1178668wrt.68.2023.05.23.22.31.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 May 2023 22:31:38 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: [PATCH] Check for sysconf decl on vxworks From: Olivier Hainque In-Reply-To: Date: Wed, 24 May 2023 07:31:37 +0200 Cc: Olivier Hainque , gcc-patches@gcc.gnu.org Content-Transfer-Encoding: quoted-printable Message-Id: <6C8BE67E-6534-4022-B8C4-19A68D327417@adacore.com> References: To: Alexandre Oliva X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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 List-Id: Good for me, thanks Alex! > On 24 May 2023, at 07:08, Alexandre Oliva wrote: >=20 >=20 > The sysconf function is only available in rtp mode on vxworks. In > kernel mode, it is not even declared, but the feature test macro in > the testsuite doesn't notice its absence because it's a link test, and > vxworks kernel mode uses partial linking. >=20 > This patch introduces an alternate test on vxworks targets to check > for a declaration and for an often-used sysconf parameter. >=20 > Bootstrapped on x86_64-linux-gnu. Also tested on ppc- and x86-vx7r2 > with gcc-12. >=20 >=20 > for gcc/testsuite/ChangeLog >=20 > * lib/target-supports.exp (check_effective_target_sysconf): > Check for declaration and _SC_PAGESIZE on vxworks. > --- > gcc/testsuite/lib/target-supports.exp | 11 +++++++++++ > 1 file changed, 11 insertions(+) >=20 > diff --git a/gcc/testsuite/lib/target-supports.exp = b/gcc/testsuite/lib/target-supports.exp > index bd9f432e4a761..263ef35a2e4df 100644 > --- a/gcc/testsuite/lib/target-supports.exp > +++ b/gcc/testsuite/lib/target-supports.exp > @@ -1146,6 +1146,17 @@ proc check_effective_target_mmap {} { > # Return 1 if the target supports sysconf, 0 otherwise. >=20 > proc check_effective_target_sysconf {} { > + # VxWorks has sysconf in rtp mode only, but our way to test can't > + # tell kernel mode doesn't, as we're doing partial links for > + # kernel modules. We can tell by checking for a declaration, or > + # for some sysconf parm, because configurations that don't offer > + # sysconf don't have either. > + if { [istarget *-*-vxworks*] } { > + return [check_no_compiler_messages sysconfdecl assembly { > + #include > + int f() { return sysconf(_SC_PAGESIZE); } > + }]; > + } > return [check_function_available "sysconf"] > } >=20 >=20 >=20 > --=20 > Alexandre Oliva, happy hacker = https://FSFLA.org/blogs/lxo/ > Free Software Activist GNU Toolchain Engineer > Disinformation flourishes because many people care deeply about = injustice > but very few check the facts. Ask me about =