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

Does not compile on arm64 #646

Closed
SylvestreG opened this issue Oct 14, 2021 · 7 comments
Closed

Does not compile on arm64 #646

SylvestreG opened this issue Oct 14, 2021 · 7 comments

Comments

@SylvestreG
Copy link

Hi,

I am currently using an apple m1 and cannot compile wasmd.

bash $ uname -a
Darwin Mac-mini-de-syl 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:20 PDT 2021; root:xnu-7195.141.6~3/RELEASE_ARM64_T8101 arm64

How to Reproduce

checkout tag

bash $ git checkout v0.20.0 

cleaning

bash $ make clean
rm -rf snapcraft-local.yaml build/

Build from source :

bash $ make install
go install -mod=readonly -tags "netgo,ledger" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=wasm -X github.com/cosmos/cosmos-sdk/version.AppName=wasmd -X github.com/cosmos/cosmos-sdk/version.Version=0.20.0 -X github.com/cosmos/cosmos-sdk/version.Commit=6a471a4a16730e371863067b27858f60a3996c91 -X github.com/CosmWasm/wasmd/app.Bech32Prefix=wasm -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger"' -trimpath ./cmd/wasmd
# github.com/keybase/go-keychain
cgo-gcc-prolog:203:11: warning: 'SecTrustedApplicationCreateFromPath' is deprecated: first deprecated in macOS 10.15 - No longer supported [-Wdeprecated-declarations]
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustedApplication.h:59:10: note: 'SecTrustedApplicationCreateFromPath' has been explicitly marked deprecated here
# github.com/CosmWasm/wasmvm/api
ld: warning: ignoring file ../../go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.0.0-beta/api/libwasmvm.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
  "_analyze_code", referenced from:
      __cgo_0e96ffb483ec_C2func_analyze_code in _x004.o
      __cgo_0e96ffb483ec_Cfunc_analyze_code in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_analyze_code, __cgo_0e96ffb483ec_C2func_analyze_code )
  "_destroy_unmanaged_vector", referenced from:
      __cgo_0e96ffb483ec_Cfunc_destroy_unmanaged_vector in _x006.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_destroy_unmanaged_vector)
  "_execute", referenced from:
      __cgo_0e96ffb483ec_C2func_execute in _x004.o
      __cgo_0e96ffb483ec_Cfunc_execute in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_execute, __cgo_0e96ffb483ec_C2func_execute )
  "_get_metrics", referenced from:
      __cgo_0e96ffb483ec_C2func_get_metrics in _x004.o
      __cgo_0e96ffb483ec_Cfunc_get_metrics in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_C2func_get_metrics, __cgo_0e96ffb483ec_Cfunc_get_metrics )
  "_ibc_channel_close", referenced from:
      __cgo_0e96ffb483ec_C2func_ibc_channel_close in _x004.o
      __cgo_0e96ffb483ec_Cfunc_ibc_channel_close in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_ibc_channel_close, __cgo_0e96ffb483ec_C2func_ibc_channel_close )
  "_ibc_channel_connect", referenced from:
      __cgo_0e96ffb483ec_C2func_ibc_channel_connect in _x004.o
      __cgo_0e96ffb483ec_Cfunc_ibc_channel_connect in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_ibc_channel_connect, __cgo_0e96ffb483ec_C2func_ibc_channel_connect )
  "_ibc_channel_open", referenced from:
      __cgo_0e96ffb483ec_C2func_ibc_channel_open in _x004.o
      __cgo_0e96ffb483ec_Cfunc_ibc_channel_open in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_C2func_ibc_channel_open, __cgo_0e96ffb483ec_Cfunc_ibc_channel_open )
  "_ibc_packet_ack", referenced from:
      __cgo_0e96ffb483ec_C2func_ibc_packet_ack in _x004.o
      __cgo_0e96ffb483ec_Cfunc_ibc_packet_ack in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_ibc_packet_ack, __cgo_0e96ffb483ec_C2func_ibc_packet_ack )
  "_ibc_packet_receive", referenced from:
      __cgo_0e96ffb483ec_C2func_ibc_packet_receive in _x004.o
      __cgo_0e96ffb483ec_Cfunc_ibc_packet_receive in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_ibc_packet_receive, __cgo_0e96ffb483ec_C2func_ibc_packet_receive )
  "_ibc_packet_timeout", referenced from:
      __cgo_0e96ffb483ec_C2func_ibc_packet_timeout in _x004.o
      __cgo_0e96ffb483ec_Cfunc_ibc_packet_timeout in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_ibc_packet_timeout, __cgo_0e96ffb483ec_C2func_ibc_packet_timeout )
  "_init_cache", referenced from:
      __cgo_0e96ffb483ec_C2func_init_cache in _x004.o
      __cgo_0e96ffb483ec_Cfunc_init_cache in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_init_cache, __cgo_0e96ffb483ec_C2func_init_cache )
  "_instantiate", referenced from:
      __cgo_0e96ffb483ec_C2func_instantiate in _x004.o
      __cgo_0e96ffb483ec_Cfunc_instantiate in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_instantiate, __cgo_0e96ffb483ec_C2func_instantiate )
  "_load_wasm", referenced from:
      __cgo_0e96ffb483ec_C2func_load_wasm in _x004.o
      __cgo_0e96ffb483ec_Cfunc_load_wasm in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_load_wasm, __cgo_0e96ffb483ec_C2func_load_wasm )
  "_migrate", referenced from:
      __cgo_0e96ffb483ec_C2func_migrate in _x004.o
      __cgo_0e96ffb483ec_Cfunc_migrate in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_migrate, __cgo_0e96ffb483ec_C2func_migrate )
  "_new_unmanaged_vector", referenced from:
      __cgo_0e96ffb483ec_Cfunc_new_unmanaged_vector in _x006.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_new_unmanaged_vector)
  "_pin", referenced from:
      __cgo_0e96ffb483ec_C2func_pin in _x004.o
      __cgo_0e96ffb483ec_Cfunc_pin in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_C2func_pin, __cgo_0e96ffb483ec_Cfunc_pin )
  "_query", referenced from:
      __cgo_0e96ffb483ec_C2func_query in _x004.o
      __cgo_0e96ffb483ec_Cfunc_query in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_query, __cgo_0e96ffb483ec_C2func_query )
  "_release_cache", referenced from:
      __cgo_0e96ffb483ec_Cfunc_release_cache in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_release_cache)
  "_reply", referenced from:
      __cgo_0e96ffb483ec_C2func_reply in _x004.o
      __cgo_0e96ffb483ec_Cfunc_reply in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_reply, __cgo_0e96ffb483ec_C2func_reply )
  "_save_wasm", referenced from:
      __cgo_0e96ffb483ec_C2func_save_wasm in _x004.o
      __cgo_0e96ffb483ec_Cfunc_save_wasm in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_save_wasm, __cgo_0e96ffb483ec_C2func_save_wasm )
  "_sudo", referenced from:
      __cgo_0e96ffb483ec_C2func_sudo in _x004.o
      __cgo_0e96ffb483ec_Cfunc_sudo in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_sudo, __cgo_0e96ffb483ec_C2func_sudo )
  "_unpin", referenced from:
      __cgo_0e96ffb483ec_C2func_unpin in _x004.o
      __cgo_0e96ffb483ec_Cfunc_unpin in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_unpin, __cgo_0e96ffb483ec_C2func_unpin )
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [install] Error 2

