From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F8A2847C for ; Thu, 12 Jan 2023 19:52:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 865D1C433F1; Thu, 12 Jan 2023 19:52:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673553142; bh=N+rkOUdz8pFlkVOQJ7wMoEbs6vwb9dQCS+jyjI4yr0w=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=sEwDAdHG+WS9hN6kyw8Xez5NVsbVf5Kn1PAxwDW2AOp1xcpAf/IrQaE5jWWWN9Mp7 Q3GV8VUZsbrM4LNoU+EpIKpq4uyeydyXxODfl+eSg/4TRFTwvFNERkbamnGdvxFWRT pClywv+UHvLXlSHlloHydDWFKk5lm+EtoViBRPt9+1kx2PXy9zwJrjIa+I1OS4Lq42 T+GnVHdkixPsxMOplHZVpRfekMXgs2baCetD91ADVBAnvNuOsm5NW7dzFEjzYHTGed +ZZznKUSAda2/dZTDSFvw5a0r9UNM9iBxinm+CKBprUuegAZnZ4Dnnq9YeX1+o2TPN jvG/iN8MRRDBA== From: Mark Brown Date: Thu, 12 Jan 2023 19:51:49 +0000 Subject: [PATCH 3/6] kselftest/arm64: Don't pass headers to the compiler as source Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230111-arm64-kselftest-clang-v1-3-89c69d377727@kernel.org> References: <20230111-arm64-kselftest-clang-v1-0-89c69d377727@kernel.org> In-Reply-To: <20230111-arm64-kselftest-clang-v1-0-89c69d377727@kernel.org> To: Catalin Marinas , Will Deacon , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Tom Rix Cc: linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, llvm@lists.linux.dev, Mark Brown X-Mailer: b4 0.12-dev-8b3d1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2253; i=broonie@kernel.org; h=from:subject:message-id; bh=N+rkOUdz8pFlkVOQJ7wMoEbs6vwb9dQCS+jyjI4yr0w=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBjwGTp/f4zdF4G6Q+1ACaPAaVth3j1KTCyjFadZQDV xgtTaKqJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCY8Bk6QAKCRAk1otyXVSH0JMOB/ 0WNFW0Jm+7kLZdGWl+VaZ4OSqlRsDp8yCHKDqTnxQ2j1ByMorud1Sz50ptaH+0Upm4QDcreK+/zn4Y pdD1M2iLk5LIZQBNe/8V8A8wH08UK3vPG2JCZczQdKZI97s9r/a1zCvi8iu5K+IiW1s4MttKQZPjMx /rzViMmQPmSakWp2GgIq9ia2dKXh5Re8n126CU6xcOjhcP2zelOvr7+kzpF3t+kGCOgC18f9Ey3AfU CJxRzx7HKv1nEK70BMoDC/cNW6boL8JvetV5j/Bhmrq6VEKp99pcQSPCo8vz/IsgTAQUtrwyAQSi3w MAmOeCOOy+wsQm/7vdl92ihLsD6Mxi X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB The signal Makefile rules pass all the dependencies for each executable, including headers, to the compiler which GCC is happy enough with but clang rejects: clang --target=aarch64-none-linux-gnu -fintegrated-as -Wall -O2 -g -I/home/broonie/git/linux/tools/testing/selftests/ -isystem /home/broonie/git/linux/usr/include -D_GNU_SOURCE -std=gnu99 -I. test_signals.c test_signals_utils.c testcases/testcases.c signals.S testcases/fake_sigreturn_bad_magic.c test_signals.h test_signals_utils.h testcases/testcases.h -o testcases/fake_sigreturn_bad_magic clang: error: cannot specify -o when generating multiple output files This happens because clang gets confused about what to do with the header files, failing to identify them as source. This is not amazing behaviour on clang's part and should ideally be fixed but even if that happens we'd still need a new clang release so let's instead rework the Makefile so we use variables for the lists of header and source files, allowing us to only pass the source files to the compiler and keep clang happy. As a bonus the resulting Makefile is a bit easier to read. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/signal/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/arm64/signal/Makefile b/tools/testing/selftests/arm64/signal/Makefile index be7520a863b0..8f5febaf1a9a 100644 --- a/tools/testing/selftests/arm64/signal/Makefile +++ b/tools/testing/selftests/arm64/signal/Makefile @@ -22,6 +22,10 @@ $(TEST_GEN_PROGS): $(PROGS) # Common test-unit targets to build common-layout test-cases executables # Needs secondary expansion to properly include the testcase c-file in pre-reqs +COMMON_SOURCES := test_signals.c test_signals_utils.c testcases/testcases.c \ + signals.S +COMMON_HEADERS := test_signals.h test_signals_utils.h testcases/testcases.h + .SECONDEXPANSION: -$(PROGS): test_signals.c test_signals_utils.c testcases/testcases.c signals.S $$@.c test_signals.h test_signals_utils.h testcases/testcases.h - $(CC) $(CFLAGS) $^ -o $@ +$(PROGS): $$@.c ${COMMON_SOURCES} ${COMMON_HEADERS} + $(CC) $(CFLAGS) ${@}.c ${COMMON_SOURCES} -o $@ -- 2.30.2 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 65CC5C54EBE for ; Thu, 12 Jan 2023 20:21:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ODKPLSLCdouS3gTgJ09sZeAE0laYfBy5/s37ZW7LhKg=; b=MKyXNOzGeHcn2e eWhFAe1rVc5ZoyLVmxKJHmkwNcHbj/VsqzJNfIZrJvHqx1nZ4F8ZCtx+zbvaRgTx7Gu6c8bvXhetn RBvEWX9fTbMd2vSffnJ76hxPGbid97dwRZKUUUMCUqFqJrx8T4w+uO/ixyBtvWiy0Vj2VPRXZiXNo DNa/IqE+S9PVOULBJhd6p5yE0xE/DFk82hKGRxwuLS4pFAkef9KEV23u3cZ+m/nN8Bw0/RrQju+U0 Q9Ko62YlsGWqCB5j/SeioHw89v0ljrZr8tIH/X+gihQPEmu4+iGsZw/r2zmFRSqE7BK7BmW8tjygT ckjplZBATrzhucNGHYhw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pG43Q-00Gqvs-Om; Thu, 12 Jan 2023 20:20:05 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pG3cd-00GemM-Pc for linux-arm-kernel@lists.infradead.org; Thu, 12 Jan 2023 19:52:25 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0D38662171; Thu, 12 Jan 2023 19:52:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 865D1C433F1; Thu, 12 Jan 2023 19:52:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673553142; bh=N+rkOUdz8pFlkVOQJ7wMoEbs6vwb9dQCS+jyjI4yr0w=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=sEwDAdHG+WS9hN6kyw8Xez5NVsbVf5Kn1PAxwDW2AOp1xcpAf/IrQaE5jWWWN9Mp7 Q3GV8VUZsbrM4LNoU+EpIKpq4uyeydyXxODfl+eSg/4TRFTwvFNERkbamnGdvxFWRT pClywv+UHvLXlSHlloHydDWFKk5lm+EtoViBRPt9+1kx2PXy9zwJrjIa+I1OS4Lq42 T+GnVHdkixPsxMOplHZVpRfekMXgs2baCetD91ADVBAnvNuOsm5NW7dzFEjzYHTGed +ZZznKUSAda2/dZTDSFvw5a0r9UNM9iBxinm+CKBprUuegAZnZ4Dnnq9YeX1+o2TPN jvG/iN8MRRDBA== From: Mark Brown Date: Thu, 12 Jan 2023 19:51:49 +0000 Subject: [PATCH 3/6] kselftest/arm64: Don't pass headers to the compiler as source MIME-Version: 1.0 Message-Id: <20230111-arm64-kselftest-clang-v1-3-89c69d377727@kernel.org> References: <20230111-arm64-kselftest-clang-v1-0-89c69d377727@kernel.org> In-Reply-To: <20230111-arm64-kselftest-clang-v1-0-89c69d377727@kernel.org> To: Catalin Marinas , Will Deacon , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Tom Rix Cc: linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, llvm@lists.linux.dev, Mark Brown X-Mailer: b4 0.12-dev-8b3d1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2253; i=broonie@kernel.org; h=from:subject:message-id; bh=N+rkOUdz8pFlkVOQJ7wMoEbs6vwb9dQCS+jyjI4yr0w=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBjwGTp/f4zdF4G6Q+1ACaPAaVth3j1KTCyjFadZQDV xgtTaKqJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCY8Bk6QAKCRAk1otyXVSH0JMOB/ 0WNFW0Jm+7kLZdGWl+VaZ4OSqlRsDp8yCHKDqTnxQ2j1ByMorud1Sz50ptaH+0Upm4QDcreK+/zn4Y pdD1M2iLk5LIZQBNe/8V8A8wH08UK3vPG2JCZczQdKZI97s9r/a1zCvi8iu5K+IiW1s4MttKQZPjMx /rzViMmQPmSakWp2GgIq9ia2dKXh5Re8n126CU6xcOjhcP2zelOvr7+kzpF3t+kGCOgC18f9Ey3AfU CJxRzx7HKv1nEK70BMoDC/cNW6boL8JvetV5j/Bhmrq6VEKp99pcQSPCo8vz/IsgTAQUtrwyAQSi3w MAmOeCOOy+wsQm/7vdl92ihLsD6Mxi X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230112_115223_966354_CC542244 X-CRM114-Status: GOOD ( 15.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The signal Makefile rules pass all the dependencies for each executable, including headers, to the compiler which GCC is happy enough with but clang rejects: clang --target=aarch64-none-linux-gnu -fintegrated-as -Wall -O2 -g -I/home/broonie/git/linux/tools/testing/selftests/ -isystem /home/broonie/git/linux/usr/include -D_GNU_SOURCE -std=gnu99 -I. test_signals.c test_signals_utils.c testcases/testcases.c signals.S testcases/fake_sigreturn_bad_magic.c test_signals.h test_signals_utils.h testcases/testcases.h -o testcases/fake_sigreturn_bad_magic clang: error: cannot specify -o when generating multiple output files This happens because clang gets confused about what to do with the header files, failing to identify them as source. This is not amazing behaviour on clang's part and should ideally be fixed but even if that happens we'd still need a new clang release so let's instead rework the Makefile so we use variables for the lists of header and source files, allowing us to only pass the source files to the compiler and keep clang happy. As a bonus the resulting Makefile is a bit easier to read. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/signal/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/arm64/signal/Makefile b/tools/testing/selftests/arm64/signal/Makefile index be7520a863b0..8f5febaf1a9a 100644 --- a/tools/testing/selftests/arm64/signal/Makefile +++ b/tools/testing/selftests/arm64/signal/Makefile @@ -22,6 +22,10 @@ $(TEST_GEN_PROGS): $(PROGS) # Common test-unit targets to build common-layout test-cases executables # Needs secondary expansion to properly include the testcase c-file in pre-reqs +COMMON_SOURCES := test_signals.c test_signals_utils.c testcases/testcases.c \ + signals.S +COMMON_HEADERS := test_signals.h test_signals_utils.h testcases/testcases.h + .SECONDEXPANSION: -$(PROGS): test_signals.c test_signals_utils.c testcases/testcases.c signals.S $$@.c test_signals.h test_signals_utils.h testcases/testcases.h - $(CC) $(CFLAGS) $^ -o $@ +$(PROGS): $$@.c ${COMMON_SOURCES} ${COMMON_HEADERS} + $(CC) $(CFLAGS) ${@}.c ${COMMON_SOURCES} -o $@ -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel