|
Boost-Build : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-09-24 03:13:52
On Friday 22 September 2006 22:28, Doug Gregor wrote:
> We ran into some linking issues on Mac OS X with the Python library.
> This patch below *seems* to fix the issue, because the Darwin linker
> fails if there are undefined symbols (usually supplied by the Python
> library) when linking libboost_python-whatever.dylib.
You mean, a shared library can't have undefined symbols? This so Windows-like,
they must have hacked ld to get this behaviour.
> The only ways
> to force the linker to ignore those undefined symbols involve -
> flat_namespace, which Apple quitely broken in the latest release.
>
> In any case, the change is just to link against the Python libraries
> with -framework Python. On other *nix variants, this would be bad,
> because we'd end up with two copies of the Python symbols... one
> linked into the libboost_python library and the other provided by the
> Python interpreter.
Only if Python lib is static, which unfortunately is the case on half the
systems ;-)
> On Mac OS X, I believe frameworking linking is
> always dynamic linking, so the problem doesn't crop up. At least, the
> Python tests seem to be running...
>
> I still don't think we're handling extension modules properly. We
> should be linking them with -bundle and (possibly) -bundle_loader,
> but we aren't. Darwin is such a pain :(
What's the difference between -framework and -bundle?
In any way, I know too little about Darwin to make any meaningfull comments.
I'd suggest to go ahead with this patch. If somebody has more comments we can
always adjust things.
> --- /u/dgregor/Projects/boost-1.34.0/tools/build/v2/tools/
> python.jam 2006-09-21 10:54:35.000000000 -0400
> +++ python.jam 2006-09-22 11:29:20.000000000 -0400
> @@ -363,19 +363,15 @@
> }
> PYTHON_FRAMEWORK = $(PYTHON_FRAMEWORK:D)/Python ;
> - alias python_for_extensions
> - :
> - :
> - :
> - : <include>$(includes)
> - ;
> -
> alias python
>
> : <os>MACOSX <toolset>darwin
> :
> : <include>$(includes) <framework>$(PYTHON_FRAMEWORK)
>
> ;
> +
> + .alias-defined = true ;
> + alias python_for_extensions : python ;
But can you please add a comment here? At least, saying that on Darwin,
extensions must link to Python directly, or link error will occur?
Thanks,
Volodya
> }
> rule init-nt ( version : root ? : includes ? : libraries ? : cygwin-
> condition ? )
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost-build
-- Vladimir Prus http://vladimir_prus.blogspot.com Boost.Build V2: http://boost.org/boost-build2
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk