Re: fails to compile with undefined symbol (FP_PLUS_INF)

Lists: pgsql-ports
From: "Riccardo Mottola" <multix(at)gmail(dot)com>
To: pgsql-ports(at)postgresql(dot)org
Subject: fails to compile with undefined symbol (FP_PLUS_INF)
Date: 2006-03-16 15:48:54
Message-ID: 259a55900603160748v2646acd4l2909650eab5a4737@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-ports

when compiling psql 8.1.3 using gcc 3.4.5 on AIX 4.2.1 on powerpc32 I
get the following error:

gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline
-Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing
-I../../src/port -DFRONTEND -I../../src/include -I/usr/local/include
-c isinf.c -o isinf.o
isinf.c: In function `isinf':
isinf.c:69: error: `FP_PLUS_INF' undeclared (first use in this function)
isinf.c:69: error: (Each undeclared identifier is reported only once
isinf.c:69: error: for each function it appears in.)
isinf.c:71: error: `FP_MINUS_INF' undeclared (first use in this function)
make[2]: *** [isinf.o] Error 1

configure options where:
./configure --with-includes=/usr/local/include
--with-libs=/usr/local/lib --without-readline

any ideas? patches? is this already known?

thanks,
Riccardo


From: Seneca Cunningham <scunning(at)ca(dot)afilias(dot)info>
To: Riccardo Mottola <multix(at)gmail(dot)com>
Cc: pgsql-ports(at)postgresql(dot)org
Subject: Re: fails to compile with undefined symbol (FP_PLUS_INF)
Date: 2006-03-16 16:05:15
Message-ID: 44198CBB.9070608@ca.afilias.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-ports

Riccardo Mottola wrote:
> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline
> -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing
> -I../../src/port -DFRONTEND -I../../src/include -I/usr/local/include
> -c isinf.c -o isinf.o
> isinf.c: In function `isinf':
> isinf.c:69: error: `FP_PLUS_INF' undeclared (first use in this function)
> isinf.c:69: error: (Each undeclared identifier is reported only once
> isinf.c:69: error: for each function it appears in.)
> isinf.c:71: error: `FP_MINUS_INF' undeclared (first use in this function)
> make[2]: *** [isinf.o] Error 1

Are FP_PLUS_INF and FP_MINUS_INF defined in float.h or math.h? The
oldest docs that I found were for AIX 4.3 and what I could gather from
them is that the code should compile.

--
Seneca Cunningham
scunning(at)ca(dot)afilias(dot)info


From: "Riccardo Mottola" <multix(at)gmail(dot)com>
To: "Seneca Cunningham" <scunning(at)ca(dot)afilias(dot)info>
Cc: pgsql-ports(at)postgresql(dot)org
Subject: Re: fails to compile with undefined symbol (FP_PLUS_INF)
Date: 2006-03-16 16:11:45
Message-ID: 259a55900603160811h6d797ddeud9efb0b91c22a51f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-ports

Hey,

our faithful grep tool says:
bash-2.01$ grep FP_PLUS_INF *
float.h:#define FP_PLUS_INF 4
bash-2.01$ grep FP_MINUS_INF *
float.h:#define FP_MINUS_INF 5

