Skip to content

Cross build luajit to aarch64-linux from x86 host #160

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

fallenwood
Copy link

Ths PR includes

  1. Build luajit without tests
  2. Add cross build for lua51 and luajit in github action
  3. Add editorconfig

The aim is to build neovim with luajit support for raspberry pi aarch64 from x86 host

@robbielyman
Copy link
Collaborator

why the .editorconfig file?

@fallenwood
Copy link
Author

why the .editorconfig file?

Thanks for reviewing.
When mading changes of this PR, I failed to start the build pipeline because the space format is not correct in yaml with the default setting of my vscode.
I think it's better to have a editorconfig to make sure the files, for example, yaml and makefile, have the correct spaces naturally

build/luajit.zig Outdated
@@ -210,6 +243,11 @@ pub fn configure(b: *Build, target: Build.ResolvedTarget, optimize: std.builtin.
return lib;
}

fn getPath(lazy_path: Build.LazyPath, src_builder: *Build, asking_step: ?*Step) []const u8 {
const p = lazy_path.getPath3(src_builder, asking_step);
Copy link
Collaborator

Choose a reason for hiding this comment

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

are users of the Zig build system supposed to call this function? I'm pretty sure they are not, right?

Copy link
Author

Choose a reason for hiding this comment

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

Yes you are right, the function was added originally and then not used, I forgot to remove it.

build/luajit.zig Outdated
@@ -96,12 +123,18 @@ pub fn configure(b: *Build, target: Build.ResolvedTarget, optimize: std.builtin.
buildvm.step.dependOn(&dynasm_run.step);
buildvm.step.dependOn(&genversion_run.step);

const buildvm_c_flags = switch (target.result.cpu.arch) {
.aarch64, .aarch64_be => &[_][]const u8{ "-DLUAJIT_TARGET=LUAJIT_ARCH_arm64", "-DLJ_ARCH_HASFPU=1", "-DLJ_ABI_SOFTFP=0" },
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this appropriate for every instance of an aarch64 target? also i think preferred zig style would be to give buildvm_c_flags type []const []const u8 and instead use &.{ // ... } instantiation here.

Copy link
Author

Choose a reason for hiding this comment

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

Sorry I don't get what "every instance" mean here

Thanks for the zig style variable insturction, I'll update it.

.editorconfig Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

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

i think this is a great file to have in your own copy of this repo, but i don't think it makes sense to add it to our source control.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks, then I'll remove this file from PR

2. Add cross build for lua51 and luajit
3. Add editorconfig
2. Use zig-style variable for buildvm_c_flags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants