- add workaround for solaris that forces new operator to be linked with main

This commit is contained in:
Bryce Denney 2002-10-17 00:09:54 +00:00
parent 3d53781ba6
commit 6e1388f0d9
3 changed files with 30 additions and 0 deletions

View File

@ -9,6 +9,16 @@
const char *version_string = "uselib-test6-1.0";
#if 1
// This lines forces main.cc to link in the functions associated with
// the new operator. If there is no "new" in the whole executable, the
// Solaris linker decides not to link in __builtin_new, giving this error
// when you try to load a module:
// fatal: relocation error: file .libs/libmodule1.so.0:
// symbol __builtin_new: referenced symbol not found
int *force_builtin_new = new int;
#endif
int register_module (const char *name)
{
printf ("register_module was called by module '%s'\n", name);

View File

@ -9,6 +9,16 @@
const char *version_string = "uselib-test6-1.0";
#if 1
// This lines forces main.cc to link in the functions associated with
// the new operator. If there is no "new" in the whole executable, the
// Solaris linker decides not to link in __builtin_new, giving this error
// when you try to load a module:
// fatal: relocation error: file .libs/libmodule1.so.0:
// symbol __builtin_new: referenced symbol not found
int *force_builtin_new = new int;
#endif
int register_module (const char *name)
{
printf ("register_module was called by module '%s'\n", name);

View File

@ -9,6 +9,16 @@
const char *version_string = "uselib-test6-1.0";
#if 1
// This lines forces main.cc to link in the functions associated with
// the new operator. If there is no "new" in the whole executable, the
// Solaris linker decides not to link in __builtin_new, giving this error
// when you try to load a module:
// fatal: relocation error: file .libs/libmodule1.so.0:
// symbol __builtin_new: referenced symbol not found
int *force_builtin_new = new int;
#endif
int register_module (const char *name)
{
printf ("register_module was called by module '%s'\n", name);