public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: hpux 11.11 build
@ 2001-09-12  9:41 Vazquez, Ed
  0 siblings, 0 replies; 3+ messages in thread
From: Vazquez, Ed @ 2001-09-12  9:41 UTC (permalink / raw)
  To: gcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 15416 bytes --]

OK, not being a C/C++ guru myself, I have been having this same
problem, not only with gcc-3.0.1, but with any GNU project that
uses the libiberty/floatformat library.

Following the instructions posted by Michael Eager, here is the
cat of the floatformat.i output.  It means little to me, but perhaps
someone out there can enlighten those of us that have to put up
with HP-UX...

====BEGIN=====
# cat pic/floatformat.i
# 20 "../../../gcc-3.0.1/libiberty/floatformat.c"
# 1 "../../../gcc-3.0.1/include/floatformat.h" 1
# 23 "../../../gcc-3.0.1/include/floatformat.h"
# 1 "../../../gcc-3.0.1/include/ansidecl.h" 1
# 24 "../../../gcc-3.0.1/include/floatformat.h" 2
# 33 "../../../gcc-3.0.1/include/floatformat.h"
enum floatformat_byteorders {




  floatformat_little,




  floatformat_big,




  floatformat_littlebyte_bigword

};

enum floatformat_intbit { floatformat_intbit_yes, floatformat_intbit_no
};

struct floatformat
{
  enum floatformat_byteorders byteorder;
  unsigned int totalsize;


  unsigned int sign_start;

  unsigned int exp_start;
  unsigned int exp_len;

  unsigned int exp_bias;



  unsigned int exp_nan;

  unsigned int man_start;
  unsigned int man_len;


  enum floatformat_intbit intbit;


  const char *name;
};



extern const struct floatformat floatformat_ieee_single_big;
extern const struct floatformat floatformat_ieee_single_little;
extern const struct floatformat floatformat_ieee_double_big;
extern const struct floatformat floatformat_ieee_double_little;



extern const struct floatformat
floatformat_ieee_double_littlebyte_bigword;



extern const struct floatformat floatformat_i387_ext;
extern const struct floatformat floatformat_m68881_ext;
extern const struct floatformat floatformat_i960_ext;
extern const struct floatformat floatformat_m88110_ext;
extern const struct floatformat floatformat_arm_ext;





extern void
floatformat_to_double (const struct floatformat *, char *, double *);




extern void
floatformat_from_double (const struct floatformat *, double *, char *);
# 21 "../../../gcc-3.0.1/libiberty/floatformat.c" 2
# 1 "/usr/src/gcc-build/gcc/include/math.h" 1 3
# 14 "/usr/src/gcc-build/gcc/include/math.h" 3
# 1 "/usr/include/sys/stdsyms.h" 1 3
# 15 "/usr/src/gcc-build/gcc/include/math.h" 2 3
# 33 "/usr/src/gcc-build/gcc/include/math.h" 3
#pragma NO_SIDE_EFFECTS fabs
# 46 "/usr/src/gcc-build/gcc/include/math.h" 3
   extern double acos(double);
   extern double asin(double);
   extern double atan(double);
   extern double atan2(double, double);
   extern double cos(double);
   extern double sin(double);
   extern double tan(double);
   extern double cosh(double);
   extern double sinh(double);
   extern double tanh(double);
   extern double exp(double);
   extern double frexp(double, int *);
   extern double ldexp(double, int);
   extern double log(double);
   extern double log10(double);
   extern double modf(double, double *);
   extern double pow(double, double);
   extern double sqrt(double);
   extern double ceil(double);
   extern double fabs(double);
   extern double floor(double);
   extern double fmod(double, double);
# 116 "/usr/src/gcc-build/gcc/include/math.h" 3
   extern int signgam;


#pragma NO_SIDE_EFFECTS isnan







     extern double erf(double);
     extern double erfc(double);
     extern double gamma(double);
     extern double hypot(double, double);
     extern int isnan(double);
     extern double j0(double);
     extern double j1(double);
     extern double jn(int, double);
     extern double lgamma(double);
     extern double y0(double);
     extern double y1(double);
     extern double yn(int, double);
# 159 "/usr/src/gcc-build/gcc/include/math.h" 3
     extern double acosh(double);
     extern double asinh(double);
     extern double atanh(double);
     extern double cbrt(double);
     extern double expm1(double);
     extern int ilogb(double);
     extern double log1p(double);
     extern double logb(double);
     extern double nextafter(double, double);
     extern double remainder(double, double);
     extern double rint(double);
     extern double scalb(double,double);
