Patchwork [1/1] eglibc: tweak glibc.fix_sqrt2.patch for eglibc-2.19

login
register
mail settings
Submitter Hongxu Jia
Date March 13, 2014, 2:14 a.m.
Message ID <a551f14de61173848ef60b768149f994d4ae3ac5.1394676641.git.hongxu.jia@windriver.com>
Download mbox | patch
Permalink /patch/68563/
State New
Headers show

Comments

Hongxu Jia - March 13, 2014, 2:14 a.m.
While the type of powerpc32 cpu is 603e (In meta/conf/machine/
qemuppc.conf, require conf/machine/include/tune-ppc603e.inc),
there was a failure to build eglibc-2.19:
...
| ../sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c: In function
'__slow_ieee754_sqrt':
| ../sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c:122:15: error:
subscripted value is neither array nor pointer nor vector
|        if ((u.l[1] & FE_INVALID) == 0)
|                ^
| ../sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c:121:20: warning:
variable 'u' set but not used [-Wunused-but-set-variable]
|        fenv_union_t u = { .fenv = fegetenv_register () };
...

In 'eglibc-2.19/libc/sysdeps/powerpc/fpu/fenv_libc.h', the above
struct fenv_union_t is defined as:
...
typedef union
{
  fenv_t fenv;
  unsigned long long l;
} fenv_union_t;
...

Rather than 'eglibc-2.16/libc/sysdeps/powerpc/fpu/fenv_libc.h':
...
typedef union
{
  fenv_t fenv;
  unsigned int l[2];
} fenv_union_t;
...

So we should update the glibc.fix_sqrt2.patch for eglibc-2.19.

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 .../eglibc/eglibc-2.19/glibc.fix_sqrt2.patch       | 24 +++++++++++-----------
 1 file changed, 12 insertions(+), 12 deletions(-)

Patch

diff --git a/meta/recipes-core/eglibc/eglibc-2.19/glibc.fix_sqrt2.patch b/meta/recipes-core/eglibc/eglibc-2.19/glibc.fix_sqrt2.patch
index a669729..0dcca7c 100644
--- a/meta/recipes-core/eglibc/eglibc-2.19/glibc.fix_sqrt2.patch
+++ b/meta/recipes-core/eglibc/eglibc-2.19/glibc.fix_sqrt2.patch
@@ -132,7 +132,7 @@  diff -ruN libc-orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c libc/sysdeps/pow
 +      feraiseexcept (FE_INVALID_SQRT);
 +
 +      fenv_union_t u = { .fenv = fegetenv_register () };
-+      if ((u.l[1] & FE_INVALID) == 0)
++      if ((u.l & FE_INVALID) == 0)
 +#endif
 +	feraiseexcept (FE_INVALID);
 +      b = a_nan.value;
@@ -237,7 +237,7 @@  diff -ruN libc-orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c libc/sysdeps/po
 +      feraiseexcept (FE_INVALID_SQRT);
 +
 +      fenv_union_t u = { .fenv = fegetenv_register () };
-+      if ((u.l[1] & FE_INVALID) == 0)
++      if ((u.l & FE_INVALID) == 0)
 +#endif
 +	feraiseexcept (FE_INVALID);
 +      b = a_nan.value;
@@ -375,7 +375,7 @@  diff -ruN libc-orig/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c libc/sysdeps/p
 +      feraiseexcept (FE_INVALID_SQRT);
 +
 +      fenv_union_t u = { .fenv = fegetenv_register () };
-+      if ((u.l[1] & FE_INVALID) == 0)
++      if ((u.l & FE_INVALID) == 0)
 +#endif
 +	feraiseexcept (FE_INVALID);
 +      b = a_nan.value;
@@ -480,7 +480,7 @@  diff -ruN libc-orig/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c libc/sysdeps/
 +      feraiseexcept (FE_INVALID_SQRT);
 +
 +      fenv_union_t u = { .fenv = fegetenv_register () };