On 3/16/06, Seneca Cunningham <scunning(at)ca(dot)afilias(dot)info> wrote:
> Riccardo Mottola wrote:
> > gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline
> > -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing
> > -I../../src/port -DFRONTEND -I../../src/include -I/usr/local/include
> > -c isinf.c -o isinf.o
> > isinf.c: In function `isinf':
> > isinf.c:69: error: `FP_PLUS_INF' undeclared (first use in this function)
> > isinf.c:69: error: (Each undeclared identifier is reported only once
> > isinf.c:69: error: for each function it appears in.)
> > isinf.c:71: error: `FP_MINUS_INF' undeclared (first use in this function)
> > make[2]: *** [isinf.o] Error 1
>
> Are FP_PLUS_INF and FP_MINUS_INF defined in float.h or math.h? The
> oldest docs that I found were for AIX 4.3 and what I could gather from
> them is that the code should compile.
>
> --
> Seneca Cunningham
> scunning(at)ca(dot)afilias(dot)info
>


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Riccardo Mottola" <multix(at)gmail(dot)com>
Cc: "Seneca Cunningham" <scunning(at)ca(dot)afilias(dot)info>, pgsql-ports(at)postgresql(dot)org
Subject: Re: fails to compile with undefined symbol (FP_PLUS_INF)
Date: 2006-03-16 16:23:49
Message-ID: 17391.1142526229@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-ports

"Riccardo Mottola" <multix(at)gmail(dot)com> writes:
> our faithful grep tool says:
> bash-2.01$ grep FP_PLUS_INF *
> float.h:#define FP_PLUS_INF 4
> bash-2.01$ grep FP_MINUS_INF *
> float.h:#define FP_MINUS_INF 5

These must be within #if's that prevent them from being seen ...
you'll need to figure out what exactly. On HPUX we use
CPPFLAGS="-D_XOPEN_SOURCE_EXTENDED"
to gain access to some symbols we need, and I'll bet something
similar is needed on AIX.

regards, tom lane


From: Seneca Cunningham <scunning(at)ca(dot)afilias(dot)info>
To: Riccardo Mottola <multix(at)gmail(dot)com>
Cc: pgsql-ports(at)postgresql(dot)org
Subject: Re: fails to compile with undefined symbol (FP_PLUS_INF)
Date: 2006-03-16 16:24:10
Message-ID: 4419912A.1070903@ca.afilias.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-ports

Riccardo Mottola wrote:
> our faithful grep tool says:
> bash-2.01$ grep FP_PLUS_INF *
> float.h:#define FP_PLUS_INF 4
> bash-2.01$ grep FP_MINUS_INF *
> float.h:#define FP_MINUS_INF 5

Is there a float.h in your gcc install directory? Is it #included
instead of /usr/include/float.h by gcc? My faithful grep tool says:

-bash-2.05b$ grep FP_MINUS_INF /usr/include/*
/usr/include/float.h:#define FP_MINUS_INF 5
/usr/include/math.h:#define FP_MINUS_INF 5

The float.h that's part of gcc doesn't contain the defines.

> On 3/16/06, Seneca Cunningham <scunning(at)ca(dot)afilias(dot)info> wrote:
>> Riccardo Mottola wrote:
>>> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline
>>> -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing
>>> -I../../src/port -DFRONTEND -I../../src/include -I/usr/local/include
>>> -c isinf.c -o isinf.o
>>> isinf.c: In function `isinf':
>>> isinf.c:69: error: `FP_PLUS_INF' undeclared (first use in this function)
>>> isinf.c:69: error: (Each undeclared identifier is reported only once
>>> isinf.c:69: error: for each function it appears in.)
>>> isinf.c:71: error: `FP_MINUS_INF' undeclared (first use in this function)
>>> make[2]: *** [isinf.o] Error 1
>> Are FP_PLUS_INF and FP_MINUS_INF defined in float.h or math.h? The
>> oldest docs that I found were for AIX 4.3 and what I could gather from
>> them is that the code should compile.

--
Seneca Cunningham
scunning(at)ca(dot)afilias(dot)info


From: "Riccardo Mottola" <multix(at)gmail(dot)com>
To: "Seneca Cunningham" <scunning(at)ca(dot)afilias(dot)info>
Cc: pgsql-ports(at)postgresql(dot)org
Subject: Re: fails to compile with undefined symbol (FP_PLUS_INF)
Date: 2006-03-16 16:38:27
Message-ID: 259a55900603160838p4a529a4l590a9baa444a5575@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-ports

Hello,

