mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-05 14:59:55 +00:00
wifi-test-suite: Fix compile issue
- Variables such as CC, CXX and related variables are usually assigned in core class like gcc.bbclass. For example, CC is assigned this specific value:
CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
If you use the += operator to add flags to the CC variable early in your recipe, your changes will be overwritten and lost because BitBake applies class assignments to CC at a later stage, which replaces any previous modifications.
We should use :append operation to ensures that additions are applied to the final value, after all assignments from core classes have been processed. As a result, when you want to extend variables that may be set in core classes (like CC in gcc.bbclass), you should use the :append syntax to guarantee your changes are preserved in the final build environment.
- Using CFLAGS is the standard way to pass compiler flag for C projects.
- The Makefile of the project doesn't respect to append to CFLAGS so added 0006-make-CFLAGS-appendable.patch to make CFLAGS appendable.
Signed-off-by: Alper Ak <alperyasinak1@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
From ef4ead927f69452c95b80e5bf042f67897f67e9d Mon Sep 17 00:00:00 2001
|
||||
From: Alper Ak <alperyasinak1@gmail.com>
|
||||
Date: Mon, 23 Jun 2025 15:46:37 +0300
|
||||
Subject: [PATCH] Allow extra CFLAGS via EXTRA_CFLAGS variable
|
||||
|
||||
This patch introduces an EXTRA_CFLAGS variable to the Makefile, which is
|
||||
appended to CFLAGS. This allows users or external build systems to pass
|
||||
their additional compiler flags.
|
||||
|
||||
Upstream-Status: Submitted [https://github.com/Wi-FiTestSuite/Wi-FiTestSuite-Linux-DUT/pull/61]
|
||||
|
||||
Signed-off-by: Alper Ak <alperyasinak1@gmail.com>
|
||||
---
|
||||
Makefile.inc | 15 ++++++++-------
|
||||
1 file changed, 8 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/Makefile.inc b/Makefile.inc
|
||||
index 0094bdf..76729b9 100644
|
||||
--- a/Makefile.inc
|
||||
+++ b/Makefile.inc
|
||||
@@ -22,28 +22,29 @@ UCC=ucc
|
||||
CON=console_src
|
||||
WTG=WTGService
|
||||
MAKE?=make
|
||||
+EXTRA_CFLAGS ?=
|
||||
|
||||
# This is for WMM-PS
|
||||
#for Ext TG
|
||||
-#CFLAGS = -g -O2 -D_REENTRANT -DWFA_WMM_PS_EXT -Wall -I../inc
|
||||
+#CFLAGS = -g -O2 -D_REENTRANT -DWFA_WMM_PS_EXT -Wall -I../inc ${EXTRA_CFLAGS}
|
||||
|
||||
## for WMM-AC, WMM-PS, Voice, PMF, TDLS Test-Bed
|
||||
-#CFLAGS = -g -O2 -D_REENTRANT -DWFA_WMM_PS_EXT -DWFA_WMM_AC -DWFA_VOICE_EXT -DWFA_STA_TB -Wall -I../inc
|
||||
+#CFLAGS = -g -O2 -D_REENTRANT -DWFA_WMM_PS_EXT -DWFA_WMM_AC -DWFA_VOICE_EXT -DWFA_STA_TB -Wall -I../inc ${EXTRA_CFLAGS}
|
||||
|
||||
## for WMM-AC, WMM-PS Test-Bed
|
||||
-#CFLAGS = -g -O2 -D_REENTRANT -DWFA_WMM_PS_EXT -DWFA_WMM_AC -DWFA_STA_TB -Wall -I../inc
|
||||
+#CFLAGS = -g -O2 -D_REENTRANT -DWFA_WMM_PS_EXT -DWFA_WMM_AC -DWFA_STA_TB -Wall -I../inc ${EXTRA_CFLAGS}
|
||||
|
||||
## for non-Test-Bed WMM-AC, WMM-PS and Voice
|
||||
-#CFLAGS = -g -O2 -D_REENTRANT -DWFA_WMM_PS_EXT -DWFA_WMM_AC -DWFA_VOICE_EXT -Wall -I../inc
|
||||
+#CFLAGS = -g -O2 -D_REENTRANT -DWFA_WMM_PS_EXT -DWFA_WMM_AC -DWFA_VOICE_EXT -Wall -I../inc ${EXTRA_CFLAGS}
|
||||
|
||||
## for PC-ENDPOINT
|
||||
-#CFLAGS = -g -O2 -D_REENTRANT -DWFA_WMM_PS_EXT -DWFA_WMM_AC -DWFA_VOICE_EXT -DWFA_PC_CONSOLE -Wall -I../inc
|
||||
+#CFLAGS = -g -O2 -D_REENTRANT -DWFA_WMM_PS_EXT -DWFA_WMM_AC -DWFA_VOICE_EXT -DWFA_PC_CONSOLE -Wall -I../inc ${EXTRA_CFLAGS}
|
||||
|
||||
## for PC-ENDPOINT No Voice
|
||||
-#CFLAGS = -g -O2 -D_REENTRANT -DWFA_WMM_PS_EXT -DWFA_WMM_AC -DWFA_PC_CONSOLE -DWFA_STA_TB -Wall -I../inc
|
||||
+#CFLAGS = -g -O2 -D_REENTRANT -DWFA_WMM_PS_EXT -DWFA_WMM_AC -DWFA_PC_CONSOLE -DWFA_STA_TB -Wall -I../inc ${EXTRA_CFLAGS}
|
||||
|
||||
# This is for WPA2 as default
|
||||
-CFLAGS = -g -O2 -D_REENTRANT -Wall -I../inc
|
||||
+CFLAGS = -g -O2 -D_REENTRANT -Wall -I../inc ${EXTRA_CFLAGS}
|
||||
|
||||
DUTLIBS = ../lib/libwfa_dut.a -lpthread
|
||||
CALIBS = ../lib/libwfa_ca.a -lpthread
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -14,7 +14,8 @@ SRC_URI = "git://github.com/Wi-FiTestSuite/Wi-FiTestSuite-Linux-DUT.git;branch=m
|
||||
file://0003-fix-path-to-usr-sbin-for-script-and-make-script-for-.patch \
|
||||
file://0004-run-ranlib-per-library-and-use-AR.patch \
|
||||
file://fno-common.patch \
|
||||
file://0001-wfa_cmdproc-Store-return-value-into-location.patch \
|
||||
file://0005-wfa_cmdproc-Store-return-value-into-location.patch \
|
||||
file://0006-make-CFLAGS-appendable.patch \
|
||||
"
|
||||
|
||||
# to avoid host path QA error
|
||||
@@ -41,4 +42,6 @@ RDEPENDS:${PN} = "wpa-supplicant"
|
||||
# http://errors.yoctoproject.org/Errors/Details/766893/
|
||||
# wfa_cmdproc.c:467:68: error: passing argument 3 of 'strtok_r' from incompatible pointer type [-Wincompatible-pointer-types]
|
||||
# wfa_cs.c:4175:57: error: initialization of 'caStaGetEventDetails_t *' {aka 'struct ca_sta_get_event_details *'} from incompatible pointer type 'caStaMngServ_t *' {aka 'struct ca_sta_manage_service *'} [-Wincompatible-pointer-types]
|
||||
CC += "-Wno-error=incompatible-pointer-types"
|
||||
CFLAGS += "-Wno-error=incompatible-pointer-types"
|
||||
|
||||
export EXTRA_CFLAGS = "${CFLAGS}"
|
||||
|
||||
Reference in New Issue
Block a user