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

[macOS] Build fails at "lib.exe" : "static.o: no such file or directory" #97

Open
Xobtah opened this issue Jul 24, 2023 · 0 comments
Open

Comments

@Xobtah
Copy link

Xobtah commented Jul 24, 2023

Environment :

  • MacBook Pro M1 on macOS Ventura 13.4.1
  • rusts 1.70.0
  • Target : x86_64-pc-windows-msvc

I have two symbolic links :
lrwxr-xr-x 1 root wheel 35 Jul 15 17:33 /usr/local/bin/link.exe -> /opt/homebrew/opt/llvm/bin/lld-link
lrwxr-xr-x 1 root wheel 35 Jul 24 19:26 /usr/local/bin/lib.exe -> /opt/homebrew/opt/llvm/bin/llvm-lib

I tried adding the dependency like it :

[target.'cfg(windows)'.dependencies]
mimalloc = { version = "0.1.37", default-features = false }

I also tried cloning the repo :

git clone --recurse-submodules https://github.com/purpleprotocol/mimalloc_rust.git

Building with this command :

cargo build --target x86_64-pc-windows-msvc

I get the same error every time :

me@mes-laptop mimalloc_rust % cargo build --target x86_64-pc-windows-msvc    
   Compiling libmimalloc-sys v0.1.33 (/private/tmp/mimalloc_rust/libmimalloc-sys)
The following warnings were emitted during compilation:

warning: In file included from c_src/mimalloc/src/static.c:17:
warning: In file included from c_src/mimalloc/include/mimalloc/internal.h:17:
warning: In file included from c_src/mimalloc/include/mimalloc/types.h:24:
warning: c_src/mimalloc/include/mimalloc/atomic.h:42:14: warning: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Wdeprecated-pragma]
warning: #if !defined(ATOMIC_VAR_INIT) || (__STDC_VERSION__ >= 201710L) // c17, see issue #735
warning:              ^
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.3/include/stdatomic.h:51:41: note: macro marked 'deprecated' here
warning: #pragma clang deprecated(ATOMIC_VAR_INIT)
warning:                                         ^
warning: 1 warning generated.
warning: /private/tmp/mimalloc_rust/target/x86_64-pc-windows-msvc/debug/build/libmimalloc-sys-2237c9a07579f04b/out/c_src/mimalloc/src/static.o: no such file or directory

error: failed to run custom build command for `libmimalloc-sys v0.1.33 (/private/tmp/mimalloc_rust/libmimalloc-sys)`

Caused by:
  process didn't exit successfully: `/private/tmp/mimalloc_rust/target/debug/build/libmimalloc-sys-8d220914bcf131c2/build-script-build` (exit status: 1)
  --- stdout
  OPT_LEVEL = Some("0")
  TARGET = Some("x86_64-pc-windows-msvc")
  HOST = Some("aarch64-apple-darwin")
  cargo:rerun-if-env-changed=CC_x86_64-pc-windows-msvc
  CC_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CC_x86_64_pc_windows_msvc
  CC_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  RUSTC_LINKER = None
  cargo:rerun-if-env-changed=CROSS_COMPILE
  CROSS_COMPILE = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64-pc-windows-msvc
  CFLAGS_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_pc_windows_msvc
  CFLAGS_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "c_src/mimalloc/include" "-I" "c_src/mimalloc/src" "-Wall" "-Wextra" "-DMI_SECURE=4" "-DMI_DEBUG=0" "-Fo/private/tmp/mimalloc_rust/target/x86_64-pc-windows-msvc/debug/build/libmimalloc-sys-2237c9a07579f04b/out/c_src/mimalloc/src/static.o" "-c" "c_src/mimalloc/src/static.c"
  cargo:warning=In file included from c_src/mimalloc/src/static.c:17:
  cargo:warning=In file included from c_src/mimalloc/include/mimalloc/internal.h:17:
  cargo:warning=In file included from c_src/mimalloc/include/mimalloc/types.h:24:
  cargo:warning=c_src/mimalloc/include/mimalloc/atomic.h:42:14: warning: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Wdeprecated-pragma]
  cargo:warning=#if !defined(ATOMIC_VAR_INIT) || (__STDC_VERSION__ >= 201710L) // c17, see issue #735
  cargo:warning=             ^
  cargo:warning=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.3/include/stdatomic.h:51:41: note: macro marked 'deprecated' here
  cargo:warning=#pragma clang deprecated(ATOMIC_VAR_INIT)
  cargo:warning=                                        ^
  cargo:warning=1 warning generated.
  exit status: 0
  cargo:rerun-if-env-changed=AR_x86_64-pc-windows-msvc
  AR_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=AR_x86_64_pc_windows_msvc
  AR_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=TARGET_AR
  TARGET_AR = None
  cargo:rerun-if-env-changed=AR
  AR = None
  cargo:rerun-if-env-changed=ARFLAGS_x86_64-pc-windows-msvc
  ARFLAGS_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=ARFLAGS_x86_64_pc_windows_msvc
  ARFLAGS_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=TARGET_ARFLAGS
  TARGET_ARFLAGS = None
  cargo:rerun-if-env-changed=ARFLAGS
  ARFLAGS = None
  running: "lib.exe" "-out:/private/tmp/mimalloc_rust/target/x86_64-pc-windows-msvc/debug/build/libmimalloc-sys-2237c9a07579f04b/out/libmimalloc.a" "-nologo" "/private/tmp/mimalloc_rust/target/x86_64-pc-windows-msvc/debug/build/libmimalloc-sys-2237c9a07579f04b/out/c_src/mimalloc/src/static.o"
  cargo:warning=/private/tmp/mimalloc_rust/target/x86_64-pc-windows-msvc/debug/build/libmimalloc-sys-2237c9a07579f04b/out/c_src/mimalloc/src/static.o: no such file or directory
  exit status: 1

  --- stderr


  error occurred: Command "lib.exe" "-out:/private/tmp/mimalloc_rust/target/x86_64-pc-windows-msvc/debug/build/libmimalloc-sys-2237c9a07579f04b/out/libmimalloc.a" "-nologo" "/private/tmp/mimalloc_rust/target/x86_64-pc-windows-msvc/debug/build/libmimalloc-sys-2237c9a07579f04b/out/c_src/mimalloc/src/static.o" with args "lib.exe" did not execute successfully (status code exit status: 1).
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