diff --git a/src/system/libroot/posix/glibc/arch/ppc/Jamfile b/src/system/libroot/posix/glibc/arch/ppc/Jamfile index 979ce22a59..adefd53136 100644 --- a/src/system/libroot/posix/glibc/arch/ppc/Jamfile +++ b/src/system/libroot/posix/glibc/arch/ppc/Jamfile @@ -1,13 +1,73 @@ -SubDir HAIKU_TOP src system libroot posix arch ppc ; +SubDir HAIKU_TOP src system libroot posix glibc arch ppc ; -MergeObject posix_arch_$(TARGET_ARCH).o : - s_ceilf.c - s_floorf.c - s_fpclassify.c - s_fpclassifyf.c - s_fpclassifyl.c +SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch $(TARGET_ARCH) ; +SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch generic ; +SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include ; +SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc stdlib ; +SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc math ; +SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc ; + +if $(OPTIM) = -O0 { + OPTIM = -O ; +} + +# don't compile with debugging +DEBUG = 0 ; + +SubDirCcFlags -D_GNU_SOURCE -D_IEEE_LIBM ; + +local genericSources = + cmp.c dbl2mpn.c divrem.c mpn2dbl.c mul.c mul_n.c + s_fpclassify.c s_fpclassifyf.c s_fpclassifyl.c s_modf.c s_modff.c s_modfl.c + w_atan2.c w_atan2f.c w_atan2l.c w_fmod.c w_fmodl.c w_fmodf.c ; -SEARCH on [ FGristFiles - s_fpclassify.c s_fpclassifyf.c s_fpclassifyl.c - ] = [ FDirName $(SUBDIR) $(DOTDOT) ] ; +MergeObject posix_gnu_arch_$(TARGET_ARCH).o : + add_n.S + addmul_1.S +# e_acos.S +# e_atan2.S +# e_atan2f.S +# e_atan2l.c +# e_fmod.S +# e_fmodf.S +# e_fmodl.c + ldbl2mpn.c + mul_1.S + lshift.S + rshift.S +# s_ceil.S + s_ceilf.c +# s_ceill.S +# s_copysign.S +# s_copysignf.S +# s_copysignl.S +# s_fdim.S +# s_fdimf.S +# s_fdiml.S +# s_fabs.S +# s_fabsf.S +# s_fabsl.S +# s_finite.S +# s_finitef.S +# s_finitel.S +# s_floor.S + s_floorf.c +# s_floorl.S +# s_logb.S +# s_logbf.S +# s_logbl.c +# s_rint.S +# s_rintf.S +# s_rintl.c +# s_scalbn.S +# s_scalbnf.S +# s_scalbnl.S + sub_n.S + submul_1.S + + $(genericSources) +; + +SEARCH on [ FGristFiles $(genericSources) ] + = [ FDirName $(HAIKU_TOP) src system libroot posix glibc arch ] ; diff --git a/src/system/libroot/posix/glibc/arch/x86/Jamfile b/src/system/libroot/posix/glibc/arch/x86/Jamfile index 96c6338f0f..fcf55408c3 100644 --- a/src/system/libroot/posix/glibc/arch/x86/Jamfile +++ b/src/system/libroot/posix/glibc/arch/x86/Jamfile @@ -1,6 +1,7 @@ SubDir HAIKU_TOP src system libroot posix glibc arch x86 ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch $(TARGET_ARCH) ; +SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch generic ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc stdlib ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc math ; @@ -15,12 +16,15 @@ DEBUG = 0 ; SubDirCcFlags -D_GNU_SOURCE -D_IEEE_LIBM ; +local genericSources = + cmp.c dbl2mpn.c divrem.c mpn2dbl.c mul.c mul_n.c + s_fpclassify.c s_fpclassifyf.c s_fpclassifyl.c s_modf.c s_modff.c s_modfl.c + w_atan2.c w_atan2f.c w_atan2l.c w_fmod.c w_fmodl.c w_fmodf.c +; + MergeObject posix_gnu_arch_$(TARGET_ARCH).o : add_n.S addmul_1.S - cmp.c - dbl2mpn.c - divrem.c e_acos.S e_atan2.S e_atan2f.S @@ -29,10 +33,7 @@ MergeObject posix_gnu_arch_$(TARGET_ARCH).o : e_fmodf.S e_fmodl.c ldbl2mpn.c - mpn2dbl.c - mul.c mul_1.S - mul_n.c lshift.S rshift.S s_ceil.S @@ -53,15 +54,9 @@ MergeObject posix_gnu_arch_$(TARGET_ARCH).o : s_floor.S s_floorf.S s_floorl.S - s_fpclassify.c - s_fpclassifyf.c - s_fpclassifyl.c s_logb.S s_logbf.S s_logbl.c - s_modf.c - s_modff.c - s_modfl.c s_rint.S s_rintf.S s_rintl.c @@ -70,15 +65,9 @@ MergeObject posix_gnu_arch_$(TARGET_ARCH).o : s_scalbnl.S sub_n.S submul_1.S - w_atan2.c - w_atan2f.c - w_atan2l.c - w_fmod.c - w_fmodf.c - w_fmodl.c + + $(genericSources) ; -SEARCH on [ FGristFiles - cmp.c divrem.c mul.c mul_n.c dbl2mpn.c mpn2dbl.c s_fpclassify.c s_fpclassifyf.c s_fpclassifyl.c s_modf.c s_modff.c s_modfl.c - w_atan2.c w_atan2f.c w_atan2l.c w_fmod.c w_fmodl.c w_fmodf.c - ] = [ FDirName $(HAIKU_TOP) src system libroot posix glibc arch ] ; +SEARCH on [ FGristFiles $(genericSources) ] + = [ FDirName $(HAIKU_TOP) src system libroot posix glibc arch ] ; diff --git a/src/system/libroot/posix/glibc/ctype/Jamfile b/src/system/libroot/posix/glibc/ctype/Jamfile index 42e1d17905..7ad7c9ef12 100644 --- a/src/system/libroot/posix/glibc/ctype/Jamfile +++ b/src/system/libroot/posix/glibc/ctype/Jamfile @@ -3,6 +3,7 @@ SubDir HAIKU_TOP src system libroot posix glibc ctype ; SubDirSysHdrs $(SUBDIR) ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch $(TARGET_ARCH) ; +SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch generic ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc locale ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc ; diff --git a/src/system/libroot/posix/glibc/extensions/Jamfile b/src/system/libroot/posix/glibc/extensions/Jamfile index 8909147031..25fdbd567f 100644 --- a/src/system/libroot/posix/glibc/extensions/Jamfile +++ b/src/system/libroot/posix/glibc/extensions/Jamfile @@ -2,6 +2,7 @@ SubDir HAIKU_TOP src system libroot posix glibc extensions ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch $(TARGET_ARCH) ; +SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch generic ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc libio ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc locale ; diff --git a/src/system/libroot/posix/glibc/include/arch/generic/bits/byteswap.h b/src/system/libroot/posix/glibc/include/arch/generic/bits/byteswap.h new file mode 100644 index 0000000000..38d8540130 --- /dev/null +++ b/src/system/libroot/posix/glibc/include/arch/generic/bits/byteswap.h @@ -0,0 +1,84 @@ +/* Macros to swap the order of bytes in integer values. + Copyright (C) 1997, 1998, 2000, 2001, 2002 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. */ + +#if !defined _BYTESWAP_H && !defined _NETINET_IN_H +# error "Never use directly; include instead." +#endif + +#ifndef _BITS_BYTESWAP_H +#define _BITS_BYTESWAP_H 1 + +/* Swap bytes in 16 bit value. */ +#ifdef __GNUC__ +# define __bswap_16(x) \ + (__extension__ \ + ({ unsigned short int __bsx = (x); \ + ((((__bsx) >> 8) & 0xff) | (((__bsx) & 0xff) << 8)); })) +#else +static __inline unsigned short int +__bswap_16 (unsigned short int __bsx) +{ + return ((((__bsx) >> 8) & 0xff) | (((__bsx) & 0xff) << 8)); +} +#endif + +/* Swap bytes in 32 bit value. */ +#ifdef __GNUC__ +# define __bswap_32(x) \ + (__extension__ \ + ({ unsigned int __bsx = (x); \ + ((((__bsx) & 0xff000000) >> 24) | (((__bsx) & 0x00ff0000) >> 8) | \ + (((__bsx) & 0x0000ff00) << 8) | (((__bsx) & 0x000000ff) << 24)); })) +#else +static __inline unsigned int +__bswap_32 (unsigned int __bsx) +{ + return ((((__bsx) & 0xff000000) >> 24) | (((__bsx) & 0x00ff0000) >> 8) | + (((__bsx) & 0x0000ff00) << 8) | (((__bsx) & 0x000000ff) << 24)); +} +#endif + +#if defined __GNUC__ && __GNUC__ >= 2 +/* Swap bytes in 64 bit value. */ +# define __bswap_constant_64(x) \ + ((((x) & 0xff00000000000000ull) >> 56) \ + | (((x) & 0x00ff000000000000ull) >> 40) \ + | (((x) & 0x0000ff0000000000ull) >> 24) \ + | (((x) & 0x000000ff00000000ull) >> 8) \ + | (((x) & 0x00000000ff000000ull) << 8) \ + | (((x) & 0x0000000000ff0000ull) << 24) \ + | (((x) & 0x000000000000ff00ull) << 40) \ + | (((x) & 0x00000000000000ffull) << 56)) + +# define __bswap_64(x) \ + (__extension__ \ + ({ union { __extension__ unsigned long long int __ll; \ + unsigned int __l[2]; } __w, __r; \ + if (__builtin_constant_p (x)) \ + __r.__ll = __bswap_constant_64 (x); \ + else \ + { \ + __w.__ll = (x); \ + __r.__l[0] = __bswap_32 (__w.__l[1]); \ + __r.__l[1] = __bswap_32 (__w.__l[0]); \ + } \ + __r.__ll; })) +#endif + +#endif /* _BITS_BYTESWAP_H */ diff --git a/src/system/libroot/posix/glibc/include/arch/generic/gmp-mparam.h b/src/system/libroot/posix/glibc/include/arch/generic/gmp-mparam.h new file mode 100644 index 0000000000..6fc7429872 --- /dev/null +++ b/src/system/libroot/posix/glibc/include/arch/generic/gmp-mparam.h @@ -0,0 +1,28 @@ +/* gmp-mparam.h -- Compiler/machine parameter header file. +Copyright (C) 1991,93,94,2002 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +MA 02111-1307, USA. */ + +#include + +#define BITS_PER_MP_LIMB __WORDSIZE +#define BYTES_PER_MP_LIMB (__WORDSIZE / 8) +#define BITS_PER_LONGINT __WORDSIZE +#define BITS_PER_INT 32 +#define BITS_PER_SHORTINT 16 +#define BITS_PER_CHAR 8 diff --git a/src/system/libroot/posix/glibc/include/arch/ppc/bits/endian.h b/src/system/libroot/posix/glibc/include/arch/ppc/bits/endian.h new file mode 100644 index 0000000000..2a079347d1 --- /dev/null +++ b/src/system/libroot/posix/glibc/include/arch/ppc/bits/endian.h @@ -0,0 +1,37 @@ +/* Copyright (C) 1997, 1998 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. */ + +/* PowerPC can be little or big endian. Hopefully gcc will know... */ + +#ifndef _ENDIAN_H +# error "Never use directly; include instead." +#endif + +#if defined __BIG_ENDIAN__ || defined _BIG_ENDIAN +# if defined __LITTLE_ENDIAN__ || defined _LITTLE_ENDIAN +# error Both BIG_ENDIAN and LITTLE_ENDIAN defined! +# endif +# define __BYTE_ORDER __BIG_ENDIAN +#else +# if defined __LITTLE_ENDIAN__ || defined _LITTLE_ENDIAN +# define __BYTE_ORDER __LITTLE_ENDIAN +# else +# warning Cannot determine current byte order, assuming big-endian. +# define __BYTE_ORDER __BIG_ENDIAN +# endif +#endif diff --git a/src/system/libroot/posix/glibc/include/arch/ppc/bits/huge_val.h b/src/system/libroot/posix/glibc/include/arch/ppc/bits/huge_val.h new file mode 100644 index 0000000000..b33974364c --- /dev/null +++ b/src/system/libroot/posix/glibc/include/arch/ppc/bits/huge_val.h @@ -0,0 +1,103 @@ +/* `HUGE_VAL' constants for IEEE 754 machines (where it is infinity). + Used by and functions for overflow. + Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000 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 _MATH_H +# error "Never use directly; include instead." +#endif + +#include + +/* IEEE positive infinity (-HUGE_VAL is negative infinity). */ + +#ifdef __GNUC__ + +# if __GNUC_PREREQ(2,96) + +# define HUGE_VAL (__extension__ 0x1.0p2047) + +# else + +# define HUGE_VAL \ + (__extension__ \ + ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \ + { __l: 0x7ff0000000000000ULL }).__d) + +# endif + +#else /* not GCC */ + +# include + +typedef union { unsigned char __c[8]; double __d; } __huge_val_t; + +# if __BYTE_ORDER == __BIG_ENDIAN +# define __HUGE_VAL_bytes { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } +# endif +# if __BYTE_ORDER == __LITTLE_ENDIAN +# define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } +# endif + +static __huge_val_t __huge_val = { __HUGE_VAL_bytes }; +# define HUGE_VAL (__huge_val.__d) + +#endif /* GCC. */ + + +/* ISO C99 extensions: (float) HUGE_VALF and (long double) HUGE_VALL. */ + +#ifdef __USE_ISOC99 + +# ifdef __GNUC__ + +# if __GNUC_PREREQ(2,96) + +# define HUGE_VALF (__extension__ 0x1.0p255f) + +# else + +# define HUGE_VALF \ + (__extension__ \ + ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \ + { __l: 0x7f800000UL }).__d) + +# endif + +# else /* not GCC */ + +typedef union { unsigned char __c[4]; float __f; } __huge_valf_t; + +# if __BYTE_ORDER == __BIG_ENDIAN +# define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 } +# endif +# if __BYTE_ORDER == __LITTLE_ENDIAN +# define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f } +# endif + +static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes }; +# define HUGE_VALF (__huge_valf.__f) + +# endif /* GCC. */ + + +/* Generally there is no separate `long double' format and it is the + same as `double'. */ +# define HUGE_VALL HUGE_VAL + +#endif /* __USE_ISOC99. */ diff --git a/src/system/libroot/posix/glibc/include/arch/ppc/bits/mathdef.h b/src/system/libroot/posix/glibc/include/arch/ppc/bits/mathdef.h new file mode 100644 index 0000000000..5eaf41ea67 --- /dev/null +++ b/src/system/libroot/posix/glibc/include/arch/ppc/bits/mathdef.h @@ -0,0 +1,81 @@ +/* Copyright (C) 1997, 1998, 1999, 2000 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. */ + +#if !defined _MATH_H && !defined _COMPLEX_H +# error "Never use directly; include instead" +#endif + + +/* FIXME! This file describes properties of the compiler, not the machine; + it should not be part of libc! + + FIXME! This file does not deal with the -fshort-double option of + gcc! */ + +#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF +# define _MATH_H_MATHDEF 1 + +# ifdef __GNUC__ +# if __STDC__ == 1 + +/* In GNU or ANSI mode, gcc leaves `float' expressions as-is. */ +typedef float float_t; /* `float' expressions are evaluated as + `float'. */ +typedef double double_t; /* `double' expressions are evaluated as + `double'. */ + +/* Signal that types stay as they were declared. */ +# define FLT_EVAL_METHOD 0 + +/* Define `INFINITY' as value of type `float'. */ +# define INFINITY HUGE_VALF + +# else + +/* For `gcc -traditional', `float' expressions are evaluated as `double'. */ +typedef double float_t; /* `float' expressions are evaluated as + `double'. */ +typedef double double_t; /* `double' expressions are evaluated as + `double'. */ + +/* Define `INFINITY' as value of type `float'. */ +# define INFINITY HUGE_VALF + +# endif +# else + +/* Wild guess at types for float_t and double_t. */ +typedef double float_t; +typedef double double_t; + +/* Define `INFINITY' as value of type `float'. */ +# define INFINITY HUGE_VALF + +# endif + +/* The values returned by `ilogb' for 0 and NaN respectively. */ +# define FP_ILOGB0 (-2147483647) +# define FP_ILOGBNAN (2147483647) + +#endif /* ISO C99 */ + +#ifndef __NO_LONG_DOUBLE_MATH +/* Signal that we do not really have a `long double'. The disables the + declaration of all the `long double' function variants. */ +# define __NO_LONG_DOUBLE_MATH 1 +#endif diff --git a/src/system/libroot/posix/glibc/include/arch/ppc/bits/mathinline.h b/src/system/libroot/posix/glibc/include/arch/ppc/bits/mathinline.h new file mode 100644 index 0000000000..34309c1a68 --- /dev/null +++ b/src/system/libroot/posix/glibc/include/arch/ppc/bits/mathinline.h @@ -0,0 +1,101 @@ +/* Inline math functions for powerpc. + Copyright (C) 1995,1996,1997,1998,1999,2000 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. */ + +#if defined __GNUC__ && !defined _SOFT_FLOAT + +#ifdef __USE_ISOC99 +# if __GNUC_PREREQ (2,96) + +# define isgreater(x, y) __builtin_isgreater (x, y) +# define isgreaterequal(x, y) __builtin_isgreaterequal (x, y) +# define isless(x, y) __builtin_isless (x, y) +# define islessequal(x, y) __builtin_islessequal (x, y) +# define islessgreater(x, y) __builtin_islessgreater (x, y) +# define isunordered(x, y) __builtin_isunordered (x, y) + +# else + +# define __unordered_cmp(x, y) \ + (__extension__ \ + ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \ + unsigned __r; \ + __asm__("fcmpu 7,%1,%2 ; mfcr %0" : "=r" (__r) : "f" (__x), "f"(__y) \ + : "cr7"); \ + __r; })) + +# define isgreater(x, y) (__unordered_cmp (x, y) >> 2 & 1) +# define isgreaterequal(x, y) ((__unordered_cmp (x, y) & 6) != 0) +# define isless(x, y) (__unordered_cmp (x, y) >> 3 & 1) +# define islessequal(x, y) ((__unordered_cmp (x, y) & 0xA) != 0) +# define islessgreater(x, y) ((__unordered_cmp (x, y) & 0xC) != 0) +# define isunordered(x, y) (__unordered_cmp (x, y) & 1) + +# endif /* __GNUC_PREREQ (2,97) */ +#endif /* __USE_ISOC99 */ + +#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__ + +#ifdef __cplusplus +# define __MATH_INLINE __inline +#else +# define __MATH_INLINE extern __inline +#endif /* __cplusplus */ + +#ifdef __USE_ISOC99 +__MATH_INLINE long int lrint (double __x) __THROW; +__MATH_INLINE long int +lrint (double __x) __THROW +{ + union { + double __d; + int __ll[2]; + } __u; + __asm__ ("fctiw %0,%1" : "=f"(__u.__d) : "f"(__x)); + return __u.__ll[1]; +} + +__MATH_INLINE long int lrintf (float __x) __THROW; +__MATH_INLINE long int +lrintf (float __x) __THROW +{ + union { + double __d; + int __ll[2]; + } __u; + __asm__ ("fctiw %0,%1" : "=f"(__u.__d) : "f"(__x)); + return __u.__ll[1]; +} + +__MATH_INLINE double fdim (double __x, double __y) __THROW; +__MATH_INLINE double +fdim (double __x, double __y) __THROW +{ + return __x < __y ? 0 : __x - __y; +} + +__MATH_INLINE float fdimf (float __x, float __y) __THROW; +__MATH_INLINE float +fdimf (float __x, float __y) __THROW +{ + return __x < __y ? 0 : __x - __y; +} + +#endif /* __USE_ISOC99 */ +#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */ +#endif /* __GNUC__ && !_SOFT_FLOAT */ diff --git a/src/system/libroot/posix/glibc/include/arch/ppc/bits/nan.h b/src/system/libroot/posix/glibc/include/arch/ppc/bits/nan.h new file mode 100644 index 0000000000..6d88b551b1 --- /dev/null +++ b/src/system/libroot/posix/glibc/include/arch/ppc/bits/nan.h @@ -0,0 +1,48 @@ +/* `NAN' constant for IEEE 754 machines. + Copyright (C) 1992, 1996, 1997, 1999 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 _MATH_H +# error "Never use directly; include instead." +#endif + + +/* IEEE Not A Number. */ + +#ifdef __GNUC__ + +# define NAN \ + (__extension__ \ + ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \ + { __l: 0x7fc00000UL }).__d) + +#else + +# include + +# if __BYTE_ORDER == __BIG_ENDIAN +# define __nan_bytes { 0x7f, 0xc0, 0, 0 } +# endif +# if __BYTE_ORDER == __LITTLE_ENDIAN +# define __nan_bytes { 0, 0, 0xc0, 0x7f } +# endif + +static union { unsigned char __c[4]; float __d; } __nan_union = { __nan_bytes }; +# define NAN (__nan_union.__d) + +#endif /* GCC. */ diff --git a/src/system/libroot/posix/glibc/include/arch/ppc/bits/wordsize.h b/src/system/libroot/posix/glibc/include/arch/ppc/bits/wordsize.h new file mode 100644 index 0000000000..1a79c86364 --- /dev/null +++ b/src/system/libroot/posix/glibc/include/arch/ppc/bits/wordsize.h @@ -0,0 +1,8 @@ +/* Determine the wordsize from the preprocessor defines. */ + +#if defined __powerpc64__ +# define __WORDSIZE 64 +# define __WORDSIZE_COMPAT32 1 +#else +# define __WORDSIZE 32 +#endif diff --git a/src/system/libroot/posix/glibc/include/arch/ppc/config.h b/src/system/libroot/posix/glibc/include/arch/ppc/config.h new file mode 100644 index 0000000000..ae97717cff --- /dev/null +++ b/src/system/libroot/posix/glibc/include/arch/ppc/config.h @@ -0,0 +1,240 @@ +//#if !defined __ASSEMBLER__ && !defined _ISOMAC && !defined __OPTIMIZE__ +//# error "glibc cannot be compiled without optimization" +//#endif + +/* Another evil option when it comes to compiling the C library is + --ffast-math since it alters the ABI. */ +#if defined __FAST_MATH__ && !defined TEST_FAST_MATH +# error "glibc must not be compiled with -ffast-math" +#endif + +/* Define if using GNU ld, with support for weak symbols in a.out, + and for symbol set and warning messages extensions in a.out and ELF. + This implies HAVE_WEAK_SYMBOLS; set by --with-gnu-ld. */ +#define HAVE_GNU_LD 1 + +/* Define if using ELF, which supports weak symbols. + This implies HAVE_ASM_WEAK_DIRECTIVE and NO_UNDERSCORES; set by + --with-elf. */ +#define HAVE_ELF 1 + +/* Define if using XCOFF. Set by --with-xcoff. */ +#undef HAVE_XCOFF + +/* Define if C symbols are asm symbols. Don't define if C symbols + have a `_' prepended to make the asm symbol. */ +#define NO_UNDERSCORES 1 + +/* Define if weak symbols are available via the `.weak' directive. */ +#define HAVE_ASM_WEAK_DIRECTIVE 1 + +/* Define if weak symbols are available via the `.weakext' directive. */ +#undef HAVE_ASM_WEAKEXT_DIRECTIVE + +/* Define to the assembler line separator character for multiple + assembler instructions per line. Default is `;' */ +#undef ASM_LINE_SEP + +/* Define if not using ELF, but `.init' and `.fini' sections are available. */ +#undef HAVE_INITFINI + +/* Define if __attribute__((section("foo"))) puts quotes around foo. */ +/*#define HAVE_SECTION_QUOTES 1 + [zooey]: defining this causes assembler errors, and I don't think + that any BeOS-gcc actually produces quotes in sections... +*/ +#undef HAVE_SECTION_QUOTES + +/* Define if using the GNU assembler, gas. */ +#define HAVE_GNU_AS 1 + +/* Define if the assembler supports the `.set' directive. */ +#define HAVE_ASM_SET_DIRECTIVE 1 + +/* Define to the name of the assembler's directive for + declaring a symbol global (default `.globl'). */ +#define ASM_GLOBAL_DIRECTIVE .globl + +/* Define to the prefix before `object' or `function' in the + assembler's `.type' directive, if it has one. */ +#undef ASM_TYPE_DIRECTIVE_PREFIX + +/* Define a symbol_name as a global .symbol_name for ld. */ +#undef HAVE_ASM_GLOBAL_DOT_NAME + +/* Define if the assembler generates debugging information directly. */ +#undef HAVE_CPP_ASM_DEBUGINFO + +/* Define if _Unwind_Find_FDE should be exported from glibc. */ +#undef EXPORT_UNWIND_FIND_FDE + +/* Define to use GNU libio instead of GNU stdio. + This is defined by configure under --enable-libio. */ +#define USE_IN_LIBIO 1 + +/* Define if using ELF and the assembler supports the `.previous' + directive. */ +#define HAVE_ASM_PREVIOUS_DIRECTIVE 1 + +/* Define if using ELF and the assembler supports the `.popsection' + directive. */ +#undef HAVE_ASM_POPSECTION_DIRECTIVE + +/* Define if versioning of the library is wanted. */ +#undef DO_VERSIONING + +/* Defined to the oldest ABI we support, like 2.1. */ +#undef GLIBC_OLDEST_ABI + +/* Define if static NSS modules are wanted. */ +#undef DO_STATIC_NSS + +/* Define if gcc uses DWARF2 unwind information for exception support. */ +#define HAVE_DWARF2_UNWIND_INFO 1 + +/* Define if gcc uses DWARF2 unwind information for exception support + with static variable. */ +#define HAVE_DWARF2_UNWIND_INFO_STATIC 1 + +/* Define if the compiler supports __builtin_expect. */ +#undef HAVE_BUILTIN_EXPECT + +/* Define if the compiler supports __builtin_memset. */ +#undef HAVE_BUILTIN_MEMSET + +/* Define if the __thread keyword is supported. */ +#undef HAVE___THREAD + +/* Define if the compiler supports __attribute__((tls_model(""))). */ +#undef HAVE_TLS_MODEL_ATTRIBUTE + +/* Define if the regparm attribute shall be used for local functions + (gcc on ix86 only). */ +#define USE_REGPARMS 1 + +/* Defined on PowerPC if the GCC being used has a problem with clobbering + certain registers (CR0, MQ, CTR, LR) in asm statements. */ +#undef BROKEN_PPC_ASM_CR0 + /* TODO: bonefish: Do we need to define this? */ + +/* Defined on SPARC if ld doesn't handle R_SPARC_WDISP22 against .hidden + symbol. sysdeps/sparc/sparc32/elf/configure. */ +#undef BROKEN_SPARC_WDISP22 + +/* Define if the linker supports the -z combreloc option. */ +#undef HAVE_Z_COMBRELOC + +/* Define if the assembler supported .protected. */ +#undef HAVE_PROTECTED + +/* Define if the assembler supported .hidden. */ +#undef HAVE_HIDDEN + +/* Define if the compiler supports __attribute__ ((visibility (...))). */ +#undef HAVE_VISIBILITY_ATTRIBUTE + +/* Define if the compiler doesn't support __attribute__ ((visibility (...))) + together with __asm__ redirection properly. */ +#undef HAVE_BROKEN_VISIBILITY_ATTRIBUTE + +/* Define if the compiler doesn't support __attribute__ ((alias (...))) + together with __asm__ redirection properly. */ +#undef HAVE_BROKEN_ALIAS_ATTRIBUTE + +/* Define if _rtld_local structure should be forced into .sdata section. */ +#undef HAVE_SDATA_SECTION + +/* Define if binutils support TLS handling. */ +#undef HAVE_TLS_SUPPORT + +/* Define if the linker supports .preinit_array/.init_array/.fini_array + sections. */ +#undef HAVE_INITFINI_ARRAY + +/* Define if the access to static and hidden variables is position independent + and does not need relocations. */ +#undef PI_STATIC_AND_HIDDEN + +/* Define this to disable the `hidden_proto' et al macros in + include/libc-symbols.h that avoid PLT slots in the shared objects. */ +#undef NO_HIDDEN + + +/* Defined to some form of __attribute__ ((...)) if the compiler supports + a different, more efficient calling convention. */ +#if defined USE_REGPARMS && !defined PROF && !defined __BOUNDED_POINTERS__ +# define internal_function __attribute__ ((regparm (3), stdcall)) +#endif + +/* Linux specific: minimum supported kernel version. */ +#undef __LINUX_KERNEL_VERSION + +/* Override abi-tags ABI version if necessary. */ +#undef __ABI_TAG_VERSION + +/* An extension in gcc 2.96 and up allows the subtraction of two + local labels. */ +#undef HAVE_SUBTRACT_LOCAL_LABELS + +/* bash 2.0 introduced the _XXX_GNU_nonoption_argv_flags_ variable to help + getopt determine whether a parameter is a flag or not. This features + was disabled later since it caused trouble. We are by default therefore + disabling the support as well. */ +#undef USE_NONOPTION_FLAGS + +/* Mach/Hurd specific: define if mig supports the `retcode' keyword. */ +#undef HAVE_MIG_RETCODE + +/* Mach specific: define if the `host_page_size' RPC is available. */ +#undef HAVE_HOST_PAGE_SIZE + +/* Mach/i386 specific: define if the `i386_io_perm_*' RPCs are available. */ +#undef HAVE_I386_IO_PERM_MODIFY + +/* Mach/i386 specific: define if the `i386_set_gdt' RPC is available. */ +#undef HAVE_I386_SET_GDT + +/* + */ + +#ifndef _LIBC + +/* These symbols might be defined by some sysdeps configures. + They are used only in miscellaneous generator programs, not + in compiling libc itself. */ + +/* sysdeps/generic/configure.in */ +#undef HAVE_PSIGNAL + +/* sysdeps/unix/configure.in */ +#define HAVE_STRERROR + +/* sysdeps/unix/common/configure.in */ +#undef HAVE_SYS_SIGLIST +#undef HAVE__SYS_SIGLIST +#undef HAVE__CTYPE_ +#undef HAVE___CTYPE_ +#undef HAVE___CTYPE +#undef HAVE__CTYPE__ +#undef HAVE__CTYPE +#undef HAVE__LOCP + +#endif + +/* + */ + +#ifdef _LIBC + +/* The zic and zdump programs need these definitions. */ + +#define HAVE_STRERROR 1 + +/* The locale code needs these definitions. */ + +#define HAVE_REGEX 1 + +//#define HAVE_MMAP 1 +#undef HAVE_MMAP + +#endif diff --git a/src/system/libroot/posix/glibc/include/arch/ppc/sysdep.h b/src/system/libroot/posix/glibc/include/arch/ppc/sysdep.h index 350fd1e3b1..b6a3551714 100644 --- a/src/system/libroot/posix/glibc/include/arch/ppc/sysdep.h +++ b/src/system/libroot/posix/glibc/include/arch/ppc/sysdep.h @@ -16,6 +16,8 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include_next + #ifdef __ASSEMBLER__ /* Symbolic names for the registers. The only portable way to write asm diff --git a/src/system/libroot/posix/glibc/libio/Jamfile b/src/system/libroot/posix/glibc/libio/Jamfile index 9563d21f56..cd82c91285 100644 --- a/src/system/libroot/posix/glibc/libio/Jamfile +++ b/src/system/libroot/posix/glibc/libio/Jamfile @@ -2,6 +2,7 @@ SubDir HAIKU_TOP src system libroot posix glibc libio ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch $(TARGET_ARCH) ; +SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch generic ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc stdio-common ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc libio ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include ; diff --git a/src/system/libroot/posix/glibc/locale/Jamfile b/src/system/libroot/posix/glibc/locale/Jamfile index 4765b11c54..39753abdab 100644 --- a/src/system/libroot/posix/glibc/locale/Jamfile +++ b/src/system/libroot/posix/glibc/locale/Jamfile @@ -2,6 +2,7 @@ SubDir HAIKU_TOP src system libroot posix glibc locale ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch $(TARGET_ARCH) ; +SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch generic ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc locale ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc ; diff --git a/src/system/libroot/posix/glibc/stdio-common/Jamfile b/src/system/libroot/posix/glibc/stdio-common/Jamfile index 34a9c5e751..d643e2b45e 100644 --- a/src/system/libroot/posix/glibc/stdio-common/Jamfile +++ b/src/system/libroot/posix/glibc/stdio-common/Jamfile @@ -5,6 +5,7 @@ SubDirCcFlags -D_GNU_SOURCE -DUSE_IN_LIBIO ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc libio ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch $(TARGET_ARCH) ; +SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch generic ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc stdio-common ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc locale ; diff --git a/src/system/libroot/posix/glibc/stdlib/Jamfile b/src/system/libroot/posix/glibc/stdlib/Jamfile index d126bb3cd7..a9ba5f2c9d 100644 --- a/src/system/libroot/posix/glibc/stdlib/Jamfile +++ b/src/system/libroot/posix/glibc/stdlib/Jamfile @@ -1,6 +1,7 @@ SubDir HAIKU_TOP src system libroot posix glibc stdlib ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch $(TARGET_ARCH) ; +SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch generic ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc locale ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc ; diff --git a/src/system/libroot/posix/glibc/wcsmbs/Jamfile b/src/system/libroot/posix/glibc/wcsmbs/Jamfile index 9fb28cb044..20515d60a6 100644 --- a/src/system/libroot/posix/glibc/wcsmbs/Jamfile +++ b/src/system/libroot/posix/glibc/wcsmbs/Jamfile @@ -2,6 +2,7 @@ SubDir HAIKU_TOP src system libroot posix glibc wcsmbs ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch $(TARGET_ARCH) ; +SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch generic ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc libio ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc wcsmbs ; diff --git a/src/system/libroot/posix/glibc/wctype/Jamfile b/src/system/libroot/posix/glibc/wctype/Jamfile index 3d9699980c..8a9ff29ec8 100644 --- a/src/system/libroot/posix/glibc/wctype/Jamfile +++ b/src/system/libroot/posix/glibc/wctype/Jamfile @@ -2,6 +2,7 @@ SubDir HAIKU_TOP src system libroot posix glibc wctype ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch $(TARGET_ARCH) ; +SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch generic ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include ; #SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc libio ; #SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc wcsmbs ;