# 194 "/usr/src/gcc-build/gcc/include/math.h" 3
     typedef float float_t;
     typedef double double_t;
# 232 "/usr/src/gcc-build/gcc/include/math.h" 3
#pragma NO_SIDE_EFFECTS copysign, copysignf, fabsf
#pragma NO_SIDE_EFFECTS _Fpclassify, _Fpclassifyf, _Fpclassifyfd
#pragma NO_SIDE_EFFECTS _Isunordered, _Isunorderedf
#pragma NO_SIDE_EFFECTS _Signbit, _Signbitf, _Isnanf, _Isinf, _Isinff
#pragma NO_SIDE_EFFECTS _Isfinite, _Isfinitef, _Isnormal, _Isnormalf,
_Isnormalf
d
# 247 "/usr/src/gcc-build/gcc/include/math.h" 3
     extern double copysign(double, double);
     extern double log2(double);
     extern double lgamma_r(double, int *);
     extern double exp2(double);
     extern double fdim(double, double);
     extern double fmax(double, double);
     extern double fmin(double, double);
     extern double nan(const char *);
     extern double scalbn(double, int);
     extern double nearbyint(double);
     extern double round(double);
     extern double trunc(double);
     extern double remquo(double, double, int *);
     extern long lrint(double);
     extern long lround(double);

       extern long long llrint(double);
       extern long long llround(double);

     extern double cosd(double);
     extern double sind(double);
     extern double tand(double);






     extern double acosd(double);
     extern double asind(double);
     extern double atand(double);
     extern double atan2d(double, double);

     extern float acosf(float);
     extern float asinf(float);
     extern float atanf(float);
     extern float atan2f(float, float);
     extern float cosf(float);
     extern float sinf(float);
     extern float tanf(float);
     extern float coshf(float);
     extern float sinhf(float);
     extern float tanhf(float);
     extern float expf(float);
     extern float logf(float);
     extern float log10f(float);
     extern float powf(float, float);
     extern float sqrtf(float);
     extern float fabsf(float);
     extern float fmodf(float, float);
     extern float cbrtf(float);
     extern float copysignf(float, float);
     extern float nextafterf(float, float);
     extern float log2f(float);
     extern float cosdf(float);
     extern float sindf(float);
     extern float tandf(float);
     extern float acosdf(float);
     extern float asindf(float);
     extern float atandf(float);
     extern float atan2df(float, float);
# 468 "/usr/src/gcc-build/gcc/include/math.h" 3
   extern const double _DINFINITY;
# 484 "/usr/src/gcc-build/gcc/include/math.h" 3
     extern const float _SINFINITY;
     extern const float _SQNAN;
     extern int _Islessgreater(double, double);
     extern int _Islessgreaterf(float, float);
# 531 "/usr/src/gcc-build/gcc/include/math.h" 3
       extern int _Signbit(double);
       extern int _Signbitf(float);
       extern int _Isnanf(float);
       extern int _Isfinite(double);
       extern int _Isfinitef(float);
       extern int _Isinf(double);
       extern int _Isinff(float);
       extern int _Isnormal(double);
       extern int _Isnormalf(float);
       extern int _Isunordered(double, double);
       extern int _Isunorderedf(float, float);
       extern int _Isless(double, double);
       extern int _Islessf(float, float);
       extern int _Islessequal(double, double);
       extern int _Islessequalf(float, float);
       extern int _Isgreater(double, double);
       extern int _Isgreaterf(float, float);
       extern int _Isgreaterequal(double, double);
       extern int _Isgreaterequalf(float, float);




       extern int _Fpclassify(double);
       extern int _Fpclassifyf(float);
# 22 "../../../gcc-3.0.1/libiberty/floatformat.c" 2

# 1 "/usr/src/gcc-build/gcc/include/stddef.h" 1 3
# 147 "/usr/src/gcc-build/gcc/include/stddef.h" 3
typedef long int ptrdiff_t;
# 287 "/usr/src/gcc-build/gcc/include/stddef.h" 3
typedef unsigned int wchar_t;
# 24 "../../../gcc-3.0.1/libiberty/floatformat.c" 2
extern void *memcpy (void *s1, const void *s2, size_t n);
extern void *memset (void *s, int c, size_t n);
# 37 "../../../gcc-3.0.1/libiberty/floatformat.c"
const struct floatformat floatformat_ieee_single_big =
{
  floatformat_big, 32, 0, 1, 8, 127, 255, 9, 23,
  floatformat_intbit_no,
  "floatformat_ieee_single_big"
};
const struct floatformat floatformat_ieee_single_little =
{
  floatformat_little, 32, 0, 1, 8, 127, 255, 9, 23,
  floatformat_intbit_no,
  "floatformat_ieee_single_little"
};
const struct floatformat floatformat_ieee_double_big =
{
  floatformat_big, 64, 0, 1, 11, 1023, 2047, 12, 52,
  floatformat_intbit_no,
  "floatformat_ieee_double_big"
};
const struct floatformat floatformat_ieee_double_little =
{
  floatformat_little, 64, 0, 1, 11, 1023, 2047, 12, 52,
  floatformat_intbit_no,
  "floatformat_ieee_double_little"
};




