[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 15:13:15 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
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 15:13 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
----------------------------------------------------------------------
related to          0013605 [patch] Compile error with IMAP_STORAGE...
====================================================================== 

---------------------------------------------------------------------- 
 (0093170) shrift (reporter) - 2008-10-04 15:13
 http://bugs.digium.com/view.php?id=13604#c93170 
---------------------------------------------------------------------- 
I have uploaded those files, this is from a ./configure and make
--ignore-errors with the _GNU_SOURCE undefined in /usr/include/features.h.
I hope this is helpful. I didn't see any more instances of the original
error I stated this time. It is entirely possible I am wrong about it
occurring in relation to more than just the voicemail. I know I did see it
more than that, but I was also doing some weird stuff to the gcc
environment variables trying to get this to work. At any rate, those
changes were since reverted and this is how it looks with the gcc
environment unmodified.

Do you want any other output from the compile? I can paste the entire
terminal output into a file too. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-10-04 15:13 shrift         Note Added: 0093170                          
======================================================================




More information about the asterisk-bugs mailing list