> Is there a float.h in your gcc install directory? Is it #included
> instead of /usr/include/float.h by gcc? My faithful grep tool says:
>
> -bash-2.05b$ grep FP_MINUS_INF /usr/include/*
> /usr/include/float.h:#define FP_MINUS_INF 5
> /usr/include/math.h:#define FP_MINUS_INF 5
>
> The float.h that's part of gcc doesn't contain the defines.

yes, exactly. lib/gcc/powerpc-ibm-aix4.2.1.0/3.4.5/include/float.h

and indeed, it has not those defines.
As far as I know, the gcc includes have always precedence. Maybe you
should run a configure check?
Do you know a workaround?

-R


From: Seneca Cunningham <scunning(at)ca(dot)afilias(dot)info>
To: Riccardo Mottola <multix(at)gmail(dot)com>
Cc: pgsql-ports(at)postgresql(dot)org
Subject: Re: fails to compile with undefined symbol (FP_PLUS_INF)
Date: 2006-03-16 17:16:23
Message-ID: 44199D67.60408@ca.afilias.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-ports

Riccardo Mottola wrote:
> Hello,
>
>> Is there a float.h in your gcc install directory? Is it #included
>> instead of /usr/include/float.h by gcc? My faithful grep tool says:
>>
>> -bash-2.05b$ grep FP_MINUS_INF /usr/include/*
>> /usr/include/float.h:#define FP_MINUS_INF 5
>> /usr/include/math.h:#define FP_MINUS_INF 5
>>
>> The float.h that's part of gcc doesn't contain the defines.
>
> yes, exactly. lib/gcc/powerpc-ibm-aix4.2.1.0/3.4.5/include/float.h
>
> and indeed, it has not those defines.
> As far as I know, the gcc includes have always precedence. Maybe you
> should run a configure check?
> Do you know a workaround?

Something that may work would be to take the block of defines output by:

grep -p FP_MINUS_INF /usr/include/*

and add it to the math.h in the gcc directory. I don't have a 4.2 box
here so I can't test this, but the math.h in my gcc directory does
contain the defines. That math.h should be similar to the math.h in
/usr/include.

--
Seneca Cunningham
scunning(at)ca(dot)afilias(dot)info


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Riccardo Mottola" <multix(at)gmail(dot)com>
Cc: "Seneca Cunningham" <scunning(at)ca(dot)afilias(dot)info>, pgsql-ports(at)postgresql(dot)org
Subject: Re: fails to compile with undefined symbol (FP_PLUS_INF)
Date: 2006-03-16 17:58:06
Message-ID: 18237.1142531886@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-ports

"Riccardo Mottola" <multix(at)gmail(dot)com> writes:
>> The float.h that's part of gcc doesn't contain the defines.

> yes, exactly. lib/gcc/powerpc-ibm-aix4.2.1.0/3.4.5/include/float.h
> and indeed, it has not those defines.

Ah-hah. This probably indicates that the gcc you are using was
originally generated on a different version of AIX. It's always bad
news when gcc's copies of the headers don't match the real ones :-(

These copies are generated during gcc build by a script called
"fixincludes". You might be able to fix them up by just re-running
fixincludes. My inclination would be to rebuild gcc altogether though.

regards, tom lane


From: Seneca Cunningham <scunning(at)ca(dot)afilias(dot)info>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Riccardo Mottola <multix(at)gmail(dot)com>, pgsql-ports(at)postgresql(dot)org
Subject: Re: fails to compile with undefined symbol (FP_PLUS_INF)
Date: 2006-03-16 18:23:30
Message-ID: 4419AD22.4020108@ca.afilias.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-ports

Tom Lane wrote:
> "Riccardo Mottola" <multix(at)gmail(dot)com> writes:
>>> The float.h that's part of gcc doesn't contain the defines.
>
>> yes, exactly. lib/gcc/powerpc-ibm-aix4.2.1.0/3.4.5/include/float.h
>> and indeed, it has not those defines.
>
> Ah-hah. This probably indicates that the gcc you are using was
> originally generated on a different version of AIX. It's always bad
> news when gcc's copies of the headers don't match the real ones :-(
>
> These copies are generated during gcc build by a script called
> "fixincludes". You might be able to fix them up by just re-running
> fixincludes. My inclination would be to rebuild gcc altogether though.

My gcc build is like that and I was the one who built it to replace
another build of gcc. gcc doesn't seem to like float.h on AIX and just
uses its own as part of fixincludes; math.h comes out in a more intact
state. This means that on AIX versions where math.h also contains
FP_PLUS_INF (and the rest of that block of defines), the defines do
occur. It would appear that 4.2 doesn't also contain the necessary
defines as part of math.h (protected by an #ifndef on 5.3).

--
Seneca Cunningham
scunning(at)ca(dot)afilias(dot)info


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Seneca Cunningham <scunning(at)ca(dot)afilias(dot)info>
Cc: Riccardo Mottola <multix(at)gmail(dot)com>, pgsql-ports(at)postgresql(dot)org
Subject: Re: fails to compile with undefined symbol (FP_PLUS_INF)
Date: 2006-03-16 18:33:14
Message-ID: 18693.1142533994@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-ports

Seneca Cunningham <scunning(at)ca(dot)afilias(dot)info> writes:
> Tom Lane wrote:
>> These copies are generated during gcc build by a script called
>> "fixincludes". You might be able to fix them up by just re-running
>> fixincludes. My inclination would be to rebuild gcc altogether though.

> My gcc build is like that and I was the one who built it to replace
> another build of gcc. gcc doesn't seem to like float.h on AIX and just
> uses its own as part of fixincludes; math.h comes out in a more intact
> state.

I'd call that a gcc bug...

regards, tom lane


From: "Riccardo Mottola" <multix(at)gmail(dot)com>
To: "Seneca Cunningham" <scunning(at)ca(dot)afilias(dot)info>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-ports(at)postgresql(dot)org
Subject: Re: fails to compile with undefined symbol (FP_PLUS_INF)
Date: 2006-03-16 18:40:40
Message-ID: 259a55900603161040n4c90781fg5722ce14536c3804@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-ports

Hello,

On 3/16/06, Seneca Cunningham <scunning(at)ca(dot)afilias(dot)info> wrote:
>
> > Ah-hah. This probably indicates that the gcc you are using was
> > originally generated on a different version of AIX. It's always bad
> > news when gcc's copies of the headers don't match the real ones :-(

incorrect: i built the gcc myself by boostrapping from an older binary gcc.
I did exactly to avoid this kind of problems.

>
> > These copies are generated during gcc build by a script called
> > "fixincludes". You might be able to fix them up by just re-running
> > fixincludes. My inclination would be to rebuild gcc altogether though.
>
> My gcc build is like that and I was the one who built it to replace
> another build of gcc. gcc doesn't seem to like float.h on AIX and just
> uses its own as part of fixincludes; math.h comes out in a more intact
> state. This means that on AIX versions where math.h also contains
> FP_PLUS_INF (and the rest of that block of defines), the defines do
> occur. It would appear that 4.2 doesn't also contain the necessary
> defines as part of math.h (protected by an #ifndef on 5.3).
>
>
yes, that seems to be it: float.h gets replaced and I don't have the defines
in math.h too thus you have more redundancy. I might just hack the gcc
include at this point.
fixinclude b0rked it.

-R


From: Seneca Cunningham <scunning(at)ca(dot)afilias(dot)info>
To: Riccardo Mottola <multix(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-ports(at)postgresql(dot)org
Subject: Re: fails to compile with undefined symbol (FP_PLUS_INF)
Date: 2006-03-16 19:52:48
Message-ID: 4419C210.4030609@ca.afilias.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-ports

Riccardo Mottola wrote:
> Hello,
>
> On 3/16/06, *Seneca Cunningham* <scunning(at)ca(dot)afilias(dot)info
> <mailto:scunning(at)ca(dot)afilias(dot)info>> wrote:
> My gcc build is like that and I was the one who built it to replace
> another build of gcc. gcc doesn't seem to like float.h on AIX and just
> uses its own as part of fixincludes; math.h comes out in a more intact
> state. This means that on AIX versions where math.h also contains
> FP_PLUS_INF (and the rest of that block of defines), the defines do
> occur. It would appear that 4.2 doesn't also contain the necessary
> defines as part of math.h (protected by an #ifndef on 5.3).
>
>
> yes, that seems to be it: float.h gets replaced and I don't have the
> defines in math.h too thus you have more redundancy. I might just hack
> the gcc include at this point.
> fixinclude b0rked it.

I took a quick look at gcc 4.0.1's build scripts (what I'm running). It
would appear that gcc blindly replaces limits.h, float.h, iso646.h,
stdarg.h, stdbool.h, stddef.h, varargs.h, and unwind.h. Of these,
limits.h is the only one that then includes the native header. They
aren't modified by fixincludes. fixincludes takes a hack at the other
headers that end up in gcc's include directory.

--
Seneca Cunningham
scunning(at)ca(dot)afilias(dot)info


From: "Riccardo Mottola" <multix(at)gmail(dot)com>
To: "Seneca Cunningham" <scunning(at)ca(dot)afilias(dot)info>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-ports(at)postgresql(dot)org
Subject: Re: fails to compile with undefined symbol (FP_PLUS_INF)
Date: 2006-03-21 10:38:05
Message-ID: 259a55900603210238n47c60b1bl1450c10cec3944a0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-ports

Hey,

> I took a quick look at gcc 4.0.1's build scripts (what I'm running). It
> would appear that gcc blindly replaces limits.h, float.h, iso646.h,
> stdarg.h, stdbool.h, stddef.h, varargs.h, and unwind.h. Of these,
> limits.h is the only one that then includes the native header. They
> aren't modified by fixincludes. fixincludes takes a hack at the other
> headers that end up in gcc's include directory.

I failed a bug report to gcc (26768) and it got closed saying that it
is float.h is fine to be replaced since those constants FP_* are non
standard, please have a look yourself.

Cheers,
Riccardo


From: Seneca Cunningham <scunning(at)ca(dot)afilias(dot)info>
To: Riccardo Mottola <multix(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-ports(at)postgresql(dot)org
Subject: Re: fails to compile with undefined symbol (FP_PLUS_INF)
Date: 2006-03-21 16:09:16
Message-ID: 4420252C.5010202@ca.afilias.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-ports

Riccardo Mottola wrote:
> Hey,
>
>> I took a quick look at gcc 4.0.1's build scripts (what I'm running). It
>> would appear that gcc blindly replaces limits.h, float.h, iso646.h,
>> stdarg.h, stdbool.h, stddef.h, varargs.h, and unwind.h. Of these,
>> limits.h is the only one that then includes the native header. They
>> aren't modified by fixincludes. fixincludes takes a hack at the other
>> headers that end up in gcc's include directory.
>
> I failed a bug report to gcc (26768) and it got closed saying that it
> is float.h is fine to be replaced since those constants FP_* are non
> standard, please have a look yourself.

I took a look at some docs[1], and it seems like the gcc people are
correct in that the standard does not define any constants FP_FOO in
float.h. They say that definitions starting with FP_ are to be in math.h.

[1] http://www.opengroup.org/onlinepubs/000095399/basedefs/math.h.html

--
Seneca Cunningham
scunning(at)ca(dot)afilias(dot)info