@ethanfrey
Copy link
Member

This is a known issue and should be documented in the README

@alpe alpe added this to the v2.0.0 milestone Oct 18, 2021
@odegnome
Copy link

I am currently using an apple m1 and cannot compile wasmd.
...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [install] Error 2

I faced this same issue when I installed go using brew. I advise anyone else facing this similar issue, that you install go using package installer available here. Remember to remove the brew installation and update the path to include $HOME/go/bin. Since, this is where the wasmd executable will be placed.

@johnsaigle
Copy link

I was also having trouble with earlier versions of the software. However, more recent branches work now.

@badgerpawz1
Copy link

I am currently using an apple m1 and cannot compile wasmd.
...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [install] Error 2

I faced this same issue when I installed go using brew. I advise anyone else facing this similar issue, that you install go using package installer available here. Remember to remove the brew installation and update the path to include $HOME/go/bin. Since, this is where the wasmd executable will be placed.

This worked for me, thanks!

@alpe alpe moved this to 🆕 New in wasmd backlog Sep 28, 2022
@alpe
Copy link
Contributor

alpe commented Sep 30, 2022

Thanks for the feedback. I will close this now

@alpe alpe closed this as completed Sep 30, 2022
Repository owner moved this from 🆕 New to ✅ Done in wasmd backlog Sep 30, 2022
@herbievine
Copy link

mac os 12.6
go version go1.18.3 darwin/arm64

I'm still getting the issue...

git checkout v0.29.0
make clean
make install

I get this:

