I'm trying to bootstrap gcc-3.4.3 on HP-UX 11.23/IA-64. I'm bootstrapping with the HP C compiler. The system has patch PHSS_33351 installed. The tail of /usr/include/math.h: inline int sqr(int __x) {return(__x*__x);} inline double sqr(double __x) {return(__x*__x);} # ifndef _STDLIB_INCLUDED inline int abs(int __d) { return (__d>0)?__d:-__d; } # endif /* _STDLIB_INCLUDED */ inline double abs(double __d) { return fabs(__d); } inline double pow(double __d,int __expon) { return pow(__d,(double)__expon); } #endif #endif /* _MATH_INCLUDED */ The tail of math.h after fixinc: inline double sqr(double __x) {return(__x*__x);} # ifndef _STDLIB_INCLUDED inline int abs(int __d) { return (__d>0)?__d:-__d; } # endif /* _STDLIB_INCLUDED */ #ifndef __GNUC__ inline double abs(double __d) { return fabs(__d); } inline double pow(double __d,int __expon) { return pow(__d,(double)__expon); } #endif #endif /* _MATH_INCLUDED */ Looking at inclhack.def, sco_math seems to be the cause of this. I replaced 'inline double abs' in select of sco_math with 'inline double _abs' and the #ifndef __GNUC__ wasn't included in the new math.h.
I thought this was fixed in 3.4.4.
I'm using the version of inclhack.def from gcc-3_4-branch. I looked at the changes in http://gcc.gnu.org/viewcvs/branches/gcc-3_4-branch/gcc/fixinc/inclhack.def?rev=100333&view=log and don't see anything relating to this. Looking at the latest inclhack.def from gcc-3_4-branch, this sed line in sco_math is causing the problem: sed = "/extern \"C\\+\\+\"/N;" "/inline double abs/i\\\n" "#ifndef __GNUC__\n"; I have no idea what math.h looks like on SCO so I have no idea how to fix. Why don't we restrict sco_math to some mach="*sco*"?
It looks like this is fixed on the mainline and on the 4.0 branch by the addition of bypass = "__GNUG__"; This patch was done in revision 90550 by jsm28. We should do this for the 3.4 branch as well.
Original patch submittal is at http://gcc.gnu.org/ml/gcc-patches/2004-11/msg00985.html I will apply this to the 3.4 branch and test it.
I forgot to include the PR number in the ChangeLog, the fix has been checked in on the 3.4 branch for 3.4.5. It was already fixed on the 4.0 branch and on the main line. The patch was submitted with: http://gcc.gnu.org/ml/gcc-patches/2005-11/msg00474.html