Skip to contentSkip to conversation

ti-rpmsg-char-examples: Fix cross compile

PATCH In review Khem Raj 3 participants 5 messages Oct 30, 2020

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 1/2 ti-rpmsg-char-examples: Fix cross compile

This fixes problems during cross compile where it starts to peek into build host's include and library paths and causes errors with clang and QA warnings with gcc

---
v2: Add upstream status

 ...-Remove-use-of-includedir-and-libdir.patch | 38 +++++++++++++++++++
 recipes-ti/ipc/ti-rpmsg-char-examples_git.bb  |  2 +
 2 files changed, 40 insertions(+)
 create mode 100644 recipes-ti/ipc/ti-rpmsg-char-examples/0001-examples-Remove-use-of-includedir-and-libdir.patch
recipes-ti/ipc/ti-rpmsg-char-examples/0001-examples-Remove-use-of-includedir-and-libdir.patch new file +38 -0
new file mode 100644
index 00000000..71fca1b0
@@ -0,0 +1,38 @@
+From 1a26cb577ba54dd9214eeb94fed0ce3a0f4603b6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 24 Oct 2020 23:46:39 -0700
+Subject: [PATCH] examples: Remove use of includedir and libdir
+
+These point to standard include and library paths which already are used
+from sysroot relative paths secondly, they use absolute paths which
+means we are asking to add -I/usr/include which might be ok in a native
+build but not in cross build. This helps mitigate QA errors found with
+OE build system since it finds it adding host include and library search
+paths to linker/compiler commandline
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ examples/Makefile.am | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/examples/Makefile.am b/examples/Makefile.am
+index 5a9bedb..d547e41 100644
+--- a/examples/Makefile.am
++++ b/examples/Makefile.am
+@@ -1,6 +1,4 @@
+-INCLUDE = -I${includedir}
+-
+-AM_CFLAGS = -Wall -g -O2 $(INCLUDE)
++AM_CFLAGS = -Wall -g -O2
+ 
+ bin_PROGRAMS = rpmsg_char_simple
+ 
+@@ -8,4 +6,3 @@ bin_PROGRAMS = rpmsg_char_simple
+ rpmsg_char_simple_SOURCES = rpmsg_char_simple.c
+ rpmsg_char_simple_CPPFLAGS = $(AM_CFLAGS)
+ rpmsg_char_simple_LDADD = -lpthread -lti_rpmsg_char
+-rpmsg_char_simple_LDFLAGS = -L${libdir}
+-- 
+2.29.1
+
recipes-ti/ipc/ti-rpmsg-char-examples_git.bb +2 -0
index 142e5bf0..cbe4d7fd 100644
@@ -2,6 +2,8 @@ SUMMARY = "TI RPMsg Char Sample Applications and Tests"
 
 require ti-rpmsg-char.inc
 
+SRC_URI += "file://0001-examples-Remove-use-of-includedir-and-libdir.patch"
+
 DEPENDS = "ti-rpmsg-char"
 
 inherit autotools pkgconfig
Signature · 1 line
2.29.1
author
#1 lore raw

PATCH v2 2/2 ti-rpmsg-char: Mark these recipes to be TI SOC specific

---
 recipes-ti/ipc/ti-rpmsg-char.inc | 3 +++
 1 file changed, 3 insertions(+)
recipes-ti/ipc/ti-rpmsg-char.inc +3 -0
index b41e68eb..d08031cb 100644
@@ -13,3 +13,6 @@ SRCREV = "9be402c2bf4053900b6b9a8092fbb42e7e303108"
 PV = "0.1.0+git${SRCPV}"
 
 S = "${WORKDIR}/git"
+
+COMPATIBLE_HOST ?= "null"
+COMPATIBLE_HOST_ti-soc = "(.*)"
Signature · 1 line
2.29.1
Reviewed-by on v2 2/2
#2 lore raw

Re: [meta-ti] [PATCH v2 2/2] ti-rpmsg-char: Mark these recipes to be TI SOC specific

Quoted 1 line · Khem Raj
Quoted 22 lines
---
 recipes-ti/ipc/ti-rpmsg-char.inc | 3 +++
 1 file changed, 3 insertions(+)