go install -mod=readonly -tags "netgo,ledger" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=wasm -X github.com/cosmos/cosmos-sdk/version.AppName=wasmd -X github.com/cosmos/cosmos-sdk/version.Version=0.29.0 -X github.com/cosmos/cosmos-sdk/version.Commit=319a9482a4b690cabe379ac3ee03880116904173 -X github.com/CosmWasm/wasmd/app.Bech32Prefix=wasm -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger"' -trimpath ./cmd/wasmd
# github.com/zondax/hid
In file included from ../../go/pkg/mod/github.com/zondax/hid@v0.9.0/hid_enabled.go:38:
../../go/pkg/mod/github.com/zondax/hid@v0.9.0/hidapi/mac/hid.c:693:34: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:123:19: note: 'kIOMasterPortDefault' has been explicitly marked deprecated here

With v0.20.0 i get this:

go install -mod=readonly -tags "netgo,ledger" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=wasm -X github.com/cosmos/cosmos-sdk/version.AppName=wasmd -X github.com/cosmos/cosmos-sdk/version.Version=0.20.0 -X github.com/cosmos/cosmos-sdk/version.Commit=6a471a4a16730e371863067b27858f60a3996c91 -X github.com/CosmWasm/wasmd/app.Bech32Prefix=wasm -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger"' -trimpath ./cmd/wasmd
# github.com/keybase/go-keychain
cgo-gcc-prolog:81:11: warning: 'SecKeychainCreate' is deprecated: first deprecated in macOS 12.0 - Custom keychain management is no longer supported [-Wdeprecated-declarations]
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:301:10: note: 'SecKeychainCreate' has been explicitly marked deprecated here
cgo-gcc-prolog:139:11: warning: 'SecKeychainLock' is deprecated: first deprecated in macOS 12.0 - Custom keychain management is no longer supported [-Wdeprecated-declarations]
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:357:10: note: 'SecKeychainLock' has been explicitly marked deprecated here
cgo-gcc-prolog:159:11: warning: 'SecKeychainOpen' is deprecated: first deprecated in macOS 12.0 - Custom keychain management is no longer supported [-Wdeprecated-declarations]
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:287:10: note: 'SecKeychainOpen' has been explicitly marked deprecated here
cgo-gcc-prolog:183:11: warning: 'SecKeychainUnlock' is deprecated: first deprecated in macOS 12.0 - Custom keychain management is no longer supported [-Wdeprecated-declarations]
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:347:10: note: 'SecKeychainUnlock' has been explicitly marked deprecated here
cgo-gcc-prolog:203:11: warning: 'SecTrustedApplicationCreateFromPath' is deprecated: first deprecated in macOS 10.15 - No longer supported [-Wdeprecated-declarations]
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustedApplication.h:59:10: note: 'SecTrustedApplicationCreateFromPath' has been explicitly marked deprecated here
# github.com/zondax/hid
In file included from ../../go/pkg/mod/github.com/zondax/hid@v0.9.0/hid_enabled.go:38:
../../go/pkg/mod/github.com/zondax/hid@v0.9.0/hidapi/mac/hid.c:693:34: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:123:19: note: 'kIOMasterPortDefault' has been explicitly marked deprecated here
# github.com/CosmWasm/wasmvm/api
ld: warning: ignoring file ../../go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.0.0-beta/api/libwasmvm.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
  "_analyze_code", referenced from:
      __cgo_0e96ffb483ec_C2func_analyze_code in _x004.o
      __cgo_0e96ffb483ec_Cfunc_analyze_code in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_analyze_code, __cgo_0e96ffb483ec_C2func_analyze_code )
  "_destroy_unmanaged_vector", referenced from:
      __cgo_0e96ffb483ec_Cfunc_destroy_unmanaged_vector in _x006.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_destroy_unmanaged_vector)
  "_execute", referenced from:
      __cgo_0e96ffb483ec_C2func_execute in _x004.o
      __cgo_0e96ffb483ec_Cfunc_execute in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_C2func_execute, __cgo_0e96ffb483ec_Cfunc_execute )
  "_get_metrics", referenced from:
      __cgo_0e96ffb483ec_C2func_get_metrics in _x004.o
      __cgo_0e96ffb483ec_Cfunc_get_metrics in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_get_metrics, __cgo_0e96ffb483ec_C2func_get_metrics )
  "_ibc_channel_close", referenced from:
      __cgo_0e96ffb483ec_C2func_ibc_channel_close in _x004.o
      __cgo_0e96ffb483ec_Cfunc_ibc_channel_close in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_ibc_channel_close, __cgo_0e96ffb483ec_C2func_ibc_channel_close )
  "_ibc_channel_connect", referenced from:
      __cgo_0e96ffb483ec_C2func_ibc_channel_connect in _x004.o
      __cgo_0e96ffb483ec_Cfunc_ibc_channel_connect in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_ibc_channel_connect, __cgo_0e96ffb483ec_C2func_ibc_channel_connect )
  "_ibc_channel_open", referenced from:
      __cgo_0e96ffb483ec_C2func_ibc_channel_open in _x004.o
      __cgo_0e96ffb483ec_Cfunc_ibc_channel_open in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_C2func_ibc_channel_open, __cgo_0e96ffb483ec_Cfunc_ibc_channel_open )
  "_ibc_packet_ack", referenced from:
      __cgo_0e96ffb483ec_C2func_ibc_packet_ack in _x004.o
      __cgo_0e96ffb483ec_Cfunc_ibc_packet_ack in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_C2func_ibc_packet_ack, __cgo_0e96ffb483ec_Cfunc_ibc_packet_ack )
  "_ibc_packet_receive", referenced from:
      __cgo_0e96ffb483ec_C2func_ibc_packet_receive in _x004.o
      __cgo_0e96ffb483ec_Cfunc_ibc_packet_receive in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_C2func_ibc_packet_receive, __cgo_0e96ffb483ec_Cfunc_ibc_packet_receive )
  "_ibc_packet_timeout", referenced from:
      __cgo_0e96ffb483ec_C2func_ibc_packet_timeout in _x004.o
      __cgo_0e96ffb483ec_Cfunc_ibc_packet_timeout in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_ibc_packet_timeout, __cgo_0e96ffb483ec_C2func_ibc_packet_timeout )
  "_init_cache", referenced from:
      __cgo_0e96ffb483ec_C2func_init_cache in _x004.o
      __cgo_0e96ffb483ec_Cfunc_init_cache in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_init_cache, __cgo_0e96ffb483ec_C2func_init_cache )
  "_instantiate", referenced from:
      __cgo_0e96ffb483ec_C2func_instantiate in _x004.o
      __cgo_0e96ffb483ec_Cfunc_instantiate in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_instantiate, __cgo_0e96ffb483ec_C2func_instantiate )
  "_load_wasm", referenced from:
      __cgo_0e96ffb483ec_C2func_load_wasm in _x004.o
      __cgo_0e96ffb483ec_Cfunc_load_wasm in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_C2func_load_wasm, __cgo_0e96ffb483ec_Cfunc_load_wasm )
  "_migrate", referenced from:
      __cgo_0e96ffb483ec_C2func_migrate in _x004.o
      __cgo_0e96ffb483ec_Cfunc_migrate in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_C2func_migrate, __cgo_0e96ffb483ec_Cfunc_migrate )
  "_new_unmanaged_vector", referenced from:
      __cgo_0e96ffb483ec_Cfunc_new_unmanaged_vector in _x006.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_new_unmanaged_vector)
  "_pin", referenced from:
      __cgo_0e96ffb483ec_C2func_pin in _x004.o
      __cgo_0e96ffb483ec_Cfunc_pin in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_C2func_pin, __cgo_0e96ffb483ec_Cfunc_pin )
  "_query", referenced from:
      __cgo_0e96ffb483ec_C2func_query in _x004.o
      __cgo_0e96ffb483ec_Cfunc_query in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_query, __cgo_0e96ffb483ec_C2func_query )
  "_release_cache", referenced from:
      __cgo_0e96ffb483ec_Cfunc_release_cache in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_release_cache)
  "_reply", referenced from:
      __cgo_0e96ffb483ec_C2func_reply in _x004.o
      __cgo_0e96ffb483ec_Cfunc_reply in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_C2func_reply, __cgo_0e96ffb483ec_Cfunc_reply )
  "_save_wasm", referenced from:
      __cgo_0e96ffb483ec_C2func_save_wasm in _x004.o
      __cgo_0e96ffb483ec_Cfunc_save_wasm in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_save_wasm, __cgo_0e96ffb483ec_C2func_save_wasm )
  "_sudo", referenced from:
      __cgo_0e96ffb483ec_C2func_sudo in _x004.o
      __cgo_0e96ffb483ec_Cfunc_sudo in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_sudo, __cgo_0e96ffb483ec_C2func_sudo )
  "_unpin", referenced from:
      __cgo_0e96ffb483ec_C2func_unpin in _x004.o
      __cgo_0e96ffb483ec_Cfunc_unpin in _x004.o
     (maybe you meant: __cgo_0e96ffb483ec_Cfunc_unpin, __cgo_0e96ffb483ec_C2func_unpin )
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [install] Error 2

$PATH has /usr/local/go/bin

@herbievine
Copy link

Issue resolved. You need to run this command for some reason:

export PATH="$PATH:$HOME/go/bin"

see more here: #641 (comment)

@alpe alpe removed this from wasmd backlog Mar 3, 2023
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

7 participants