const struct floatformat floatformat_ieee_double_littlebyte_bigword =
{
  floatformat_littlebyte_bigword, 64, 0, 1, 11, 1023, 2047, 12, 52,
  floatformat_intbit_no,
  "floatformat_ieee_double_little"
};

const struct floatformat floatformat_i387_ext =
{
  floatformat_little, 80, 0, 1, 15, 0x3fff, 0x7fff, 16, 64,
  floatformat_intbit_yes,
  "floatformat_i387_ext"
};
const struct floatformat floatformat_m68881_ext =
{

  floatformat_big, 96, 0, 1, 15, 0x3fff, 0x7fff, 32, 64,
  floatformat_intbit_yes,
  "floatformat_m68881_ext"
};
const struct floatformat floatformat_i960_ext =
{

  floatformat_little, 96, 16, 17, 15, 0x3fff, 0x7fff, 32, 64,
  floatformat_intbit_yes,
  "floatformat_i960_ext"
};
const struct floatformat floatformat_m88110_ext =
{







  floatformat_big, 80, 0, 1, 15, 0x3fff, 0x7fff, 16, 64,
  floatformat_intbit_yes,
  "floatformat_m88110_ext"

};
const struct floatformat floatformat_arm_ext =
{

  floatformat_big, 96, 0, 17, 15, 0x3fff, 0x7fff, 32, 64,
  floatformat_intbit_yes,
  "floatformat_arm_ext"
};

static unsigned long get_field (unsigned char *, enum
floatformat_byteorders, un
signed int, unsigned int, unsigned int);







static unsigned long
get_field (data, order, total_len, start, len)
     unsigned char *data;
     enum floatformat_byteorders order;
     unsigned int total_len;
     unsigned int start;
     unsigned int len;
{
  unsigned long result;
  unsigned int cur_byte;
  int cur_bitshift;


  cur_byte = (start + len) / 8;
  if (order == floatformat_little)
    cur_byte = (total_len / 8) - cur_byte - 1;
  cur_bitshift =
    ((start + len) % 8) - 8;
  result = *(data + cur_byte) >> (-cur_bitshift);
  cur_bitshift += 8;
  if (order == floatformat_little)
    ++cur_byte;
  else
    --cur_byte;


  while ((unsigned int) cur_bitshift < len)
    {
      if (len - cur_bitshift < 8)


        result |=
          (*(data + cur_byte) & ((1 << (len - cur_bitshift)) - 1))
            << cur_bitshift;
      else
        result |= *(data + cur_byte) << cur_bitshift;
      cur_bitshift += 8;
      if (order == floatformat_little)
        ++cur_byte;
      else
        --cur_byte;
    }
  return result;
}
# 175 "../../../gcc-3.0.1/libiberty/floatformat.c"
void
floatformat_to_double (fmt, from, to)
     const struct floatformat *fmt;
     char *from;
     double *to;
{
  unsigned char *ufrom = (unsigned char *)from;
  double dto;
  long exponent;
  unsigned long mant;
  unsigned int mant_bits, mant_off;
  int mant_bits_left;
  int special_exponent;

  exponent = get_field (ufrom, fmt->byteorder, fmt->totalsize,
                        fmt->exp_start, fmt->exp_len);




  mant_bits_left = fmt->man_len;
  mant_off = fmt->man_start;
  dto = 0.0;

  special_exponent = exponent == 0 || (unsigned long) exponent ==
fmt->exp_nan;


  if (!special_exponent)
    exponent -= fmt->exp_bias;







  if (!special_exponent)
    {
      if (fmt->intbit == floatformat_intbit_no)
        dto = ldexp (1.0, exponent);
      else
        exponent++;
    }

  while (mant_bits_left > 0)
    {
      mant_bits = ((mant_bits_left) < (32) ? (mant_bits_left) : (32));

      mant = get_field (ufrom, fmt->byteorder, fmt->totalsize,
                         mant_off, mant_bits);

      dto += ldexp ((double)mant, exponent - mant_bits);
      exponent -= mant_bits;
      mant_off += mant_bits;
      mant_bits_left -= mant_bits;
    }


  if (get_field (ufrom, fmt->byteorder, fmt->totalsize, fmt->sign_start,
1))
    dto = -dto;
  *to = dto;
}

