From 1a8027d6250dc7bf2156e293d453a611cd8dce35 Mon Sep 17 00:00:00 2001 From: cuiziwei Date: Mon, 21 Aug 2023 15:39:49 +0800 Subject: [PATCH] nuttx/arch:add -Wno-psabi to Toolchain.defs Signed-off-by: cuiziwei --- arch/arm/src/common/Toolchain.defs | 9 +++++++++ arch/arm64/src/Toolchain.defs | 9 +++++++++ arch/risc-v/src/common/Toolchain.defs | 9 +++++++++ arch/xtensa/src/lx6/Toolchain.defs | 9 +++++++++ arch/xtensa/src/lx7/Toolchain.defs | 9 +++++++++ 5 files changed, 45 insertions(+) diff --git a/arch/arm/src/common/Toolchain.defs b/arch/arm/src/common/Toolchain.defs index 618ed630ff0..0beabaf4aa6 100644 --- a/arch/arm/src/common/Toolchain.defs +++ b/arch/arm/src/common/Toolchain.defs @@ -270,6 +270,15 @@ endif ARCHCFLAGS += -Wstrict-prototypes -Wno-attributes -Wno-unknown-pragmas ARCHCXXFLAGS += -nostdinc++ -Wno-attributes -Wno-unknown-pragmas +# When all C++ code is built using GCC 7.1 or a higher version, +# we can safely disregard warnings of the type "parameter passing for X changed in GCC 7.1." +# Refer to : https://stackoverflow.com/questions/48149323/what-does-the-gcc-warning-project-parameter-passing-for-x-changed-in-gcc-7-1-m + +ifneq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),y) + ARCHCFLAGS += -Wno-psabi + ARCHCXXFLAGS += -Wno-psabi +endif + ifneq ($(CONFIG_CXX_STANDARD),) ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD) endif diff --git a/arch/arm64/src/Toolchain.defs b/arch/arm64/src/Toolchain.defs index 832565c28f4..c8ab501e555 100644 --- a/arch/arm64/src/Toolchain.defs +++ b/arch/arm64/src/Toolchain.defs @@ -95,6 +95,15 @@ ARCHCXXFLAGS += -fno-common -nostdinc++ ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef -Werror -Wno-attributes -Wno-unknown-pragmas ARCHCXXFLAGS += -Wall -Wshadow -Wundef -Wno-attributes -Wno-unknown-pragmas +# When all C++ code is built using GCC 7.1 or a higher version, +# we can safely disregard warnings of the type "parameter passing for X changed in GCC 7.1." +# Refer to : https://stackoverflow.com/questions/48149323/what-does-the-gcc-warning-project-parameter-passing-for-x-changed-in-gcc-7-1-m + +ifneq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),y) + ARCHCFLAGS += -Wno-psabi + ARCHCXXFLAGS += -Wno-psabi +endif + ifneq ($(CONFIG_CXX_STANDARD),) ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD) endif diff --git a/arch/risc-v/src/common/Toolchain.defs b/arch/risc-v/src/common/Toolchain.defs index 0f0270b347d..9032d5a89d1 100644 --- a/arch/risc-v/src/common/Toolchain.defs +++ b/arch/risc-v/src/common/Toolchain.defs @@ -83,6 +83,15 @@ ARCHCXXFLAGS += -fno-common -nostdinc++ ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef -Wno-attributes -Wno-unknown-pragmas ARCHCXXFLAGS += -Wall -Wshadow -Wundef -Wno-attributes -Wno-unknown-pragmas +# When all C++ code is built using GCC 7.1 or a higher version, +# we can safely disregard warnings of the type "parameter passing for X changed in GCC 7.1." +# Refer to : https://stackoverflow.com/questions/48149323/what-does-the-gcc-warning-project-parameter-passing-for-x-changed-in-gcc-7-1-m + +ifneq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),y) + ARCHCFLAGS += -Wno-psabi + ARCHCXXFLAGS += -Wno-psabi +endif + ifneq ($(CONFIG_CXX_STANDARD),) ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD) endif diff --git a/arch/xtensa/src/lx6/Toolchain.defs b/arch/xtensa/src/lx6/Toolchain.defs index e1258773da2..7e18245d011 100644 --- a/arch/xtensa/src/lx6/Toolchain.defs +++ b/arch/xtensa/src/lx6/Toolchain.defs @@ -93,6 +93,15 @@ ARCHCXXFLAGS += -fno-common -nostdinc++ ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef -Wno-attributes -Wno-unknown-pragmas ARCHCXXFLAGS += -Wall -Wshadow -Wundef -Wno-attributes -Wno-unknown-pragmas +# When all C++ code is built using GCC 7.1 or a higher version, +# we can safely disregard warnings of the type "parameter passing for X changed in GCC 7.1." +# Refer to : https://stackoverflow.com/questions/48149323/what-does-the-gcc-warning-project-parameter-passing-for-x-changed-in-gcc-7-1-m + +ifneq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),y) + ARCHCFLAGS += -Wno-psabi + ARCHCXXFLAGS += -Wno-psabi +endif + ifneq ($(CONFIG_CXX_STANDARD),) ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD) endif diff --git a/arch/xtensa/src/lx7/Toolchain.defs b/arch/xtensa/src/lx7/Toolchain.defs index f8719643fe6..cc93a0c1bfd 100644 --- a/arch/xtensa/src/lx7/Toolchain.defs +++ b/arch/xtensa/src/lx7/Toolchain.defs @@ -97,6 +97,15 @@ ARCHCXXFLAGS += -fno-common -nostdinc++ ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef -Wno-attributes -Wno-unknown-pragmas ARCHCXXFLAGS += -Wall -Wshadow -Wundef -Wno-attributes -Wno-unknown-pragmas +# When all C++ code is built using GCC 7.1 or a higher version, +# we can safely disregard warnings of the type "parameter passing for X changed in GCC 7.1." +# Refer to : https://stackoverflow.com/questions/48149323/what-does-the-gcc-warning-project-parameter-passing-for-x-changed-in-gcc-7-1-m + +ifneq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),y) + ARCHCFLAGS += -Wno-psabi + ARCHCXXFLAGS += -Wno-psabi +endif + ifneq ($(CONFIG_CXX_STANDARD),) ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD) endif