[oe,meta-oe,V2,2/5] modemmanager: Fix build with musl provide canonicalize_file_name()

Message ID 20180613063512.1755-2-raj.khem@gmail.com
State Superseded
Headers show
Series
  • [oe,meta-networking,V2,1/5] rdma-core: Update to version 18
Related show

Commit Message

Khem Raj June 13, 2018, 6:35 a.m.
Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 ...eck-for-canonicalize_file_name-befor.patch | 64 +++++++++++++++++++
 .../modemmanager/modemmanager_1.7.991.bb      |  4 +-
 2 files changed, 67 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-connectivity/modemmanager/modemmanager/0001-Add-configure-check-for-canonicalize_file_name-befor.patch

-- 
2.17.1

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

Comments

Andreas Müller June 13, 2018, 8:18 a.m. | #1
On Wed, Jun 13, 2018 at 8:35 AM, Khem Raj <raj.khem@gmail.com> wrote:
> Signed-off-by: Khem Raj <raj.khem@gmail.com>

> ---

>  ...eck-for-canonicalize_file_name-befor.patch | 64 +++++++++++++++++++

>  .../modemmanager/modemmanager_1.7.991.bb      |  4 +-

>  2 files changed, 67 insertions(+), 1 deletion(-)

>  create mode 100644 meta-oe/recipes-connectivity/modemmanager/modemmanager/0001-Add-configure-check-for-canonicalize_file_name-befor.patch

>

> diff --git a/meta-oe/recipes-connectivity/modemmanager/modemmanager/0001-Add-configure-check-for-canonicalize_file_name-befor.patch b/meta-oe/recipes-connectivity/modemmanager/modemmanager/0001-Add-configure-check-for-canonicalize_file_name-befor.patch

> new file mode 100644

> index 0000000000..256dd2ce0b

> --- /dev/null

> +++ b/meta-oe/recipes-connectivity/modemmanager/modemmanager/0001-Add-configure-check-for-canonicalize_file_name-befor.patch

> @@ -0,0 +1,64 @@

> +From 07f1eda630517816bfa900e811963745a149e57c Mon Sep 17 00:00:00 2001

> +From: Khem Raj <raj.khem@gmail.com>

> +Date: Fri, 8 Jun 2018 20:38:30 -0700

> +Subject: [PATCH] Add configure check for canonicalize_file_name() before use

> +

> +Define canonicalize_file_name API if not provided by system C library

> +musl e.g. does not provide this API

> +

> +Signed-off-by: Khem Raj <raj.khem@gmail.com>

^ Don't know what the current status: Do we still insist on Upstream-Status?

Why I ask: This solution might have the chance upstream.

Andreas
-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Khem Raj June 13, 2018, 1:45 p.m. | #2
Hi Andreas

On 6/13/18 1:18 AM, Andreas Müller wrote:
> On Wed, Jun 13, 2018 at 8:35 AM, Khem Raj <raj.khem@gmail.com> wrote:
>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> ---
>>   ...eck-for-canonicalize_file_name-befor.patch | 64 +++++++++++++++++++
>>   .../modemmanager/modemmanager_1.7.991.bb      |  4 +-
>>   2 files changed, 67 insertions(+), 1 deletion(-)
>>   create mode 100644 meta-oe/recipes-connectivity/modemmanager/modemmanager/0001-Add-configure-check-for-canonicalize_file_name-befor.patch
>>
>> diff --git a/meta-oe/recipes-connectivity/modemmanager/modemmanager/0001-Add-configure-check-for-canonicalize_file_name-befor.patch b/meta-oe/recipes-connectivity/modemmanager/modemmanager/0001-Add-configure-check-for-canonicalize_file_name-befor.patch
>> new file mode 100644
>> index 0000000000..256dd2ce0b
>> --- /dev/null
>> +++ b/meta-oe/recipes-connectivity/modemmanager/modemmanager/0001-Add-configure-check-for-canonicalize_file_name-befor.patch
>> @@ -0,0 +1,64 @@
>> +From 07f1eda630517816bfa900e811963745a149e57c Mon Sep 17 00:00:00 2001
>> +From: Khem Raj <raj.khem@gmail.com>
>> +Date: Fri, 8 Jun 2018 20:38:30 -0700
>> +Subject: [PATCH] Add configure check for canonicalize_file_name() before use
>> +
>> +Define canonicalize_file_name API if not provided by system C library
>> +musl e.g. does not provide this API
>> +
>> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ^ Don't know what the current status: Do we still insist on Upstream-Status?
> 
> Why I ask: This solution might have the chance upstream.
> 

