From b9e8f3cc44aed3b6da71c7510c6287bf7bbbc66b Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 14 Jun 2023 15:13:45 +0100 Subject: gentoo auto-resync : 14:06:2023 - 15:13:45 --- .../files/dibbler-1.0.1-clang-16-musl-fix.patch | 74 ++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 net-misc/dibbler/files/dibbler-1.0.1-clang-16-musl-fix.patch (limited to 'net-misc/dibbler/files') diff --git a/net-misc/dibbler/files/dibbler-1.0.1-clang-16-musl-fix.patch b/net-misc/dibbler/files/dibbler-1.0.1-clang-16-musl-fix.patch new file mode 100644 index 000000000000..99fdc342b229 --- /dev/null +++ b/net-misc/dibbler/files/dibbler-1.0.1-clang-16-musl-fix.patch @@ -0,0 +1,74 @@ +From: Brahmajit Das +Date: Wed, 31 May 2023 06:27:08 +0000 +Subject: [PATCH] Fix build with clang 16 + +Especially on musl libc. + +On musl libc with clang-16, the function pthread_kill can't be found, as its +only available if the FTM is enabled. Hence defining _GNU_SOURCE makes thie +function available. + +Other than that this patch also renames the variable lock, to fix the following +error: ./Port-linux/dibbler-client.cpp:48:27: error: reference to 'lock' is +ambiguous. I'm exactly not sure what the errors are, but I'm guessing it's +related to CPP namespaces. Not sure either why its not reproducable under glibc +llvm. + +Bug: https://bugs.gentoo.org/897944 +Signed-off-by: Brahmajit Das +--- a/Port-linux/dibbler-client.cpp ++++ b/Port-linux/dibbler-client.cpp +@@ -26,7 +26,7 @@ using namespace std; + + #define IF_RECONNECTED_DETECTED -1 + +-extern pthread_mutex_t lock; ++extern pthread_mutex_t plock; + + TDHCPClient* ptr = 0; + +@@ -44,8 +44,8 @@ void signal_handler(int n) { + #ifdef MOD_CLNT_CONFIRM + void signal_handler_of_linkstate_change(int n) { + Log(Notice) << "Network switch off event detected. initiating CONFIRM." << LogEnd; +- pthread_mutex_lock(&lock); +- pthread_mutex_unlock(&lock); ++ pthread_mutex_lock(&plock); ++ pthread_mutex_unlock(&plock); + } + #endif + +--- a/Port-linux/lowlevel-linux-link-state.c ++++ b/Port-linux/lowlevel-linux-link-state.c +@@ -10,6 +10,7 @@ + #ifdef MOD_CLNT_CONFIRM + + #define __USE_UNIX98 ++#define _GNU_SOURCE + + #include + #include +@@ -34,7 +35,7 @@ volatile int * notifier = 0; + int isDone = 0; + pthread_t parent_id; + pthread_t ntid; +-pthread_mutex_t lock; ++pthread_mutex_t plock; + + struct state { + int id; +@@ -86,9 +87,9 @@ void link_state_changed(int ifindex) + { + if (changed_links->cnt<16) + changed_links->ifindex[changed_links->cnt++] = ifindex; +- pthread_mutex_lock(&lock); ++ pthread_mutex_lock(&plock); + *notifier = 1; /* notify that change has occured */ +- pthread_mutex_unlock(&lock); ++ pthread_mutex_unlock(&plock); + pthread_kill(parent_id,SIGUSR1); + } else + { +-- +2.40.1 + -- cgit v1.2.3