recipes-ti/ipc/ti-rpmsg-char.inc +3 -0
index b41e68eb..d08031cb 100644
@@ -13,3 +13,6 @@ SRCREV = "9be402c2bf4053900b6b9a8092fbb42e7e303108"
 PV = "0.1.0+git${SRCPV}"
 
 S = "${WORKDIR}/git"
+
+COMPATIBLE_HOST ?= "null"
+COMPATIBLE_HOST_ti-soc = "(.*)"
Signature · 1 line
2.29.1
Reviewed-by
#3 lore raw

Re: [meta-ti] [PATCH v2 2/2] ti-rpmsg-char: Mark these recipes to be TI SOC specific

Quoted 4 lines · Denys Dmytriyenko via lists.yoctoproject.org
Quoted 1 line · Khem Raj

Adding mine back again,

regards
Suman

Quoted 29 lines
Quoted 24 lines

---
 recipes-ti/ipc/ti-rpmsg-char.inc | 3 +++
 1 file changed, 3 insertions(+)
recipes-ti/ipc/ti-rpmsg-char.inc +3 -0
index b41e68eb..d08031cb 100644
@@ -13,3 +13,6 @@ SRCREV = "9be402c2bf4053900b6b9a8092fbb42e7e303108"
 PV = "0.1.0+git${SRCPV}"
 
 S = "${WORKDIR}/git"
+
+COMPATIBLE_HOST ?= "null"
+COMPATIBLE_HOST_ti-soc = "(.*)"
Signature · 1 line
2.29.1
Reviewed-by on v2 1/2
#4 lore raw
In reply to Khem Raj
Quoted 5 lines · Khem Raj

This fixes problems during cross compile where it starts to peek into build host's include and library paths and causes errors with clang and QA warnings with gcc

Quoted 72 lines

---
v2: Add upstream status

 ...-Remove-use-of-includedir-and-libdir.patch | 38 +++++++++++++++++++
 recipes-ti/ipc/ti-rpmsg-char-examples_git.bb  |  2 +
 2 files changed, 40 insertions(+)
 create mode 100644 recipes-ti/ipc/ti-rpmsg-char-examples/0001-examples-Remove-use-of-includedir-and-libdir.patch
recipes-ti/ipc/ti-rpmsg-char-examples/0001-examples-Remove-use-of-includedir-and-libdir.patch new file +38 -0
new file mode 100644
index 00000000..71fca1b0
@@ -0,0 +1,38 @@
+From 1a26cb577ba54dd9214eeb94fed0ce3a0f4603b6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 24 Oct 2020 23:46:39 -0700
+Subject: [PATCH] examples: Remove use of includedir and libdir
+
+These point to standard include and library paths which already are used
+from sysroot relative paths secondly, they use absolute paths which
+means we are asking to add -I/usr/include which might be ok in a native
+build but not in cross build. This helps mitigate QA errors found with
+OE build system since it finds it adding host include and library search
+paths to linker/compiler commandline
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ examples/Makefile.am | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/examples/Makefile.am b/examples/Makefile.am
+index 5a9bedb..d547e41 100644
+--- a/examples/Makefile.am
++++ b/examples/Makefile.am
+@@ -1,6 +1,4 @@
+-INCLUDE = -I${includedir}
+-
+-AM_CFLAGS = -Wall -g -O2 $(INCLUDE)
++AM_CFLAGS = -Wall -g -O2
+ 
+ bin_PROGRAMS = rpmsg_char_simple
+ 
+@@ -8,4 +6,3 @@ bin_PROGRAMS = rpmsg_char_simple
+ rpmsg_char_simple_SOURCES = rpmsg_char_simple.c
+ rpmsg_char_simple_CPPFLAGS = $(AM_CFLAGS)
+ rpmsg_char_simple_LDADD = -lpthread -lti_rpmsg_char
+-rpmsg_char_simple_LDFLAGS = -L${libdir}
+-- 
+2.29.1
+
recipes-ti/ipc/ti-rpmsg-char-examples_git.bb +2 -0
index 142e5bf0..cbe4d7fd 100644
@@ -2,6 +2,8 @@ SUMMARY = "TI RPMsg Char Sample Applications and Tests"
 
 require ti-rpmsg-char.inc
 
+SRC_URI += "file://0001-examples-Remove-use-of-includedir-and-libdir.patch"
+
 DEPENDS = "ti-rpmsg-char"
 
 inherit autotools pkgconfig
Signature · 1 line
2.29.1