Commit bf448f42 authored by panne's avatar panne
Browse files

[project @ 2002-04-01 15:32:46 by panne]

Sigbjorn's last optimization (checking for -mno-cygwin only for
mingw32 targets) kicked out -O from the default SRC_CC_OPTS. Apart
from a minor performance hit for some parts of GHC, it yields a GHCi
which can't load HSbase_cbits.o because `lstat' is unknown, at least
on SuSE 7.3.

A little investigation showed the rather arcane reason: lstat and
friends are inline functions and therefore not in libc.so, only in its
static counterpart. Normally this is not a problem at all, but the CPP
INLINE trickery in fptools/libraries/base/cbits/PrelIOUtils.c manages
to get a reference to lstat into PrelIOUtils.o if -O is not given. %-}
A similar problem exists for fstat, too.

Simple solution: Re-add -O to SRC_CC_OPTS, simplifying configure.in a
bit on the way.
parent 25d33ea3
......@@ -556,18 +556,16 @@ FPTOOLS_HAVE_GCC
dnl ** figure out how to invoke cpp directly (gcc -E is no good)
AC_PROG_CPP
dnl ** does the C compiler support the following options?
case $TargetOS_CPP in
mingw32)
FPTOOLS_CC_FLAG(-mno-cygwin,CC_SUPPORTS_MNO_CYGWIN)
EXTRA_CC_OPTS="$CC_SUPPORTS_MNO_CYGWIN"
SRC_CC_OPTS="-O $EXTRA_CC_OPTS"
CPPFLAGS="$EXTRA_CC_OPTS $CPPFLAGS"
AC_SUBST(SRC_CC_OPTS)
;;
*) ;;
esac
dnl ** Without optimization some INLINE trickery fails for GHCi
SRC_CC_OPTS="-O"
dnl ** Try to add -mno-cygwin to the C compiler options for mingw32 targets
if test x"$TargetOS_CPP" = x"mingw32"; then
FPTOOLS_CC_FLAG(-mno-cygwin,CC_SUPPORTS_MNO_CYGWIN)
SRC_CC_OPTS="$CC_SUPPORTS_MNO_CYGWIN $SRC_CC_OPTS"
CPPFLAGS="$CC_SUPPORTS_MNO_CYGWIN $CPPFLAGS"
fi
AC_SUBST(SRC_CC_OPTS)
dnl ** figure out how to do context diffs
FPTOOLS_PROG_DIFF
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment