|
| 1 | +From ec88adb782aed38c3445c20d20213c51dae7e092 Mon Sep 17 00:00:00 2001 |
| 2 | +From: InterLinked1 < [email protected]> |
| 3 | +Date: Fri, 21 Feb 2025 21:42:19 -0500 |
| 4 | +Subject: [PATCH] Kbuild: Use ccflags-y instead of EXTRA_CFLAGS. |
| 5 | + |
| 6 | +ccflags-y was added to the kernel back in 2007, in commit |
| 7 | +f77bf01425b11947eeb3b5b54. Recent kernel commit |
| 8 | +dbd83ea09699390892e5efecddd74ae43a00f071 has now completely |
| 9 | +removed the deprecated EXTRA_CFLAGS. |
| 10 | + |
| 11 | +Comments in Kbuild and the Makefile for the oct612x library were |
| 12 | +added back when it was created in 2013 in commit f65299e8b2e6ffb0b07089759f8c4ff33a695c09 |
| 13 | +to use the newer ccflags-y based on the kernel version, |
| 14 | +but the change was never made to conditionally move away |
| 15 | +from the EXTRA_CFLAGS. |
| 16 | + |
| 17 | +Now that the older way no longer exists, always use ccflags-y. |
| 18 | + |
| 19 | +Resolves: #76 |
| 20 | +--- |
| 21 | + drivers/dahdi/Kbuild | 4 ++-- |
| 22 | + drivers/dahdi/oct612x/Kbuild | 5 +---- |
| 23 | + drivers/dahdi/oct612x/Makefile | 5 +---- |
| 24 | + drivers/dahdi/opvxa1200/Kbuild | 6 +++--- |
| 25 | + drivers/dahdi/voicebus/Kbuild | 4 ++-- |
| 26 | + drivers/dahdi/wcb4xxp/Kbuild | 2 +- |
| 27 | + drivers/dahdi/wct4xxp/Kbuild | 6 +++--- |
| 28 | + drivers/dahdi/wctc4xxp/Kbuild | 4 ++-- |
| 29 | + drivers/dahdi/wctdm24xxp/Kbuild | 2 +- |
| 30 | + drivers/dahdi/wcte12xp/Kbuild | 2 +- |
| 31 | + drivers/dahdi/xpp/Kbuild | 4 ++-- |
| 32 | + 11 files changed, 19 insertions(+), 25 deletions(-) |
| 33 | + |
| 34 | +--- a/drivers/dahdi/Kbuild |
| 35 | ++++ b/drivers/dahdi/Kbuild |
| 36 | +@@ -83,13 +83,13 @@ CFLAGS_MODULE += -I$(DAHDI_INCLUDE) -I$( |
| 37 | + BAD_KERNELS_VERS := 22 34 34.0.1 34.0.2 |
| 38 | + BAD_KERNELS := $(foreach ver,$(BAD_KERNELS_VERS),2.6.9-$(ver).EL 2.6.9-$(ver).ELsmp) |
| 39 | + ifneq (,$(filter $(KVERS),$(BAD_KERNELS))) |
| 40 | +-EXTRA_CFLAGS+=-Drw_lock_t=rwlock_t |
| 41 | ++ccflags-y+=-Drw_lock_t=rwlock_t |
| 42 | + endif |
| 43 | + |
| 44 | + # A number of Fedora 10 (9 also?) kernels backported hrtimer to 2.6.27 |
| 45 | + # as part of an ALSA backport. TODO: Any better way to detect that? |
| 46 | + ifeq (1,$(shell fgrep -q ' hrtimer_set_expires' include/linux/hrtimer.h 2>/dev/null && echo 1)) |
| 47 | +-EXTRA_CFLAGS+=-DHAVE_HRTIMER_ACCESSORS=1 |
| 48 | ++ccflags-y+=-DHAVE_HRTIMER_ACCESSORS=1 |
| 49 | + endif |
| 50 | + |
| 51 | + ifeq (1,$(shell fgrep -q 'wait_for_completion_timeout' include/linux/completion.h 2>/dev/null && echo 1)) |
| 52 | +--- a/drivers/dahdi/oct612x/Kbuild |
| 53 | ++++ b/drivers/dahdi/oct612x/Kbuild |
| 54 | +@@ -24,9 +24,6 @@ octapi_files = octdeviceapi/oct6100api/o |
| 55 | + apilib/llman/octapi_llman.o \ |
| 56 | + oct612x-user.o |
| 57 | + |
| 58 | +-# TODO: ccflags was added in 2.6.24 in commit f77bf01425b11947eeb3b5b54. This |
| 59 | +-# should be changed to a conditional compilation based on the Kernel Version. |
| 60 | +-# ccflags-y := -I$(src)/.. -Wno-undef -I$(src)/include -I$(src)/octdeviceapi -I$(src)/octdeviceapi/oct6100api |
| 61 | +-EXTRA_CFLAGS = -I$(src)/.. -Wno-undef -I$(src)/include -I$(src)/octdeviceapi -I$(src)/octdeviceapi/oct6100api |
| 62 | ++ccflags-y := -I$(src)/.. -Wno-undef -I$(src)/include -I$(src)/octdeviceapi -I$(src)/octdeviceapi/oct6100api |
| 63 | + obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_OCT612X) := oct612x.o |
| 64 | + oct612x-objs := $(octapi_files) |
| 65 | +--- a/drivers/dahdi/oct612x/Makefile |
| 66 | ++++ b/drivers/dahdi/oct612x/Makefile |
| 67 | +@@ -23,8 +23,5 @@ octapi_files = octdeviceapi/oct6100api/o |
| 68 | + apilib/largmath/octapi_largmath.o \ |
| 69 | + apilib/llman/octapi_llman.o |
| 70 | + |
| 71 | +-# TODO: ccflags was added in 2.6.24 in commit f77bf01425b11947eeb3b5b54. This |
| 72 | +-# should be changed to a conditional compilation based on the Kernel Version. |
| 73 | +-# ccflags-y := -I$(src)/.. -Wno-undef -I$(src)/include -I$(src)/octdeviceapi -I$(src)/octdeviceapi/oct6100api |
| 74 | +-EXTRA_CFLAGS = -I$(src)/.. -Wno-undef -I$(src)/include -I$(src)/octdeviceapi -I$(src)/octdeviceapi/oct6100api |
| 75 | ++ccflags-y := -I$(src)/.. -Wno-undef -I$(src)/include -I$(src)/octdeviceapi -I$(src)/octdeviceapi/oct6100api |
| 76 | + lib-y := $(octapi_files) |
| 77 | +--- a/drivers/dahdi/opvxa1200/Kbuild |
| 78 | ++++ b/drivers/dahdi/opvxa1200/Kbuild |
| 79 | +@@ -1,6 +1,6 @@ |
| 80 | + obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_OPVXA1200) += opvxa1200.o |
| 81 | + |
| 82 | +-EXTRA_CFLAGS += -I$(src)/.. -Wno-undef -Wno-error=unused-variable |
| 83 | ++ccflags-y += -I$(src)/.. -Wno-undef |
| 84 | + |
| 85 | + opvxa1200-objs := base.o |
| 86 | + |
| 87 | +@@ -10,10 +10,10 @@ ifneq ($(DAHDI_KERNEL_H_PATH),) |
| 88 | + DAHDI_SPAN_MODULE:=$(shell if grep -C 5 "struct dahdi_span {" $(DAHDI_KERNEL_H_PATH) | grep -q "struct module \*owner"; then echo "yes"; else echo "no"; fi) |
| 89 | + DAHDI_SPAN_OPS:=$(shell if grep -q "struct dahdi_span_ops {" $(DAHDI_KERNEL_H_PATH); then echo "yes"; else echo "no"; fi) |
| 90 | + ifeq ($(DAHDI_SPAN_MODULE),yes) |
| 91 | +- EXTRA_CFLAGS+=-DDAHDI_SPAN_MODULE |
| 92 | ++ ccflags-y+=-DDAHDI_SPAN_MODULE |
| 93 | + else |
| 94 | + ifeq ($(DAHDI_SPAN_OPS),yes) |
| 95 | +- EXTRA_CFLAGS+=-DDAHDI_SPAN_OPS |
| 96 | ++ ccflags-y+=-DDAHDI_SPAN_OPS |
| 97 | + endif |
| 98 | + endif |
| 99 | + endif |
| 100 | +--- a/drivers/dahdi/voicebus/Kbuild |
| 101 | ++++ b/drivers/dahdi/voicebus/Kbuild |
| 102 | +@@ -8,10 +8,10 @@ ifneq ($(HOTPLUG_FIRMWARE),yes) |
| 103 | + dahdi_voicebus-objs += $(FIRM_DIR)/dahdi-fw-vpmoct032.o |
| 104 | + $(warning WARNING: You are compiling firmware into voicebus.ko which is not available under the terms of the GPL. It may be a violation of the GPL to distribute the resulting image since it combines both GPL and non-GPL work. You should consult a lawyer of your own before distributing such an image.) |
| 105 | + else |
| 106 | +- EXTRA_CFLAGS+=-DHOTPLUG_FIRMWARE |
| 107 | ++ ccflags-y+=-DHOTPLUG_FIRMWARE |
| 108 | + endif |
| 109 | + |
| 110 | +-EXTRA_CFLAGS += -I$(src)/.. -Wno-undef |
| 111 | ++ccflags-y += -I$(src)/.. -Wno-undef |
| 112 | + |
| 113 | + $(obj)/$(FIRM_DIR)/dahdi-fw-vpmoct032.o: $(obj)/voicebus.o |
| 114 | + $(MAKE) -C $(obj)/$(FIRM_DIR) dahdi-fw-vpmoct032.o |
| 115 | +--- a/drivers/dahdi/wcb4xxp/Kbuild |
| 116 | ++++ b/drivers/dahdi/wcb4xxp/Kbuild |
| 117 | +@@ -1,6 +1,6 @@ |
| 118 | + obj-m += wcb4xxp.o |
| 119 | + |
| 120 | +-EXTRA_CFLAGS += -I$(src)/.. -Wno-undef |
| 121 | ++ccflags-y += -I$(src)/.. -Wno-undef |
| 122 | + |
| 123 | + wcb4xxp-objs := base.o |
| 124 | + |
| 125 | +--- a/drivers/dahdi/wct4xxp/Kbuild |
| 126 | ++++ b/drivers/dahdi/wct4xxp/Kbuild |
| 127 | +@@ -2,16 +2,16 @@ obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCT |
| 128 | + |
| 129 | + FIRM_DIR := ../firmware |
| 130 | + |
| 131 | +-EXTRA_CFLAGS += -I$(src)/.. -I$(src)/../oct612x/ $(shell $(src)/../oct612x/octasic-helper cflags $(src)/../oct612x) -Wno-undef |
| 132 | ++ccflags-y += -I$(src)/.. -I$(src)/../oct612x/ $(shell $(src)/../oct612x/octasic-helper cflags $(src)/../oct612x) -Wno-undef |
| 133 | + |
| 134 | + # The OCT612X source files are from a vendor drop and we do not want to edit |
| 135 | + # them to make this warning go away. Therefore, turn off the |
| 136 | + # unused-but-set-variable warning for this driver. |
| 137 | + |
| 138 | +-EXTRA_CFLAGS += $(call cc-option, -Wno-unused-but-set-variable) |
| 139 | ++ccflags-y += $(call cc-option, -Wno-unused-but-set-variable) |
| 140 | + |
| 141 | + ifeq ($(HOTPLUG_FIRMWARE),yes) |
| 142 | +- EXTRA_CFLAGS+=-DHOTPLUG_FIRMWARE |
| 143 | ++ ccflags-y+=-DHOTPLUG_FIRMWARE |
| 144 | + endif |
| 145 | + |
| 146 | + wct4xxp-objs := base.o vpm450m.o |
| 147 | +--- a/drivers/dahdi/wctc4xxp/Kbuild |
| 148 | ++++ b/drivers/dahdi/wctc4xxp/Kbuild |
| 149 | +@@ -2,10 +2,10 @@ obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCT |
| 150 | + |
| 151 | + FIRM_DIR := ../firmware |
| 152 | + |
| 153 | +-EXTRA_CFLAGS += -I$(src)/.. -Wno-undef |
| 154 | ++ccflags-y += -I$(src)/.. -Wno-undef |
| 155 | + |
| 156 | + ifeq ($(HOTPLUG_FIRMWARE),yes) |
| 157 | +- EXTRA_CFLAGS+=-DHOTPLUG_FIRMWARE |
| 158 | ++ ccflags-y+=-DHOTPLUG_FIRMWARE |
| 159 | + endif |
| 160 | + |
| 161 | + wctc4xxp-objs := base.o |
| 162 | +--- a/drivers/dahdi/wctdm24xxp/Kbuild |
| 163 | ++++ b/drivers/dahdi/wctdm24xxp/Kbuild |
| 164 | +@@ -1,5 +1,5 @@ |
| 165 | + obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTDM24XXP) += wctdm24xxp.o |
| 166 | + |
| 167 | +-EXTRA_CFLAGS += -I$(src)/.. -Wno-undef |
| 168 | ++ccflags-y += -I$(src)/.. -Wno-undef |
| 169 | + |
| 170 | + wctdm24xxp-objs := base.o xhfc.o |
| 171 | +--- a/drivers/dahdi/wcte12xp/Kbuild |
| 172 | ++++ b/drivers/dahdi/wcte12xp/Kbuild |
| 173 | +@@ -1,5 +1,5 @@ |
| 174 | + obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTE12XP) += wcte12xp.o |
| 175 | + |
| 176 | +-EXTRA_CFLAGS += -I$(src)/.. -Wno-undef |
| 177 | ++ccflags-y += -I$(src)/.. -Wno-undef |
| 178 | + |
| 179 | + wcte12xp-objs := base.o |
| 180 | +--- a/drivers/dahdi/xpp/Kbuild |
| 181 | ++++ b/drivers/dahdi/xpp/Kbuild |
| 182 | +@@ -1,4 +1,4 @@ |
| 183 | +-EXTRA_CFLAGS = $(XPP_LOCAL_CFLAGS) \ |
| 184 | ++ccflags-y = $(XPP_LOCAL_CFLAGS) \ |
| 185 | + -DDEBUG \ |
| 186 | + -DPOLL_DIGITAL_INPUTS \ |
| 187 | + -DDEBUG_PCMTX \ |
| 188 | +@@ -32,7 +32,7 @@ xpd_echo-objs += card_echo.o |
| 189 | + xpp_mmap-objs += mmapbus.o mmapdrv.o |
| 190 | + |
| 191 | + ifeq (y,$(PARPORT_DEBUG)) |
| 192 | +-EXTRA_CFLAGS += -DDEBUG_SYNC_PARPORT |
| 193 | ++ccflags-y += -DDEBUG_SYNC_PARPORT |
| 194 | + obj-m += parport_debug.o |
| 195 | + endif |
| 196 | + |
0 commit comments