Browse Source

Interoperability with gcc-3.0 -fuse-cxa-atexit.

master
Bruno Haible 23 years ago
parent
commit
75ddb198df
  1. 9
      ChangeLog
  2. 32
      autoconf/aclocal.m4
  3. 132
      include/cln/modules.h

9
ChangeLog

@ -1,3 +1,12 @@
2001-11-04 Bruno Haible <haible@clisp.cons.org>
Interoperability with gcc-3.0 -fuse-cxa-atexit.
* autoconf/aclocal.m4 (CL_GLOBAL_CONSTRUCTORS): Add test whether
global destructors actually exist.
* include/cln/modules.h (CL_PROVIDE, CL_PROVIDE_END, CL_PROVIDE_END):
Don't hack the global destructors if there is no global destructors
function.
2001-11-03 Richard Kreckel <kreckel@ginac.de> 2001-11-03 Richard Kreckel <kreckel@ginac.de>
* src/float/transcendental/cl_F_sinx.cc (sinx_naive): For small * src/float/transcendental/cl_F_sinx.cc (sinx_naive): For small

32
autoconf/aclocal.m4

@ -570,8 +570,33 @@ rm -f conftest*
if test "$cl_cv_cplusplus_ctorprefix" '!=' unknown; then if test "$cl_cv_cplusplus_ctorprefix" '!=' unknown; then
ac_value='"'"$cl_cv_cplusplus_ctorprefix"'"' ac_value='"'"$cl_cv_cplusplus_ctorprefix"'"'
AC_DEFINE_UNQUOTED(CL_GLOBAL_CONSTRUCTOR_PREFIX,$ac_value) AC_DEFINE_UNQUOTED(CL_GLOBAL_CONSTRUCTOR_PREFIX,$ac_value)
ac_value=`echo "$ac_value" | sed -e 's,I,D,'`
AC_DEFINE_UNQUOTED(CL_GLOBAL_DESTRUCTOR_PREFIX,$ac_value)
AC_CACHE_CHECK(for the global destructors function prefix,
cl_cv_cplusplus_dtorprefix, [
cat > conftest.cc << EOF
struct foo { foo (); ~ foo (); };
foo foobar;
EOF
# look for the assembly language name in the .s file
AC_TRY_COMMAND(${CXX-g++} $CXXFLAGS -S conftest.cc) >/dev/null 2>&1
if grep '_GLOBAL_\$D\$foobar' conftest.s >/dev/null ; then
cl_cv_cplusplus_dtorprefix='_GLOBAL_$D$'
else
if grep '_GLOBAL_\.D\.foobar' conftest.s >/dev/null ; then
cl_cv_cplusplus_dtorprefix='_GLOBAL_.D.'
else
if grep '_GLOBAL__D_foobar' conftest.s >/dev/null ; then
cl_cv_cplusplus_dtorprefix='_GLOBAL__D_'
else
cl_cv_cplusplus_dtorprefix=none
fi
fi
fi
rm -f conftest*
])
if test "$cl_cv_cplusplus_dtorprefix" '!=' none; then
ac_value='"'"$cl_cv_cplusplus_ctorprefix"'"'
AC_DEFINE_UNQUOTED(CL_GLOBAL_DESTRUCTOR_PREFIX,$ac_value)
fi
dnl Check whether the global constructors/destructors functions are file-scope dnl Check whether the global constructors/destructors functions are file-scope
dnl only by default. This is the case in egcs-1.1.2 or newer. dnl only by default. This is the case in egcs-1.1.2 or newer.
AC_CACHE_CHECK(whether the global constructors function need to be exported, AC_CACHE_CHECK(whether the global constructors function need to be exported,
@ -709,6 +734,9 @@ dnl
## configuration script generated by Autoconf, you may include it under ## configuration script generated by Autoconf, you may include it under
## the same distribution terms that you use for the rest of that program. ## the same distribution terms that you use for the rest of that program.
# The next line was added by Bruno Haible 2001-06-08.
builtin([undefine],[symbols])
# serial 46 AC_PROG_LIBTOOL # serial 46 AC_PROG_LIBTOOL
AC_DEFUN([AC_PROG_LIBTOOL], AC_DEFUN([AC_PROG_LIBTOOL],
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl

132
include/cln/modules.h

HTTP/1.1 200 OK Content-Type: text/html; charset=UTF-8 Set-Cookie: i_like_gitea=8bda8f450d4c1042; Path=/; HttpOnly; SameSite=Lax Set-Cookie: _csrf=NVW8X9WMvalyYHdAYdgApmYpWoY6MTczNTAwNzA1NTU1NjMwNTk3Nw; Path=/; Expires=Wed, 25 Dec 2024 02:24:15 GMT; HttpOnly; SameSite=Lax Set-Cookie: macaron_flash=; Path=/; Max-Age=0; HttpOnly; SameSite=Lax X-Frame-Options: SAMEORIGIN Date: Tue, 24 Dec 2024 02:24:15 GMT Transfer-Encoding: chunked cb9d sp/cln_mirror - cln_mirror - Gitea: Git with a cup of tea
@ -152,53 +152,91 @@
#if defined(__ia64__) #if defined(__ia64__)
#define CL_JUMP_TO(addr) ASM_VOLATILE("br " #addr) #define CL_JUMP_TO(addr) ASM_VOLATILE("br " #addr)
#endif #endif
#define CL_PROVIDE(module) \
extern "C" void cl_module__##module##__firstglobalfun () {} \
extern "C" void cl_module__##module##__ctorend (void); \
extern "C" void cl_module__##module##__dtorend (void); \
CL_GLOBALIZE_JUMP_LABEL(cl_module__##module##__ctorend) \
CL_GLOBALIZE_JUMP_LABEL(cl_module__##module##__dtorend) \
CL_GLOBALIZE_CTORDTOR_LABEL( \
ASM_UNDERSCORE_PREFIX CL_GLOBAL_CONSTRUCTOR_PREFIX \
"cl_module__" #module "__firstglobalfun") \
CL_GLOBALIZE_CTORDTOR_LABEL( \
ASM_UNDERSCORE_PREFIX CL_GLOBAL_DESTRUCTOR_PREFIX \
"cl_module__" #module "__firstglobalfun") \
static int cl_module__##module##__counter; \
struct cl_module__##module##__controller { \
inline cl_module__##module##__controller () \
{ if (cl_module__##module##__counter++) \
{ CL_JUMP_TO(cl_module__##module##__ctorend); } \
} \
inline ~cl_module__##module##__controller () \
{ CL_OUTPUT_LABEL (ASM_UNDERSCORE_PREFIX "cl_module__" #module "__dtorend"); } \
}; \
static cl_module__##module##__controller cl_module__##module##__ctordummy;
#define CL_PROVIDE_END(module) \
struct cl_module__##module##__destroyer { \
inline cl_module__##module##__destroyer () \
{ CL_OUTPUT_LABEL (ASM_UNDERSCORE_PREFIX "cl_module__" #module "__ctorend"); } \
inline ~cl_module__##module##__destroyer () \
{ if (--cl_module__##module##__counter) \
{ CL_JUMP_TO(cl_module__##module##__dtorend); } \
} \
}; \
static cl_module__##module##__destroyer cl_module__##module##__dtordummy;
#define CL_REQUIRE(module) \
extern "C" void cl_module__##module##__ctor (void) \
__asm__ (ASM_UNDERSCORE_PREFIX CL_GLOBAL_CONSTRUCTOR_PREFIX \
"cl_module__" #module "__firstglobalfun"); \
extern "C" void cl_module__##module##__dtor (void) \
__asm__ (ASM_UNDERSCORE_PREFIX CL_GLOBAL_DESTRUCTOR_PREFIX \
"cl_module__" #module "__firstglobalfun"); \
struct _CL_REQUIRE_CLASSNAME(module,__LINE__) { \
inline _CL_REQUIRE_CLASSNAME(module,__LINE__) () \
{ cl_module__##module##__ctor (); } \
inline ~_CL_REQUIRE_CLASSNAME(module,__LINE__) () \
{ cl_module__##module##__dtor (); } \
}; \
static _CL_REQUIRE_CLASSNAME(module,__LINE__) \
_CL_REQUIRE_CLASSNAME(module##_requirer,__LINE__);
#ifdef CL_GLOBAL_DESTRUCTOR_PREFIX
#define CL_PROVIDE(module) \
extern "C" void cl_module__##module##__firstglobalfun () {} \
extern "C" void cl_module__##module##__ctorend (void); \
extern "C" void cl_module__##module##__dtorend (void); \
CL_GLOBALIZE_JUMP_LABEL(cl_module__##module##__ctorend) \
CL_GLOBALIZE_JUMP_LABEL(cl_module__##module##__dtorend) \
CL_GLOBALIZE_CTORDTOR_LABEL( \
ASM_UNDERSCORE_PREFIX CL_GLOBAL_CONSTRUCTOR_PREFIX \
"cl_module__" #module "__firstglobalfun") \
CL_GLOBALIZE_CTORDTOR_LABEL( \
ASM_UNDERSCORE_PREFIX CL_GLOBAL_DESTRUCTOR_PREFIX \
"cl_module__" #module "__firstglobalfun") \
static int cl_module__##module##__counter; \
struct cl_module__##module##__controller { \
inline cl_module__##module##__controller () \
{ if (cl_module__##module##__counter++) \
{ CL_JUMP_TO(cl_module__##module##__ctorend); } \
} \
Author SHA1 Message Date
Richard Kreckel 98bc175431 Enable modifying operators by default. 17 years ago
Richard Kreckel 665c18cd37 * */*: Convert encoding from ISO 8859-1 to UTF-8. 18 years ago
Richard Kreckel 5370ad8054 * */*: Remove cl_boolean, cl_true, and cl_false in favor of built-in 18 years ago
Richard Kreckel e528307482 Extend the exponent range from 32 bits to 64 bits on selected platforms. 18 years ago
Richard Kreckel c84c6db5d5 2006-04-25 Bruno Haible <bruno@clisp.org> 19 years ago
Bruno Haible 9d39b1f00e Force link-time references despite optimizations done by g++. 23 years ago
Richard Kreckel 850abfde7f * All Files have been modified for inclusion of namespace cln; 25 years ago
Richard Kreckel dd9e0f894e Initial revision 25 years ago
0