Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 544420 Details for
Bug 663236
dev-db/mysql-connector-c doesn't build against musl
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
ugly attempt to fix the problem
mysql-connector-c-6.1.11-musl.patch (text/plain), 10.56 KB, created by
Stijn Tintel
on 2018-08-21 20:33:18 UTC
(
hide
)
Description:
ugly attempt to fix the problem
Filename:
MIME Type:
Creator:
Stijn Tintel
Created:
2018-08-21 20:33:18 UTC
Size:
10.56 KB
patch
obsolete
>Index: mysql-connector-c-6.1.11-src/cmake/os/WindowsCache.cmake >=================================================================== >--- mysql-connector-c-6.1.11-src.orig/cmake/os/WindowsCache.cmake >+++ mysql-connector-c-6.1.11-src/cmake/os/WindowsCache.cmake >@@ -159,8 +159,6 @@ SET(HAVE_LRAND48 CACHE INTERNAL "") > SET(GWINSZ_IN_SYS_IOCTL CACHE INTERNAL "") > SET(FIONREAD_IN_SYS_IOCTL CACHE INTERNAL "") > SET(FIONREAD_IN_SYS_FILIO CACHE INTERNAL "") >-SET(HAVE_SIGEV_THREAD_ID CACHE INTERNAL "") >-SET(HAVE_SIGEV_PORT CACHE INTERNAL "") > # Check needed HAVE_LOG2 > > # Check needed HAVE_ISINF >Index: mysql-connector-c-6.1.11-src/config.h.cmake >=================================================================== >--- mysql-connector-c-6.1.11-src.orig/config.h.cmake >+++ mysql-connector-c-6.1.11-src/config.h.cmake >@@ -156,8 +156,6 @@ > #cmakedefine GWINSZ_IN_SYS_IOCTL 1 > #cmakedefine FIONREAD_IN_SYS_IOCTL 1 > #cmakedefine FIONREAD_IN_SYS_FILIO 1 >-#cmakedefine HAVE_SIGEV_THREAD_ID 1 >-#cmakedefine HAVE_SIGEV_PORT 1 > #cmakedefine HAVE_LOG2 1 > > #cmakedefine HAVE_ISINF 1 >Index: mysql-connector-c-6.1.11-src/configure.cmake >=================================================================== >--- mysql-connector-c-6.1.11-src.orig/configure.cmake >+++ mysql-connector-c-6.1.11-src/configure.cmake >@@ -533,8 +533,6 @@ CHECK_SYMBOL_EXISTS(lrand48 "stdlib.h" H > CHECK_SYMBOL_EXISTS(TIOCGWINSZ "sys/ioctl.h" GWINSZ_IN_SYS_IOCTL) > CHECK_SYMBOL_EXISTS(FIONREAD "sys/ioctl.h" FIONREAD_IN_SYS_IOCTL) > CHECK_SYMBOL_EXISTS(FIONREAD "sys/filio.h" FIONREAD_IN_SYS_FILIO) >-CHECK_SYMBOL_EXISTS(SIGEV_THREAD_ID "signal.h;time.h" HAVE_SIGEV_THREAD_ID) >-CHECK_SYMBOL_EXISTS(SIGEV_PORT "signal.h;time.h;sys/siginfo.h" HAVE_SIGEV_PORT) > > CHECK_SYMBOL_EXISTS(log2 math.h HAVE_LOG2) > >@@ -564,9 +562,7 @@ CHECK_SYMBOL_EXISTS(EVFILT_TIMER "sys/ty > IF(HAVE_KQUEUE AND HAVE_EVFILT_TIMER) > SET(HAVE_KQUEUE_TIMERS 1 CACHE INTERNAL "Have kqueue timer-related filter") > ELSEIF(HAVE_TIMER_CREATE AND HAVE_TIMER_SETTIME) >- IF(HAVE_SIGEV_THREAD_ID OR HAVE_SIGEV_PORT) >- SET(HAVE_POSIX_TIMERS 1 CACHE INTERNAL "Have POSIX timer-related functions") >- ENDIF() >+ SET(HAVE_POSIX_TIMERS 1 CACHE INTERNAL "Have POSIX timer-related functions") > ENDIF() > > IF(NOT HAVE_POSIX_TIMERS AND NOT HAVE_KQUEUE_TIMERS AND NOT WIN32) >Index: mysql-connector-c-6.1.11-src/include/my_timer.h >=================================================================== >--- mysql-connector-c-6.1.11-src.orig/include/my_timer.h >+++ mysql-connector-c-6.1.11-src/include/my_timer.h >@@ -46,17 +46,15 @@ struct st_my_timer > void (*notify_function)(my_timer_t *); > }; > >-C_MODE_START >- > #ifdef HAVE_PSI_INTERFACE > extern PSI_thread_key key_thread_timer_notifier; > #endif > > /* Initialize internal components. */ >-int my_timer_initialize(void); >+int my_timer_initialize(); > > /* Release any resources acquired. */ >-void my_timer_deinitialize(void); >+void my_timer_deinitialize(); > > /* Create a timer object. */ > int my_timer_create(my_timer_t *timer); >@@ -70,6 +68,4 @@ int my_timer_cancel(my_timer_t *timer, i > /* Delete a timer object. */ > void my_timer_delete(my_timer_t *timer); > >-C_MODE_END >- > #endif /* MY_TIMER_H */ >Index: mysql-connector-c-6.1.11-src/libmysql/libmysql.c >=================================================================== >--- mysql-connector-c-6.1.11-src.orig/libmysql/libmysql.c >+++ mysql-connector-c-6.1.11-src/libmysql/libmysql.c >@@ -35,7 +35,7 @@ > #include <sys/select.h> > #endif > #ifdef HAVE_POLL >-#include <sys/poll.h> >+#include <poll.h> > #endif > #ifdef HAVE_SYS_UN_H > #include <sys/un.h> >Index: mysql-connector-c-6.1.11-src/mysys/posix_timers.c >=================================================================== >--- mysql-connector-c-6.1.11-src.orig/mysys/posix_timers.c >+++ mysql-connector-c-6.1.11-src/mysys/posix_timers.c >@@ -15,167 +15,38 @@ > > > #include "my_global.h" >-#include "my_thread.h" /* my_thread_init, my_thread_end */ >-#include "my_sys.h" /* my_message_local */ > #include "my_timer.h" /* my_timer_t */ > >-#include <string.h> /* memset */ > #include <signal.h> >+#include <string.h> /* memset */ > >-#if defined(HAVE_SIGEV_THREAD_ID) >-#include <sys/syscall.h> /* SYS_gettid */ >- >-#ifndef sigev_notify_thread_id >-#define sigev_notify_thread_id _sigev_un._tid >-#endif >- >-#define MY_TIMER_EVENT_SIGNO (SIGRTMIN) >-#define MY_TIMER_KILL_SIGNO (SIGRTMIN+1) >- >-/* Timer thread ID (TID). */ >-static pid_t timer_notify_thread_id; >- >-#elif defined(HAVE_SIGEV_PORT) >-#include <port.h> >- >-int port_id= -1; >- >-#endif >- >-/* Timer thread object. */ >-static my_thread_handle timer_notify_thread; >+typedef union mysigval { >+ int sival_int; >+ void *sival_ptr; >+} mysigval; > >-#if defined(HAVE_SIGEV_THREAD_ID) > /** > Timer expiration notification thread. > >- @param arg Barrier object. >+ @param arg Event info. > */ > >-static void * >-timer_notify_thread_func(void *arg) >-{ >- sigset_t set; >- siginfo_t info; >- my_timer_t *timer; >- pthread_barrier_t *barrier= arg; >- >- my_thread_init(); >- >- sigemptyset(&set); >- sigaddset(&set, MY_TIMER_EVENT_SIGNO); >- sigaddset(&set, MY_TIMER_KILL_SIGNO); >- >- /* Get the thread ID of the current thread. */ >- timer_notify_thread_id= (pid_t) syscall(SYS_gettid); >- >- /* Wake up parent thread, timer_notify_thread_id is available. */ >- pthread_barrier_wait(barrier); >- >- while (1) >- { >- if (sigwaitinfo(&set, &info) < 0) >- continue; >- >- if (info.si_signo == MY_TIMER_EVENT_SIGNO) >- { >- timer= (my_timer_t*)info.si_value.sival_ptr; >- timer->notify_function(timer); >- } >- else if (info.si_signo == MY_TIMER_KILL_SIGNO) >- break; >- } >- >- my_thread_end(); >- >- return NULL; >+static void >+timer_notify_thread_func(mysigval arg) { >+ my_timer_t *timer = (my_timer_t *)(arg.sival_ptr); >+ timer->notify_function(timer); > } > >- >-/** >- Create a helper thread to dispatch timer expiration notifications. >- >- @return On success, 0. On error, -1 is returned. >-*/ >- >-static int >-start_helper_thread(void) >-{ >- pthread_barrier_t barrier; >- >- if (pthread_barrier_init(&barrier, NULL, 2)) >- { >- my_message_local(ERROR_LEVEL, >- "Failed to initialize pthread barrier. errno=%d", errno); >- return -1; >- } >- >- if (mysql_thread_create(key_thread_timer_notifier, &timer_notify_thread, >- NULL, timer_notify_thread_func, &barrier)) >- { >- my_message_local(ERROR_LEVEL, >- "Failed to create timer notify thread (errno= %d).", >- errno); >- pthread_barrier_destroy(&barrier); >- return -1; >- } >- >- pthread_barrier_wait(&barrier); >- pthread_barrier_destroy(&barrier); >- >- return 0; >-} >- >- >-/** >- Initialize internal components. >- >- @return On success, 0. >- On error, -1 is returned, and errno is set to indicate the error. >-*/ >- > int >-my_timer_initialize(void) >+my_timer_initialize() > { >- int rc; >- sigset_t set, old_set; >- >- if (sigfillset(&set)) >- { >- my_message_local(ERROR_LEVEL, >- "Failed to intialize signal set (errno=%d).", errno); >- return -1; >- } >- >- /* >- Temporarily block all signals. New thread will inherit signal >- mask of the current thread. >- */ >- if (pthread_sigmask(SIG_BLOCK, &set, &old_set)) >- return -1; >- >- /* Create a helper thread. */ >- rc= start_helper_thread(); >- >- /* Restore the signal mask. */ >- pthread_sigmask(SIG_SETMASK, &old_set, NULL); >- >- return rc; >+ return 0; > } > > >-/** >- Release any resources that were allocated as part of initialization. >-*/ >- > void > my_timer_deinitialize(void) > { >- /* Kill helper thread. */ >- pthread_kill(timer_notify_thread.thread, MY_TIMER_KILL_SIGNO); >- >- /* Wait for helper thread termination. */ >- my_thread_join(&timer_notify_thread, NULL); > } > > >@@ -195,136 +66,16 @@ my_timer_create(my_timer_t *timer) > > memset(&sigev, 0, sizeof(sigev)); > >+ sigev.sigev_notify= SIGEV_THREAD; > sigev.sigev_value.sival_ptr= timer; >- sigev.sigev_signo= MY_TIMER_EVENT_SIGNO; >- sigev.sigev_notify= SIGEV_SIGNAL | SIGEV_THREAD_ID; >- sigev.sigev_notify_thread_id= timer_notify_thread_id; >- >- return timer_create(CLOCK_MONOTONIC, &sigev, &timer->id); >-} >-#elif defined(HAVE_SIGEV_PORT) >-/** >- Timer expiration notification thread. >- >- @param arg Barrier object. >-*/ >- >-static void * >-timer_notify_thread_func(void *arg MY_ATTRIBUTE((unused))) >-{ >- port_event_t port_event; >- my_timer_t *timer; >- >- my_thread_init(); >- >- while (1) >- { >- if (port_get(port_id, &port_event, NULL)) >- break; >- >- if (port_event.portev_source != PORT_SOURCE_TIMER) >- continue; >- >- timer= (my_timer_t*)port_event.portev_user; >- timer->notify_function(timer); >- } >- >- my_thread_end(); >- >- return NULL; >-} >- >- >-/** >- Create a helper thread to dispatch timer expiration notifications. >- >- @return On success, 0. On error, -1 is returned. >-*/ >- >-static int >-start_helper_thread(void) >-{ >- if (mysql_thread_create(key_thread_timer_notifier, &timer_notify_thread, >- NULL, timer_notify_thread_func, NULL)) >- { >- my_message_local(ERROR_LEVEL, >- "Failed to create timer notify thread (errno= %d).", >- errno); >- return -1; >- } >- >- return 0; >-} >- >- >-/** >- Initialize internal components. >- >- @return On success, 0. >- On error, -1 is returned, and errno is set to indicate the error. >-*/ >- >-int >-my_timer_initialize(void) >-{ >- int rc; >- >- if ((port_id= port_create()) < 0) >- { >- my_message_local(ERROR_LEVEL, "Failed to create port (errno= %d).", errno); >- return -1; >- } >- >- /* Create a helper thread. */ >- rc= start_helper_thread(); >- >- return rc; >-} >- >- >-/** >- Release any resources that were allocated as part of initialization. >-*/ >- >-void >-my_timer_deinitialize(void) >-{ >- DBUG_ASSERT(port_id >= 0); >- >- // close port >- close(port_id); >- >- /* Wait for helper thread termination. */ >- my_thread_join(&timer_notify_thread, NULL); >-} >- >- >-/** >- Create a timer object. >- >- @param timer Location where the timer ID is returned. >- >- @return On success, 0. >- On error, -1 is returned, and errno is set to indicate the error. >-*/ >- >-int >-my_timer_create(my_timer_t *timer) >-{ >- struct sigevent sigev; >- port_notify_t port_notify; >- >- port_notify.portnfy_port= port_id; >- port_notify.portnfy_user= timer; >- >- memset(&sigev, 0, sizeof(sigev)); >- sigev.sigev_value.sival_ptr= &port_notify; >- sigev.sigev_notify= SIGEV_PORT; >+ sigev.sigev_notify_function= &timer_notify_thread_func; > >+#ifdef __sun // CLOCK_MONOTONIC not supported on Solaris even if it compiles. > return timer_create(CLOCK_REALTIME, &sigev, &timer->id); >-} >+#else >+ return timer_create(CLOCK_MONOTONIC, &sigev, &timer->id); > #endif >- >+} > > /** > Set the time until the next expiration of the timer.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 663236
:
542892
| 544420