Subject: Re: C++ compiler wackyness.
To: Harald Bjoroy <harald@bitcon.no>
From: Simon Burge <simonb@telstra.com.au>
List: port-pmax
Date: 08/13/1998 10:11:06
Ok, I've got a solution that works (from Michael Hitch) that I won't
even pretent to understand.  Add:

	/*
	 * Workaround an ld shared library bug:  define these dummy entries to
	 * satisify __do_global_ctors() instead of the entries in libg++.so.
	 */
	int *__CTOR_LIST__[] = {0};
	int *__DTOR_LIST__[] = {0,0};

somewhere.  With these couple of lines, the main.cpp does nothing (not
even a core dump :), and the hello.c prints "hello world" - both of
which are good things!  Here's a snippet from what Michael explains is
wrong:

	defined dummy __CTOR_LIST__ and __DTOR_LIST__ arrays to get
	around the problem of ld not creating relocation information
	for the ones defined in the shared libraries.  [Even if ld
	did generate the correct relocation information, I suspect
	the way these are being used is incorrect.

FWIW, my -current system (as of late May) doesn't even compile the test
program.  I'll try upgrading it to a current -current and see if I can
at least compile the program.

Simon.