All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] package/gensio: fix build without threads
Date: Sat, 25 Jan 2020 23:45:10 +0100	[thread overview]
Message-ID: <20200125224510.3757122-1-fontaine.fabrice@gmail.com> (raw)

Fixes:
 - http://autobuild.buildroot.org/results/b5847ac9e818571b746e2a81cf830b6caf50a7d7

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...sue-compiling-with-pthreads-disabled.patch | 27 ++++++++++++
 ...tor.c-fix-definition-of-pthread_mute.patch | 42 +++++++++++++++++++
 2 files changed, 69 insertions(+)
 create mode 100644 package/gensio/0001-Fix-an-issue-compiling-with-pthreads-disabled.patch
 create mode 100644 package/gensio/0002-lib-gensio_selector.c-fix-definition-of-pthread_mute.patch

diff --git a/package/gensio/0001-Fix-an-issue-compiling-with-pthreads-disabled.patch b/package/gensio/0001-Fix-an-issue-compiling-with-pthreads-disabled.patch
new file mode 100644
index 0000000000..d7af0acb97
--- /dev/null
+++ b/package/gensio/0001-Fix-an-issue-compiling-with-pthreads-disabled.patch
@@ -0,0 +1,27 @@
+From 2e1a982ed0eef1188ad15995e177e7d40746685f Mon Sep 17 00:00:00 2001
+From: Corey Minyard <cminyard@mvista.com>
+Date: Tue, 7 Jan 2020 11:34:33 -0600
+Subject: [PATCH] Fix an issue compiling with pthreads disabled
+
+Define PTHREAD_MUTEX_INITIALIZER in this case.
+
+Signed-off-by: Corey Minyard <cminyard@mvista.com>
+[Retrieved from:
+https://github.com/cminyard/gensio/commit/2e1a982ed0eef1188ad15995e177e7d40746685f]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ lib/gensio_selector.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/gensio_selector.c b/lib/gensio_selector.c
+index c050df0..66ada01 100644
+--- a/lib/gensio_selector.c
++++ b/lib/gensio_selector.c
+@@ -30,6 +30,7 @@
+ #define pthread_mutex_unlock(l) do { } while (0)
+ #define pthread_mutex_init(l, n) do { } while (0)
+ #define pthread_mutex_destroy(l, n) do { } while (0)
++#define PTHREAD_MUTEX_INITIALIZER 0
+ #endif
+ 
+ #include <gensio/gensio_selector.h>
diff --git a/package/gensio/0002-lib-gensio_selector.c-fix-definition-of-pthread_mute.patch b/package/gensio/0002-lib-gensio_selector.c-fix-definition-of-pthread_mute.patch
new file mode 100644
index 0000000000..1c90bf3711
--- /dev/null
+++ b/package/gensio/0002-lib-gensio_selector.c-fix-definition-of-pthread_mute.patch
@@ -0,0 +1,42 @@
+From f1582f417aaf8f4fa7f1828f2504ba2f03909819 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Sat, 25 Jan 2020 23:35:54 +0100
+Subject: [PATCH] lib/gensio_selector.c: fix definition of
+ pthread_mutex_destroy
+
+Fix definition of pthread_mutex_destroy otherwise build without threads
+will fail on:
+
+gensio_selector.c: In function 'gensio_sel_free_lock':
+gensio_selector.c:82:38: error: macro "pthread_mutex_destroy" requires 2 arguments, but only 1 given
+     pthread_mutex_destroy(&lock->lock);
+                                      ^
+gensio_selector.c:82:5: error: 'pthread_mutex_destroy' undeclared (first use in this function)
+     pthread_mutex_destroy(&lock->lock);
+     ^~~~~~~~~~~~~~~~~~~~~
+
+Fixes:
+ - http://autobuild.buildroot.org/results/b5847ac9e818571b746e2a81cf830b6caf50a7d7
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: https://github.com/cminyard/gensio/pull/8]
+---
+ lib/gensio_selector.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gensio_selector.c b/lib/gensio_selector.c
+index a3bec38..615ab61 100644
+--- a/lib/gensio_selector.c
++++ b/lib/gensio_selector.c
+@@ -29,7 +29,7 @@
+ #define pthread_mutex_lock(l) do { } while (0)
+ #define pthread_mutex_unlock(l) do { } while (0)
+ #define pthread_mutex_init(l, n) do { } while (0)
+-#define pthread_mutex_destroy(l, n) do { } while (0)
++#define pthread_mutex_destroy(l) do { } while (0)
+ #define PTHREAD_MUTEX_INITIALIZER 0
+ #endif
+ 
+-- 
+2.24.1
+
-- 
2.24.1

             reply	other threads:[~2020-01-25 22:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-25 22:45 Fabrice Fontaine [this message]
2020-01-26  8:09 ` [Buildroot] [PATCH 1/1] package/gensio: fix build without threads Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200125224510.3757122-1-fontaine.fabrice@gmail.com \
    --to=fontaine.fabrice@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.