ceetm: fix the building warning

Submitted by C.R. Guo on Aug. 14, 2019, 3:34 a.m. | Patch ID: 163947

Details

Message ID 1565753650-26241-1-git-send-email-chunrong.guo@nxp.com
State New
Headers show

Commit Message

C.R. Guo Aug. 14, 2019, 3:34 a.m.
From: Chunrong Guo <chunrong.guo@nxp.com>

*fix the below warning
|#warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]

*add 0001-Makefile-update-CFLAGS.patch to avoid build Errors.

*remove do_compile_prepend

*Obey LDFLAGS and CFLAGS in Makefile

Signed-off-by: Chunrong Guo <chunrong.guo@nxp.com>
---
 .../ceetm/ceetm/0001-Makefile-update-CFLAGS.patch  | 31 ++++++++++++++++++++++
 recipes-kernel/ceetm/ceetm_git.bb                  | 11 ++++----
 2 files changed, 37 insertions(+), 5 deletions(-)
 create mode 100644 recipes-kernel/ceetm/ceetm/0001-Makefile-update-CFLAGS.patch

Patch hide | download patch | download mbox

diff --git a/recipes-kernel/ceetm/ceetm/0001-Makefile-update-CFLAGS.patch b/recipes-kernel/ceetm/ceetm/0001-Makefile-update-CFLAGS.patch
new file mode 100644
index 0000000..1369788
--- /dev/null
+++ b/recipes-kernel/ceetm/ceetm/0001-Makefile-update-CFLAGS.patch
@@ -0,0 +1,31 @@ 
+From fb1fe93a2bab083652a65804be5ddd37a7e86a9f Mon Sep 17 00:00:00 2001
+From: Chunrong Guo <chunrong.guo@nxp.com>
+Date: Wed, 14 Aug 2019 04:05:14 +0200
+Subject: [PATCH] Makefile: update CFLAGS
+
+*fix the below error:
+|error: json_print.h: No such file or directory
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: C.r. Guo <nxa13725@lsv07004.swis.us-cdc01.nxp.com>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index f89700c..49243d8 100644
+--- a/Makefile
++++ b/Makefile
+@@ -8,7 +8,7 @@ LDFLAGS += -Wl,-export-dynamic
+ # if you are not using flex-builder. Download the iproute2 sources for the
+ # desired version and point to those instead.
+ ifneq ($(IPROUTE2_DIR),)
+-CFLAGS += -I$(IPROUTE2_DIR) -I$(IPROUTE2_DIR)/include
++CFLAGS += -I$(IPROUTE2_DIR) -I$(IPROUTE2_DIR)/include -I$(IPROUTE2_DIR)/usr/include/ -I$(IPROUTE2_DIR)/usr/include/include
+ endif
+ 
+ MODDESTDIR := $(DESTDIR)/usr/lib/tc
+-- 
+2.7.4
+
diff --git a/recipes-kernel/ceetm/ceetm_git.bb b/recipes-kernel/ceetm/ceetm_git.bb
index 8613e50..68fb67e 100644
--- a/recipes-kernel/ceetm/ceetm_git.bb
+++ b/recipes-kernel/ceetm/ceetm_git.bb
@@ -4,16 +4,17 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=bac620b9883d38a84dfb73ca7122d915"
 
 SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/ceetm;nobranch=1"
 SRCREV = "6a7f2ec2091df2f4380cb8d25a36c399aed5af1b"
-
+SRC_URI_append = " file://0001-Makefile-update-CFLAGS.patch \
+"
 DEPENDS = "iproute2"
 
 S = "${WORKDIR}/git"
 
-EXTRA_OEMAKE = 'CC="${CC}" LD="${CC}" IPROUTE2_DIR="{STAGING_DIR_TARGET}"'
+export IPROUTE2_DIR="${STAGING_DIR_TARGET}"
+WRAP_TARGET_PREFIX ?= "${TARGET_PREFIX}"
+export CROSS_COMPILE="${WRAP_TARGET_PREFIX}"
 
-do_compile_prepend () {
-    cp ${RECIPE_SYSROOT}/usr/include/include/json_print.h ${RECIPE_SYSROOT}/usr/include
-}
+LDFLAGS += "${TOOLCHAIN_OPTIONS}"
 
 do_install(){
     mkdir -p ${D}/${libdir}/tc