Bug #5667
closed
Added by b kuhls almost 6 years ago.
Updated almost 6 years ago.
Description
Current git head
https://github.com/tvheadend/tvheadend/commit/771dfd6bea7bd4035ed991eccbe735dc00d3f800
does not build with uClibC:
src/tvh_thread.h:163:25: error: unknown type name â__do_not_use_pthread_mutex_tâ
#define pthread_mutex_t __do_not_use_pthread_mutex_t
Removing
#ifndef TVH_THREAD_C
#define pthread_cond __do_not_use_pthread_cond
#define pthread_cond_t __do_not_use_pthread_cond_t
#define pthread_mutex __do_not_use_pthread_mutex
#define pthread_mutex_t __do_not_use_pthread_mutex_t
#endif
from src/tvh_thread.h fixes the problem but I am unsure whether such a patch would be accepted.
Which .c file causes this problem? The pthread_mutex_t should not be used anywhere in tvh except in the tvh_thread.c.
CC src/main.o
In file included from src/main.c:19:0:
/home/buildroot/br5/output/build/tvheadend-771dfd6bea7bd4035ed991eccbe735dc00d3f800/src/tvh_thread.h:163:25: error: unknown type name â__do_not_use_pthread_mutex_tâ
#define pthread_mutex_t __do_not_use_pthread_mutex_t
^
main.c does not use pthread_mutex_t . It apears like a compiler issue.
You've not got the point. It's only define, so if the pthread_mutex_t is not used in the code (and it should not be used in main.c) then the compilation error should not occur because of the forced invalid symbol (and yes - it's defined by purpose to catch all occurences of pthread usage to not mix the special tvheadend mutex code). I don't see anything from your report why uclibc compilation ends with such error. So again, where is the pthread_mutex_t symbol used when main.c is being compiled?
You may use 'gcc -E' and inspect the source code after the preprocessor run to get an overview where is pthread_mutex_t used in uclibc.
What about to include uclibc's stdio.h before tvheadend's header files? It would be probably nice to make those hacks visible using #ifdef like:
#ifdef __UCLIBC_HAS_THREADS__
#include <stdio.h> /* uses pthread_mutex_t */
#endif
- Status changed from New to Fixed
Also available in: Atom
PDF