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

M1 support? #26

Open
kvaps opened this issue Dec 16, 2021 · 1 comment
Open

M1 support? #26

kvaps opened this issue Dec 16, 2021 · 1 comment

Comments

@kvaps
Copy link

kvaps commented Dec 16, 2021

How can I even compile it?

CGO_ENABLED=1 CGO_CFLAGS="-I./libjq/include -I/opt/homebrew/include" CGO_LDFLAGS="-L./libjq/lib" go get
# github.com/flant/libjq-go/pkg/libjq
ld: warning: ignoring file ./libjq/lib/libjq.a, building for macOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
ld: warning: ignoring file ./libjq/lib/libonig.a, building for macOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
Undefined symbols for architecture arm64:
  "_jq_compile", referenced from:
      _libjq_go_compile in _x004.o
     (maybe you meant: __cgo_05055bf62b24_Cfunc_jq_compile_args)
  "_jq_compile_args", referenced from:
      __cgo_05055bf62b24_Cfunc_jq_compile_args in _x004.o
     (maybe you meant: __cgo_05055bf62b24_Cfunc_jq_compile_args)
  "_jq_format_error", referenced from:
      __cgo_05055bf62b24_Cfunc_jq_format_error in _x003.o
      _libjq_go_err_cb in _x004.o
     (maybe you meant: __cgo_05055bf62b24_Cfunc_jq_format_error)
  "_jq_init", referenced from:
      __cgo_05055bf62b24_Cfunc_jq_init in _x004.o
     (maybe you meant: __cgo_05055bf62b24_Cfunc_jq_init)
  "_jq_next", referenced from:
      __cgo_05055bf62b24_Cfunc_jq_next in _x004.o
     (maybe you meant: __cgo_05055bf62b24_Cfunc_jq_next)
  "_jq_set_attr", referenced from:
      __cgo_05055bf62b24_Cfunc_jq_set_attr in _x004.o
     (maybe you meant: __cgo_05055bf62b24_Cfunc_jq_set_attr)
  "_jq_set_error_cb", referenced from:
      _libjq_go_compile in _x004.o
  "_jq_start", referenced from:
      __cgo_05055bf62b24_Cfunc_jq_start in _x004.o
     (maybe you meant: __cgo_05055bf62b24_Cfunc_jq_start)
  "_jq_teardown", referenced from:
      __cgo_05055bf62b24_Cfunc_jq_teardown in _x004.o
     (maybe you meant: __cgo_05055bf62b24_Cfunc_jq_teardown)
  "_jv_array", referenced from:
      __cgo_05055bf62b24_Cfunc_jv_array in _x004.o
     (maybe you meant: __cgo_05055bf62b24_Cfunc_jv_array_append, __cgo_05055bf62b24_Cfunc_jv_array_get , __cgo_05055bf62b24_Cfunc_jv_array_length , __cgo_05055bf62b24_Cfunc_jv_array )
  "_jv_array_append", referenced from:
      _libjq_go_err_cb in _x004.o
      __cgo_05055bf62b24_Cfunc_jv_array_append in _x005.o
     (maybe you meant: __cgo_05055bf62b24_Cfunc_jv_array_append)
  "_jv_array_get", referenced from:
      __cgo_05055bf62b24_Cfunc_jv_array_get in _x005.o
     (maybe you meant: __cgo_05055bf62b24_Cfunc_jv_array_get)
  "_jv_array_length", referenced from:
      __cgo_05055bf62b24_Cfunc_jv_array_length in _x005.o
     (maybe you meant: __cgo_05055bf62b24_Cfunc_jv_array_length)
  "_jv_copy", referenced from:
      _libjq_go_format_error in _x004.o
      _libjq_go_err_cb in _x004.o
      __cgo_05055bf62b24_Cfunc_jv_copy in _x005.o
     (maybe you meant: __cgo_05055bf62b24_Cfunc_jv_copy)
  "_jv_dump_string", referenced from:
      _libjq_go_format_error in _x004.o
      __cgo_05055bf62b24_Cfunc_jv_dump_string in _x005.o
     (maybe you meant: __cgo_05055bf62b24_Cfunc_jv_dump_string)
  "_jv_free", referenced from:
      __cgo_05055bf62b24_Cfunc_jv_free in _x003.o
      _libjq_go_format_error in _x004.o
      _libjq_go_err_cb in _x004.o
     (maybe you meant: __cgo_05055bf62b24_Cfunc_jv_free)
  "_jv_get_kind", referenced from:
      __cgo_05055bf62b24_Cfunc_jv_get_kind in _x003.o
      _libjq_go_format_error in _x004.o
      _libjq_go_err_cb in _x004.o
      _jv_is_valid in _x004.o
     (maybe you meant: __cgo_05055bf62b24_Cfunc_jv_get_kind)
  "_jv_invalid_get_msg", referenced from:
      __cgo_05055bf62b24_Cfunc_jv_invalid_get_msg in _x003.o
      _libjq_go_format_error in _x004.o
     (maybe you meant: __cgo_05055bf62b24_Cfunc_jv_invalid_get_msg)
  "_jv_invalid_has_msg", referenced from:
      _libjq_go_format_error in _x004.o
  "_jv_null", referenced from:
      _libjq_go_format_error in _x004.o
      __cgo_05055bf62b24_Cfunc_jv_null in _x004.o
     (maybe you meant: __cgo_05055bf62b24_Cfunc_jv_null)
  "_jv_parse", referenced from:
      __cgo_05055bf62b24_Cfunc_jv_parse in _x004.o
     (maybe you meant: __cgo_05055bf62b24_Cfunc_jv_parse)
  "_jv_string", referenced from:
      _libjq_go_format_error in _x004.o
      __cgo_05055bf62b24_Cfunc_jv_string in _x005.o
     (maybe you meant: __cgo_05055bf62b24_Cfunc_jv_string, __cgo_05055bf62b24_Cfunc_jv_string_value )
  "_jv_string_fmt", referenced from:
      _libjq_go_format_error in _x004.o
  "_jv_string_value", referenced from:
      __cgo_05055bf62b24_Cfunc_jv_string_value in _x003.o
      _libjq_go_format_error in _x004.o
     (maybe you meant: __cgo_05055bf62b24_Cfunc_jv_string_value)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
@kvaps
Copy link
Author

kvaps commented Dec 16, 2021

currently

GOARCH=amd64 go test .

is working fine

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

1 participant