Hello,

I've been trying to compile gcc 4.5.4 from the sources using
--with-fpmath=387 but I'm getting this error: "Invalid
--with-fpmath=387". I looked in the configs and found that it doesn't
support this option:

case ${with_fpmath} in
  avx)
    tm_file="${tm_file} i386/avxmath.h"
    ;;
  sse)
    tm_file="${tm_file} i386/ssemath.h"
    ;;
  *)
    echo "Invalid --with-fpmath=$with_fpmath" 1>&2
    exit 1

Basically, I started this whole thing because I need to supply a
statically linked executable for an old target platform (in fact, it's
an old Celeron but without any SSE2 instructions that are apparently
used by libstdc++ by DEFAULT). The executable crashes at the first
instruction (movq XMM0,...) coming from copying routines in the
internals of libstdc++ with an "Illegal instruction" message. Is there
any way to resolve this? I need to be on a fairly recent g++ to be
able to port my existing code base and it should be all statically
linked as the target OS hardly has anything installed.

I was wondering if it's possible to supply these headers/sources from
an older build to enable support for regular x87 instructions, so that
no SSE instructions are referenced?

PS Right now I'm trying a hack in gcc\config\i386\ssemath.h where I replace

#undef TARGET_FPMATH_DEFAULT
#define TARGET_FPMATH_DEFAULT (TARGET_SSE2 ? FPMATH_SSE : FPMATH_387)

#undef TARGET_SUBTARGET32_ISA_DEFAULT
#define TARGET_SUBTARGET32_ISA_DEFAULT \
   (OPTION_MASK_ISA_MMX | OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_SSE2)

with

#undef TARGET_FPMATH_DEFAULT
#define TARGET_FPMATH_DEFAULT (FPMATH_387)

#undef TARGET_SUBTARGET32_ISA_DEFAULT
#define TARGET_SUBTARGET32_ISA_DEFAULT \
   (OPTION_MASK_ISA_MMX )


But I'm not sure this is going to to work and what sort of side
effects this could cause.


Thanks.

Reply via email to