aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManfred Hollstein <manfred@s-direktnet.de>1997-12-12 06:53:30 +0000
committerJeff Law <law@gcc.gnu.org>1997-12-11 23:53:30 -0700
commit7567d496ec32e1e233aed895e938e7930dea65b2 (patch)
tree78afe9a65c7b4ceca4360d1c736af21e267a398d
parent0a6969ad7cfe5a44854a2e19a8c38505862c2528 (diff)
downloadgcc-7567d496ec32e1e233aed895e938e7930dea65b2.zip
gcc-7567d496ec32e1e233aed895e938e7930dea65b2.tar.gz
gcc-7567d496ec32e1e233aed895e938e7930dea65b2.tar.bz2
fixincludes (str{len,spn,cspn} return value): Handle different layout on sysV88.
* fixincludes (str{len,spn,cspn} return value): Handle different layout on sysV88. (hypot): Provide a fake for hypot which is broken on m88k-motorola-sysv3. From-SVN: r17062
-rw-r--r--gcc/ChangeLog7
-rwxr-xr-xgcc/fixincludes46
2 files changed, 53 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c6e8e20..e88615f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+Thu Dec 11 23:55:17 1997 Manfred Hollstein <manfred@s-direktnet.de>
+
+ * fixincludes (str{len,spn,cspn} return value): Handle different
+ layout on sysV88.
+ (hypot): Provide a fake for hypot which is broken on
+ m88k-motorola-sysv3.
+
Thu Dec 11 23:50:17 1997 John F. Carr <jfc@mit.edu>
* tree.c, tree.h: Change tree_code_type, tree_code_length, and
diff --git a/gcc/fixincludes b/gcc/fixincludes
index 89c9f71..80032e6 100755
--- a/gcc/fixincludes
+++ b/gcc/fixincludes
@@ -12,6 +12,14 @@ INPUT=${2-${INPUT-/usr/include}}
# Directory in which to store the results.
LIB=${1?"fixincludes: output directory not specified"}
+# Define what target system we're fixing.
+if test -r ./Makefile; then
+ target_canonical="`sed -n -e 's,^target[ ]*=[ ]*\(.*\)$,\1,p' < Makefile`"
+ test -z "${target_canonical}" && target_canonical=unknown
+else
+ target_canonical=unknown
+fi
+
# Define PWDCMD as a command to use to get the working dir
# in the form that we want.
PWDCMD=pwd
@@ -1983,6 +1991,7 @@ fi
# Correct the return type for strlen in string.h on Lynx.
# Correct the argument type for ffs in string.h on Alpha OSF/1 V2.0.
# Add missing const for strdup on OSF/1 V3.0.
+# On sysV88 layout is slightly different.
file=string.h
if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
@@ -2001,6 +2010,8 @@ if [ -r ${LIB}/$file ]; then
-e 's/^\( strncmp()\),\n\( strlen(),\)$/\1;\
extern unsigned int\
\2/'\
+ -e '/^extern int$/N'\
+ -e 's/^extern int\(\n strlen(),\)/extern size_t\1/' \
${LIB}/$file > ${LIB}/${file}.sed
rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
if cmp $file ${LIB}/$file >/dev/null 2>&1; then
@@ -2286,6 +2297,41 @@ do
fi
done
+# libm.a on m88k-motorola-sysv3 contains a stupid optimization for function
+# hypot(), which returns the second argument without even looking at its value
+# if the other is 0.0
+file=math.h
+if [ $target_canonical = m88k-motorola-sysv3 ]; then
+ if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
+ cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
+ chmod +w ${LIB}/$file 2>/dev/null
+ chmod a+r ${LIB}/$file 2>/dev/null
+ fi
+
+ if [ -r ${LIB}/$file ]; then
+ echo Fixing $file, hypot definition
+ sed -e '/^extern double hypot();$/a\
+\/* Workaround a stupid Motorola optimization if one\
+ of x or y is 0.0 and the other is negative! *\/\
+#ifdef __STDC__\
+static __inline__ double fake_hypot (double x, double y)\
+#else\
+static __inline__ double fake_hypot (x, y)\
+ double x, y;\
+#endif\
+{\
+ return fabs (hypot (x, y));\
+}\
+#define hypot fake_hypot
+' \
+ ${LIB}/$file > ${LIB}/${file}.sed
+ rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
+ if cmp $file ${LIB}/$file >/dev/null 2>&1; then
+ rm -f ${LIB}/$file
+ fi
+ fi
+fi
+
# math.h on SunOS 4 puts the declaration of matherr before the definition
# of struct exception, so the prototype (added by fixproto) causes havoc.
file=math.h