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

Cannot compile under Rosetta 2 on Macos #116512

Open
lukaso opened this issue Oct 7, 2023 · 3 comments
Open

Cannot compile under Rosetta 2 on Macos #116512

lukaso opened this issue Oct 7, 2023 · 3 comments
Labels
C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@lukaso
Copy link

lukaso commented Oct 7, 2023

I'm building rust from source on MacOS inside a Rosetta 2 emulator on an M1 Mac (I use macports).

Basically, building rust on an emulated x86_64 does not work.

arch -x86_64 /bin/zsh
sudo port install -s rust

I expected to see this happen: Rust to compile.

Instead, this happened:

:info:build error: process didn't exit successfully: `/Users/user/macports-gimp3-x86_64/var/macports/build/_Users_user_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.71.1-src/build/bootstrap/debug/rustc -vV` (exit status: 254)
:info:build --- stdout
:info:build Did not run successfully: signal: 6 (SIGABRT)
:info:build DYLD_LIBRARY_PATH="/Users/user/macports-gimp3-x86_64/var/macports/build/_Users_user_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.71.1-src/build/x86_64-apple-darwin/stage1/lib" "/Users/user/macports-gimp3-x86_64/var/macports/build/_Users_user_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.71.1-src/build/x86_64-apple-darwin/stage1/bin/rustc" "-vV" "-Wrust_2018_idioms" "-Wunused_lifetimes" "-Wsemicolon_in_expressions_from_macros" "-Dwarnings" "-Clinker=/Users/user/macports-gimp3-x86_64/var/macports/build/_Users_user_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/compwrap/ld/usr/bin/clang" "-Zunstable-options" "--check-cfg=values(bootstrap)" "--remap-path-prefix" "/Users/user/macports-gimp3-x86_64/var/macports/build/_Users_user_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work=/Users/user/macports-gimp3-x86_64/libexec/rust/src" "-Z" "force-unstable-if-unmarked"
:info:build -------------
:info:build --- stderr
:info:build <jemalloc>: Error allocating TSD
:info:build rustc exited with signal: 6 (SIGABRT)
:info:build command did not execute successfully: cd "/Users/user/macports-gimp3-x86_64/var/macports/build/_Users_user_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.71.1-src" && AR_x86_64_apple_darwin="/usr/bin/ar" CARGO_INCREMENTAL="0" CARGO_PROFILE_RELEASE_DEBUG="0" CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS="false" CARGO_PROFILE_RELEASE_OVERFLOW_CHECKS="false" CARGO_TARGET_DIR="/Users/user/macports-gimp3-x86_64/var/macports/build/_Users_user_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.71.1-src/build/x86_64-apple-darwin/stage1-std" CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER="/Users/user/macports-gimp3-x86_64/var/macports/build/_Users_user_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/compwrap/ld/usr/bin/clang" CC_x86_64_apple_darwin="/Users/user/macports-gimp3-x86_64/var/macports/build/_Users_user_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/compwrap/cc/usr/bin/clang" CFG_COMPILER_HOST_TRIPLE="x86_64-apple-darwin" CFG_DISABLE_UNSTABLE_FEATURES="1" CFG_RELEASE_CHANNEL="stable" CFLAGS_x86_64_apple_darwin="-ffunction-sections -fdata-sections -fPIC --target=x86_64-apple-darwin -stdlib=libc++" CXXFLAGS_x86_64_apple_darwin="-ffunction-sections -fdata-sections -fPIC --target=x86_64-apple-darwin -stdlib=libc++" CXX_x86_64_apple_darwin="/Users/user/macports-gimp3-x86_64/var/macports/build/_Users_user_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/compwrap/cxx/usr/bin/clang++" LIBC_CHECK_CFG="1" RANLIB_x86_64_apple_darwin="/usr/bin/ar s" REAL_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" RUSTBUILD_NATIVE_DIR="/Users/user/macports-gimp3-x86_64/var/macports/build/_Users_user_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.71.1-src/build/x86_64-apple-darwin/native" RUSTC="/Users/user/macports-gimp3-x86_64/var/macports/build/_Users_user_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.71.1-src/build/bootstrap/debug/rustc" RUSTC_BOOTSTRAP="1" RUSTC_BREAK_ON_ICE="1" RUSTC_ERROR_METADATA_DST="/Users/user/macports-gimp3-x86_64/var/macports/build/_Users_user_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.71.1-src/build/tmp/extended-error-metadata" RUSTC_FORCE_UNSTABLE="1" RUSTC_HOST_LINKER="/Users/user/macports-gimp3-x86_64/var/macports/build/_Users_user_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/compwrap/ld/usr/bin/clang" RUSTC_INSTALL_BINDIR="bin" RUSTC_LIBDIR="/Users/user/macports-gimp3-x86_64/var/macports/build/_Users_user_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.71.1-src/build/x86_64-apple-darwin/stage1/lib" RUSTC_LINT_FLAGS="-Wrust_2018_idioms -Wunused_lifetimes -Wsemicolon_in_expressions_from_macros -Dwarnings" RUSTC_REAL="/Users/user/macports-gimp3-x86_64/var/macports/build/_Users_user_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.71.1-src/build/x86_64-apple-darwin/stage1/bin/rustc" RUSTC_SNAPSHOT="/Users/user/macports-gimp3-x86_64/var/macports/build/_Users_user_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.70.0-x86_64-apple-darwin/rustc/bin/rustc" RUSTC_SNAPSHOT_LIBDIR="/Users/user/macports-gimp3-x86_64/var/macports/build/_Users_user_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.70.0-x86_64-apple-darwin/rustc/lib" RUSTC_STAGE="1" RUSTC_SYSROOT="/Users/user/macports-gimp3-x86_64/var/macports/build/_Users_user_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.71.1-src/build/x86_64-apple-darwin/stage1" RUSTC_VERBOSE="2" RUSTDOC="/Users/user/macports-gimp3-x86_64/var/macports/build/_Users_user_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.71.1-src/build/bootstrap/debug/rustdoc" RUSTDOCFLAGS="-Csymbol-mangling-version=legacy -Zunstable-options -Zunstable-options --check-cfg=values(bootstrap) --check-cfg=values(stdarch_intel_sde) --check-cfg=values(no_fp_fmt_parse) --check-cfg=values(no_global_oom_handling) --check-cfg=values(no_rc) --check-cfg=values(no_sync) --check-cfg=values(freebsd12) --check-cfg=values(freebsd13) --check-cfg=values(backtrace_in_libstd) --check-cfg=values(target_env,\"libnx\") --check-cfg=values(target_arch,\"asmjs\",\"spirv\",\"nvptx\",\"xtensa\") -Dwarnings -Wrustdoc::invalid_codeblock_attributes --crate-version 1.71.1\t(eb26296b5\t2023-08-03)\t(built\tfrom\ta\tsource\ttarball) -Zcrate-attr=doc(html_root_url=\"https://doc.rust-lang.org/1.71.1/\") -Zcrate-attr=warn(rust_2018_idioms)" RUSTDOC_REAL="/path/to/nowhere/rustdoc/not/required" RUSTFLAGS="-Csymbol-mangling-version=legacy -Zunstable-options -Zunstable-options --check-cfg=values(bootstrap) --check-cfg=values(stdarch_intel_sde) --check-cfg=values(no_fp_fmt_parse) --check-cfg=values(no_global_oom_handling) --check-cfg=values(no_rc) --check-cfg=values(no_sync) --check-cfg=values(freebsd12) --check-cfg=values(freebsd13) --check-cfg=values(backtrace_in_libstd) --check-cfg=values(target_env,\"libnx\") --check-cfg=values(target_arch,\"asmjs\",\"spirv\",\"nvptx\",\"xtensa\") -Zmacro-backtrace -Zosx-rpath-install-name -Clink-args=-Wl,-rpath,@loader_path/../lib -Csplit-debuginfo=unpacked -Cprefer-dynamic -Zinline-mir -Cembed-bitcode=yes -Zcrate-attr=doc(html_root_url=\"https://doc.rust-lang.org/1.71.1/\")" RUST_COMPILER_RT_ROOT="/Users/user/macports-gimp3-x86_64/var/macports/build/_Users_user_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.71.1-src/src/llvm-project/compiler-rt" RUST_TEST_THREADS="10" WINAPI_NO_BUNDLED_LIBRARIES="1" __CARGO_DEFAULT_LIB_METADATA="stablestd" "/Users/user/macports-gimp3-x86_64/var/macports/build/_Users_user_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/cargo-1.70.0-x86_64-apple-darwin/cargo/bin/cargo" "build" "--target" "x86_64-apple-darwin" "--release" "-Zcheck-cfg=names,values,output" "-Zbinary-dep-depinfo" "-j" "10" "-v" "-v" "--features" " panic-unwind backtrace compiler-builtins-c" "--manifest-path" "/Users/user/macports-gimp3-x86_64/var/macports/build/_Users_user_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.71.1-src/library/sysroot/Cargo.toml" "--message-format" "json-render-diagnostics"

Meta

version is 1.71.1 but since it's not compiled, I can't do the verbose version.

Backtrace N/A.

Other

@lukaso lukaso added the C-bug Category: This is a bug. label Oct 7, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 7, 2023
@saethlin saethlin added I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Oct 7, 2023
@lukaso
Copy link
Author

lukaso commented Oct 7, 2023

@ehuss
Copy link
Contributor

ehuss commented Oct 7, 2023

FWIW, I'm able to reproduce without macports, just doing arch -x86_64 /bin/zsh and then ./x.py build with jemalloc=true in config.toml.

I'm guessing this is an upstream issue for jemalloc. I see tikv/jemallocator#17 and jemalloc/jemalloc#2014 which although showing different errors, indicates that jemalloc might have issues with running under Rosetta.

@lukaso
Copy link
Author

lukaso commented Oct 8, 2023

BTW: this command will detect (return 1) if running under rosetta 2: sysctl -n sysctl.proc_translated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants