Broken build with uClibc
Current git head
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
#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.
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 ^
src/main.c includes tvh_thread.h in line 19:
This header file in line 163 has the code which is broken on uClibc:
This line is only included when TVH_THREAD_C is not defined.
TVH_THREAD_C is only defined in tvh_thread.c but not in main.c which seems
to me the cause of the problem. I see two possible solutions here:
- delete at least line 163 from tvh_thread.h
- add "#define TVH_THREAD_C 1" to main.c (and tvhlog.c & tvh_locale.c)
If you agree on either one of these solutions I will send a patch.
Updated by Jaroslav Kysela 4 months ago
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.
This line is included during the build of main.c: