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

Building zstd-sys 2.0.10 for wasm32-unknown-unknown fails on aarch64-apple-darwin #285

Closed
crajcan opened this issue Jun 14, 2024 · 1 comment

Comments

@crajcan
Copy link

crajcan commented Jun 14, 2024

Reproduction

./sandbox λ: rustup toolchain list
...
...
1.78-aarch64-apple-darwin (override) 

Cargo.toml

[package]
name = "sandbox"
version = "0.1.0"
edition = "2021"

[dependencies]
zstd-sys = { version = "=2.0.10" }

Run:

cargo build --target=wasm32-uknown-unknown

Output

   Compiling zstd-sys v2.0.10+zstd.1.5.6
The following warnings were emitted during compilation:

warning: [email protected]+zstd.1.5.6: In file included from zstd/lib/common/zstd_common.c:18:
warning: [email protected]+zstd.1.5.6: In file included from zstd/lib/common/zstd_internal.h:35:
warning: [email protected]+zstd.1.5.6: zstd/lib/common/xxhash.h:3157:22: error: called object type 'int' is not a function or function pointer
warning: [email protected]+zstd.1.5.6:  3157 |     XXH_STATIC_ASSERT(sizeof(XXH32_canonical_t) == sizeof(XXH32_hash_t));
warning: [email protected]+zstd.1.5.6:       |     ~~~~~~~~~~~~~~~~~^
warning: [email protected]+zstd.1.5.6: zstd/lib/common/xxhash.h:3600:22: error: called object type 'int' is not a function or function pointer
warning: [email protected]+zstd.1.5.6:  3600 |     XXH_STATIC_ASSERT(sizeof(XXH64_canonical_t) == sizeof(XXH64_hash_t));
warning: [email protected]+zstd.1.5.6:       |     ~~~~~~~~~~~~~~~~~^
warning: [email protected]+zstd.1.5.6: 2 errors generated.

/ ... snipped for repetition ... /

warning: [email protected]+zstd.1.5.6: ToolExecError: Command "/opt/homebrew/opt/llvm@18/bin/clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=wasm32-unknown-unknown" "-I" "wasm-shim/" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-I" "zstd/lib/legacy" "-fvisibility=hidden" "-ffunction-sections" "-fdata-sections" "-fmerge-all-constants" "-DXXH_STATIC_ASSERT=0" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZDICTLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-DZSTD_LEGACY_SUPPORT=1" "-o" "/Users/foobar/source/rust/sandbox/target/wasm32-unknown-unknown/debug/build/zstd-sys-4361939e378b0f98/out/b0401a448be314bb-zdict.o" "-c" "zstd/lib/dictBuilder/zdict.c" with args clang did not execute successfully (status code exit status: 1).cargo:warning=In file included from zstd/lib/legacy/zstd_v07.c:20:
warning: [email protected]+zstd.1.5.6: zstd/lib/legacy/../common/xxhash.h:3157:22: error: called object type 'int' is not a function or function pointer
warning: [email protected]+zstd.1.5.6:  3157 |     XXH_STATIC_ASSERT(sizeof(XXH32_canonical_t) == sizeof(XXH32_hash_t));
warning: [email protected]+zstd.1.5.6:       |     ~~~~~~~~~~~~~~~~~^
warning: [email protected]+zstd.1.5.6: zstd/lib/legacy/../common/xxhash.h:3600:22: error: called object type 'int' is not a function or function pointer
warning: [email protected]+zstd.1.5.6:  3600 |     XXH_STATIC_ASSERT(sizeof(XXH64_canonical_t) == sizeof(XXH64_hash_t));
warning: [email protected]+zstd.1.5.6:       |     ~~~~~~~~~~~~~~~~~^
warning: [email protected]+zstd.1.5.6: 2 errors generated.
warning: [email protected]+zstd.1.5.6: ToolExecError: Command "/opt/homebrew/opt/llvm@18/bin/clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=wasm32-unknown-unknown" "-I" "wasm-shim/" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-I" "zstd/lib/legacy" "-fvisibility=hidden" "-ffunction-sections" "-fdata-sections" "-fmerge-all-constants" "-DXXH_STATIC_ASSERT=0" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZDICTLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-DZSTD_LEGACY_SUPPORT=1" "-o" "/Users/foobar/source/rust/sandbox/target/wasm32-unknown-unknown/debug/build/zstd-sys-4361939e378b0f98/out/5eeec2f4c1e9b3b6-zstd_v07.o" "-c" "zstd/lib/legacy/zstd_v07.c" with args clang did not execute successfully (status code exit status: 1).

error: failed to run custom build command for `zstd-sys v2.0.10+zstd.1.5.6`

Caused by:
  process didn't exit successfully: `/Users/foobar/source/rust/sandbox/target/debug/build/zstd-sys-ea796c5104f2924d/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=ZSTD_SYS_USE_PKG_CONFIG
  cargo:rustc-cfg=feature="std"
  cargo:rerun-if-changed=wasm-shim/stdlib.h
  cargo:rerun-if-changed=wasm-shim/string.h
  TARGET = Some("wasm32-unknown-unknown")
  OPT_LEVEL = Some("0")
  HOST = Some("aarch64-apple-darwin")
  cargo:rerun-if-env-changed=CC_wasm32-unknown-unknown
  CC_wasm32-unknown-unknown = None
  cargo:rerun-if-env-changed=CC_wasm32_unknown_unknown
  CC_wasm32_unknown_unknown = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some("/opt/homebrew/opt/llvm@18/bin/clang")
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  cargo:rerun-if-env-changed=CFLAGS_wasm32-unknown-unknown
  CFLAGS_wasm32-unknown-unknown = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_unknown_unknown
  CFLAGS_wasm32_unknown_unknown = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32-unknown-unknown
  CFLAGS_wasm32-unknown-unknown = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_unknown_unknown
  CFLAGS_wasm32_unknown_unknown = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32-unknown-unknown
  CFLAGS_wasm32-unknown-unknown = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_unknown_unknown
  CFLAGS_wasm32_unknown_unknown = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32-unknown-unknown
  CFLAGS_wasm32-unknown-unknown = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_unknown_unknown
  CFLAGS_wasm32_unknown_unknown = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:warning=In file included from zstd/lib/common/zstd_common.c:18:
  cargo:warning=In file included from zstd/lib/common/zstd_internal.h:35:
  cargo:warning=zstd/lib/common/xxhash.h:3157:22: error: called object type 'int' is not a function or function pointer
  cargo:warning= 3157 |     XXH_STATIC_ASSERT(sizeof(XXH32_canonical_t) == sizeof(XXH32_hash_t));
  cargo:warning=      |     ~~~~~~~~~~~~~~~~~^
  cargo:warning=zstd/lib/common/xxhash.h:3600:22: error: called object type 'int' is not a function or function pointer
  cargo:warning= 3600 |     XXH_STATIC_ASSERT(sizeof(XXH64_canonical_t) == sizeof(XXH64_hash_t));
  cargo:warning=      |     ~~~~~~~~~~~~~~~~~^
  cargo:warning=2 errors generated.
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 1
  cargo:warning=ToolExecError: Command "/opt/homebrew/opt/llvm@18/bin/clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=wasm32-unknown-unknown" "-I" "wasm-shim/" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-I" "zstd/lib/legacy" "-fvisibility=hidden" "-ffunction-sections" "-fdata-sections" "-fmerge-all-constants" "-DXXH_STATIC_ASSERT=0" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZDICTLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-DZSTD_LEGACY_SUPPORT=1" "-o" "/Users/foobar/source/rust/sandbox/target/wasm32-unknown-unknown/debug/build/zstd-sys-4361939e378b0f98/out/8957a4c8b028b07b-zstd_common.o" "-c" "zstd/lib/common/zstd_common.c" with args clang did not execute successfully (status code exit status: 1).cargo:warning=In file included from zstd/lib/compress/zstd_compress.c:21:
  cargo:warning=In file included from zstd/lib/compress/zstd_compress_internal.h:21:
  cargo:warning=In file included from zstd/lib/compress/../common/zstd_internal.h:35:
  cargo:warning=zstd/lib/compress/../common/xxhash.h:3157:22: error: called object type 'int' is not a function or function pointer
  cargo:warning= 3157 |     XXH_STATIC_ASSERT(sizeof(XXH32_canonical_t) == sizeof(XXH32_hash_t));
  cargo:warning=      |     ~~~~~~~~~~~~~~~~~^
  cargo:warning=zstd/lib/compress/../common/xxhash.h:3600:22: error: called object type 'int' is not a function or function pointer
  cargo:warning= 3600 |     XXH_STATIC_ASSERT(sizeof(XXH64_canonical_t) == sizeof(XXH64_hash_t));
  cargo:warning=      |     ~~~~~~~~~~~~~~~~~^
  cargo:warning=2 errors generated.

  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 1
  cargo:warning=ToolExecError: Command "/opt/homebrew/opt/llvm@18/bin/clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=wasm32-unknown-unknown" "-I" "wasm-shim/" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-I" "zstd/lib/legacy" "-fvisibility=hidden" "-ffunction-sections" "-fdata-sections" "-fmerge-all-constants" "-DXXH_STATIC_ASSERT=0" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZDICTLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-DZSTD_LEGACY_SUPPORT=1" "-o" "/Users/foobar/source/rust/sandbox/target/wasm32-unknown-unknown/debug/build/zstd-sys-4361939e378b0f98/out/1ddd1489cc625d97-zstd_compress.o" "-c" "zstd/lib/compress/zstd_compress.c" with args clang did not execute successfully (status code exit status: 1).cargo:warning=In file included from zstd/lib/compress/zstd_compress_literals.c:14:
  cargo:warning=In file included from zstd/lib/compress/zstd_compress_literals.h:14:
  cargo:warning=In file included from zstd/lib/compress/zstd_compress_internal.h:21:
  cargo:warning=In file included from zstd/lib/compress/../common/zstd_internal.h:35:
  cargo:warning=zstd/lib/compress/../common/xxhash.h:3157:22: error: called object type 'int' is not a function or function pointer
  cargo:warning= 3157 |     XXH_STATIC_ASSERT(sizeof(XXH32_canonical_t) == sizeof(XXH32_hash_t));
  cargo:warning=      |     ~~~~~~~~~~~~~~~~~^
  cargo:warning=zstd/lib/compress/../common/xxhash.h:3600:22: error: called object type 'int' is not a function or function pointer
  cargo:warning= 3600 |     XXH_STATIC_ASSERT(sizeof(XXH64_canonical_t) == sizeof(XXH64_hash_t));
  cargo:warning=      |     ~~~~~~~~~~~~~~~~~^
  cargo:warning=2 errors generated.
  
  / ... snipped for repetition .../ 

@crajcan
Copy link
Author

crajcan commented Jun 15, 2024

closing as duplicate to #269

@crajcan crajcan closed this as completed Jun 15, 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

1 participant