[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#674412: tcc: undefined symbol '__builtin_expect' on pthread_cleanup_push() call



reassign 674412 libc6-dev
thanks

Le jeudi 24 mai 2012 14:47:39, vous avez écrit :
> 
> $ tcc -Wall -Wextra thread.c -pthread
> thread.c:10: warning: implicit declaration of function '__builtin_expect'
> tcc: error: undefined symbol '__builtin_expect'

__builtin_expect is not currently supported by tcc. I asked upstream if they 
were willing to ignore this keyword but they feel glibc, which is providing 
the macro for pthread_cleanup_push, should not assume non gcc compilers to 
accept __builtin_expect. Hence reassigning to glibc package.

For glibc maintainers:

In pthread.h, pthread_cleanup_push is defined around line 650 in the following 
way when __GNUC__ is not defined (the case for tcc for example):

# define pthread_cleanup_push(routine, arg) \
  do {                                                                        
\
    __pthread_unwind_buf_t __cancel_buf;                                      
\
    void (*__cancel_routine) (void *) = (routine);                            
\
    void *__cancel_arg = (arg);                                               
\
    int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *)     \
                                        __cancel_buf.__cancel_jmp_buf, 0);    
\
    if (__builtin_expect (__not_first_call, 0))                               \
      {                                                                       
\
        __cancel_routine (__cancel_arg);                                      
\
        __pthread_unwind_next (&__cancel_buf);                                
\
        /* NOTREACHED */                                                      
\
      }                                                                       
\
                                                                              \
    __pthread_register_cancel (&__cancel_buf);                                
\
    do {

This makes use of __builtin_expect which should not be assume to exist.

Best regards.

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: