[{"id":1766126,"web_url":"http://patchwork.ozlabs.org/comment/1766126/","msgid":"<20170911082709.gwkfnhg37krcynjn@sapphire.tkos.co.il>","list_archive_url":null,"date":"2017-09-11T08:27:09","subject":"Re: [Buildroot] [PATCH] libmbim: fix build with musl libc","submitter":{"id":1458,"url":"http://patchwork.ozlabs.org/api/people/1458/","name":"Baruch Siach","email":"baruch@tkos.co.il"},"content":"Hi Aleksander,\n\nOn Mon, Sep 11, 2017 at 09:54:26AM +0200, Aleksander Morgado wrote:\n> This is now failing because the libgudev dependency is optional and\n> the build will only use if it's found during the configure checks.\n> \n> Imported the same patch that has been applied in the upstream libmbim\n> git repository:\n>   https://cgit.freedesktop.org/libmbim/libmbim/commit/?id=417b0b80023dc30d61c111ec0a54da2884d3a541\n> \n> Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>\n> ---\n>  ...-prefer-realpath-to-canonicalize_file_nam.patch | 36 ++++++++++++++++++++++\n>  1 file changed, 36 insertions(+)\n>  create mode 100644 package/libmbim/0001-mbim-device-prefer-realpath-to-canonicalize_file_nam.patch\n> \n> diff --git a/package/libmbim/0001-mbim-device-prefer-realpath-to-canonicalize_file_nam.patch b/package/libmbim/0001-mbim-device-prefer-realpath-to-canonicalize_file_nam.patch\n> new file mode 100644\n> index 000000000..a13aee547\n> --- /dev/null\n> +++ b/package/libmbim/0001-mbim-device-prefer-realpath-to-canonicalize_file_nam.patch\n> @@ -0,0 +1,36 @@\n> +From 48772b32f10523cca22b7d63c3523377279c7427 Mon Sep 17 00:00:00 2001\n> +From: Aleksander Morgado <aleksander@aleksander.es>\n> +Date: Mon, 11 Sep 2017 09:31:03 +0200\n> +Subject: [PATCH] mbim-device: prefer realpath() to canonicalize_file_name()\n> +\n> +Usually the canonicalize_file_name() GNU extension is preferred to the\n> +POSIX realpath(), as it covers some of the limitations the latter has.\n> +But this extension isn't available in lots of platforms or in other\n> +c library implementations (e.g. musl), so just default to the POSIX\n> +method to improve portability.\n> +\n> +Note that the check for canonicalize_file_name() availability during\n> +configure isn't as trivial as adding a new AC_CHECK_FUNCS(), and\n> +importing a gnulib module seems overkill just for this one liner.\n> +\n> +(cherry picked from commit 417b0b80023dc30d61c111ec0a54da2884d3a541)\n\nPlease add your sign-off here.\n\nbaruch\n\n> +---\n> + src/libmbim-glib/mbim-device.c | 2 +-\n> + 1 file changed, 1 insertion(+), 1 deletion(-)\n> +\n> +diff --git a/src/libmbim-glib/mbim-device.c b/src/libmbim-glib/mbim-device.c\n> +index e1f32a6..20e64af 100644\n> +--- a/src/libmbim-glib/mbim-device.c\n> ++++ b/src/libmbim-glib/mbim-device.c\n> +@@ -867,7 +867,7 @@ get_descriptors_filepath (MbimDevice *self)\n> +          *    /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5/2-1.5:2.0\n> +          */\n> +         tmp = g_strdup_printf (\"/sys/class/%s/%s/device\", subsystems[i], device_basename);\n> +-        path = canonicalize_file_name (tmp);\n> ++        path = realpath (tmp, NULL);\n> +         g_free (tmp);\n> + \n> +         if (g_file_test (path, G_FILE_TEST_EXISTS)) {","headers":{"Return-Path":"<buildroot-bounces@busybox.net>","X-Original-To":["incoming@patchwork.ozlabs.org","buildroot@lists.busybox.net"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","buildroot@osuosl.org"],"Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=busybox.net\n\t(client-ip=140.211.166.136; helo=silver.osuosl.org;\n\tenvelope-from=buildroot-bounces@busybox.net;\n\treceiver=<UNKNOWN>)","Received":["from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xrLdV1YJMz9s83\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 11 Sep 2017 18:27:26 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id AFD24306B3;\n\tMon, 11 Sep 2017 08:27:22 +0000 (UTC)","from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id EmWyq2RrvxDe; Mon, 11 Sep 2017 08:27:21 +0000 (UTC)","from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id C60772F4E3;\n\tMon, 11 Sep 2017 08:27:20 +0000 (UTC)","from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 1945E1C0306\n\tfor <buildroot@lists.busybox.net>;\n\tMon, 11 Sep 2017 08:27:19 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 13CA486C4B\n\tfor <buildroot@lists.busybox.net>;\n\tMon, 11 Sep 2017 08:27:19 +0000 (UTC)","from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id X7KFpzWUMcP7 for <buildroot@lists.busybox.net>;\n\tMon, 11 Sep 2017 08:27:16 +0000 (UTC)","from mx.tkos.co.il (guitar.tcltek.co.il [192.115.133.116])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id D049786BEE\n\tfor <buildroot@buildroot.org>; Mon, 11 Sep 2017 08:27:15 +0000 (UTC)","from sapphire.tkos.co.il (unknown [10.0.4.3])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby mx.tkos.co.il (Postfix) with ESMTPS id 936FB4402B3;\n\tMon, 11 Sep 2017 11:27:10 +0300 (IDT)"],"X-Virus-Scanned":["amavisd-new at osuosl.org","amavisd-new at osuosl.org"],"X-Greylist":"domain auto-whitelisted by SQLgrey-1.7.6","Date":"Mon, 11 Sep 2017 11:27:09 +0300","From":"Baruch Siach <baruch@tkos.co.il>","To":"Aleksander Morgado <aleksander@aleksander.es>","Message-ID":"<20170911082709.gwkfnhg37krcynjn@sapphire.tkos.co.il>","References":"<20170911075426.514-1-aleksander@aleksander.es>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20170911075426.514-1-aleksander@aleksander.es>","User-Agent":"NeoMutt/20170609 (1.8.3)","Cc":"thomas.petazzoni@free-electrons.com, buildroot@buildroot.org","Subject":"Re: [Buildroot] [PATCH] libmbim: fix build with musl libc","X-BeenThere":"buildroot@busybox.net","X-Mailman-Version":"2.1.18-1","Precedence":"list","List-Id":"Discussion and development of buildroot <buildroot.busybox.net>","List-Unsubscribe":"<http://lists.busybox.net/mailman/options/buildroot>,\n\t<mailto:buildroot-request@busybox.net?subject=unsubscribe>","List-Archive":"<http://lists.busybox.net/pipermail/buildroot/>","List-Post":"<mailto:buildroot@busybox.net>","List-Help":"<mailto:buildroot-request@busybox.net?subject=help>","List-Subscribe":"<http://lists.busybox.net/mailman/listinfo/buildroot>,\n\t<mailto:buildroot-request@busybox.net?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"buildroot-bounces@busybox.net","Sender":"\"buildroot\" <buildroot-bounces@busybox.net>"}}]