]> git.baikalelectronics.ru Git - kernel.git/commit
lib/raid6/test/Makefile: Use $(pound) instead of \# for Make 4.3
authorPaul Menzel <pmenzel@molgen.mpg.de>
Tue, 8 Feb 2022 15:21:48 +0000 (16:21 +0100)
committerSong Liu <song@kernel.org>
Tue, 8 Mar 2022 23:20:21 +0000 (15:20 -0800)
commitff04a072653a94f115daec73f5937021e9f9bb20
tree494bb06d11a65b7a151c62632aefad4ebc78e482
parent8a6a0cc3c2c0f31d1dfab6fa4594b5601669c1ea
lib/raid6/test/Makefile: Use $(pound) instead of \# for Make 4.3

Buidling raid6test on Ubuntu 21.10 (ppc64le) with GNU Make 4.3 shows the
errors below:

    $ cd lib/raid6/test/
    $ make
    <stdin>:1:1: error: stray ‘\’ in program
    <stdin>:1:2: error: stray ‘#’ in program
    <stdin>:1:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ \
        before ‘<’ token

    [...]

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 a9a62b426c5b ("Kbuild: fix # escaping in .cmd
files for future Make") and commit 70ea19c5829e ("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 <matthew.brown.dev@gmail.com>
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Song Liu <song@kernel.org>
lib/raid6/test/Makefile