From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA107C433DF for ; Tue, 4 Aug 2020 06:37:33 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8F96820781 for ; Tue, 4 Aug 2020 06:37:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F96820781 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4BLQ6M1wWSzDqYM for ; Tue, 4 Aug 2020 16:37:31 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=sandipan@linux.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4BLQ4347vWzDqW7 for ; Tue, 4 Aug 2020 16:35:31 +1000 (AEST) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0746WChO005716; Tue, 4 Aug 2020 02:35:20 -0400 Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0b-001b2d01.pphosted.com with ESMTP id 32pypj3ywm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 04 Aug 2020 02:35:20 -0400 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0746NVWY002145; Tue, 4 Aug 2020 06:35:18 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma06fra.de.ibm.com with ESMTP id 32mynh9u3r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 04 Aug 2020 06:35:18 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0746ZGJU37159266 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 4 Aug 2020 06:35:16 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8ACCEA4055; Tue, 4 Aug 2020 06:35:16 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B031FA4040; Tue, 4 Aug 2020 06:35:15 +0000 (GMT) Received: from [9.199.38.35] (unknown [9.199.38.35]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 4 Aug 2020 06:35:15 +0000 (GMT) Subject: Re: [merge] Build failure selftest/powerpc/mm/pkey_exec_prot To: Michael Ellerman References: <37C1E196-B35D-46C4-AAA7-BC250078E4F2@linux.vnet.ibm.com> <63dc2f90-9a16-21f8-51fa-cfef9df80676@linux.ibm.com> <875za00z75.fsf@mpe.ellerman.id.au> <3ada0268-9474-5ee6-b1aa-82e8d245615d@linux.ibm.com> <87mu3bz083.fsf@mpe.ellerman.id.au> From: Sandipan Das Message-ID: <185c2277-91fd-74eb-3c04-75caeb90ed9e@linux.ibm.com> Date: Tue, 4 Aug 2020 12:05:14 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <87mu3bz083.fsf@mpe.ellerman.id.au> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-04_02:2020-08-03, 2020-08-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 lowpriorityscore=0 spamscore=0 clxscore=1015 phishscore=0 malwarescore=0 mlxscore=0 impostorscore=0 suspectscore=0 adultscore=0 priorityscore=1501 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008040045 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sachin Sant , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Hi Michael, On 04/08/20 6:38 am, Michael Ellerman wrote: > Sandipan Das writes: >> On 03/08/20 4:32 pm, Michael Ellerman wrote: >>> Sachin Sant writes: >>>>> On 02-Aug-2020, at 10:58 PM, Sandipan Das wrote: >>>>> On 02/08/20 4:45 pm, Sachin Sant wrote: >>>>>> pkey_exec_prot test from linuxppc merge branch (3f68564f1f5a) fails to >>>>>> build due to following error: >>>>>> >>>>>> gcc -std=gnu99 -O2 -Wall -Werror -DGIT_VERSION='"v5.8-rc7-1276-g3f68564f1f5a"' -I/home/sachin/linux/tools/testing/selftests/powerpc/include -m64 pkey_exec_prot.c /home/sachin/linux/tools/testing/selftests/kselftest_harness.h /home/sachin/linux/tools/testing/selftests/kselftest.h ../harness.c ../utils.c -o /home/sachin/linux/tools/testing/selftests/powerpc/mm/pkey_exec_prot >>>>>> In file included from pkey_exec_prot.c:18: >>>>>> /home/sachin/linux/tools/testing/selftests/powerpc/include/pkeys.h:34: error: "SYS_pkey_mprotect" redefined [-Werror] >>>>>> #define SYS_pkey_mprotect 386 >>>>>> >>>>>> In file included from /usr/include/sys/syscall.h:31, >>>>>> from /home/sachin/linux/tools/testing/selftests/powerpc/include/utils.h:47, >>>>>> from /home/sachin/linux/tools/testing/selftests/powerpc/include/pkeys.h:12, >>>>>> from pkey_exec_prot.c:18: >>>>>> /usr/include/bits/syscall.h:1583: note: this is the location of the previous definition >>>>>> # define SYS_pkey_mprotect __NR_pkey_mprotect >>>>>> >>>>>> commit 128d3d021007 introduced this error. >>>>>> selftests/powerpc: Move pkey helpers to headers >>>>>> >>>>>> Possibly the # defines for sys calls can be retained in pkey_exec_prot.c or >>>>>> >>>>> >>>>> I am unable to reproduce this on the latest merge branch (HEAD at f59195f7faa4). >>>>> I don't see any redefinitions in pkey_exec_prot.c either. >>>>> >>>> >>>> I can still see this problem on latest merge branch. >>>> I have following gcc version >>>> >>>> gcc version 8.3.1 20191121 >>> >>> What libc version? Or just the distro & version? >> >> Sachin observed this on RHEL 8.2 with glibc-2.28. >> I couldn't reproduce it on Ubuntu 20.04 and Fedora 32 and both these distros >> are using glibc-2.31. > > OK odd. Usually it's newer glibc that hits this problem. > > I guess on RHEL 8.2 we're getting the asm-generic version? But that > would be quite wrong if that's what's happening. > If I let GCC dump all the headers that are being used for the source file, I always see syscall.h being included on the RHEL 8.2 system. That is the header with the conflicting definition. $ cd tools/testing/selftests/powerpc/mm $ gcc -H -std=gnu99 -O2 -Wall -Werror -DGIT_VERSION='"v5.8-rc7-1456-gf59195f7faa4-dirty"' \ -I../include -m64 pkey_exec_prot.c ../../kselftest_harness.h ../../kselftest.h ../harness.c ../utils.c \ -o pkey_exec_prot 2>&1 | grep syscall On Ubuntu 20.04 and Fedora 32, grep doesn't find any matching text. On RHEL 8.2, it shows the following. ... /usr/include/sys/syscall.h .... /usr/include/bits/syscall.h In file included from /usr/include/sys/syscall.h:31, /usr/include/bits/syscall.h:1583: note: this is the location of the previous definition In file included from /usr/include/sys/syscall.h:31, /usr/include/bits/syscall.h:1575: note: this is the location of the previous definition In file included from /usr/include/sys/syscall.h:31, /usr/include/bits/syscall.h:1579: note: this is the location of the previous definition /usr/include/bits/syscall.h .. /usr/include/sys/syscall.h ... /usr/include/bits/syscall.h /usr/include/bits/syscall.h .. /usr/include/sys/syscall.h ... /usr/include/bits/syscall.h /usr/include/bits/syscall.h So utils.h is also including /usr/include/sys/syscall.h for glibc versions older than 2.30 because of commit 743f3544fffb ("selftests/powerpc: Add wrapper for gettid") :) [...] . ../include/pkeys.h [...] .. ../include/utils.h [...] ... /usr/include/sys/syscall.h .... /usr/include/asm/unistd.h .... /usr/include/bits/syscall.h In file included from pkey_exec_prot.c:18: ../include/pkeys.h:34: error: "SYS_pkey_mprotect" redefined [-Werror] #define SYS_pkey_mprotect 386 In file included from /usr/include/sys/syscall.h:31, from ../include/utils.h:47, from ../include/pkeys.h:12, from pkey_exec_prot.c:18: /usr/include/bits/syscall.h:1583: note: this is the location of the previous definition # define SYS_pkey_mprotect __NR_pkey_mprotect [...] - Sandipan