Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 318563 - libao-1.0.0 fails to build on IRIX
Summary: libao-1.0.0 fails to build on IRIX
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All IRIX
: High normal
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-05 10:06 UTC by Stuart Shelton
Modified: 2011-12-15 18:56 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
libao-1.0.0-irix.patch (libao-1.0.0-irix.patch,18.04 KB, patch)
2010-05-05 13:14 UTC, Stuart Shelton
Details | Diff
libao-1.0.0-c99.patch (libao-1.0.0-c99.patch,6.80 KB, patch)
2010-05-05 14:56 UTC, Stuart Shelton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stuart Shelton 2010-05-05 10:06:24 UTC
libao-1.0.0 has native IRIX support, but fails to build with lots of errors such as:

cc-1018 cc: ERROR File = ../../../include/ao/ao_private.h, Line = 141
  An unmatched left parentheses "(" appears in an expression.
                           
  #define adebug(format, args...) {\
                             ^
                           
cc-1018 cc: ERROR File = ../../../include/ao/ao_private.h, Line = 155
  An unmatched left parentheses "(" appears in an expression.
                           
  #define averbose(format, args...) {\
                               ^
                                                                                                                                                                                                   cc-1018 cc: ERROR File = ../../../include/ao/ao_private.h, Line = 169                                                                                                                                An unmatched left parentheses "(" appears in an expression.                                                                                                                                                                                                                                                                                                                                           #define ainfo(format, args...) {\                                                                                                                                                                                            ^
                                                                                                                                                                                                   cc-1018 cc: ERROR File = ../../../include/ao/ao_private.h, Line = 183
  An unmatched left parentheses "(" appears in an expression.
                           
  #define awarn(format, args...) {\
                            ^
                           
cc-1018 cc: ERROR File = ../../../include/ao/ao_private.h, Line = 197
  An unmatched left parentheses "(" appears in an expression.
                           
  #define aerror(format, args...) {                                       \
                             ^
                           
cc-1029 cc: ERROR File = ao_irix.c, Line = 123
  An expression is expected at this point.
                           
                aerror("alSetQueueSize failed: %s\n",
                ^          
                           
cc-1055 cc: ERROR File = ao_irix.c, Line = 130
  A macro invocation has too many arguments.
                           
                        device->output_channels, alGetErrorString(oserror()));
                                                 ^
                           
cc-1029 cc: ERROR File = ao_irix.c, Line = 129
  An expression is expected at this point.
                           
                aerror("alSetChannels(%d) failed: %s\n",
                ^          
                           
cc-1029 cc: ERROR File = ao_irix.c, Line = 137
  An expression is expected at this point.
                           
                aerror("alSetDevice failed: %s\n",
                ^          
                           
cc-1029 cc: ERROR File = ao_irix.c, Line = 143
  An expression is expected at this point.
                           
                aerror("alSetSampFmt failed: %s\n",
                ^          
                           
cc-1029 cc: ERROR File = ao_irix.c, Line = 165
  An expression is expected at this point.
                           
                aerror("unsupported bit with %d\n",
                ^          
                           
cc-1029 cc: ERROR File = ao_irix.c, Line = 171
  An expression is expected at this point.
                           
                aerror("alSetWidth failed: %s\n",
                ^          
                           
cc-1029 cc: ERROR File = ao_irix.c, Line = 180
  An expression is expected at this point.
                           
                aerror("alOpenPort failed: %s\n",
                ^          
                           
cc-1029 cc: ERROR File = ao_irix.c, Line = 189
  An expression is expected at this point.
                           
                aerror("alSetParams() failed: %s\n", alGetErrorString(oserror()));
                ^          
                           
14 errors detected in the compilation of "ao_irix.c".


... which happens because MIPSpro supports variadic macros of the form 'f(x,...)' but not with named arguments such as 'f(x,y...)'.  Correcting the macros definitions and the implementations to use __VA_ARGS__ results in a further problem that some invocations of the macros include only a single argument and some multiple arguments, resulting in:

cc-1054 cc: ERROR File = audio_out.c, Line = 217                                                                                                                                                     There are not enough arguments in a macro invocation.

          adebug("Testing drivers to find playback default...\n");

... etc.
Comment 1 Stuart Shelton 2010-05-05 13:14:37 UTC
Created attachment 230455 [details, diff]
libao-1.0.0-irix.patch


Patch to fix variadic macros for IRIX/MIPSpro.

Not pretty, but it works ;)
Comment 2 Stuart Shelton 2010-05-05 14:56:11 UTC
Created attachment 230465 [details, diff]
libao-1.0.0-c99.patch


Okay - ignore that last patch: it still contained GNU-isms (oops) and made (too many) changes outside of the affected header.

Here is a new version which makes a cosmetic change to the output (all debug messages will be prefixed by their debug level, whereas previously logging "\n" alone produced only a blank line on &2) but has the benefit of actually conforming to C99 (without GNU extensions), and so should be applicable on all platforms.
Comment 3 Fabian Groffen gentoo-dev 2011-12-15 18:56:38 UTC
We are sorry to close this bug.  We lack the man-power and devotion to support mips-irix in the tree.