Subject: Re: trouble compiling gcc3 on IRIX64 6.5.20m
To: Michal Pasternak <michal@pasternak.w.lub.pl>
From: Ryan Cresawn <cresawn@chass.utoronto.ca>
List: tech-pkg
Date: 11/25/2003 11:10:31
--a8Wt8u1KmwUX3Y2C
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Michal,

I have attached the file 'getpwd.c' and the output from the command
you asked me to run is below.  What do you mean when you mention
'priv'?  I hope this is everything you've requested.

Ryan


  # echo f00 | cpp -dM
  #define __DBL_MIN_EXP__ (-1021)
  #define sgi 1
  #define __EXTENSIONS__ 1
  #define __FLT_MIN__ 1.17549435e-38F
  #define _MIPS_TUNE_MIPS3 1
  #define _COMPILER_VERSION 601
  #define __CHAR_BIT__ 8
  #define __SYSTYPE_SVR4__ 1
  #define __WCHAR_MAX__ 2147483647
  #define __DBL_DENORM_MIN__ 4.9406564584124654e-324
  #define __FLT_EVAL_METHOD__ 0
  #define __unix__ 1
  #define unix 1
  #define __SIZE_TYPE__ unsigned int
  #define __SYSTYPE_SVR4 1
  #define _MIPS_ISA _MIPS_ISA_MIPS3
  #define SYSTYPE_SVR4 1
  #define __LANGUAGE_C 1
  #define __DBL_MIN_10_EXP__ (-307)
  #define __FINITE_MATH_ONLY__ 0
  #define _MIPS_TUNE "mips3"
  #define __FLT_RADIX__ 2
  #define __LDBL_EPSILON__ 2.46519032881566189191165176650871e-32L
  #define __mips64 1
  #define __SHRT_MAX__ 32767
  #define __LDBL_MAX__ 1.79769313486231590772930519078900e+308L
  #define __DSO__ 1
  #define host_mips 1
  #define __LANGUAGE_C__ 1
  #define __host_mips 1
  #define __CHAR_UNSIGNED__ 1
  #define _MIPS_SZPTR 32
  #define __LDBL_MAX_EXP__ 1024
  #define _MODERN_C 1
  #define _R4000 1
  #define __LONG_MAX__ 2147483647L
  #define __unix 1
  #define __SCHAR_MAX__ 127
  #define __DBL_DIG__ 15
  #define _mips 1
  #define __USER_LABEL_PREFIX__ 
  #define __STDC_HOSTED__ 1
  #define _MIPS_SZINT 32
  #define __mips_fpr 64
  #define __LDBL_MANT_DIG__ 106
  #define __FLT_EPSILON__ 1.19209290e-7F
  #define _LONGLONG 1
  #define __MIPSEB 1
  #define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L
  #define __WCHAR_TYPE__ long int
  #define MIPSEB 1
  #define __host_mips__ 1
  #define __FLT_DIG__ 6
  #define __FLT_MAX_10_EXP__ 38
  #define __INT_MAX__ 2147483647
  #define __FLT_MAX_EXP__ 128
  #define _MIPS_SIM _ABIN32
  #define __DECIMAL_DIG__ 33
  #define __DBL_MANT_DIG__ 53
  #define __mips__ 1
  #define __WINT_TYPE__ long int
  #define __LDBL_MIN_EXP__ (-968)
  #define _MIPS_FPSET 32
  #define __LDBL_MAX_10_EXP__ 308
  #define __DBL_EPSILON__ 2.2204460492503131e-16
  #define _SGI_SOURCE 1
  #define __DBL_MAX__ 1.7976931348623157e+308
  #define _ABIN32 2
  #define __R4000 1
  #define __DBL_MAX_EXP__ 1024
  #define mips 1
  #define __FLT_DENORM_MIN__ 1.40129846e-45F
  #define __LONG_LONG_MAX__ 9223372036854775807LL
  #define __sgi 1
  #define _MIPS_ARCH_MIPS3 1
  #define __FLT_MAX__ 3.40282347e+38F
  #define LANGUAGE_C 1
  #define R4000 1
  #define __GXX_ABI_VERSION 102
  #define __FLT_MIN_10_EXP__ (-37)
  #define __FLT_MIN_EXP__ (-125)
  #define _LANGUAGE_C 1
  #define __MIPSEB__ 1
  #define __DBL_MAX_10_EXP__ 308
  #define _MIPSEB 1
  #define __LDBL_DENORM_MIN__ 4.94065645841246544176568792868221e-324L
  #define __DBL_MIN__ 2.2250738585072014e-308
  #define _MIPS_ARCH "mips3"
  #define _SVR4_SOURCE 1
  #define __mips_hard_float 1
  #define __PTRDIFF_TYPE__ int
  #define __mips 3
  #define __sgi__ 1
  #define _MIPS_SZLONG 32
  #define __R4000__ 1
  #define __LDBL_MIN_10_EXP__ (-291)
  #define __REGISTER_PREFIX__ 
  #define __LDBL_DIG__ 31
  #define __NO_INLINE__ 1
  #define __FLT_MANT_DIG__ 24
  #define __VERSION__ "3.3"


