-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable darwin-host cross compilation. Tested with build=linux, host=darwin #60495
Comments
I've fixed up the very few missing configure bits and one issue with PYTHON_FOR_BUILD using srcdir instead of builddir. I also rolled in a simple warning fix that I ran into (the #ifdef HAVE_CHROOT added to posixmodule.c) configured with: using these compilers: and MacOSX10.7.sdk, I can successfully build Python for Mac OS X on Linux. |
I'm curious as to what value there would be in adding support for cross building an OS X variant of Python on Linux. It seems to me that such an animal would be fragile and incomplete at best. For example, normal Python builds on OS X normally require certain OS X frameworks outside of those included with the compiler. It's difficult enough to support native builds on a wide range of OS X releases and hardware configurations. Why would we want to officially support this particular variant of cross building on another platform? |
There's no reason for it to be either fragile or incomplete. My cross builds have a goal of being comprehensive.
If the user supplies the Apple Mac OS X SDK then the frameworks are correctly detected and used. To enable this, I use a set of wrapper scripts to enable this, here's the contents of x86_64-apple-darwin11-gcc: #!/bin/sh
There's 3 separate issues merged into this patch, general cross compilation fixes, the new darwin cross compilation feature and a few darwin warning fixes (that apply equally to cross and native). I shouldn't have done that, and am in the process of splitting this issue up so that each part can be judged in isolation. Please see the new issue I've made for the general cross compilation issues: http://bugs.python.org/issue16292 |
Here's the darwin cross enabling portion. I've also removed the warnings fixes from it as they're not relevant. |
The patch itself looks fine, but I wonder how useful it will be. A small question about the patch, why this case in the cross_arch function: + x86_64*darwin*) That doesn't look correct. Back to the more important issue of the usefulness of this patch:
|
From a real Mac Book Pro: $ uname -a
Darwin MACBOOKPRO.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64
$ /usr/bin/arch
i386
$ uname -m
x86_64 It would seem arch on OS X can only be used to determine PPC vs Intel (which is all that configure uses it for anyway).
Cross compiling is always useful for build engineers who have to target multiple hosts.
Ideally yes, or a Virtual Machine with OSX on it or confidence based on the results of a previous test built with the same sources or maloader (...though maybe not, I've never personally tried maloader).
My personal interest is for having Python embedded in other things (GDB) and using it from the command-line. Python Launcher is not part of the scope.
I'd be happy to do whatever I can to help out with this. If we could identify in the build that it was built via cross compilation somehow or have my email address in the help would that make it more palatable?
The users would get the SDK from being registered as a developer with Apple. As for the license, while also not being a lawyer, my interpretation is this: In the Xcode License.rtf file (and the Command Line tools license), the relevant part is "you are granted a limited, non-exclusive license to use the Developer Software on Apple-branded computers to develop and test application and other software". This doesn't say anything about the OS that's running on said Apple-branded computer, and my interpretation is that you could install a Linux distro on an Apple computer or on a VM on an Apple computer and still be compliant with that license. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: