@@ -82,52 +82,37 @@ export TCL840 := 1
8282# Common CFLAGS
8383CFGFLAGS += -DUSE_LINUX_BDE_MMAP=1
8484#CFGFLAGS += -DBDE_LINUX_USE_MSI_INTERRUPT
85- OPT_CFLAGS += -Wno-error=unused-value
86- OPT_CFLAGS += -Wno-error=unused-function
87- OPT_CFLAGS += -Wno-error=cpp
88- OPT_CFLAGS += -Wno-error=array-bounds
89- OPT_CFLAGS += -Wno-error=strict-overflow
85+ ifneq (1,$(USE_CLANG))
9086CFLAGS += -L$(TOOLCHAIN_DIR)/lib
9187CFLAGS += -L$(TOOLCHAIN_DIR)/lib64
88+ endif
9289#OPT_CFLAGS += -Wl,--rpath=/lib64 # may need to set rpath and dynamic-linker path here (and possibly in KLFAGS below) in the future, #
9390#OPT_CFLAGS += -Wl,--dynamic-linker=/lib64/ld-linux-x86-64.so.2 # if we want to build the target executable to be used with shared libs #
9491
92+ # Needed for a warning in src/soc/phy/fcmap/src/bfcmap88060_a0.c that can't be
93+ # fixed because of a Montreal2 FW dependency
94+ ifeq ($(LOCALDIR),src/soc/phy/fcmap/src)
95+ OPT_CFLAGS += -Wno-address-of-packed-member
96+ endif
97+
9598# Compiler-specific CFLAGS
9699ifeq (1,$(USE_CLANG)) # CLANG-specific CFLAGS
97- OPT_CFLAGS += -Wno-strlcpy-strlcat-size
98- OPT_CFLAGS += -Wno-strncat-size
99100ifeq "$(shell expr $(CROSS_GCC_VER_MAJOR) \>= 12)" "1"
100101 export LIBNSL_DEPRECATED := 1
101102endif
102103else # GCC-specific CFLAGS
103- OPT_CFLAGS += -Wno-error=unused-but-set-variable
104- OPT_CFLAGS += -Wno-error=maybe-uninitialized
105- OPT_CFLAGS += -Wno-error=aggressive-loop-optimizations
106- OPT_CFLAGS += -Wno-error=sizeof-pointer-div #SDK-233830
107- OPT_CFLAGS += -Wno-error=memset-elt-size #SDK-232626
108- OPT_CFLAGS += -Wno-error=unused-variable #SDK-232993
109- OPT_CFLAGS += -Wno-deprecated-declarations #SDK-233174
110104ifeq "$(shell expr $(CROSS_GCC_VER_MAJOR) \>= 8)" "1"
111- OPT_CFLAGS += -Wno-stringop-overflow
112- OPT_CFLAGS += -Wno-stringop-truncation
113- OPT_CFLAGS += -Wno-error=restrict
114105endif
115106ifeq "$(shell expr $(CROSS_GCC_VER_MAJOR) \>= 9)" "1"
116- OPT_CFLAGS += -Wno-address-of-packed-member
117107endif
118108ifeq "$(shell expr $(CROSS_GCC_VER_MAJOR) \>= 10)" "1"
119- OPT_CFLAGS += -Wno-error=uninitialized
120- OPT_CFLAGS += -Wno-error=format-overflow
121109 CFLAGS += -fcommon
122- OPT_CFLAGS += -Wno-zero-length-bounds
123110endif
124111ifeq "$(shell expr $(CROSS_GCC_VER_MAJOR) \>= 12)" "1"
125112 CFLAGS += -flarge-source-files
126- OPT_CFLAGS += -Wno-error=address
127113 export LIBNSL_DEPRECATED := 1
128114endif
129115ifeq "$(shell expr $(CROSS_GCC_VER_MAJOR) \>= 13)" "1"
130- OPT_CFLAGS += -Wno-error=enum-int-mismatch
131116 CFLAGS += -fcf-protection
132117endif
133118endif # Compiler-specific CFLAGS
@@ -137,9 +122,9 @@ CFGFLAGS += -fgnu89-inline
137122
138123# set up KFLAGS appropriately. #
139124ifeq (,$(KFLAGS))
140- KFLAGS := -L$(TOOLCHAIN_DIR)/lib -L$(TOOLCHAIN_DIR)/lib64 - I$(KERNDIR) -lc -nostdinc -isystem $(SYSINC) -Iinclude -I$(KERNDIR)/arch/x86/include -I$(KERNDIR)/arch/x86/include/generated -I$(KERNDIR)/arch/x86/include/generated/uapi -I$(KERNDIR)/arch/x86/include/uapi -I$(KERNDIR)/include -I$(KERNDIR)/include/generated -I$(KERNDIR)/include/generated/uapi -I$(KERNDIR)/include/uapi -include $(KERNDIR)/include/generated/autoconf.h -D__KERNEL__ -DNDEBUG -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Wno-format-security -fno-delete-null-pointer-checks -Os -mno-sse -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -fstack-protector -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign -fno-dwarf2-cfi-asm
125+ KFLAGS := -I$(KERNDIR) -nostdinc -isystem $(SYSINC) -Iinclude -I$(KERNDIR)/arch/x86/include -I$(KERNDIR)/arch/x86/include/generated -I$(KERNDIR)/arch/x86/include/generated/uapi -I$(KERNDIR)/arch/x86/include/uapi -I$(KERNDIR)/include -I$(KERNDIR)/include/generated -I$(KERNDIR)/include/generated/uapi -I$(KERNDIR)/include/uapi -include $(KERNDIR)/include/generated/autoconf.h -D__KERNEL__ -DNDEBUG -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Wno-format-security -fno-delete-null-pointer-checks -Os -mno-sse -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -fstack-protector -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign -fno-dwarf2-cfi-asm
141126ifneq (1,$(USE_CLANG))
142- KFLAGS += -funit-at-a-time -maccumulate-outgoing-args -fconserve-stack
127+ KFLAGS += -L$(TOOLCHAIN_DIR)/lib -L$(TOOLCHAIN_DIR)/lib64 -lc - funit-at-a-time -maccumulate-outgoing-args -fconserve-stack
143128else
144129KFLAGS += -fno-pie
145130endif
0 commit comments