On Tue, Nov 25, 2003 at 07:13:56AM +0100, Michal Pasternak wrote:
> Ryan Cresawn [Mon, Nov 24, 2003 at 11:04:14PM -0500]:
> >   /usr/pkgsrc/lang/gcc3/work/gcc-3.3/gcc/xgcc -B/usr/pkgsrc/lang/gcc3/work/gcc-3.3/gcc/ -B/usr/pkg/gcc-3.3/mips-sgi-irix6.5/bin/ -B/usr/pkg/gcc-3.3/mips-sgi-irix6.5/lib/ -isystem /usr/pkg/gcc-3.3/mips-sgi-irix6.5/include -c -DHAVE_CONFIG_H -O2 -O2 -I/usr/pkg/include -I. -I./../../include  -W -Wall -Wtraditional -pedantic getpwd.c -o getpwd.o
> >   getpwd.c: In function getpwd':
> 
> Please send me this file together with output of "echo f00 | cpp -dM" on
> priv and I'll see what I can do.
> 
> > Is this normal to have so many problems or is something seriously
> 
> It's normal (of course, if you setup your pkgsrc properly). That's why
> pkgsrc exists, to help people building on various, very different machines.
> 
> -- 
> Michal Pasternak :: http://pasternak.w.lub.pl

--a8Wt8u1KmwUX3Y2C
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="getpwd.c"

/* getpwd.c - get the working directory */

/*

@deftypefn Supplemental char* getpwd (void)

Returns the current working directory.  This implementation caches the
result on the assumption that the process will not call @code{chdir}
between calls to @code{getpwd}.

@end deftypefn

*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <sys/types.h>

#include <errno.h>
#ifndef errno
extern int errno;
#endif

#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif

/* Prototype these in case the system headers don't provide them. */
extern char *getpwd ();
extern char *getwd ();

#include "libiberty.h"

/* Virtually every UN*X system now in common use (except for pre-4.3-tahoe
   BSD systems) now provides getcwd as called for by POSIX.  Allow for
   the few exceptions to the general rule here.  */

#if !defined(HAVE_GETCWD) && defined(HAVE_GETWD)
#define getcwd(buf,len) getwd(buf)
#endif

#ifdef MAXPATHLEN
#define GUESSPATHLEN (MAXPATHLEN + 1)
#else
#define GUESSPATHLEN 100
#endif

#if !(defined (VMS) || (defined(_WIN32) && !defined(__CYGWIN__)))

/* Get the working directory.  Use the PWD environment variable if it's
   set correctly, since this is faster and gives more uniform answers
   to the user.  Yield the working directory if successful; otherwise,
   yield 0 and set errno.  */

char *
getpwd ()
{
  static char *pwd;
  static int failure_errno;

  char *p = pwd;
  size_t s;
  struct stat dotstat, pwdstat;

  if (!p && !(errno = failure_errno))
    {
      if (! ((p = getenv ("PWD")) != 0
	     && *p == '/'
	     && stat (p, &pwdstat) == 0
	     && stat (".", &dotstat) == 0
	     && dotstat.st_ino == pwdstat.st_ino
	     && dotstat.st_dev == pwdstat.st_dev))

	/* The shortcut didn't work.  Try the slow, ``sure'' way.  */
	for (s = GUESSPATHLEN;  ! getcwd (p = xmalloc (s), s);  s *= 2)
	  {
	    int e = errno;
	    free (p);
#ifdef ERANGE
	    if (e != ERANGE)
#endif
	      {
		errno = failure_errno = e;
		p = 0;
		break;
	      }
	  }

      /* Cache the result.  This assumes that the program does
	 not invoke chdir between calls to getpwd.  */
      pwd = p;
    }
  return p;
}

#else	/* VMS || _WIN32 && !__CYGWIN__ */

#ifndef MAXPATHLEN
#define MAXPATHLEN 255
#endif

char *
getpwd ()
{
  static char *pwd = 0;

  if (!pwd)
    pwd = getcwd (xmalloc (MAXPATHLEN + 1), MAXPATHLEN + 1
#ifdef VMS
		  , 0
#endif
		  );
  return pwd;
}

#endif	/* VMS || _WIN32 && !__CYGWIN__ */

--a8Wt8u1KmwUX3Y2C--