]> code.ossystems Code Review - openembedded-core.git/commitdiff
attr: Add patch to account for use of internal glibc header
authorKhem Raj <raj.khem@gmail.com>
Thu, 19 Nov 2015 01:07:21 +0000 (01:07 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 12 Dec 2015 23:31:45 +0000 (23:31 +0000)
based on suggestions on musl FAQ
http://wiki.musl-libc.org/wiki/FAQ

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-support/attr/attr_2.4.47.bb
meta/recipes-support/attr/files/dont-use-decl-macros.patch [new file with mode: 0644]

index ad40c9b72af35b2a290149a978f8d303ef01effa..44eee39644ea526dd88a4b016ef7fcf11e524c72 100644 (file)
@@ -2,7 +2,9 @@ require attr.inc
 
 # configure.ac was missing from the release tarball. This should be fixed in
 # future releases of attr, remove this when updating the recipe.
-SRC_URI_append += "file://attr-Missing-configure.ac.patch"
+SRC_URI_append += "file://attr-Missing-configure.ac.patch \
+                   file://dont-use-decl-macros.patch \
+                  "
 
 SRC_URI[md5sum] = "84f58dec00b60f2dc8fd1c9709291cc7"
 SRC_URI[sha256sum] = "25772f653ac5b2e3ceeb89df50e4688891e21f723c460636548971652af0a859"
diff --git a/meta/recipes-support/attr/files/dont-use-decl-macros.patch b/meta/recipes-support/attr/files/dont-use-decl-macros.patch
new file mode 100644 (file)
index 0000000..9d4b892
--- /dev/null
@@ -0,0 +1,56 @@
+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
+
+anyway they defined like below
+
+#ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS }
+#else
+# define __BEGIN_DECLS /* empty */
+# define __END_DECLS /* empty */
+#endif
+
+__THROW macro is also not available on musl, defined thusly
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: attr-2.4.47/include/xattr.h
+===================================================================
+--- attr-2.4.47.orig/include/xattr.h   2014-04-02 00:01:30.252091280 -0700
++++ attr-2.4.47/include/xattr.h        2014-04-02 00:12:57.985428099 -0700
+@@ -30,8 +30,20 @@
+ #define XATTR_CREATE  0x1       /* set value, fail if attr already exists */
+ #define XATTR_REPLACE 0x2       /* set value, fail if attr does not exist */
+-
+-__BEGIN_DECLS
++#ifndef __THROW
++# ifndef __GNUC_PREREQ
++#  define __GNUC_PREREQ(maj, min) (0)
++# endif
++# if defined __cplusplus && __GNUC_PREREQ (2,8)
++#  define __THROW       throw ()
++# else
++#  define __THROW
++# endif
++#endif
++
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern int setxattr (const char *__path, const char *__name,
+                     const void *__value, size_t __size, int __flags) __THROW;
+@@ -58,6 +70,8 @@
+ extern int lremovexattr (const char *__path, const char *__name) __THROW;
+ extern int fremovexattr (int __filedes,   const char *__name) __THROW;
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ #endif        /* __XATTR_H__ */