Yes I will add Upstream-Status: Pending

> Andreas
>

Patch

diff --git a/meta-oe/recipes-connectivity/modemmanager/modemmanager/0001-Add-configure-check-for-canonicalize_file_name-befor.patch b/meta-oe/recipes-connectivity/modemmanager/modemmanager/0001-Add-configure-check-for-canonicalize_file_name-befor.patch
new file mode 100644
index 0000000000..256dd2ce0b
--- /dev/null
+++ b/meta-oe/recipes-connectivity/modemmanager/modemmanager/0001-Add-configure-check-for-canonicalize_file_name-befor.patch
@@ -0,0 +1,64 @@ 
+From 07f1eda630517816bfa900e811963745a149e57c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jun 2018 20:38:30 -0700
+Subject: [PATCH] Add configure check for canonicalize_file_name() before use
+
+Define canonicalize_file_name API if not provided by system C library
+musl e.g. does not provide this API
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac                                |  2 ++
+ src/kerneldevice/mm-kernel-device-generic.c | 18 ++++++++++++++++++
+ 2 files changed, 20 insertions(+)
+
+Index: ModemManager-1.7.991/configure.ac
+===================================================================
+--- ModemManager-1.7.991.orig/configure.ac
++++ ModemManager-1.7.991/configure.ac
+@@ -72,6 +72,8 @@ AC_SUBST(MM_GLIB_LT_CURRENT)
+ AC_SUBST(MM_GLIB_LT_REVISION)
+ AC_SUBST(MM_GLIB_LT_AGE)
+ 
++AC_CHECK_FUNCS([canonicalize_file_name])
++
+ dnl-----------------------------------------------------------------------------
+ dnl Documentation
+ dnl
+Index: ModemManager-1.7.991/src/kerneldevice/mm-kernel-device-generic.c
+===================================================================
+--- ModemManager-1.7.991.orig/src/kerneldevice/mm-kernel-device-generic.c
++++ ModemManager-1.7.991/src/kerneldevice/mm-kernel-device-generic.c
+@@ -21,6 +21,7 @@
+ #define _LIBMM_INSIDE_MM
+ #include <libmm-glib.h>
+ 
++#include "config.h"
+ #include "mm-kernel-device-generic.h"
+ #include "mm-kernel-device-generic-rules.h"
+ #include "mm-log.h"
+@@ -100,6 +101,24 @@ read_sysfs_property_as_string (const gch
+     return contents;
+ }
+ 
++#ifndef HAVE_CANONICALIZE_FILE_NAME
++#include <limits.h>
++#include <string.h>
++#include <stdlib.h>
++#include <stdio.h>
++static char * canonicalize_file_name(const char *path)
++{
++   char buf[PATH_MAX] = { };
++
++   snprintf(buf, sizeof(buf) - 1, "%s", path);
++
++   if (!realpath(path, buf))
++       return NULL;
++
++   return strdup(buf);
++}
++#endif
++
+ /*****************************************************************************/
+ /* Load contents */
+ 
diff --git a/meta-oe/recipes-connectivity/modemmanager/modemmanager_1.7.991.bb b/meta-oe/recipes-connectivity/modemmanager/modemmanager_1.7.991.bb
index b1a718dbfb..26b56d17d0 100644
--- a/meta-oe/recipes-connectivity/modemmanager/modemmanager_1.7.991.bb
+++ b/meta-oe/recipes-connectivity/modemmanager/modemmanager_1.7.991.bb
@@ -11,7 +11,9 @@  inherit gnomebase gettext systemd vala gobject-introspection bash-completion
 
 DEPENDS = "glib-2.0 libgudev dbus-glib intltool-native"
 
-SRC_URI = "http://www.freedesktop.org/software/ModemManager/ModemManager-${PV}.tar.xz"
+SRC_URI = "http://www.freedesktop.org/software/ModemManager/ModemManager-${PV}.tar.xz \
+           file://0001-Add-configure-check-for-canonicalize_file_name-befor.patch \
+           "
 
 SRC_URI[md5sum] = "4efe6a240cef212bf8855c95424e7c7f"
 SRC_URI[sha256sum] = "4e366243bd4983f2e6efe35cb901cf5da51939307b5d6299fe622a9fcf411745"