[Home]

Summary:ASTERISK-13182: [patch] apps/app_festival.c does not compile for PPC target
Reporter:Florian Floimair (ffloimair)Labels:
Date Opened:2008-12-09 04:49:38.000-0600Date Closed:2009-07-22 16:46:10
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_festival
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) app_festival.c.patch
Description:When I try to cross compile Asterisk for a PowerPC based system (MPC 5200B), I get the error below.

Tested with Asterisk 1.6.0.2 and 1.6.0.3-rc1.

I identified the following lines in apps/app_festival.c

118: static int send_waveform_to_fd(char *waveform, int length, int fd)
119: {
120: int res;
121: int x;
122: #ifdef __PPC__
123: char c;
124: int x;
125: #endif

It's pretty obvious that 'int x' is declarated twice when __PPC__ evaluates to true.

****** ADDITIONAL INFORMATION ******

Output of 'make' (including last lines of 'configure'):

             .$$$$$$$$$$$$$$$=..      
           .$7$7..          .7$$7:.    
         .$$:.                 ,$7.7  
       .$7.     7$$$$           .$$77  
    ..$$.       $$$$$            .$$$7
   ..7$   .?.   $$$$$   .?.       7$$$.
  $.$.   .$$$7. $$$$7 .7$$$.      .$$$.
.777.   .$$$$$$77$$$77$$$$$7.      $$$,
$$$~      .7$$$$$$$$$$$$$7.       .$$$.
.$$7          .7$$$$$$$7:          ?$$$.
$$$          ?7$$$$$$$$$$I        .$$$7
$$$       .7$$$$$$$$$$$$$$$$      :$$$.
$$$       $$$$$$7$$$$$$$$$$$$    .$$$.  
$$$        $$$   7$$$7  .$$$    .$$$.  
$$$$             $$$$7         .$$$.    
7$$$7            7$$$$        7$$$      
$$$$$                        $$$      
 $$$$7.                       $$  (TM)    
  $$$$$$$.           .7$$$$$$  $$          
    $$$$$$$$$$$$7$$$$$$$$$.$$$$$$          
      $$$$$$$$$$$$$$$$.                    

configure: Package configured for:
configure: OS type  : linux-gnu    
configure: Host CPU : powerpc      
configure: build-cpu:vendor:os: x86 : unknown : linux-gnu :
configure: host-cpu:vendor:os: powerpc : unknown : linux-gnu :
configure: Cross Compilation = YES                            
CC="cc" CXX="/opt/powerpc-603e-linux-gnu/gcc-4.1.2-glibc-2.5-kernel-2.6.18/bin/powerpc-603e-linux-gnu-c++" LD="" AR="" RANLIB="" CFLAGS="" make -C menuselect CONFIGURE_SILENT="--silent" makeopts                                                                
make[1]: Entering directory '/home/commend/Desktop/phytec/Asterisk/asterisk-1.6.0.3-rc1/menuselect'                            
make[1]: »makeopts« is already up to date.                                                                                    
make[1]: Leaving directory '/home/commend/Desktop/phytec/Asterisk/asterisk-1.6.0.3-rc1/menuselect'                            
menuselect/menuselect --check-deps menuselect.makeopts                                                                          
Generating embedded module rules ...                                                                                            
  [CC] app_festival.c -> app_festival.o                                                                                        
app_festival.c: In function 'send_waveform_to_fd':                                                                              
app_festival.c:124: error: redeclaration of 'x' with no linkage                                                                  
app_festival.c:121: error: previous declaration of 'x' was here                                                                  
make[1]: *** [app_festival.o] Error 1                                                                                          
make: *** [apps] Error 2
Comments:By: Digium Subversion (svnbot) 2008-12-09 14:44:27.000-0600

Repository: asterisk
Revision: 162273

U   branches/1.4/apps/app_festival.c

------------------------------------------------------------------------
r162273 | file | 2008-12-09 14:44:27 -0600 (Tue, 09 Dec 2008) | 4 lines

Fix double declaration of 'x' on the PPC platform.
(closes issue ASTERISK-13182)
Reported by: ffloimair

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=162273

By: Florian Floimair (ffloimair) 2009-01-26 04:44:56.000-0600

I just tried compiling Asterisk 1.6.0.5 and the issue is there again. Seems like the fix didn't make it into the release version. I also tried 1.6.0.3 and it also didn't include the fix.

Seems to me that the fix was only applied to the 1.4 branch of Asterisk.

I commented out the line that was deleted in the previously posted fix and can confirm that it also works for 1.6.0.3 and 1.6.0.5



By: Joshua C. Colp (jcolp) 2009-02-06 10:27:37.000-0600

I have confirmed that this has already been changed in the 1.6.0 branch, it should be in the next release.

By: Florian Floimair (ffloimair) 2009-07-20 07:17:14

now the int variable x is only used within "__PPC__" definition.
Therefore it is never declared at all (used to be double-declaration when I first opened this issue).

This issue applies to Asterisk 1.6.1.1 but it is no issue in 1.6.0.x branch.

I have attached a small patch that adds the declaration with the "__PPC__" definition.

Please integrate into trunk. Thanks.

By: Digium Subversion (svnbot) 2009-07-22 16:44:02

Repository: asterisk
Revision: 208113

U   trunk/apps/app_festival.c

------------------------------------------------------------------------
r208113 | qwell | 2009-07-22 16:44:01 -0500 (Wed, 22 Jul 2009) | 9 lines

Restore an int declaration on PPC platforms.

This x is one crafty little bugger...
It was used for 2 different things (one of which was only done on PPC) in 1.4.
One of the uses were removed in trunk, and with it went the declaration.

(closes issue ASTERISK-13182)
Reported by: ffloimair

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=208113

By: Digium Subversion (svnbot) 2009-07-22 16:44:57

Repository: asterisk
Revision: 208114

_U  branches/1.6.0/

------------------------------------------------------------------------
r208114 | qwell | 2009-07-22 16:44:57 -0500 (Wed, 22 Jul 2009) | 15 lines

Blocked revisions 208113 via svnmerge

........
 r208113 | qwell | 2009-07-22 16:43:57 -0500 (Wed, 22 Jul 2009) | 9 lines
 
 Restore an int declaration on PPC platforms.
 
 This x is one crafty little bugger...
 It was used for 2 different things (one of which was only done on PPC) in 1.4.
 One of the uses were removed in trunk, and with it went the declaration.
 
 (closes issue ASTERISK-13182)
 Reported by: ffloimair
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=208114

By: Digium Subversion (svnbot) 2009-07-22 16:45:38

Repository: asterisk
Revision: 208115

_U  branches/1.6.1/
U   branches/1.6.1/apps/app_festival.c

------------------------------------------------------------------------
r208115 | qwell | 2009-07-22 16:45:38 -0500 (Wed, 22 Jul 2009) | 16 lines

Merged revisions 208113 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r208113 | qwell | 2009-07-22 16:43:57 -0500 (Wed, 22 Jul 2009) | 9 lines
 
 Restore an int declaration on PPC platforms.
 
 This x is one crafty little bugger...
 It was used for 2 different things (one of which was only done on PPC) in 1.4.
 One of the uses were removed in trunk, and with it went the declaration.
 
 (closes issue ASTERISK-13182)
 Reported by: ffloimair
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=208115

By: Digium Subversion (svnbot) 2009-07-22 16:46:09

Repository: asterisk
Revision: 208116

_U  branches/1.6.2/
U   branches/1.6.2/apps/app_festival.c

------------------------------------------------------------------------
r208116 | qwell | 2009-07-22 16:46:09 -0500 (Wed, 22 Jul 2009) | 16 lines

Merged revisions 208113 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r208113 | qwell | 2009-07-22 16:43:57 -0500 (Wed, 22 Jul 2009) | 9 lines
 
 Restore an int declaration on PPC platforms.
 
 This x is one crafty little bugger...
 It was used for 2 different things (one of which was only done on PPC) in 1.4.
 One of the uses were removed in trunk, and with it went the declaration.
 
 (closes issue ASTERISK-13182)
 Reported by: ffloimair
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=208116