From eca711bb64a7c806ae34c8483cac73fe22b0104f Mon Sep 17 00:00:00 2001 From: Guangyao Ma Date: Tue, 15 Jun 2021 19:45:17 +0800 Subject: [PATCH] fix: avoid compile warning ignored Close #I3VOAO Change-Id: I42103e0e7061e50f8d63df98ea9f5cecd49fe6f4 Signed-off-by: Guangyao Ma --- apps/config.mk | 2 +- build.sh | 12 ++++++------ kernel/extended/vdso/usr/Makefile | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/apps/config.mk b/apps/config.mk index 6f08d019..3fda230a 100644 --- a/apps/config.mk +++ b/apps/config.mk @@ -37,7 +37,7 @@ LIBSOUT := $(OBJOUT)/libs IMGOUT := $(OUT) # common flags config -BASE_OPTS := -ffunction-sections -fdata-sections -fno-omit-frame-pointer -D_GNU_SOURCE \ +BASE_OPTS := -ffunction-sections -fdata-sections -fno-omit-frame-pointer -fno-common -fno-strict-aliasing -D_GNU_SOURCE \ $(LITEOS_SSP) $(LITEOS_CORE_COPTS) $(WARNING_AS_ERROR) $(LLVM_EXTRA_OPTS) $(LITEOS_GCOV_OPTS) CFLAGS := -std=c99 -fno-exceptions $(BASE_OPTS) $(LITEOS_COPTS_OPTMIZE) diff --git a/build.sh b/build.sh index 4475a50a..41f4ddae 100755 --- a/build.sh +++ b/build.sh @@ -38,22 +38,22 @@ outdir="../..$3/test_info/gen/kernel/test" if [ "$5" = "tee" ]; then tee="_tee" fi -productName="$(basename $7)" -source="tools/build/config/${productName}_release.config" +product_name="$(basename $7)" +source="tools/build/config/${product_name}_release.config" if [ "$2" = "clang" ]; then if [ "$4" = "debug" ]; then - config_file="${productName}_$2$tee.config" + config_file="${product_name}_$2$tee.config" source="tools/build/config/debug/$config_file" else - config_file="${productName}_$2_release$tee.config" + config_file="${product_name}_$2_release$tee.config" source="tools/build/config/$config_file" fi elif [ "$2" = "gcc" ]; then if [ "$4" = "debug" ]; then - config_file="${productName}_debug_shell$tee.config" + config_file="${product_name}_debug_shell$tee.config" source="tools/build/config/$config_file" else - config_file="${productName}_release$tee.config" + config_file="${product_name}_release$tee.config" source="tools/build/config/$config_file" fi fi diff --git a/kernel/extended/vdso/usr/Makefile b/kernel/extended/vdso/usr/Makefile index aac0727e..f4bef985 100644 --- a/kernel/extended/vdso/usr/Makefile +++ b/kernel/extended/vdso/usr/Makefile @@ -37,7 +37,8 @@ VDSO_INCLUDE := -I $(LITEOSTOPDIR)/kernel/extended/vdso/include \ -I $(LITEOSTOPDIR)/kernel/common \ -I $(LITEOSTOPDIR)/bsd/compat/linuxkpi/include -VDSO_CCFLAGS := -nostdlib -fPIC $(LITEOS_SSP) $(LITEOS_CORE_COPTS) $(WARNING_AS_ERROR) $(LITEOS_COPTS_OPTMIZE) +VDSO_CCFLAGS := -nostdlib -fPIC -fno-common -fno-strict-aliasing \ + $(LITEOS_SSP) $(LITEOS_CORE_COPTS) $(WARNING_AS_ERROR) $(LITEOS_COPTS_OPTMIZE) ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y) VDSO_CCFLAGS += $(LLVM_EXTRA_OPTS) --sysroot=$(LITEOSTOPDIR)/../../prebuilts/lite/sysroot/ endif