Skip to contentSkip to conversation

libion: Fix musl build

PATCH Applied Khem Raj 3 participants 4 messages Sep 14, 2019 – Sep 16, 2019

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 libion: Fix musl build

---
 ...tead-of-__BEGIN_DECL-__END_DECL-macr.patch | 42 +++++++++++++++++++
 recipes-devtools/ion/libion_git.bb            |  4 +-
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 recipes-devtools/ion/libion/0001-Use-extern-C-instead-of-__BEGIN_DECL-__END_DECL-macr.patch
recipes-devtools/ion/libion/0001-Use-extern-C-instead-of-__BEGIN_DECL-__END_DECL-macr.patch new file +42 -0
new file mode 100644
index 00000000..530c869e
@@ -0,0 +1,42 @@
+From 197e7bf9a20076c6564a860bd2215e8101ee4cad Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 14 Sep 2019 07:36:47 -0700
+Subject: [PATCH] Use extern "C" instead of __BEGIN_DECL/__END_DECL macros
+
+these macros are defined in sys/cdefs.h for glibc and this header is not available on all libc
+
+for glibc they are defined like below
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ include/ion/ion.h | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/include/ion/ion.h b/include/ion/ion.h
+index 81ab9cc..e95df4b 100644
+--- a/include/ion/ion.h
++++ b/include/ion/ion.h
+@@ -24,7 +24,9 @@
+ #include <sys/types.h>
+ #include <linux/ion.h>
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ int ion_open();
+ int ion_close(int fd);
+@@ -34,6 +36,8 @@ int ion_free(int fd, int handle_fd);
+ int ion_query_heap_cnt(int fd, int* cnt);
+ int ion_query_get_heaps(int fd, int cnt, void* buffers);
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* __ION_H */
+-- 
+2.23.0
+
recipes-devtools/ion/libion_git.bb +3 -1
index 7c93ed3f..38ba9bd8 100644
@@ -6,7 +6,9 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
 PV = "1.0.0"
 
 BRANCH = "master"
-SRC_URI = "git://github.com/glneo/libion.git;protocol=git;branch=${BRANCH}"
+SRC_URI = "git://github.com/glneo/libion.git;protocol=git;branch=${BRANCH} \
+           file://0001-Use-extern-C-instead-of-__BEGIN_DECL-__END_DECL-macr.patch \
+"
 SRCREV = "11dad7977ec3ecba37c013da7ec0408c01413000"
 
 S = "${WORKDIR}/git"
Signature · 1 line
2.23.0
#1 lore raw

Khem,

Thanks for the fix. What's the Upstream-Status: ? :) I guess "Pending" would be appropriate for now.

Andrew,

Would you be willing to take the change in, so we don't have to carry the patch in meta-ti, or do you see any issues with it?

Signature · 1 line
Denys
Quoted 78 lines · Khem Raj
---
 ...tead-of-__BEGIN_DECL-__END_DECL-macr.patch | 42 +++++++++++++++++++
 recipes-devtools/ion/libion_git.bb            |  4 +-
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 recipes-devtools/ion/libion/0001-Use-extern-C-instead-of-__BEGIN_DECL-__END_DECL-macr.patch
recipes-devtools/ion/libion/0001-Use-extern-C-instead-of-__BEGIN_DECL-__END_DECL-macr.patch new file +42 -0
new file mode 100644
index 00000000..530c869e
@@ -0,0 +1,42 @@
+From 197e7bf9a20076c6564a860bd2215e8101ee4cad Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 14 Sep 2019 07:36:47 -0700
+Subject: [PATCH] Use extern "C" instead of __BEGIN_DECL/__END_DECL macros
+
+these macros are defined in sys/cdefs.h for glibc and this header is not available on all libc
+
+for glibc they are defined like below
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ include/ion/ion.h | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/include/ion/ion.h b/include/ion/ion.h
+index 81ab9cc..e95df4b 100644
+--- a/include/ion/ion.h
++++ b/include/ion/ion.h
+@@ -24,7 +24,9 @@
+ #include <sys/types.h>
+ #include <linux/ion.h>
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ int ion_open();
+ int ion_close(int fd);
+@@ -34,6 +36,8 @@ int ion_free(int fd, int handle_fd);
+ int ion_query_heap_cnt(int fd, int* cnt);
+ int ion_query_get_heaps(int fd, int cnt, void* buffers);
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* __ION_H */
+-- 
+2.23.0
+
recipes-devtools/ion/libion_git.bb +3 -1
index 7c93ed3f..38ba9bd8 100644
@@ -6,7 +6,9 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
 PV = "1.0.0"
 
 BRANCH = "master"
-SRC_URI = "git://github.com/glneo/libion.git;protocol=git;branch=${BRANCH}"
+SRC_URI = "git://github.com/glneo/libion.git;protocol=git;branch=${BRANCH} \
+           file://0001-Use-extern-C-instead-of-__BEGIN_DECL-__END_DECL-macr.patch \
+"
 SRCREV = "11dad7977ec3ecba37c013da7ec0408c01413000"
 
 S = "${WORKDIR}/git"
Signature · 7 lines
2.23.0

-- 
_______________________________________________
meta-ti mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-ti
author
#2 lore raw

I have submitted it https://github.com/glneo/libion/pull/1

Quoted 95 lines · Denys Dmytriyenko

Khem,

