Skip to content
Snippets Groups Projects
Commit 3380347b authored by toy's avatar toy
Browse files

Earlier versions of gcc on Solaris deletes some of the symbols we

need.  gcc 3.0 does this even with -O0.  (I think this is a bug in
gcc.)  Try to arrange things so that gcc can't possibly delete
them by moving functions to reference_random_symbols_table.
parent b5fb0995
No related branches found
No related tags found
No related merge requests found
/* Routines that must be linked into the core for lisp to work. */ /* Routines that must be linked into the core for lisp to work. */
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/undefineds.c,v 1.5 1997/08/23 16:00:23 pw Exp $ */ /* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/undefineds.c,v 1.6 2001/09/24 21:23:18 toy Exp $ */
#ifdef sun #ifdef sun
#ifndef MACH #ifndef MACH
...@@ -23,7 +23,7 @@ extern func ...@@ -23,7 +23,7 @@ extern func
#undef F #undef F
#undef D #undef D
exit; /* just a random function known to exist */ exit; /* just a random function known to exist */
#if defined(SOLARIS) || defined(irix) #if defined(SOLARIS) || defined(irix)
#ifdef irix #ifdef irix
...@@ -42,20 +42,52 @@ errno; /* a random variable known to exist */ ...@@ -42,20 +42,52 @@ errno; /* a random variable known to exist */
int reference_random_symbols(void) { int reference_random_symbols(void) {
int a; int a;
#define F(x) x(); #if defined(SOLARIS) && defined(__GNUC__)
/*
* For some reason, gcc 3.0 still deletes function calls here, even
* with -O0. I don't know why. So, we don't define the functions
* here, but define them in the table below.
*/
#define F(x)
#else
#define F(x) x(0);
#endif
#define D(x) a+=x; #define D(x) a+=x;
#include "undefineds.h" #include "undefineds.h"
#undef F #undef F
#undef D #undef D
return a; return a;
} }
#if defined(SOLARIS) && defined(__GNUC__)
/*
* If we reference the functions here, gcc 3.0 will leave them in the
* object file. However, don't try to put the data symbols here. It
* will cause CMUCL to crash doing a get_timezone.
*/
func *reference_random_symbols_table[] = {
#define F(x) x,
#define D(x)
#include "undefineds.h"
#undef F
#undef D
exit /* a random function known to exist */
};
#endif
#else #else
#if defined(SVR4)
extern char *tzname[];
extern int daylight;
extern long altzone;
extern long timezone;
#endif
func *reference_random_symbols[] = { func *reference_random_symbols[] = {
#define F(x) x, #define F(x) x,
/* XXXfixme next line is probably wrong but was previous behavior */ /* XXXfixme next line is probably wrong but was previous behavior */
#define D(x) x, #define D(x) &x,
#include "undefineds.h" #include "undefineds.h"
#undef F #undef F
#undef D #undef D
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment