Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1128189pxb; Tue, 8 Feb 2022 09:52:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJxsieSSmbXL+iMlXya2wv9y7GD7l5UocOXXeVS/oBrdYjuYgvvIqqECrnT2TleosoM4MDyk X-Received: by 2002:a17:902:e885:: with SMTP id w5mr5640834plg.147.1644342767049; Tue, 08 Feb 2022 09:52:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644342767; cv=none; d=google.com; s=arc-20160816; b=Gh9MzujS7YAB7D8CAC/HIiLXw+b5FWqqppBe7cH5rAbIUcfnOXTLaIglS68ASFlyvy KuKVTCJc0hNTV/rSvQJzGMF6Bm2zD9fa1un9QfoKOL7UqP3nNnebtl+M7gxxewb7v2yT 2iR6z/GK6BnFsjy6uKBg7WD2lLl8tS5aQVp9ozc37bX69hu+3R9bVDUmr8IImIv1qi+S Z0nQWRZ5yn5LMS6ft2n+4PJ4lsjTOzYNGJYyzQAF+jab3jhpj1nR9Tvr9hx/FOQIupi2 SiWtFHJ2/ELKXgPy/iWir4CzWmtMIEulgXr2LO/w8RvYRjmjfVIOqZiyag0oVw8RoCk+ wuCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=LmWrrOJH2Wgz/mgYXNAQkWNWYqSsqBbLsaBKU64gvwk=; b=Jw2IFSKvJPAaOvoQwK47VffvH/eV55o1boYWPaVqlmet+73RBqeFyvuXNuc+SS+4sQ LjfP189M1x7IVkelMttaPaycUjv/os7j9b3YfQtJLQ22wcTw5bwYcvpvQids4TzCS2zp OTUYU1nx4mU1hK9Fh/dTXu9pbKUiz9m942QIBewyGv+XhfnDOlTbb6/E7laesEV3361J GUdY2dqLBiUD/zMMVpiWzlAoa7YHvarW4dTmPsZM4O1gmSmR0XUW1MnvgQYsMw5Mb3bq zF7Ki5FzqCD3jEpUc36yz1RfwMZ0jPUF0In3xZC0tvqEjLjZyZ6Qothbp1U/fCfy/1oE Q7Mw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d17si12746382pls.281.2022.02.08.09.52.32; Tue, 08 Feb 2022 09:52:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379988AbiBHPW6 (ORCPT + 99 others); Tue, 8 Feb 2022 10:22:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233761AbiBHPWz (ORCPT ); Tue, 8 Feb 2022 10:22:55 -0500 Received: from mx1.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EFB4C061576; Tue, 8 Feb 2022 07:22:54 -0800 (PST) Received: from localhost.localdomain (ip5f5aebc2.dynamic.kabel-deutschland.de [95.90.235.194]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 51C0D61E6478B; Tue, 8 Feb 2022 16:22:52 +0100 (CET) From: Paul Menzel To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh Cc: Paul Menzel , Michael Ellerman , linuxppc-dev@lists.ozlabs.org, Song Liu , linux-raid@vger.kernel.org, Matt Brown , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH v2 1/2] lib/raid6/test/Makefile: Use `$(pound)` instead of `\#` for Make 4.3 Date: Tue, 8 Feb 2022 16:21:48 +0100 Message-Id: <20220208152148.48534-1-pmenzel@molgen.mpg.de> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Buidling `raid6test` on Ubuntu 21.10 (ppc64le) with GNU Make 4.3 shows the errors below: $ cd lib/raid6/test/ $ make :1:1: error: stray ‘\’ in program :1:2: error: stray ‘#’ in program :1:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token cp -f ../int.uc int.uc awk -f ../unroll.awk -vN=1 < int.uc > int1.c gcc -I.. -I ../../../include -g -O2 -c -o int1.o int1.c awk -f ../unroll.awk -vN=2 < int.uc > int2.c gcc -I.. -I ../../../include -g -O2 -c -o int2.o int2.c awk -f ../unroll.awk -vN=4 < int.uc > int4.c gcc -I.. -I ../../../include -g -O2 -c -o int4.o int4.c awk -f ../unroll.awk -vN=8 < int.uc > int8.c gcc -I.. -I ../../../include -g -O2 -c -o int8.o int8.c awk -f ../unroll.awk -vN=16 < int.uc > int16.c gcc -I.. -I ../../../include -g -O2 -c -o int16.o int16.c awk -f ../unroll.awk -vN=32 < int.uc > int32.c gcc -I.. -I ../../../include -g -O2 -c -o int32.o int32.c rm -f raid6.a ar cq raid6.a int1.o int2.o int4.o int8.o int16.o int32.o recov.o algos.o tables.o ranlib raid6.a gcc -I.. -I ../../../include -g -O2 -o raid6test test.c raid6.a /usr/bin/ld: raid6.a(algos.o):/dev/shm/linux/lib/raid6/test/algos.c:28: multiple definition of `raid6_call'; /scratch/local/ccIJjN8s.o:/dev/shm/linux/lib/raid6/test/test.c:22: first defined here collect2: error: ld returned 1 exit status make: *** [Makefile:72: raid6test] Error 1 The errors come from the `HAS_ALTIVEC` test, which fails, and the POWER optimized versions are not built. That’s also reason nobody noticed on the other architectures. GNU Make 4.3 does not remove the backslash anymore. From the 4.3 release announcment: > * WARNING: Backward-incompatibility! > Number signs (#) appearing inside a macro reference or function invocation > no longer introduce comments and should not be escaped with backslashes: > thus a call such as: > foo := $(shell echo '#') > is legal. Previously the number sign needed to be escaped, for example: > foo := $(shell echo '\#') > Now this latter will resolve to "\#". If you want to write makefiles > portable to both versions, assign the number sign to a variable: > H := \# > foo := $(shell echo '$H') > This was claimed to be fixed in 3.81, but wasn't, for some reason. > To detect this change search for 'nocomment' in the .FEATURES variable. So, do the same as commit 9564a8cf422d ("Kbuild: fix # escaping in .cmd files for future Make") and commit 929bef467771 ("bpf: Use $(pound) instead of \# in Makefiles") and define and use a `$(pound)` variable. Reference for the change in make: https://git.savannah.gnu.org/cgit/make.git/commit/?id=c6966b323811c37acedff05b57 Cc: Matt Brown Signed-off-by: Paul Menzel --- v2: Fix checkpatch.pl errors by adding missing quotes around git commit message summary/title. lib/raid6/test/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/raid6/test/Makefile b/lib/raid6/test/Makefile index a4c7cd74cff5..4fb7700a741b 100644 --- a/lib/raid6/test/Makefile +++ b/lib/raid6/test/Makefile @@ -4,6 +4,8 @@ # from userspace. # +pound := \# + CC = gcc OPTFLAGS = -O2 # Adjust as desired CFLAGS = -I.. -I ../../../include -g $(OPTFLAGS) @@ -42,7 +44,7 @@ else ifeq ($(HAS_NEON),yes) OBJS += neon.o neon1.o neon2.o neon4.o neon8.o recov_neon.o recov_neon_inner.o CFLAGS += -DCONFIG_KERNEL_MODE_NEON=1 else - HAS_ALTIVEC := $(shell printf '\#include \nvector int a;\n' |\ + HAS_ALTIVEC := $(shell printf '$(pound)include \nvector int a;\n' |\ gcc -c -x c - >/dev/null && rm ./-.o && echo yes) ifeq ($(HAS_ALTIVEC),yes) CFLAGS += -I../../../arch/powerpc/include -- 2.34.1