[oe-commits] org.oe.dev packages/glibc/glibc_2.5.bb: The following set of patches adds support for soft-float to powerpc targets

ifaistos commit openembedded-commits at lists.openembedded.org
Mon Mar 12 13:09:58 UTC 2007


packages/glibc/glibc_2.5.bb: The following set of patches adds support for soft-float to powerpc targets
without fpu for gcc 4.1.1/glibc 2.5

Author: ifaistos at openembedded.org
Branch: org.openembedded.dev
Revision: 53b0d42710fbb9b919ba5fc0aa75ec5c4d963fb4
ViewMTN: http://monotone.openembedded.org/revision.psp?id=53b0d42710fbb9b919ba5fc0aa75ec5c4d963fb4
Files:
1
packages/glibc/files/ppc-ld-nofpu-20070104.patch
packages/glibc/files/ppc-ports-ld-nofpu-20070114.patch
packages/glibc/files/ppc-sfp-machine.patch
packages/glibc/files/ppc-soft-fp-20070115.patch
packages/glibc/glibc_2.5.bb
Diffs:

#
# mt diff -r577d4786588a405a02c4a02eb12954a3198c3915 -r53b0d42710fbb9b919ba5fc0aa75ec5c4d963fb4
#
# 
# 
# add_file "packages/glibc/files/ppc-ld-nofpu-20070104.patch"
#  content [f685f7e048b348f715a3649781d6bfde50ed8682]
# 
# add_file "packages/glibc/files/ppc-ports-ld-nofpu-20070114.patch"
#  content [7a149dbea339b9b3072f84ba8ff992be1183b70e]
# 
# add_file "packages/glibc/files/ppc-sfp-machine.patch"
#  content [f0ddfab68512b6a1a4e45041e1db38a62eb2bf76]
# 
# add_file "packages/glibc/files/ppc-soft-fp-20070115.patch"
#  content [bce1ab2b0dcea76a383f6813a7d6eac67b1b05d5]
# 
# patch "packages/glibc/glibc_2.5.bb"
#  from [2b99e9d77548a1260cf860d3097b7f00265956c3]
#    to [4015c83608d6e808fb1a87df47640fad6ffc5714]
# 
============================================================
--- packages/glibc/files/ppc-ld-nofpu-20070104.patch	f685f7e048b348f715a3649781d6bfde50ed8682
+++ packages/glibc/files/ppc-ld-nofpu-20070104.patch	f685f7e048b348f715a3649781d6bfde50ed8682
@@ -0,0 +1,190 @@
+2007-01-12  Steven Munroe  <sjmunroe at us.ibm.com>
+	    Joe Kerian  <jkerian at us.us.ibm.com>
+
+	[BZ #2749]
+	* sysdeps/ieee754/ldbl-128ibm/s_copysignl.c:
+	Include <math_ldbl_opt.h>.
+	Remove weak_alias.  Use long_double_symbol macro.
+	(__copysignl): Use signbit() for comparison.
+	* sysdeps/ieee754/ldbl-128ibm/s_fabsl.c: Correct parms for
+	SET_LDOUBLE_WORDS64.
+
+	[BZ #2423, #2749]
+	* sysdeps/ieee754/ldbl-128ibm/s_ceill.c: Don't include <fenv_libc.h>.
+	(__ceill): Remove calls to fegetround(), fesetround().
+	* sysdeps/ieee754/ldbl-128ibm/s_floorl.c: Likewise.
+	* sysdeps/ieee754/ldbl-128ibm/s_roundl.c: Likewise.
+	* sysdeps/ieee754/ldbl-128ibm/s_truncl.c: Likewise.
+
+diff -urN libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_ceill.c libc24/sysdeps/ieee754/ldbl-128ibm/s_ceill.c
+--- libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_ceill.c	2006-03-16 05:46:37.000000000 -0600
++++ libc24/sysdeps/ieee754/ldbl-128ibm/s_ceill.c	2007-01-11 10:30:12.856890432 -0600
+@@ -19,7 +19,6 @@
+    02111-1307 USA.  */
+ 
+ #include <math.h>
+-#include <fenv_libc.h>
+ #include <math_ldbl_opt.h>
+ #include <float.h>
+ #include <ieee754.h>
+@@ -44,11 +43,9 @@
+ 					     __builtin_inf ()), 1))
+     {
+       double orig_xh;
+-      int save_round = fegetround ();
+ 
+       /* Long double arithmetic, including the canonicalisation below,
+ 	 only works in round-to-nearest mode.  */
+-      fesetround (FE_TONEAREST);
+ 
+       /* Convert the high double to integer.  */
+       orig_xh = xh;
+@@ -81,8 +78,6 @@
+       /* Ensure we return -0 rather than +0 when appropriate.  */
+       if (orig_xh < 0.0)
+ 	xh = -__builtin_fabs (xh);
+-
+-      fesetround (save_round);
+     }
+ 
+   return ldbl_pack (xh, xl);
+diff -urN libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c libc24/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c
+--- libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c	2006-01-27 18:07:25.000000000 -0600
++++ libc24/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c	2007-01-11 10:30:12.857890280 -0600
+@@ -25,6 +25,7 @@
+ 
+ #include "math.h"
+ #include "math_private.h"
++#include <math_ldbl_opt.h>
+ 
+ #ifdef __STDC__
+ 	long double __copysignl(long double x, long double y)
+@@ -33,13 +34,13 @@
+ 	long double x,y;
+ #endif
+ {
+-  if (y < 0.0)
+-    {
+-      if (x >= 0.0)
+-	x = -x;
+-    }
+-  else if (x < 0.0)
++  if( signbit(x) != signbit(y) )
+     x = -x;
+   return x;
+ }
+-weak_alias (__copysignl, copysignl)
++
++#ifdef IS_IN_libm
++long_double_symbol (libm, __copysignl, copysignl);
++#else
++long_double_symbol (libc, __copysignl, copysignl);
++#endif
+diff -urN libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c libc24/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c
+--- libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c	2006-01-27 18:07:25.000000000 -0600
++++ libc24/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c	2007-01-11 10:30:12.857890280 -0600
+@@ -37,7 +37,7 @@
+ 	GET_LDOUBLE_WORDS64(hx,lx,x);
+ 	lx = lx ^ ( hx & 0x8000000000000000LL );
+ 	hx = hx & 0x7fffffffffffffffLL;
+-	SET_LDOUBLE_WORDS64(hx,lx,x);
++	SET_LDOUBLE_WORDS64(x,hx,lx);
+         return x;
+ }
+ long_double_symbol (libm, __fabsl, fabsl);
+diff -urN libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_floorl.c libc24/sysdeps/ieee754/ldbl-128ibm/s_floorl.c
+--- libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_floorl.c	2006-03-16 05:46:37.000000000 -0600
++++ libc24/sysdeps/ieee754/ldbl-128ibm/s_floorl.c	2007-01-11 10:30:12.858890128 -0600
+@@ -19,7 +19,6 @@
+    02111-1307 USA.  */
+ 
+ #include <math.h>
+-#include <fenv_libc.h>
+ #include <math_ldbl_opt.h>
+ #include <float.h>
+ #include <ieee754.h>
+@@ -43,11 +42,8 @@
+ 			&& __builtin_isless (__builtin_fabs (xh),
+ 					     __builtin_inf ()), 1))
+     {
+-      int save_round = fegetround ();
+-
+       /* Long double arithmetic, including the canonicalisation below,
+ 	 only works in round-to-nearest mode.  */
+-      fesetround (FE_TONEAREST);
+ 
+       /* Convert the high double to integer.  */
+       hi = ldbl_nearbyint (xh);
+@@ -75,8 +71,6 @@
+       xh = hi;
+       xl = lo;
+       ldbl_canonicalize (&xh, &xl);
+-
+-      fesetround (save_round);
+     }
+ 
+   return ldbl_pack (xh, xl);
+diff -urN libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_roundl.c libc24/sysdeps/ieee754/ldbl-128ibm/s_roundl.c
+--- libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_roundl.c	2006-03-16 05:46:37.000000000 -0600
++++ libc24/sysdeps/ieee754/ldbl-128ibm/s_roundl.c	2007-01-11 10:30:12.859889976 -0600
+@@ -22,7 +22,6 @@
+    when it's coded in C.  */
+ 
+ #include <math.h>
+-#include <fenv_libc.h>
+ #include <math_ldbl_opt.h>
+ #include <float.h>
+ #include <ieee754.h>
+@@ -47,11 +46,9 @@
+ 					     __builtin_inf ()), 1))
+     {
+       double orig_xh;
+-      int save_round = fegetround ();
+ 
+       /* Long double arithmetic, including the canonicalisation below,
+ 	 only works in round-to-nearest mode.  */
+-      fesetround (FE_TONEAREST);
+ 
+       /* Convert the high double to integer.  */
+       orig_xh = xh;
+@@ -88,8 +85,6 @@
+       xh = hi;
+       xl = lo;
+       ldbl_canonicalize (&xh, &xl);
+-
+-      fesetround (save_round);
+     }
+ 
+   return ldbl_pack (xh, xl);
+diff -urN libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_truncl.c libc24/sysdeps/ieee754/ldbl-128ibm/s_truncl.c
+--- libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_truncl.c	2006-03-16 05:46:37.000000000 -0600
++++ libc24/sysdeps/ieee754/ldbl-128ibm/s_truncl.c	2007-01-11 10:30:12.860889824 -0600
+@@ -22,7 +22,6 @@
+    when it's coded in C.  */
+ 
+ #include <math.h>
+-#include <fenv_libc.h>
+ #include <math_ldbl_opt.h>
+ #include <float.h>
+ #include <ieee754.h>
+@@ -47,11 +46,9 @@
+ 					     __builtin_inf ()), 1))
+     {
+       double orig_xh;
+-      int save_round = fegetround ();
+ 
+       /* Long double arithmetic, including the canonicalisation below,
+ 	 only works in round-to-nearest mode.  */
+-      fesetround (FE_TONEAREST);
+ 
+       /* Convert the high double to integer.  */
+       orig_xh = xh;
+@@ -92,8 +89,6 @@
+       /* Ensure we return -0 rather than +0 when appropriate.  */
+       if (orig_xh < 0.0)
+ 	xh = -__builtin_fabs (xh);
+-
+-      fesetround (save_round);
+     }
+ 
+   return ldbl_pack (xh, xl);
============================================================
--- packages/glibc/files/ppc-ports-ld-nofpu-20070114.patch	7a149dbea339b9b3072f84ba8ff992be1183b70e
+++ packages/glibc/files/ppc-ports-ld-nofpu-20070114.patch	7a149dbea339b9b3072f84ba8ff992be1183b70e
@@ -0,0 +1,38 @@
+2007-01-14  Steven Munroe  <sjmunroe at us.ibm.com>
+
+	[BZ #2749]
+	* sysdeps/powerpc/nofpu/fenv_libc.h: New file.
+
+diff -urN dummy-libc/ports-cvstip-20070104/sysdeps/powerpc/nofpu/fenv_libc.h libc25/ports/sysdeps/powerpc/nofpu/fenv_libc.h
+--- dummy-libc/ports-cvstip-20070104/sysdeps/powerpc/nofpu/fenv_libc.h	Wed Dec 31 18:00:00 1969
++++ libc25/ports/sysdeps/powerpc/nofpu/fenv_libc.h	Thu Jan 11 11:00:53 2007
+@@ -0,0 +1,29 @@
++/* Internal libc stuff for floating point environment routines.
++   Copyright (C) 2007 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#ifndef _FENV_LIBC_H
++#define _FENV_LIBC_H	1
++
++/* fenv_libc.h is used in libm implementations of ldbl-128ibm.  So we
++   need this version in the soft-fp to at minimum include fenv.h to
++   get the fegetround definition.  */
++
++#include <fenv.h>
++ 
++#endif /* fenv_libc.h */
============================================================
--- packages/glibc/files/ppc-sfp-machine.patch	f0ddfab68512b6a1a4e45041e1db38a62eb2bf76
+++ packages/glibc/files/ppc-sfp-machine.patch	f0ddfab68512b6a1a4e45041e1db38a62eb2bf76
@@ -0,0 +1,297 @@
+This patch combined with the other patches from Bugzilla #2749 allows
+powerpc32 to build. The Subdirs pulls in the soft-fp directory from
+libc, The Implies pulls in the ports powerpc/soft-fp directory which
+includes sfp-machine.h
+
+The get/set/swapcontext changes overide the common implimentation in
+libc to avoid using hardware FP instructions.
+
+
+
+2006-06-01  Steven Munroe  <sjmunroe at us.ibm.com>
+
+	[BZ #2749]
+	* sysdeps/powerpc/soft-fp/Subdirs: New file.
+	* sysdeps/powerpc/soft-fp/sfp-machine.h: New file.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/Implies: New file.
+
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S:
+	New file.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S:
+	New file.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/swapcontext.S:
+	New file.
+
+diff -urN dummy-libc/ports-cvstip-20060512/sysdeps/powerpc/soft-fp/Subdirs 
+libc24/ports/sysdeps/powerpc/soft-fp/Subdirs
+--- dummy-libc/ports-cvstip-20060512/sysdeps/powerpc/soft-fp/Subdirs	Wed Dec 31 18:00:00 1969
++++ libc24/ports/sysdeps/powerpc/soft-fp/Subdirs	Wed May 31 16:58:44 2006
+@@ -0,0 +1,1 @@
++soft-fp
+diff -urN dummy-libc/ports-cvstip-20060512/sysdeps/powerpc/soft-fp/sfp-machine.h 
+libc24/ports/sysdeps/powerpc/soft-fp/sfp-machine.h
+--- dummy-libc/ports-cvstip-20060512/sysdeps/powerpc/soft-fp/sfp-machine.h	Wed Dec 31 18:00:00 1969
++++ libc24/ports/sysdeps/powerpc/soft-fp/sfp-machine.h	Wed May 31 13:57:07 2006
+@@ -0,0 +1,63 @@
++#define _FP_W_TYPE_SIZE		32
++#define _FP_W_TYPE		unsigned long
++#define _FP_WS_TYPE		signed long
++#define _FP_I_TYPE		long
++
++#define _FP_MUL_MEAT_S(R,X,Y)				\
++  _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
++#define _FP_MUL_MEAT_D(R,X,Y)				\
++  _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
++#define _FP_MUL_MEAT_Q(R,X,Y)				\
++  _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
++
++#define _FP_DIV_MEAT_S(R,X,Y)	_FP_DIV_MEAT_1_loop(S,R,X,Y)
++#define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_2_udiv(D,R,X,Y)
++#define _FP_DIV_MEAT_Q(R,X,Y)	_FP_DIV_MEAT_4_udiv(Q,R,X,Y)
++
++#define _FP_NANFRAC_S		((_FP_QNANBIT_S << 1) - 1)
++#define _FP_NANFRAC_D		((_FP_QNANBIT_D << 1) - 1), -1
++#define _FP_NANFRAC_Q		((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1
++#define _FP_NANSIGN_S		0
++#define _FP_NANSIGN_D		0
++#define _FP_NANSIGN_Q		0
++
++#define _FP_KEEPNANFRACP 1
++
++/* Someone please check this.  */
++#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)			\
++  do {								\
++    if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs)		\
++	&& !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs))	\
++      {								\
++	R##_s = Y##_s;						\
++	_FP_FRAC_COPY_##wc(R,Y);				\
++      }								\
++    else							\
++      {								\
++	R##_s = X##_s;						\
++	_FP_FRAC_COPY_##wc(R,X);				\
++      }								\
++    R##_c = FP_CLS_NAN;						\
++  } while (0)
++
++/* Exception flags.  We use the bit positions of the appropriate bits
++   in the FPSCR, which also correspond to the FE_* bits.  This makes
++   everything easier ;-).  */
++#define FP_EX_INVALID         (1 << (31 - 2))
++#define FP_EX_OVERFLOW        (1 << (31 - 3))
++#define FP_EX_UNDERFLOW       (1 << (31 - 4))
++#define FP_EX_DENORM          FP_EX_UNDERFLOW
++#define FP_EX_DIVZERO         (1 << (31 - 5))
++#define FP_EX_INEXACT         (1 << (31 - 6))
++
++#define FP_HANDLE_EXCEPTIONS  __simulate_exceptions (_fex)
++#define FP_ROUNDMODE          __sim_round_mode
++
++extern int __sim_exceptions;
++libc_hidden_proto (__sim_exceptions);
++extern int __sim_disabled_exceptions;
++libc_hidden_proto (__sim_disabled_exceptions);
++extern int __sim_round_mode;
++libc_hidden_proto (__sim_round_mode);
++
++extern void __simulate_exceptions (int x) attribute_hidden;
+diff -urN dummy-libc/ports-cvstip-20060512/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/Implies 
+libc24/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/Implies
+--- dummy-libc/ports-cvstip-20060512/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/Implies	Wed Dec 31 18:00:00 1969
++++ libc24/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/Implies	Wed May 31 15:46:44 2006
+@@ -0,0 +1,1 @@
++powerpc/soft-fp
+diff -urN dummy-libc/ports-cvstip-20060512/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S 
+libc24/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S
+--- dummy-libc/ports-cvstip-20060512/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S	Wed Dec 31 18:00:00 1969
++++ libc24/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S	Thu Jun 01 15:31:03 2006
+@@ -0,0 +1,59 @@
++/* Save current context.
++   Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include <sysdep.h>
++#include <rtld-global-offsets.h>
++#include <shlib-compat.h>
++
++#define __ASSEMBLY__
++#include <asm/ptrace.h>
++#include "ucontext_i.h"
++
++#define __CONTEXT_FUNC_NAME __getcontext
++#undef __CONTEXT_ENABLE_FPRS
++#undef __CONTEXT_ENABLE_VRS
++
++#include "getcontext-common.S"
++
++versioned_symbol (libc, __getcontext, getcontext, GLIBC_2_3_4)
++
++#if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)
++
++/* For the nofpu case the old/new versions are the same function.  */  
++strong_alias (__getcontext, __novec_getcontext)
++
++compat_symbol (libc, __novec_getcontext, getcontext, GLIBC_2_3_3)
++
++#endif
++
++#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_3_3)
++
++#define _ERRNO_H	1
++#include <bits/errno.h>
++
++	compat_text_section
++ENTRY (__getcontext_stub)
++	li	r3,ENOSYS
++	b	__syscall_error at local
++END (__getcontext_stub)
++	.previous
++
++compat_symbol (libc, __getcontext_stub, getcontext, GLIBC_2_1)
++
++#endif
+diff -urN dummy-libc/ports-cvstip-20060512/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S 
+libc24/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S
+--- dummy-libc/ports-cvstip-20060512/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S	Wed Dec 31 18:00:00 1969
++++ libc24/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S	Thu Jun 01 15:31:03 2006
+@@ -0,0 +1,59 @@
++/* Jump to a new context.
++   Copyright (C) 2002, 2004, 2005 Free Software Foundation%s
>>> DIFF TRUNCATED @ 16K






More information about the Openembedded-commits mailing list