33683156 发表于 2014-12-18 13:49

求解答,交叉编译glibc-2.8时出现impossible constraint in 'asm'

configure参数-->
CC=/opt/freescale/usr/local/gcc-4.3.74-eglibc-2.8.74-dp-2/powerpc-none-linux-gnuspe/bin/powerpc-none-linux-gnuspe-gcc CXX=/opt/freescale/usr/local/gcc-4.3.74-eglibc-2.8.74-dp-2/powerpc-none-linux-gnuspe/bin/powerpc-none-linux-gnuspe-g++ AR=/opt/freescale/usr/local/gcc-4.3.74-eglibc-2.8.74-dp-2/powerpc-none-linux-gnuspe/bin/powerpc-none-linux-gnuspe-ar AS=/opt/freescale/usr/local/gcc-4.3.74-eglibc-2.8.74-dp-2/powerpc-none-linux-gnuspe/bin/powerpc-none-linux-gnuspe-as LD=/opt/freescale/usr/local/gcc-4.3.74-eglibc-2.8.74-dp-2/powerpc-none-linux-gnuspe/bin/powerpc-none-linux-gnuspe-ld ../glibc-2.8/configure --prefix=/home/zhangy/other/gcc9799/glibc-2.8/glibc --target=powerpc-none-linux-gnuspe --host=powerpc-none-linux-gnuspe --with-headers=/opt/freescale/usr/local/gcc-4.3.74-eglibc-2.8.74-dp-2/powerpc-none-linux-gnuspe/powerpc-none-linux-gnuspe/include --build=i686-pc-linux-gnu


make 报错信息-->
make: Entering directory `/home/zhangy/other/gcc9799/glibc-2.8/glibc-2.8/math'
/opt/freescale/usr/local/gcc-4.3.74-eglibc-2.8.74-dp-2/powerpc-none-linux-gnuspe/bin/powerpc-none-linux-gnuspe-gcc ../sysdeps/powerpc/fpu/fclrexcpt.c -c -std=gnu99 -fgnu89-inline -O2 -Wall -Winline -Wwrite-strings -fmerge-all-constants -g -mnew-mnemonics -Wstrict-prototypes -mlong-double-128    -Wno-uninitialized -D__NO_MATH_INLINES -D__LIBC_INTERNAL_MATH_INLINES -I../include -I/home/zhangy/other/gcc9799/glibc-2.8/build/math -I/home/zhangy/other/gcc9799/glibc-2.8/build -I../sysdeps/powerpc/powerpc32/elf -I../sysdeps/powerpc/elf -I../sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu -I../sysdeps/powerpc/powerpc32/fpu -I../nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32 -I../sysdeps/unix/sysv/linux/powerpc/powerpc32 -I../nptl/sysdeps/unix/sysv/linux/powerpc -I../sysdeps/unix/sysv/linux/powerpc -I../sysdeps/ieee754/ldbl-128ibm -I../sysdeps/ieee754/ldbl-opt -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../nptl/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/powerpc -I../nptl/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/powerpc/powerpc32 -I../sysdeps/wordsize-32 -I../sysdeps/powerpc/fpu -I../nptl/sysdeps/powerpc -I../sysdeps/powerpc -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl-I.. -I../libio -I. -nostdinc -isystem /opt/freescale/usr/local/gcc-4.3.74-eglibc-2.8.74-dp-2/powerpc-none-linux-gnuspe/lib/gcc/powerpc-none-linux-gnuspe/4.3.2/include -isystem /opt/freescale/usr/local/gcc-4.3.74-eglibc-2.8.74-dp-2/powerpc-none-linux-gnuspe/lib/gcc/powerpc-none-linux-gnuspe/4.3.2/include-fixed -isystem /opt/freescale/usr/local/gcc-4.3.74-eglibc-2.8.74-dp-2/powerpc-none-linux-gnuspe/powerpc-none-linux-gnuspe/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h   -DNOT_IN_libc=1 -DIS_IN_libm=1    -o /home/zhangy/other/gcc9799/glibc-2.8/build/math/fclrexcpt.o -MD -MP -MF /home/zhangy/other/gcc9799/glibc-2.8/build/math/fclrexcpt.o.dt -MT /home/zhangy/other/gcc9799/glibc-2.8/build/math/fclrexcpt.o
../sysdeps/powerpc/fpu/fclrexcpt.c: In function '__feclearexcept':
../sysdeps/powerpc/fpu/fclrexcpt.c:29: error: impossible constraint in 'asm'
../sysdeps/powerpc/fpu/fclrexcpt.c:36: error: impossible constraint in 'asm'
make: *** 错误 1
make: Leaving directory `/home/zhangy/other/gcc9799/glibc-2.8/glibc-2.8/math'
make: *** 错误 2
make: Leaving directory `/home/zhangy/other/gcc9799/glibc-2.8/glibc-2.8'
make: *** 错误 2


../sysdeps/powerpc/fpu/fclrexcpt.c错误相关代码
#include <fenv_libc.h>

#undef feclearexcept
int
__feclearexcept (int excepts)
{
fenv_union_t u;

/* Get the current state.*/
u.fenv = fegetenv_register ();

/* Clear the relevant bits.*/
u.l = u.l & ~((-(excepts >> (31 - FPSCR_VX) & 1) & FE_ALL_INVALID)
                      | (excepts & FPSCR_STICKY_BITS));

/* Put the new state in effect.*/
fesetenv_register (u.fenv);

/* Success.*/
return 0;
}

fegetenv_register ();实际调用代码
fenv_libc.h中
#ifndef _FENV_LIBC_H
#define _FENV_LIBC_H    1

#include <fenv.h>

libm_hidden_proto (__fe_nomask_env)

/* The sticky bits in the FPSCR indicating exceptions have occurred.*/
#define FPSCR_STICKY_BITS ((FE_ALL_EXCEPT | FE_ALL_INVALID) & ~FE_INVALID)

/* Equivalent to fegetenv, but returns a fenv_t instead of taking a
   pointer.*/
#define fegetenv_register() \
      ({ fenv_t env; asm volatile ("mffs %0" : "=f" (env)); env; })

/* Equivalent to fesetenv, but takes a fenv_t instead of a pointer.*/
#define fesetenv_register(env) \
      ({ double d = (env); asm volatile ("mtfsf 0xff,%0" : : "f" (d)); })

报这个错误是表示那段asm汇编指令有问题吗?被这个问题困扰很久了,不知道如何解决~~~
页: [1]
查看完整版本: 求解答,交叉编译glibc-2.8时出现impossible constraint in 'asm'