static void put_field (unsigned char *, enum floatformat_byteorders,
unsigned in
t, unsigned int, unsigned int, unsigned long);







static void
put_field (data, order, total_len, start, len, stuff_to_put)
     unsigned char *data;
     enum floatformat_byteorders order;
     unsigned int total_len;
     unsigned int start;
     unsigned int len;
     unsigned long stuff_to_put;
{
  unsigned int cur_byte;
  int cur_bitshift;


  cur_byte = (start + len) / 8;
  if (order == floatformat_little)
    cur_byte = (total_len / 8) - cur_byte - 1;
  cur_bitshift =
    ((start + len) % 8) - 8;
  *(data + cur_byte) &=
    ~(((1 << ((start + len) % 8)) - 1) << (-cur_bitshift));
  *(data + cur_byte) |=
    (stuff_to_put & ((1 << 8) - 1)) << (-cur_bitshift);
  cur_bitshift += 8;
  if (order == floatformat_little)
    ++cur_byte;
  else
    --cur_byte;


  while ((unsigned int) cur_bitshift < len)
    {
      if (len - cur_bitshift < 8)
        {

          *(data + cur_byte) &=
            ~((1 << (len - cur_bitshift)) - 1);
          *(data + cur_byte) |= (stuff_to_put >> cur_bitshift);
        }
      else
        *(data + cur_byte) = ((stuff_to_put >> cur_bitshift)
                              & ((1 << 8) - 1));
      cur_bitshift += 8;
      if (order == floatformat_little)
        ++cur_byte;
      else
        --cur_byte;
    }
}





void
floatformat_from_double (fmt, from, to)
     const struct floatformat *fmt;
     double *from;
     char *to;
{
  double dfrom;
  int exponent;
  double mant;
  unsigned int mant_bits, mant_off;
  int mant_bits_left;
  unsigned char *uto = (unsigned char *)to;

  memcpy (&dfrom, from, sizeof (dfrom));
  memset (uto, 0, fmt->totalsize / 8);
  if (dfrom == 0)
    return;
  if (dfrom != dfrom)
    {

      put_field (uto, fmt->byteorder, fmt->totalsize, fmt->exp_start,
                 fmt->exp_len, fmt->exp_nan);

      put_field (uto, fmt->byteorder, fmt->totalsize, fmt->man_start,
                 32, 1);
      return;
    }


  if (dfrom < 0)
    {
      put_field (uto, fmt->byteorder, fmt->totalsize, fmt->sign_start,
1, 1);
      dfrom = -dfrom;
    }



  mant = frexp (dfrom, &exponent);
  put_field (uto, fmt->byteorder, fmt->totalsize, fmt->exp_start,
fmt->exp_len,
             exponent + fmt->exp_bias - 1);

  mant_bits_left = fmt->man_len;
  mant_off = fmt->man_start;
  while (mant_bits_left > 0)
    {
      unsigned long mant_long;
      mant_bits = mant_bits_left < 32 ? mant_bits_left : 32;

      mant *= 4294967296.0;
      mant_long = (unsigned long)mant;
      mant -= mant_long;





      if ((unsigned int) mant_bits_left == fmt->man_len
          && fmt->intbit == floatformat_intbit_no)
        {
          mant_long &= 0x7fffffff;
          mant_bits -= 1;
        }
      else if (mant_bits < 32)
        {


          mant_long >>= 32 - mant_bits;
        }

      put_field (uto, fmt->byteorder, fmt->totalsize,
                 mant_off, mant_bits, mant_long);
      mant_off += mant_bits;
      mant_bits_left -= mant_bits;
    }
}
#
=====END=====

-- 
Ed Vázquez

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: hpux 11.11 build
  2001-08-18  7:50 Gary Bell
@ 2001-08-24 16:00 ` Michael Eager
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Eager @ 2001-08-24 16:00 UTC (permalink / raw)
  To: bell.gary; +Cc: gcc

The lines at floatformat.c:24-25:

extern void *memcpy (void *s1, const void *s2, size_t n);
extern void *memset (void *s, int c, size_t n);    

The error message says that there was a parse error before "size_t"
in both of these lines.  There may be a macro which is causing a
error before the "size_t" token.  

Compile by hand, replacing the -c command line option with -E to 
see the preprocessor output. Direct the output to floatformat.i, 
rather than the normal object file.

Take a look at the preprocessed source and see exactly what the compiler
is complaining about in these two lines.

   
Gary Bell wrote:
> 
> I have been trying to Build gcc-3.0 on a HPUX 11.11 workstation.  I have
> run
>   in to several problems and have have a developer friend to help me
> with the
>   compilation.  I have gotten stuck on this part of the build and not
> being
>   very C literate, have been told to post this information here to see
> if you
>   had any insight as to how I can overcome this message.
> 
>   Thank you,
>   Gary Bell
> 
>   ---snip---
> 
>   if [ x"" != x ]; then \
>             /temp/gcc-3.0/gcc/xgcc -B/temp/gcc-3.0/gcc/
>   -B/usr/local/gcc-3.0/hppa1.1-hp-hpux11.11/bin/
>   -B/usr/local/gcc-3.0/hppa1.1-hp-hpux11.11/lib/ -isystem
>   /usr/local/gcc-3.0/hppa1.1-hp-hpux11.11/include -c -DHAVE_CONFIG_H -g
> -O2
>   -I. -I./../../include  -W -Wall -Wtraditional -pedantic  floatformat.c
> -o
>   pic/floatformat.o; \
>           else true; fi
>           /temp/gcc-3.0/gcc/xgcc -B/temp/gcc-3.0/gcc/
>   -B/usr/local/gcc-3.0/hppa1.1-hp-hpux11.11/bin/
>   -B/usr/local/gcc-3.0/hppa1.1-hp-hpux11.11/lib/ -isystem
>   /usr/local/gcc-3.0/hppa1.1-hp-hpux11.11/include -c -DHAVE_CONFIG_H -g
> -O2
>   -I. -I./../../include  -W -Wall -Wtraditional -pedantic floatformat.c
>   floatformat.c:24: parse error before "size_t"
>   floatformat.c:25: parse error before "size_t"
>   *** Error exit code 1
> 
>   Stop.
>   *** Error exit code 1
> 
>   Stop.
>   *** Error exit code 1
> 
>   Stop.

--
Michael Eager     eager@mvista.com	408-328-8426	
MontaVista Software, Inc. 1237 E. Arques Ave., Sunnyvale, CA  94085

^ permalink raw reply	[flat|nested] 3+ messages in thread

* hpux 11.11 build
@ 2001-08-18  7:50 Gary Bell
  2001-08-24 16:00 ` Michael Eager
  0 siblings, 1 reply; 3+ messages in thread
From: Gary Bell @ 2001-08-18  7:50 UTC (permalink / raw)
  To: gcc

I have been trying to Build gcc-3.0 on a HPUX 11.11 workstation.  I have
run
  in to several problems and have have a developer friend to help me
with the
  compilation.  I have gotten stuck on this part of the build and not
being
  very C literate, have been told to post this information here to see
if you
  had any insight as to how I can overcome this message.

  Thank you,
  Gary Bell

  ---snip---

  if [ x"" != x ]; then \
            /temp/gcc-3.0/gcc/xgcc -B/temp/gcc-3.0/gcc/
  -B/usr/local/gcc-3.0/hppa1.1-hp-hpux11.11/bin/
  -B/usr/local/gcc-3.0/hppa1.1-hp-hpux11.11/lib/ -isystem
  /usr/local/gcc-3.0/hppa1.1-hp-hpux11.11/include -c -DHAVE_CONFIG_H -g
-O2
  -I. -I./../../include  -W -Wall -Wtraditional -pedantic  floatformat.c
-o
  pic/floatformat.o; \
          else true; fi
          /temp/gcc-3.0/gcc/xgcc -B/temp/gcc-3.0/gcc/
  -B/usr/local/gcc-3.0/hppa1.1-hp-hpux11.11/bin/
  -B/usr/local/gcc-3.0/hppa1.1-hp-hpux11.11/lib/ -isystem
  /usr/local/gcc-3.0/hppa1.1-hp-hpux11.11/include -c -DHAVE_CONFIG_H -g
-O2
  -I. -I./../../include  -W -Wall -Wtraditional -pedantic floatformat.c
  floatformat.c:24: parse error before "size_t"
  floatformat.c:25: parse error before "size_t"
  *** Error exit code 1

  Stop.
  *** Error exit code 1

  Stop.
  *** Error exit code 1

  Stop.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-09-12  9:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-12  9:41 hpux 11.11 build Vazquez, Ed
  -- strict thread matches above, loose matches on Subject: below --
2001-08-18  7:50 Gary Bell
2001-08-24 16:00 ` Michael Eager

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).