libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: use of -flat_namespace on darwin


From: Adam Mercer
Subject: Re: use of -flat_namespace on darwin
Date: Wed, 23 Dec 2009 17:18:48 +0000

On Wed, Dec 23, 2009 at 16:30, Peter O'Gorman <address@hidden> wrote:

>> In one of our projects we are experiencing a problem which seems to be
>> related to the fact that the -flat_namespace option is not being
>> passed to the linker, looking into why this is the case I see the
>> following code in libtool.m4:
>
> What is the problem?

We have a library which defines a global variable, lalDebugLevel which
effects the behaviour of certains functions depending on the value to
which it is set. Then in other codes, which utilise this library, you
can set the value of lalDebugLevel accordingly and this will be passed
onto the functions which will alter their behaviour accordingly.

When this library was first written, many years ago (before I took
over maintenance), codes that wanted to modify this simple defined a
global variable lalDebugLevel with the value they wanted. Clearly this
won't work with a two-level namespace and we have been seeing test
failures on Mac OS X and we have tracked the failures down to the
point at which I updated the version of libtool used.

The previous maintainer must have been aware of this problem as he had
hacked the included version of libtool to always pass -flat_namespace
to the linker on Mac OS X. I don't want to do this as I feel that this
is done for a reason, and the correct solution must lie elsewhere.

>> I see that the -flat_namespace is only passed for 10.0, 10.1, and
>> 10.2. Why is this? Are there adverse effects to using a flat namespace
>> on more recent OS X versions?
>
> Two level namespace is the default, last time I checked every library on the
> system was two level namespace (there used to be one flat namespace X11
> library, I think that changed). Two level namespace is faster, and solves
> numerous portability problems.

I had ascertained as much from various google search over the last few
hours therefore I feel the correct solution is to modify the code so
that it doesn't assume a flat namespace, therefore I imagine something
like

extern int lalDebugLevel;
lalDebugLevel = 0;

should be used, instead of

int lalDebugLevel = 0;

is a more correct solution. Thanks for confirming my suspicions
regarding the absence of -flat_namespace.

Cheers

Adam




reply via email to

[Prev in Thread] Current Thread [Next in Thread]