classpath-patches
[Top][All Lists]
Advanced

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

[cp-patches] RFC: fdlibm namespace protection


From: Guilhem Lavaux
Subject: [cp-patches] RFC: fdlibm namespace protection
Date: Wed, 14 Dec 2005 21:35:37 +0100
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050322)

Hi,

Here is a patch to fix some problem we met on darwin5 where apparently the same library is used for math operations. The linker was failing because of duplicated symbols between fdlibm and libm. So this patch adds a generated file called namespace.h which renames all the necessary symbols to prevent from clashing with those of libm. The patch also includes a tool to produce the header file and the list of symbols to rename. This file should be static but if someone prefers so we can invoke the generation from a makefile.

Cheers,

Guilhem.

ChangeLog entry:

2005-12-14  Guilhem Lavaux  <address@hidden>

        * native/fdlibm/mprec.h, native/fdlibm/fdlibm.h: Added the
        inclusion of namespace.h

        * native/fdlibm/namespace.h: New file.

        * scripts/build_mathnamespace, scripts/math_symbols: New files.
Index: scripts/build_mathnamespace
===================================================================
RCS file: scripts/build_mathnamespace
diff -N scripts/build_mathnamespace
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ scripts/build_mathnamespace 14 Dec 2005 20:29:02 -0000
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+echo "/* Warning ! This is a generated file. Use build_mathnamespace to 
regenerate it */"
+while read fun;do
+       echo "#define ${fun} ClasspathMath_${fun}"
+done
Index: scripts/math_symbols
===================================================================
RCS file: scripts/math_symbols
diff -N scripts/math_symbols
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ scripts/math_symbols        14 Dec 2005 20:29:02 -0000
@@ -0,0 +1,66 @@
+acos
+asin
+atan
+atan2
+cos
+sin
+tan
+cosh
+sinh
+exp
+frexp
+ldexp
+log
+modf
+pow
+sqrt
+ceil
+fabs
+floor
+fmod
+erf
+erfc
+gamma
+hypot
+isnan
+finite
+j0
+j1
+jn
+lgamma
+y0
+y1
+yn
+acosh
+asinh
+cbrt
+logb
+nextafter
+remainder
+logb
+scalb
+significand
+logbf
+scalbf
+significandf
+copysign
+ilogb
+rint
+rintf
+scalbn
+__ieee754_sqrt
+__ieee754_asin
+__ieee754_asin
+__ieee754_atan2
+__ieee754_exp
+__ieee754_fmod
+__ieee754_log
+__ieee754_pow
+__ieee754_rem_pio2
+__ieee754_remainder
+__ieee754_scalb
+__ieee754_acos
+__kernel_cos
+__kernel_sin
+__kernel_tan
+__kernel_rem_pio2
Index: native/fdlibm/fdlibm.h
===================================================================
RCS file: /cvsroot/classpath/classpath/native/fdlibm/fdlibm.h,v
retrieving revision 1.6
diff -u -r1.6 fdlibm.h
--- native/fdlibm/fdlibm.h      21 May 2004 07:03:56 -0000      1.6
+++ native/fdlibm/fdlibm.h      14 Dec 2005 20:29:02 -0000
@@ -24,6 +24,8 @@
 
 /* GCJ LOCAL: Include files.  */
 #include "ieeefp.h"
+/* CLASSPATH LOCAL: */
+#include "namespace.h"
 
 #include "mprec.h"
 
Index: native/fdlibm/mprec.h
===================================================================
RCS file: /cvsroot/classpath/classpath/native/fdlibm/mprec.h,v
retrieving revision 1.5
diff -u -r1.5 mprec.h
--- native/fdlibm/mprec.h       15 Sep 2005 17:10:29 -0000      1.5
+++ native/fdlibm/mprec.h       14 Dec 2005 20:29:02 -0000
@@ -31,6 +31,8 @@
 
 #include <config.h>
 #include "ieeefp.h"
