Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 246270 - eix-0.15.0 fails to build on IRIX
Summary: eix-0.15.0 fails to build on IRIX
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All IRIX
: High normal (vote)
Assignee: Gentoo non-Linux Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-10 11:37 UTC by Stuart Shelton
Modified: 2008-11-10 20:38 UTC (History)
1 user (show)

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


Attachments
Patch to include unistd.h for size_t and off_t (types_unistd.patch,211 bytes, patch)
2008-11-10 14:02 UTC, Martin Väth
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stuart Shelton 2008-11-10 11:37:49 UTC
I guess we should've been expecting this ;)


source='database/package_reader.cc' object='database/package_reader.o' libtool=no \
        DEPDIR=.deps depmode=sgi /opt/portage/bin/bash ../config/depcomp \
        CC -DHAVE_CONFIG_H -I. -I..   -I/opt/portage/usr/include -DSYSCONFDIR=\"/opt/portage/etc\" -J2 -O2 -n32 -mips4 -r14000 -float_const -use_readonly_const -TARG:isa=mips4:platform=ip35: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 -diag_error 1035 -FE:eliminate_duplicate_inline_copies:template_in_elf_section -woff 1174,1183,1185,1552,3968,3970  -c -o database/package_reader.o database/package_reader.cc
cc-1020 CC: ERROR File = ./database/types.h, Line = 20
  The identifier "size_t" is undefined.

        typedef size_t UNumber;
                ^

cc-1020 CC: ERROR File = ./database/types.h, Line = 26
  The identifier "off_t" is undefined.

        typedef off_t OffsetType;
                ^

cc-1295 CC: ERROR File = ./database/header.h, Line = 50
  The indicated data member initializer is not allowed.

                static const DBVersion current = 28;
                                               ^

3 errors detected in the compilation of "database/package_reader.cc".
make[2]: *** [database/package_reader.o] Error 2
make[2]: Leaving directory `/usr/opt/portage/var/tmp/portage/app-portage/eix-0.15.0/work/eix-0.15.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/opt/portage/var/tmp/portage/app-portage/eix-0.15.0/work/eix-0.15.0'
make: *** [all] Error 2


I believe that size_t is a C99 definition, and therefore not available to (IRIX) C++.

(Note that on IRIX, care should be taken to run configure against cc for C/C99 code, and CC for C++ code - the capabilities of the two are markedly different.  Specifically, <stdint.h> contains as the very start of the header:

#ifndef __STDINT_H__
#define __STDINT_H__

#ifndef __c99
#error This header file is to be used only for c99 mode compilations
#else

... and __c99 is not defined for C++ code.
Comment 1 Martin Väth 2008-11-10 14:02:48 UTC
Created attachment 171296 [details, diff]
Patch to include unistd.h for size_t and off_t

According to the C++ standard
  http://www.cplusplus.com/reference/clibrary/cstdlib/
at least size_t should have been defined by #include <stdlib>.
However, unistd.h should define both, size_t and off_t, and including this
helps on MacOS (see bug 246222). Does the attached patch work on IRIX, too?
Comment 2 Stuart Shelton 2008-11-10 17:52:33 UTC
Yes, perfect - adding <unistd.h> fixes the IRIX build-process :)
Comment 3 Fabian Groffen gentoo-dev 2008-11-10 20:38:01 UTC
I checked in the patch, please reopen if more problems pop up.