Undefined references to pthread - make STRIP=1 broken
The compilation with make STRIP=1 is currently broken on LInux - it complains about missing references to pthread-symbols:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__register_frame_info_bases':
(.text+0x1b49): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__register_frame_info':
(.text+0x1c03): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__register_frame_info_table_bases':
(.text+0x1cd8): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__register_frame_info_table':
(.text+0x1d70): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__register_frame_table':
(.text+0x1e1d): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/libgcc_eh.a(unwind-dw2-fde-dip.o):(.text+0x1e9e): more undefined references to `pthread_mutex_lock' follow
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__deregister_frame_info_bases':
(.text+0x1eea): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: (.text+0x1f6d): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `_Unwind_Find_FDE':
(.text+0x2094): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: (.text+0x21d3): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: (.text+0x2221): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__register_frame_info_bases':
(.text+0x1b7c): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__register_frame_info':
(.text+0x1c36): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__register_frame_info_table_bases':
(.text+0x1d0b): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/libgcc_eh.a(unwind-dw2-fde-dip.o):(.text+0x1da3): more undefined references to `pthread_mutex_unlock' follow
/usr/bin/ld: ./libivasutil.a(ivas_rtp_payload.o): in function `mtx_init':
/home/ame-tmp2/mul/ivas/check_code/ivas-codec/lib_util/mutex.h:58: undefined reference to `pthread_mutex_init'
/usr/bin/ld: ./libivasutil.a(ivas_bpool.o): in function `mtx_init':
/home/ame-tmp2/mul/ivas/check_code/ivas-codec/lib_util/mutex.h:58: undefined reference to `pthread_mutex_init'
/usr/bin/ld: ./libivasutil.a(ivas_bpool.o): in function `mtx_lock':
/home/ame-tmp2/mul/ivas/check_code/ivas-codec/lib_util/mutex.h:82: undefined reference to `pthread_mutex_lock'
/usr/bin/ld: ./libivasutil.a(ivas_bpool.o): in function `mtx_unlock':
/home/ame-tmp2/mul/ivas/check_code/ivas-codec/lib_util/mutex.h:95: undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: ./libivasutil.a(ivas_queue.o): in function `mtx_init':
/home/ame-tmp2/mul/ivas/check_code/ivas-codec/lib_util/mutex.h:58: undefined reference to `pthread_mutex_init'
/usr/bin/ld: ./libivasutil.a(ivas_queue.o): in function `mtx_lock':
/home/ame-tmp2/mul/ivas/check_code/ivas-codec/lib_util/mutex.h:82: undefined reference to `pthread_mutex_lock'
/usr/bin/ld: ./libivasutil.a(ivas_queue.o): in function `mtx_unlock':
/home/ame-tmp2/mul/ivas/check_code/ivas-codec/lib_util/mutex.h:95: undefined reference to `pthread_mutex_unlock'
collect2: error: ld returned 1 exit status
make: *** [Makefile:216: ISAR_post_rend] Error 1
make: *** Waiting for unfinished jobs....
This option is used by scripts/find_unused_symbols.sh (which I've used to identify unused functions and tables).
I've experimented with adding -pthread and -lpthread to CFLAGS/LDFLAGS, but couldn't resolve it myself...
Edited by multrus