Skip to content
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

Build broken with v1.34 #61

Closed
gsora opened this issue Mar 26, 2024 · 3 comments
Closed

Build broken with v1.34 #61

gsora opened this issue Mar 26, 2024 · 3 comments

Comments

@gsora
Copy link

gsora commented Mar 26, 2024

Hi!

Apparently v1.34 breaks compiling on arm64 CPUs on macOS.

This is the compiler output:

/opt/homebrew/Cellar/go/1.22.1/libexec/pkg/tool/darwin_arm64/link: running cc failed: exit status 1
ld: warning: ignoring file '/Users/pinebit/go/pkg/mod/github.com/herumi/bls-eth-go-binary@v1.34.1/bls/lib/darwin/arm64/libbls384_256.a[5](static_code.o)': found architecture 'x86_64', required architecture 'arm64'
Undefined symbols for architecture arm64:
  "_mclx_Fp2Dbl_mulPre", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fp2Dbl_mul_xi", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fp2Dbl_sqrPre", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fp2_add", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fp2_mul", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fp2_mul2", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fp2_mul_xi", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fp2_neg", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fp2_sqr", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fp2_sub", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_FpDbl_add", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_FpDbl_addPre", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_FpDbl_mod", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_FpDbl_mulPre", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_FpDbl_sqrPre", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_FpDbl_sub", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_FpDbl_subPre", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fp_add", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fp_addPre", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fp_mul", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fp_mul2", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fp_neg", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fp_preInv", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fp_shr1", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fp_sqr", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fp_sub", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fp_subPre", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fr_add", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fr_addPre", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fr_mul", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fr_mul2", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fr_neg", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fr_preInv", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fr_shr1", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fr_sqr", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fr_sub", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
  "_mclx_Fr_subPre", referenced from:
      mcl::fp::setStaticCode(mcl::fp::Op&) in libbls384_256.a[2](fp.o)
      mcl::fp::Op::init(mcl::Vint const&, unsigned long, int, mcl::fp::Mode, unsigned long) in libbls384_256.a[2](fp.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Maybe bls/lib/darwin/arm64/libbls384_256.a for amd64 was mistakenly placed in the arm64 directory?

Thank you!

gsora pushed a commit to ObolNetwork/charon that referenced this issue Mar 26, 2024
obol-bulldozer bot pushed a commit to ObolNetwork/charon that referenced this issue Mar 26, 2024
@pk910
Copy link

pk910 commented Apr 2, 2024

same problem here, after upgrading to 1.34.1, building arm64 binaries fails:

/Users/runner/hostedtoolcache/go/1.21.7/x64/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
ld: archive has no table of contents file '/Users/runner/go/pkg/mod/github.com/herumi/bls-eth-go-binary@v1.34.1/bls/lib/darwin/arm64/libbls384_256.a'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@herumi
Copy link
Owner

herumi commented Apr 2, 2024

Could you try https://github.com/herumi/bls-eth-go-binary/releases/tag/v1.34.2 ?
I verified that it runs on {x86_64, arm64}/linux, {x86_64, m1}/macOS, x86_64/Windows mingw.

@gsora
Copy link
Author

gsora commented Apr 4, 2024

Fixed on my side! Thank you.

@gsora gsora closed this as completed Apr 4, 2024
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

No branches or pull requests

3 participants