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

Cross compile build error from mac aarch64 to windows x86_64 #328

Open
tbillington opened this issue Nov 15, 2023 · 2 comments
Open

Cross compile build error from mac aarch64 to windows x86_64 #328

tbillington opened this issue Nov 15, 2023 · 2 comments

Comments

@tbillington
Copy link

Heya, apologies if this isn't the correct repo to open this, still figuring out how the build process works. It could also be in xwin or luau.

When building a binary for x86_64-pc-windows-msvc from aarch64-apple-darwin I get a number of errors that from what I can find online indicate the use of c++ features that the compiler doesn't support/hasn't got enabled. I'm running on Homebrew clang version 17.0.4. Is this something coming from the way luau is being vendored?

error: no template named 'optional' in namespace 'std'
(full error line)

warning: In file included from /Users/choc/.cargo/registry/src/index.crates.io-6f17d22bba15001f/luau0-src-0.7.8+luau601/luau/Ast/src/Ast.cpp:2:
warning: /Users/choc/.cargo/registry/src/index.crates.io-6f17d22bba15001f/luau0-src-0.7.8+luau601/luau/Ast/include/Luau/Ast.h(376,46): error: no template named 'optional' in namespace 'std'
warning:   376 |         const AstName& debugname, const std::optional<AstTypeList>& returnAnnotation = {}, AstTypePack* varargAnnotation = nullptr,
warning:       |                                         ~~~~~^

...

error: failed to run custom build command for `mlua-sys v0.3.2`

Caused by:
  process didn't exit successfully: `/Users/choc/code/driving/target/debug/build/mlua-sys-086b5f599c374c51/build-script-main` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=build
  cargo:rerun-if-env-changed=CXX_x86_64-pc-windows-msvc
  CXX_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CXX_x86_64_pc_windows_msvc
  CXX_x86_64_pc_windows_msvc = Some("clang-cl")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64-pc-windows-msvc
  CXXFLAGS_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64_pc_windows_msvc
  CXXFLAGS_x86_64_pc_windows_msvc = Some("--target=x86_64-pc-windows-msvc -Wno-unused-command-line-argument -fuse-ld=lld-link /imsvc/Users/choc/Library/Caches/cargo-xwin/xwin/crt/include /imsvc/Users/choc/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt /imsvc/Users/choc/Library/Caches/cargo-xwin/xwin/sdk/include/um /imsvc/Users/choc/Library/Caches/cargo-xwin/xwin/sdk/include/shared  ")
  cargo:rerun-if-env-changed=CXX_x86_64-pc-windows-msvc
  CXX_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CXX_x86_64_pc_windows_msvc
  CXX_x86_64_pc_windows_msvc = Some("clang-cl")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64-pc-windows-msvc
  CXXFLAGS_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64_pc_windows_msvc
  CXXFLAGS_x86_64_pc_windows_msvc = Some("--target=x86_64-pc-windows-msvc -Wno-unused-command-line-argument -fuse-ld=lld-link /imsvc/Users/choc/Library/Caches/cargo-xwin/xwin/crt/include /imsvc/Users/choc/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt /imsvc/Users/choc/Library/Caches/cargo-xwin/xwin/sdk/include/um /imsvc/Users/choc/Library/Caches/cargo-xwin/xwin/sdk/include/shared  ")
  running: "clang-cl" "-nologo" "-MD" "-O2" "-Z7" "-Brepro" "-m64" "--target=x86_64-pc-windows-msvc" "-Wno-unused-command-line-argument" "-fuse-ld=lld-link" "/imsvc/Users/choc/Library/Caches/cargo-xwin/xwin/crt/include" "/imsvc/Users/choc/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt" "/imsvc/Users/choc/Library/Caches/cargo-xwin/xwin/sdk/include/um" "/imsvc/Users/choc/Library/Caches/cargo-xwin/xwin/sdk/include/shared" "-I" "/Users/choc/.cargo/registry/src/index.crates.io-6f17d22bba15001f/luau0-src-0.7.8+luau601/luau/Ast/include" "-I" "/Users/choc/.cargo/registry/src/index.crates.io-6f17d22bba15001f/luau0-src-0.7.8+luau601/luau/Common/include" "-DLUAI_MAXCSTACK=100000" "-DLUA_VECTOR_SIZE=3" "-Fo/Users/choc/code/driving/target/x86_64-pc-windows-msvc/debug/build/mlua-sys-bc87202e190734b8/out/luau-build/lib/1650a0a9048e3136-Ast.o" "-c" "--" "/Users/choc/.cargo/registry/src/index.crates.io-6f17d22bba15001f/luau0-src-0.7.8+luau601/luau/Ast/src/Ast.cpp"
@khvzak
Copy link
Member

khvzak commented Nov 20, 2023

I'll take a look! What x86_64-pc-windows-msvc toolchain do you use?

@tbillington
Copy link
Author

I was trying with xwin, cargo xwin build --target=x86_64-pc-windows-msvc. Not for any particular reason though

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

2 participants