-+      if ((u.l[1] & FE_INVALID) == 0)
++      if ((u.l & FE_INVALID) == 0)
 +#endif
 +	feraiseexcept (FE_INVALID);
 +      b = a_nan.value;
@@ -618,7 +618,7 @@  diff -ruN libc-orig/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c libc/sysdeps/po
 +      feraiseexcept (FE_INVALID_SQRT);
 +
 +      fenv_union_t u = { .fenv = fegetenv_register () };
-+      if ((u.l[1] & FE_INVALID) == 0)
++      if ((u.l & FE_INVALID) == 0)
 +#endif
 +	feraiseexcept (FE_INVALID);
 +      b = a_nan.value;
@@ -723,7 +723,7 @@  diff -ruN libc-orig/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c libc/sysdeps/p
 +      feraiseexcept (FE_INVALID_SQRT);
 +
 +      fenv_union_t u = { .fenv = fegetenv_register () };
-+      if ((u.l[1] & FE_INVALID) == 0)
++      if ((u.l & FE_INVALID) == 0)
 +#endif
 +	feraiseexcept (FE_INVALID);
 +      b = a_nan.value;
@@ -861,7 +861,7 @@  diff -ruN libc-orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c libc/sysdeps/po
 +      feraiseexcept (FE_INVALID_SQRT);
 +
 +      fenv_union_t u = { .fenv = fegetenv_register () };
-+      if ((u.l[1] & FE_INVALID) == 0)
++      if ((u.l & FE_INVALID) == 0)
 +#endif
 +	feraiseexcept (FE_INVALID);
 +      b = a_nan.value;
@@ -966,7 +966,7 @@  diff -ruN libc-orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c libc/sysdeps/p
 +      feraiseexcept (FE_INVALID_SQRT);
 +
 +      fenv_union_t u = { .fenv = fegetenv_register () };
-+      if ((u.l[1] & FE_INVALID) == 0)
++      if ((u.l & FE_INVALID) == 0)
 +#endif
 +	feraiseexcept (FE_INVALID);
 +      b = a_nan.value;
@@ -1104,7 +1104,7 @@  diff -ruN libc-orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c libc/sysdeps/po
 +      feraiseexcept (FE_INVALID_SQRT);
 +
 +      fenv_union_t u = { .fenv = fegetenv_register () };
-+      if ((u.l[1] & FE_INVALID) == 0)
++      if ((u.l & FE_INVALID) == 0)
 +#endif
 +	feraiseexcept (FE_INVALID);
 +      b = a_nan.value;
@@ -1209,7 +1209,7 @@  diff -ruN libc-orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c libc/sysdeps/p
 +      feraiseexcept (FE_INVALID_SQRT);
 +
 +      fenv_union_t u = { .fenv = fegetenv_register () };
-+      if ((u.l[1] & FE_INVALID) == 0)
++      if ((u.l & FE_INVALID) == 0)
 +#endif
 +	feraiseexcept (FE_INVALID);
 +      b = a_nan.value;
@@ -1347,7 +1347,7 @@  diff -ruN libc-orig/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c libc/sysdeps/po
 +      feraiseexcept (FE_INVALID_SQRT);
 +
 +      fenv_union_t u = { .fenv = fegetenv_register () };
-+      if ((u.l[1] & FE_INVALID) == 0)
++      if ((u.l & FE_INVALID) == 0)
 +#endif
 +	feraiseexcept (FE_INVALID);
 +      b = a_nan.value;
@@ -1452,7 +1452,7 @@  diff -ruN libc-orig/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c libc/sysdeps/p
 +      feraiseexcept (FE_INVALID_SQRT);
 +
 +      fenv_union_t u = { .fenv = fegetenv_register () };
-+      if ((u.l[1] & FE_INVALID) == 0)
++      if ((u.l & FE_INVALID) == 0)
 +#endif
 +	feraiseexcept (FE_INVALID);
 +      b = a_nan.value;