Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Use "linuxstatic" to generate bytecode for different arch on Linux #1144

Merged
merged 3 commits into from
Apr 23, 2021

Conversation

jesec
Copy link
Contributor

@jesec jesec commented Apr 23, 2021

Currently pkg can't generate executable for different arch:

Warning Failed to make bytecode node14-arm64 for file ...

as it attempts to run Node of different arch to make bytecode.

We can set up QEMU and binfmt to allow emulation. However, the "linux"
binary needs libraries from the system, and it is PITA to set up the
entire sysroot of a different arch.

This change workarounds the issue by using "linuxstatic" to generate
bytecode for different arch.

Currently `pkg` can't generate executable for different arch:

> Warning Failed to make bytecode node14-arm64 for file ...

as it attempts to run binary of different arch.

We can set up QEMU and binfmt to allow emulation. However, the "linux"
binary needs libraries from the system, and it is PITA to set up the
entire sysroot of a different arch.

This change workarounds the issue by using "linuxstatic" to generate
bytecode for different arch.
Copy link
Contributor

@robertsLando robertsLando left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Maybe adding a log when the fabPlatform is forced (explaining why) would be good

@jesec
Copy link
Contributor Author

jesec commented Apr 23, 2021

LGTM. Maybe adding a log when the fabPlatform is forced (explaining why) would be good

Later, we can add more documentation about compiling for different arch.

@jesec jesec merged commit a3f9110 into master Apr 23, 2021
@jesec jesec deleted the pr/other-arch branch April 23, 2021 14:04
@fcastilloec
Copy link

Will this change help compile for armv7? and probably help with #1148? If so, how can use this to generate an armv7 from an x86_64 arch?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants