diff options
| author | Khem Raj <raj.khem@gmail.com> | 2019-02-01 06:55:45 -0800 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2019-02-01 06:57:14 -0800 |
| commit | 5ca9c88503770ed9d2aeea7a77ad8e28d7941787 (patch) | |
| tree | d6d64cc7252c544f4ad7633a7b7f5a655390c99f | |
| parent | 53cb161e6c475708b9ca3a1ec570592c868ca392 (diff) | |
| download | meta-openembedded-5ca9c88503770ed9d2aeea7a77ad8e28d7941787.tar.gz | |
dibbler: Fix build with clang/libc++
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | meta-networking/recipes-connectivity/dibbler/dibbler/0001-linux-port-Rename-pthread_mutex_t-variable-lock.patch | 74 | ||||
| -rw-r--r-- | meta-networking/recipes-connectivity/dibbler/dibbler_git.bb | 3 |
2 files changed, 76 insertions, 1 deletions
diff --git a/meta-networking/recipes-connectivity/dibbler/dibbler/0001-linux-port-Rename-pthread_mutex_t-variable-lock.patch b/meta-networking/recipes-connectivity/dibbler/dibbler/0001-linux-port-Rename-pthread_mutex_t-variable-lock.patch new file mode 100644 index 0000000000..346a56a9ad --- /dev/null +++ b/meta-networking/recipes-connectivity/dibbler/dibbler/0001-linux-port-Rename-pthread_mutex_t-variable-lock.patch | |||
| @@ -0,0 +1,74 @@ | |||
| 1 | From 630086cf1b3fba71822319a268d3711734cd6aa8 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Thu, 31 Jan 2019 12:56:13 -0800 | ||
| 4 | Subject: [PATCH] linux-port: Rename pthread_mutex_t variable 'lock' | ||
| 5 | |||
| 6 | lock is also used by libc++ in std namespace and using it here causes | ||
| 7 | clang to fail e.g. | ||
| 8 | |||
| 9 | dibbler-client.cpp:47:25: error: reference to 'lock' is ambiguous | ||
| 10 | pthread_mutex_lock(&lock); | ||
| 11 | ^ | ||
| 12 | ../../../../../../../workspace/sources/dibbler/Port-linux/dibbler-client.cpp:29:26: note: candidate found by name lookup is 'lock' | ||
| 13 | extern ::pthread_mutex_t lock; | ||
| 14 | ^ | ||
| 15 | /mnt/a/yoe/build/tmp/work/aarch64-yoe-linux/dibbler/1.0.1+1.0.2RC1+gitc4b0ed52e751da7823dd9a36e91f93a6310e5525-r0/recipe-sysroot/usr/include/c++/v1/mutex:446:1: note: candidate found by name lookup is 'std::__1::lock' | ||
| 16 | lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3& ...__l3) | ||
| 17 | |||
| 18 | Upstream-Status: Submitted [https://github.com/tomaszmrugalski/dibbler/pull/37] | ||
| 19 | |||
| 20 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 21 | --- | ||
| 22 | Port-linux/dibbler-client.cpp | 6 +++--- | ||
| 23 | Port-linux/lowlevel-linux-link-state.c | 6 +++--- | ||
| 24 | 2 files changed, 6 insertions(+), 6 deletions(-) | ||
| 25 | |||
| 26 | diff --git a/Port-linux/dibbler-client.cpp b/Port-linux/dibbler-client.cpp | ||
| 27 | index 78f34241..b5ebb9f0 100644 | ||
| 28 | --- a/Port-linux/dibbler-client.cpp | ||
| 29 | +++ b/Port-linux/dibbler-client.cpp | ||
| 30 | @@ -26,7 +26,7 @@ using namespace std; | ||
| 31 | |||
| 32 | #define IF_RECONNECTED_DETECTED -1 | ||
| 33 | |||
| 34 | -extern pthread_mutex_t lock; | ||
| 35 | +extern pthread_mutex_t dibbler_lock; | ||
| 36 | |||
| 37 | TDHCPClient* ptr = 0; | ||
| 38 | |||
| 39 | @@ -44,8 +44,8 @@ void signal_handler(int n) { | ||
| 40 | #ifdef MOD_CLNT_CONFIRM | ||
| 41 | void signal_handler_of_linkstate_change(int n) { | ||
| 42 | Log(Notice) << "Network switch off event detected. initiating CONFIRM." << LogEnd; | ||
| 43 | - pthread_mutex_lock(&lock); | ||
| 44 | - pthread_mutex_unlock(&lock); | ||
| 45 | + pthread_mutex_lock(&dibbler_lock); | ||
| 46 | + pthread_mutex_unlock(&dibbler_lock); | ||
| 47 | } | ||
| 48 | #endif | ||
| 49 | |||
| 50 | diff --git a/Port-linux/lowlevel-linux-link-state.c b/Port-linux/lowlevel-linux-link-state.c | ||
| 51 | index 76293ea1..e6b94063 100644 | ||
| 52 | --- a/Port-linux/lowlevel-linux-link-state.c | ||
| 53 | +++ b/Port-linux/lowlevel-linux-link-state.c | ||
| 54 | @@ -34,7 +34,7 @@ volatile int * notifier = 0; | ||
| 55 | int isDone = 0; | ||
| 56 | pthread_t parent_id; | ||
| 57 | pthread_t ntid; | ||
| 58 | -pthread_mutex_t lock; | ||
| 59 | +pthread_mutex_t dibbler_lock; | ||
| 60 | |||
| 61 | struct state { | ||
| 62 | int id; | ||
| 63 | @@ -86,9 +86,9 @@ void link_state_changed(int ifindex) | ||
| 64 | { | ||
| 65 | if (changed_links->cnt<16) | ||
| 66 | changed_links->ifindex[changed_links->cnt++] = ifindex; | ||
| 67 | - pthread_mutex_lock(&lock); | ||
| 68 | + pthread_mutex_lock(&dibbler_lock); | ||
| 69 | *notifier = 1; /* notify that change has occured */ | ||
| 70 | - pthread_mutex_unlock(&lock); | ||
| 71 | + pthread_mutex_unlock(&dibbler_lock); | ||
| 72 | pthread_kill(parent_id,SIGUSR1); | ||
| 73 | } else | ||
| 74 | { | ||
diff --git a/meta-networking/recipes-connectivity/dibbler/dibbler_git.bb b/meta-networking/recipes-connectivity/dibbler/dibbler_git.bb index 8890e14318..90051a319a 100644 --- a/meta-networking/recipes-connectivity/dibbler/dibbler_git.bb +++ b/meta-networking/recipes-connectivity/dibbler/dibbler_git.bb | |||
| @@ -9,7 +9,8 @@ SRCREV = "c4b0ed52e751da7823dd9a36e91f93a6310e5525" | |||
| 9 | 9 | ||
| 10 | SRC_URI = "git://github.com/tomaszmrugalski/dibbler \ | 10 | SRC_URI = "git://github.com/tomaszmrugalski/dibbler \ |
| 11 | file://dibbler_fix_getSize_crash.patch \ | 11 | file://dibbler_fix_getSize_crash.patch \ |
| 12 | " | 12 | file://0001-linux-port-Rename-pthread_mutex_t-variable-lock.patch \ |
| 13 | " | ||
| 13 | PV = "1.0.1+1.0.2RC1+git${SRCREV}" | 14 | PV = "1.0.1+1.0.2RC1+git${SRCREV}" |
| 14 | 15 | ||
| 15 | S = "${WORKDIR}/git" | 16 | S = "${WORKDIR}/git" |
