From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by sourceware.org (Postfix) with ESMTPS id 1A5713858D1E for ; Wed, 20 Mar 2024 13:28:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1A5713858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1A5713858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::102c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710941307; cv=none; b=Q4uJ+hKmxFh+fby5NNrY/k1SzEhJukN3RAja1tRmJxTMQowPturj6hMhCfTAVivYHa8zcHraJufalSY+9DaUYWjvkI8VlYNSZgSzwhMnMQXK8RAb87UoUUda2rqCesLkSzJ6dLtP+7aBoc7A1y7jbHGmevAvUvKZs9NURBqfHPw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710941307; c=relaxed/simple; bh=JvYreo8Lxd0WU0NaMQ378qU+sjxUh98378fILnoP8y8=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=jpMbQoNUdEE1ebj3TpGZs9maOIQ58TPGnUJLw7d3r30ToiM7KFL4n7d+lxot4Dx46wQ0a1zUPpNnpa4DzrZVrEEz8WFx2RzzC0S50z0ZnfiXhLkeoQKHCXHLGD4v1NxE1g5WffXZ3k2uHtNTg3TAwWpAqD8TN/AppvAKEadsuBA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-29dee60302fso680352a91.1 for ; Wed, 20 Mar 2024 06:28:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710941305; x=1711546105; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=JrA4OYSghLG3evtY7qUXeFWKhBNcsLnb97lB9uYa090=; b=ce4RfGZcw4w6wSQrqo/V9eJkZHpcr9WqsaRVkIj1lqibRB2KVR+9PGppfGuNqYJUjj rBbW6v6KQgn1TGcEV9Y9uF5/1W1aXaZhgwSUsufdhGwNx6jX6KGGvtlhFWAQHk45TEnE /h+1o8QohwnzJKe7imA/No+j3VpAU5s1n3mlPZNaAV1YhPIppyiMBYFWkJPHGHvYVgo0 y8vXBwIqB96wO8PFfxCa/aZyHqnUkfEawnvouOQRnHvKXb7+2WsC7zIMAEBHn685lHP3 F6GTERA1wReQX3gqa2lq3uDEQPhyBVkpb2p0DpOHCCW7EgGoIcT88aIO8YrNTK76EIcr N+LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710941305; x=1711546105; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JrA4OYSghLG3evtY7qUXeFWKhBNcsLnb97lB9uYa090=; b=FfXc1Um5lvr532+bNqVIn4TlD6BlaFVOjBdI3SKZTMofHjoq3vb6Ayv6VOwNk3EgPM OLs9zF3wvU9gHNFOu5V7eccuLHMIkTSqLBN9/hCypBEUtE2j0xO5UPCTyAatDg1gwgf6 kLfRxzURCnrtEkvzzAld/v2LH82dbY6GywYQXNCjya28xXsjF2kkk3M1GcTQtX9XQ9Mz ScDBR30Xq7l6bfJMHd/o2I+iemM0S4GtwaeZQSK5+le+OWY1Z1ADiHsMKywMupQYKKAb 7tpDMFU9/dfv6Mju0TT2/GY+DZDsBh89eQ4s0fawQhtXA4QOsJVQor9ATVeazYdwmu42 lKbg== X-Forwarded-Encrypted: i=1; AJvYcCUzM0WhIjRVGm1xFsOzm4cN8cpojlsfXobkenUJLytxjFv4YRjOqrv5y7VG58zVv0YYZ9ZLlLRPmmoUNxQvzk29GRbbHFW+x3u9 X-Gm-Message-State: AOJu0Yy3hD65c7bZKBGuR/RClpR45qWBTW27wyJPIpfnhD3/vpauRpDu zBjZI/1fMcBkn0J5DlZbGzt27tZhd+zvXwHdochsncGcBqvVtcIMA2wVF7M7Y0E= X-Google-Smtp-Source: AGHT+IEfmICBBfqjx+GAlRT0M17qwbS78cnkUHEfs46RQiU6n8dzdgkKCS2TrKRUZb0UdtYZQvqF8A== X-Received: by 2002:a17:90a:3482:b0:29b:a345:620a with SMTP id p2-20020a17090a348200b0029ba345620amr3382415pjb.20.1710941304932; Wed, 20 Mar 2024 06:28:24 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c3:1d04:9481:20ec:563b:127c? ([2804:1b3:a7c3:1d04:9481:20ec:563b:127c]) by smtp.gmail.com with ESMTPSA id nr19-20020a17090b241300b0029beec8e86csm1578580pjb.36.2024.03.20.06.28.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Mar 2024 06:28:24 -0700 (PDT) Message-ID: <21f682a2-60cf-4310-87dc-44fdb2df2702@linaro.org> Date: Wed, 20 Mar 2024 10:28:21 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 4/4] or1k: Add prctl wrapper to unwrap variadic args Content-Language: en-US To: Stafford Horne , GLIBC patches Cc: Linux OpenRISC References: <20240319214244.736981-1-shorne@gmail.com> <20240319214244.736981-5-shorne@gmail.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <20240319214244.736981-5-shorne@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 List-Id: On 19/03/24 18:42, Stafford Horne wrote: > On OpenRISC variadic functions and regular functions have different > calling conventions so this wrapper is needed to translate. This > wrapper is copied from x86_64/x32. I don't know the build system enough > to find a cleaner way to share the code between x86_64/x32 and or1k > (maybe Implies?), so I went with the straight copy. It looks ok, the old way of cross-reference ABIs implementations only add complications. > > This fixes test failures: > > misc/tst-prctl > nptl/tst-setgetname > --- > sysdeps/unix/sysv/linux/or1k/prctl.c | 42 ++++++++++++++++++++++++++++ > 1 file changed, 42 insertions(+) > create mode 100644 sysdeps/unix/sysv/linux/or1k/prctl.c > > diff --git a/sysdeps/unix/sysv/linux/or1k/prctl.c b/sysdeps/unix/sysv/linux/or1k/prctl.c > new file mode 100644 > index 0000000000..1aa707d175 > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/or1k/prctl.c > @@ -0,0 +1,42 @@ > +/* prctl - Linux specific syscall. OpenRISC version. > + Copyright (C) 2024 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library 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 > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library; if not, see > + . */ > + > +#include > +#include > +#include > + > +/* Unconditionally read all potential arguments. This may pass > + garbage values to the kernel, but avoids the need for teaching > + glibc the argument counts of individual options (including ones > + that are added to the kernel in the future). */ > + > +int > +__prctl (int option, ...) > +{ > + va_list arg; > + va_start (arg, option); > + unsigned long int arg2 = va_arg (arg, unsigned long int); > + unsigned long int arg3 = va_arg (arg, unsigned long int); > + unsigned long int arg4 = va_arg (arg, unsigned long int); > + unsigned long int arg5 = va_arg (arg, unsigned long int); > + va_end (arg); > + return INLINE_SYSCALL_CALL (prctl, option, arg2, arg3, arg4, arg5); > +} > + > +libc_hidden_def (__prctl) > +weak_alias (__prctl, prctl)