[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#525261: use of FPU_SETCW or FPU_GETCW causes illegal instruction on armel



Package: glibc
Version: 2.9-7

/usr/include/fpu_control.h on armel defines FPU_[SG]ETCW as VFP
coprocessor instructions, whereas armel is soft-float.

#define _FPU_GETCW(cw) \
  __asm__ __volatile__ ("mrc p10, 7, %0, cr1, cr0, 0" : "=r" (cw))
/* This is fmxr fpscr, %0.  */
#define _FPU_SETCW(cw) \
  __asm__ __volatile__ ("mcr p10, 7, %0, cr1, cr0, 0" : : "r" (cw))

Packages that use these cause an illegal instruction trap on hardware
that does not have a VFP unit (and misleadingly set the FPU control
word on those that do, while softfloat remains unaffected).

This was highlighted by build failure of gerris - see Drew Parsons' messages in
http://lists.debian.org/debian-arm/2009/04/msg00018.html
He suggests that the right thing for fpu_control.h may be simply not
to define these macros but I don't know if that's right.



Reply to: