Subject: pkg/37420: audio/flac-1.2.1 fails to build on IRIX
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <srcshelton@gmail.com>
List: pkgsrc-bugs
Date: 11/22/2007 13:00:01
>Number:         37420
>Category:       pkg
>Synopsis:       audio/flac-1.2.1 fails to build on IRIX
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 22 13:00:00 +0000 2007
>Originator:     Stuart Shelton
>Release:        n/a - pkgsrc from CVS
>Organization:
>Environment:
IRIX64 octane 6.5 07202013 IP30 - MIPSpro 7.4.4m compilers
>Description:

flac-1.2.1 fails to compile on IRIX:

Making all in libFLAC++
gmake[3]: Entering directory `/usr/bsd/var/tmp/audio/flac/work/flac-1.2.1/src/libFLAC++'
source='metadata.cpp' object='metadata.lo' libtool=yes \
        depfile='.deps/metadata.Plo' tmpdepfile='.deps/metadata.TPlo' \
        depmode=sgi /bin/ksh ../../depcomp \
        /bin/ksh ../../libtool --mode=compile CC -DHAVE_CONFIG_H -I. -I. -I../..   -DNDEBUG -I../.. -I./include -I../../include -I/usr/bsd/include -D__inline__=inline  -O2 -n32 -mips4 -r14000 -apo -float_const -use_readonly_const -TARG:isa=mips4:platform=ip30:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -woff 1174,1183,1185,1552,3970,3968 -FE:eliminate_duplicate_inline_copies:template_in_elf_section -D__STDC_LIMIT_MACROS=1 -I/usr/bsd/include -c -o metadata.lo `test -f 'metadata.cpp' || echo './'`metadata.cpp
mkdir .libs
 CC -DHAVE_CONFIG_H -I. -I../.. -DNDEBUG -I./include -I../../include -I/usr/bsd/var/tmp/audio/flac/work/.buildlink/include -D__inline__=inline -O2 -n32 -mips4 -r14000 -apo -float_const -use_readonly_const -TARG:isa=mips4:platform=ip30:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -woff 1174,1183,1185,1552,3970,3968 -FE:eliminate_duplicate_inline_copies:template_in_elf_section -D__STDC_LIMIT_MACROS=1 -c metadata.cpp -Wp,-MDupdate,.deps/metadata.TPlo  -DPIC -o .libs/metadata.o
cc-1035 CC: WARNING File = /usr/include/stdint.h, Line = 5
  #error directive:  This header file is to be used only for c99 mode
          compilations

  #error This header file is to be used only for c99 mode compilations
   ^

cc-1035 CC: WARNING File = ../../include/share/alloc.h, Line = 41
  #error directive:  

  #   error
      ^

cc-1020 CC: ERROR File = ../../include/share/alloc.h, Line = 120
  The identifier "SIZE_T_MAX" is undefined.

        if(size1 > SIZE_MAX / size2)
                   ^

cc-1020 CC: ERROR File = ../../include/share/alloc.h, Line = 130
  The identifier "SIZE_T_MAX" is undefined.

        if(size1 > SIZE_MAX / size2)
                   ^

cc-1020 CC: ERROR File = ../../include/share/alloc.h, Line = 143
  The identifier "SIZE_T_MAX" is undefined.

        if(size1 > SIZE_MAX / size2)
                   ^

cc-1020 CC: ERROR File = ../../include/share/alloc.h, Line = 196
  The identifier "SIZE_T_MAX" is undefined.

        if(size1 > SIZE_MAX / size2)
                   ^

4 errors detected in the compilation of "metadata.cpp".
gmake[3]: *** [metadata.lo] Error 1
gmake[3]: Leaving directory `/usr/bsd/var/tmp/audio/flac/work/flac-1.2.1/src/libFLAC++'
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory `/usr/bsd/var/tmp/audio/flac/work/flac-1.2.1/src'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/usr/bsd/var/tmp/audio/flac/work/flac-1.2.1'
gmake: *** [all] Error 2
*** Error code 2

Stop.
bmake: stopped in /usr/bsd/src/audio/flac
*** Error code 1

Stop.
bmake: stopped in /usr/bsd/src/audio/flac


(This is with 'CXXFLAGS+= -D__STDC_LIMIT_MACROS=1' in the pkg Makefile, as suggested by a comment in flac's include/share/alloc.h)
>How-To-Repeat:

The problem here appears to be that flac is including a C header in a piece of C++ code.

The "-c99" flag applies to 'cc' only, not 'CC'.  Most of the contents of stdint.h are therefore not being included.


(Note, there is also a note in the Makefile to re-try building at -O3 under MIPSpro for release 1.1.3 ;)
>Fix:

This is probably a really easy fix either by including the right header, or conditionally defining the values which flac's include/share/alloc.h requires.