herumi / mcl

a portable and fast pairing-based cryptography library
BSD 3-Clause "New" or "Revised" License
450 stars 152 forks source link

`src/gen_bint.exe` failing when cross compiling for other systems #157

Closed mxaddict closed 1 year ago

mxaddict commented 1 year ago
src/gen_bint.exe -u 64 -ver 0x90 > src/bint64.ll
/bin/sh: 1: src/gen_bint.exe: Exec format error

Basically the src/gen_bint.exe is failing because we are building for Linux aarch64 on a Linux x86_64 system.

It's compiled correctly but for a different arch so when it's run to create the src/bint64.ll it's failing

herumi commented 1 year ago

I have already committed src/bin32.ll and src/bin64.ll, which are common for all architectures, so you don't have to build them by yourself.

mxaddict commented 1 year ago

I have already committed src/bin32.ll and src/bin64.ll, which are common for all architectures, so you don't have to build them by yourself.

I see, it's just that the makefile auto builds them even when files are present.

Maybe we can add a flag to ignore building them? or check if they exist already.

herumi commented 1 year ago

Okay, I'll check the dependency.

mxaddict commented 1 year ago

I see you've added https://github.com/herumi/mcl/blob/master/Makefile#L128-L135

I think this is resolved now. Noice! :+1:

herumi commented 1 year ago

I'm sorry to miss telling you about the modification. By the way, I reverted the path https://github.com/herumi/mcl/pull/154 at https://github.com/herumi/mcl/commit/f2310c84ab25539b8a343b54da138685b030c609 because it causes an error on Linux/AArch64. Would you like to setAS and ASFLAGS if necessary?

mxaddict commented 1 year ago

I'm not sure what is the best way to accomplish that as of yet, still experimenting.