Skip to content

tools: use LDFLAGS_host for host toolset #37444

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

Closed
wants to merge 1 commit into from
Closed

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