+/* CLASSPATH LOCAL */
+#include "namespace.h"
 
 #if defined HAVE_STDINT_H
 #include <stdint.h>
Index: native/fdlibm/namespace.h
===================================================================
RCS file: native/fdlibm/namespace.h
diff -N native/fdlibm/namespace.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ native/fdlibm/namespace.h   14 Dec 2005 20:29:02 -0000
@@ -0,0 +1,67 @@
+/* Warning ! This is a generated file. Use build_mathnamespace to regenerate 
it */
+#define acos ClasspathMath_acos
+#define asin ClasspathMath_asin
+#define atan ClasspathMath_atan
+#define atan2 ClasspathMath_atan2
+#define cos ClasspathMath_cos
+#define sin ClasspathMath_sin
+#define tan ClasspathMath_tan
+#define cosh ClasspathMath_cosh
+#define sinh ClasspathMath_sinh
+#define exp ClasspathMath_exp
+#define frexp ClasspathMath_frexp
+#define ldexp ClasspathMath_ldexp
+#define log ClasspathMath_log
+#define modf ClasspathMath_modf
+#define pow ClasspathMath_pow
+#define sqrt ClasspathMath_sqrt
+#define ceil ClasspathMath_ceil
+#define fabs ClasspathMath_fabs
+#define floor ClasspathMath_floor
+#define fmod ClasspathMath_fmod
+#define erf ClasspathMath_erf
+#define erfc ClasspathMath_erfc
+#define gamma ClasspathMath_gamma
+#define hypot ClasspathMath_hypot
+#define isnan ClasspathMath_isnan
+#define finite ClasspathMath_finite
+#define j0 ClasspathMath_j0
+#define j1 ClasspathMath_j1
+#define jn ClasspathMath_jn
+#define lgamma ClasspathMath_lgamma
+#define y0 ClasspathMath_y0
+#define y1 ClasspathMath_y1
+#define yn ClasspathMath_yn
+#define acosh ClasspathMath_acosh
+#define asinh ClasspathMath_asinh
+#define cbrt ClasspathMath_cbrt
+#define logb ClasspathMath_logb
+#define nextafter ClasspathMath_nextafter
+#define remainder ClasspathMath_remainder
+#define logb ClasspathMath_logb
+#define scalb ClasspathMath_scalb
+#define significand ClasspathMath_significand
+#define logbf ClasspathMath_logbf
+#define scalbf ClasspathMath_scalbf
+#define significandf ClasspathMath_significandf
+#define copysign ClasspathMath_copysign
+#define ilogb ClasspathMath_ilogb
+#define rint ClasspathMath_rint
+#define rintf ClasspathMath_rintf
+#define scalbn ClasspathMath_scalbn
+#define __ieee754_sqrt ClasspathMath___ieee754_sqrt
+#define __ieee754_asin ClasspathMath___ieee754_asin
+#define __ieee754_asin ClasspathMath___ieee754_asin
+#define __ieee754_atan2 ClasspathMath___ieee754_atan2
+#define __ieee754_exp ClasspathMath___ieee754_exp
+#define __ieee754_fmod ClasspathMath___ieee754_fmod
+#define __ieee754_log ClasspathMath___ieee754_log
+#define __ieee754_pow ClasspathMath___ieee754_pow
+#define __ieee754_rem_pio2 ClasspathMath___ieee754_rem_pio2
+#define __ieee754_remainder ClasspathMath___ieee754_remainder
+#define __ieee754_scalb ClasspathMath___ieee754_scalb
+#define __ieee754_acos ClasspathMath___ieee754_acos
+#define __kernel_cos ClasspathMath___kernel_cos
+#define __kernel_sin ClasspathMath___kernel_sin
+#define __kernel_tan ClasspathMath___kernel_tan
+#define __kernel_rem_pio2 ClasspathMath___kernel_rem_pio2

reply via email to

[Prev in Thread] Current Thread [Next in Thread]