This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: multiple definitions of 'xxx keyed to...' in egcs-1.1.1


>>>>> Mark Mitchell <mark@markmitchell.com>:

>>>>> "Jason" == Jason Merrill <jason@cygnus.com> writes:

Jason> The current code uses timestamp ^ pid directly, without going
Jason> through the random number generator.  The code was lifted from
Jason> mkstemp in libiberty.

Jason> Really, this seems entirely adequate to me.  The number of
Jason> translation units that actually rely on this is small; witness
Jason> how long it took to fix this problem in the first place.

> Probably the current approach *is* good enough.  I was operating
> under the assumption that it wasn't, since HJ was concerned about
> it.

If this is the approach 1.1.1 uses on the thing that started this
thread (I'm not sure of I'm following the current discussion), this
test case will break it on linux:
	http://egcs.cygnus.com/ml/egcs-bugs/1999-02/msg00469.html

If the approach Jason lists above is the cause, the approach does not
seem adequate to me.  

What I'm doing in the real cause (not the test case) is putting self
registering singletons in .so files, and having them register
temselves with a central registry when the .so files are loaded (the
constructor of the singleton does the registration, and we create a
static instance of each singleton).

I don't think this is a particularily exotic thing to do.  It seemed
like a good, clean way to implement run-time loadable modules.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]