Thanks for the fix. What's the Upstream-Status: ? :) I guess "Pending" would be appropriate for now.

Andrew,

Would you be willing to take the change in, so we don't have to carry the patch in meta-ti, or do you see any issues with it?

--
Denys

Quoted 78 lines · Khem Raj
---
 ...tead-of-__BEGIN_DECL-__END_DECL-macr.patch | 42 +++++++++++++++++++
 recipes-devtools/ion/libion_git.bb            |  4 +-
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 recipes-devtools/ion/libion/0001-Use-extern-C-instead-of-__BEGIN_DECL-__END_DECL-macr.patch
recipes-devtools/ion/libion/0001-Use-extern-C-instead-of-__BEGIN_DECL-__END_DECL-macr.patch new file +42 -0
new file mode 100644
index 00000000..530c869e
@@ -0,0 +1,42 @@
+From 197e7bf9a20076c6564a860bd2215e8101ee4cad Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 14 Sep 2019 07:36:47 -0700
+Subject: [PATCH] Use extern "C" instead of __BEGIN_DECL/__END_DECL macros
+
+these macros are defined in sys/cdefs.h for glibc and this header is not available on all libc
+
+for glibc they are defined like below
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ include/ion/ion.h | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/include/ion/ion.h b/include/ion/ion.h
+index 81ab9cc..e95df4b 100644
+--- a/include/ion/ion.h
++++ b/include/ion/ion.h
+@@ -24,7 +24,9 @@
+ #include <sys/types.h>
+ #include <linux/ion.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ int ion_open();
+ int ion_close(int fd);
+@@ -34,6 +36,8 @@ int ion_free(int fd, int handle_fd);
+ int ion_query_heap_cnt(int fd, int* cnt);
+ int ion_query_get_heaps(int fd, int cnt, void* buffers);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* __ION_H */
+--
+2.23.0
+
recipes-devtools/ion/libion_git.bb +3 -2
index 7c93ed3f..38ba9bd8 100644
@@ -6,7 +6,9 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
 PV = "1.0.0"
 
 BRANCH = "master"
-SRC_URI = "git://github.com/glneo/libion.git;protocol=git;branch=${BRANCH}"
+SRC_URI = "git://github.com/glneo/libion.git;protocol=git;branch=${BRANCH} \
+           file://0001-Use-extern-C-instead-of-__BEGIN_DECL-__END_DECL-macr.patch \
+"
 SRCREV = "11dad7977ec3ecba37c013da7ec0408c01413000"
 
 S = "${WORKDIR}/git"
--

2.23.0

--
_______________________________________________
meta-ti mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-ti

#3 lore raw

Merged, thanks for the fix.

Andrew

Quoted 98 lines · Khem Raj

I have submitted it https://github.com/glneo/libion/pull/1

Quoted 95 lines · Denys Dmytriyenko

Khem,

Thanks for the fix. What's the Upstream-Status: ? :) I guess "Pending" would be appropriate for now.

Andrew,

Would you be willing to take the change in, so we don't have to carry the patch in meta-ti, or do you see any issues with it?

--
Denys

Quoted 78 lines · Khem Raj
---
 ...tead-of-__BEGIN_DECL-__END_DECL-macr.patch | 42 +++++++++++++++++++
 recipes-devtools/ion/libion_git.bb            |  4 +-
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 recipes-devtools/ion/libion/0001-Use-extern-C-instead-of-__BEGIN_DECL-__END_DECL-macr.patch
recipes-devtools/ion/libion/0001-Use-extern-C-instead-of-__BEGIN_DECL-__END_DECL-macr.patch new file +42 -0
new file mode 100644
index 00000000..530c869e
@@ -0,0 +1,42 @@
+From 197e7bf9a20076c6564a860bd2215e8101ee4cad Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 14 Sep 2019 07:36:47 -0700
+Subject: [PATCH] Use extern "C" instead of __BEGIN_DECL/__END_DECL macros
+
+these macros are defined in sys/cdefs.h for glibc and this header is not available on all libc
+
+for glibc they are defined like below
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ include/ion/ion.h | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/include/ion/ion.h b/include/ion/ion.h
+index 81ab9cc..e95df4b 100644
+--- a/include/ion/ion.h
++++ b/include/ion/ion.h
+@@ -24,7 +24,9 @@
+ #include <sys/types.h>
+ #include <linux/ion.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ int ion_open();
+ int ion_close(int fd);
+@@ -34,6 +36,8 @@ int ion_free(int fd, int handle_fd);
+ int ion_query_heap_cnt(int fd, int* cnt);
+ int ion_query_get_heaps(int fd, int cnt, void* buffers);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* __ION_H */
+--
+2.23.0
+
recipes-devtools/ion/libion_git.bb +3 -2
index 7c93ed3f..38ba9bd8 100644
@@ -6,7 +6,9 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
 PV = "1.0.0"
 
 BRANCH = "master"
-SRC_URI = "git://github.com/glneo/libion.git;protocol=git;branch=${BRANCH}"
+SRC_URI = "git://github.com/glneo/libion.git;protocol=git;branch=${BRANCH} \
+           file://0001-Use-extern-C-instead-of-__BEGIN_DECL-__END_DECL-macr.patch \
+"
 SRCREV = "11dad7977ec3ecba37c013da7ec0408c01413000"
 
 S = "${WORKDIR}/git"
--

2.23.0

--
_______________________________________________
meta-ti mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-ti