-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
doc: fix documentation regarding cross-compilation #12556
Comments
Are you sure you have an appropriate macos toolchain installed? It sounds like you may not or at least it's not being picked up (perhaps environment variables are not set correctly). |
no, I likely don't. I don't have much experience with cross-compiling (especially from Linux to Mac) so if you have any pointers, that would be greatly appreciated. Thanks! BTW, just for some context, I have |
I don't have any experience with a macos cross-compiler toolchain, but a quick google search turns up this which may work. |
The |
Thanks! I have managed to build the cross compiler from osxcross and the node.js build started fine. However, it failed part way through with a missing header: Out of curiosity, how is node.js built? Is it built on a single platform using the |
We don't do cross-compiling when we build Node. Basically if you'd like to fix cross-compiling and submit a PR we'll happily accept, but we currently don't test in CI, so you may run into all sorts of issues. |
@gibfahn Thanks. At least I know what I'm up against -- I thought I was being dense that I couldn't figure it out. I'm trying to build it in a docker container too, so if I manage to get it working, it should be portable too. I'll post any progress I make here. Thanks again for the pointers. |
I have created a GitHub project that contains a set of It seems even when using a mac toolchain, and specifying I'm not sure how I'll leave this here in case anyone has ideas how to fix this, or pointers for where to look in the node.js / v8 build. |
@irbull Since it seems the docs have become irrelevant I'm going to change the title. |
I don't think the docs have become irrelevant, we should still document how it would work, and if someone wants to do the work to get it working (and maybe even tested in CI) then that would be fine. We just don't have anyone who's stepped up to do that yet. |
@gibfahn It would be great if we could get this working. I've been pushing on it with the help of another J2V8 contributor. We've managed to get past the linux platform specific compile errors (by manually tweaking some gyp parameters), but now we're stuck at the linking stage. It's using the OSX toolchain, but it's passing linux specific linker arguments (which obviously don't work). I can't figure out where these are coming from. Our progress is on eclipsesource/J2V8#232. I'm happy to keep pushing forward with this, and if we get anywhere I'd be glad to parameterize this and put together a Pull Request. However, I think I might be stuck again. If anyone with knowledge of cross platform builds knows anything about linker args, I'm all ears. BTW, the docker approach is really nice. If this works, then we should have an isolated build system that can (in theory) build Node for several platforms from a single command on a single machine. |
@gibfahn Ok. |
Closing due to lack of participation in the last nine month. If someone thinks differently, please reopen. |
I'm trying to cross compile from Linux to Mac. I'm not even sure it's supposed to work, but according to the docs you can specify a
dest-os
and a--cross-compiling
so I guess it should.When I first tried to build on Linux for Mac,
./configure
threw some errors that XCode was not installed. I understand that you need XCode if you build on a Mac, but is this a requirement when you build for a Mac? I found that if you include--ninja
then the XCode dependency was removed. The configuration arguments I'm using are:./configure --cross-compiling --without-intl --without-inspector --dest-cpu=x64 --dest-os=mac --without-snapshot --without-dtrace --ninja
However, if I then try to link the
.a
files on a Mac now (I'm linking against some other code I have), then I get the following:Any ideas / pointers?
The text was updated successfully, but these errors were encountered: