Patch "kselftest/arm64: Don't pass headers to the compiler as source" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    kselftest/arm64: Don't pass headers to the compiler as source

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     kselftest-arm64-don-t-pass-headers-to-the-compiler-a.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 3674998b7b9890516fff02e22e9b73a4ae53a643
Author: Mark Brown <broonie@xxxxxxxxxx>
Date:   Thu Jan 12 19:51:49 2023 +0000

    kselftest/arm64: Don't pass headers to the compiler as source
    
    [ Upstream commit a884f7970e57aef78c6011561e29d238e46b3a9f ]
    
    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 <broonie@xxxxxxxxxx>
    Reviewed-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230111-arm64-kselftest-clang-v1-3-89c69d377727@xxxxxxxxxx
    Signed-off-by: Catalin Marinas <catalin.marinas@xxxxxxx>
    Stable-dep-of: 5225b6562b9a ("kselftest/arm64: signal: fix/refactor SVE vector length enumeration")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/testing/selftests/arm64/signal/Makefile b/tools/testing/selftests/arm64/signal/Makefile
index be7520a863b03..8f5febaf1a9a2 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 $@




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux