wifi-test-suite: Fix compile issue
PATCH v2 1/1 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.
---
...oc-Store-return-value-into-location.patch} | 0
.../files/0006-make-CFLAGS-appendable.patch | 60 +++++++++++++++++++
.../wifi-test-suite_10.10.1.bb | 7 ++-
3 files changed, 65 insertions(+), 2 deletions(-)
rename meta-oe/recipes-connectivity/wifi-test-suite/files/{0001-wfa_cmdproc-Store-return-value-into-location.patch => 0005-wfa_cmdproc-Store-return-value-into-location.patch} (100%)
create mode 100644 meta-oe/recipes-connectivity/wifi-test-suite/files/0006-make-CFLAGS-appendable.patchmeta-oe/recipes-connectivity/wifi-test-suite/files/0005-wfa_cmdproc-Store-return-value-into-location.patch renamed from meta-oe/recipes-connectivity/wifi-test-suite/files/0001-wfa_cmdproc-Store-return-value-into-location.patch +0 -0
meta-oe/recipes-connectivity/wifi-test-suite/files/0006-make-CFLAGS-appendable.patch new file +60 -0
60 lines not on this page · raw message
meta-oe/recipes-connectivity/wifi-test-suite/wifi-test-suite_10.10.1.bb +5 -2
@@ -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}"
Signature · 1 line
2.43.0