Skip to content

Conversation

@isuruf
Copy link

@isuruf isuruf commented Feb 19, 2021

This makes the behaviour similar to that of CFLAGS_host

This makes the behaviour similar to that of CFLAGS_host
@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. tools Issues and PRs related to the tools directory. labels Feb 19, 2021
@richardlau
Copy link
Member

This should be upstreamed first to https://github.com/nodejs/gyp-next.

@isuruf
Copy link
Author

isuruf commented Feb 19, 2021

Thanks. Done in nodejs/gyp-next#98

@targos
Copy link
Member

targos commented Feb 19, 2021

What is the use case in Node.js ?

@isuruf
Copy link
Author

isuruf commented Feb 19, 2021

To cross compile nodejs to a different platform. (My use case is for compiling in x86_64-apple-darwin for aarch64-apple-darwin.)

@targos
Copy link
Member

targos commented Feb 19, 2021

I wonder why we never had the need before. We already cross-compile for ARM on Linux.

@isuruf
Copy link
Author

isuruf commented Feb 19, 2021

I think that's because the compiler is smart enough to ignore the libraries for target platform and look for only the host libraries when building host executables. In my case, I needed to give some library directories (-L flags) for host because they were not in a standard directory.

@nodejs-github-bot
Copy link
Collaborator

@targos
Copy link
Member

targos commented Feb 20, 2021

I launched CI to check whether our cross-compilation setup works with the change.

@minrk
Copy link

minrk commented Feb 23, 2021

FWIW, with this and the patch for torque referenced in #37441, we now have working cross-compilation from mac-x86_64 to mac-arm64.

@targos
Copy link
Member

targos commented Aug 1, 2021

This was included in #38867. Thanks for the PRs!

@targos targos closed this Aug 1, 2021
@isuruf isuruf deleted the patch-2 branch August 1, 2021 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Issues and PRs related to build files or the CI. tools Issues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants