[asterisk-bugs] [Asterisk 0013604]: error: ‘PTHREAD_MUTEX_RECURSIVE’ undeclared (first use in this function) on powerpc during compile of 1.6 rc6

Asterisk Bug Tracker noreply at bugs.digium.com
Sat Oct 4 08:24:50 CDT 2008


The following issue has been UPDATED. 
====================================================================== 
http://bugs.digium.com/view.php?id=13604 
====================================================================== 
Reported By:                shrift
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   13604
Category:                   General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           1.6.0-rc6 
SVN Branch (only for SVN checkouts, not tarball releases): 1.6.0 
SVN Revision (number only!): 145746 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-10-02 10:25 CDT
Last Modified:              2008-10-04 08:24 CDT
====================================================================== 
Summary:                    error: ‘PTHREAD_MUTEX_RECURSIVE’ undeclared
(first use in this function) on powerpc during compile of 1.6 rc6
Description: 
The gcc compiler on powerpc needs to have "#define _GNU_SOURCE" set in
/usr/include/features.h in order for 1.6 to compile cleanly on powerpc
architecture. otherwise you will receive errors like this:

   [CC] app_voicemail.c -> app_voicemail.o
In file included from app_voicemail.c:100:
/usr/local/asterisk/include/asterisk/lock.h: In function
`ast_mutex_init':
/usr/local/asterisk/include/asterisk/lock.h:749: warning: implicit
declaration of function `pthread_mutexattr_settype'
In file included from /usr/local/asterisk/include/asterisk/config.h:30,
                 from /usr/local/asterisk/include/asterisk/channel.h:147,
                 from app_voicemail.c:102:
/usr/local/asterisk/include/asterisk/utils.h: In function `_ast_strndup':
/usr/local/asterisk/include/asterisk/utils.h:532: warning: implicit
declaration of function `strndup'
/usr/local/asterisk/include/asterisk/utils.h:532: warning: assignment
makes pointer from integer without a cast
/usr/local/asterisk/include/asterisk/utils.h: In function
`_ast_vasprintf':
/usr/local/asterisk/include/asterisk/utils.h:571: warning: implicit
declaration of function `vasprintf'
app_voicemail.c: At top level:
app_voicemail.c:169: error: `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP'
undeclared here (not in a function)
app_voicemail.c:169: error: initializer element is not constant
app_voicemail.c:169: error: (near initialization for `vmstates.lock')
app_voicemail.c:567: error: initializer element is not constant
app_voicemail.c:567: error: (near initialization for `users.lock')
app_voicemail.c:568: error: initializer element is not constant
app_voicemail.c:568: error: (near initialization for `zones.lock')
make[1]: *** [app_voicemail.o] Error 1
make: *** [apps] Error 2


I suggest either the compiler be made to check for this setting or a not
be made in the readme. My environment was Debian etc/testing on a powerpc
Mac G4.
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
duplicate of        0013605 [patch] Compile error with IMAP_STORAGE...
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-10-04 08:24 shrift         Status                   closed => new       
2008-10-04 08:24 shrift         Resolution               duplicate => reopened
======================================================================




More information about the asterisk-bugs mailing list