Hello, I'm trying to build rust (dep for firefox) on -CURRENT/aarch64, and it fails with the following error: [ 6%] Building CXX object src/wasm/CMakeFiles/wasm.dir/wasm-binary.cpp.o gmake[7]: Leaving directory '/usr/ports/lang/rust/work/rustc-1.23.0-src/build/aarch64-unknown-freebsd/stage0-rustc/aarch64-unknown -freebsd/release/build/rustc_binaryen-cfb76adb9420e94c/out/build' gmake[6]: Leaving directory '/usr/ports/lang/rust/work/rustc-1.23.0-src/build/aarch64-unknown-freebsd/stage0-rustc/aarch64-unknown -freebsd/release/build/rustc_binaryen-cfb76adb9420e94c/out/build' gmake[5]: Leaving directory '/usr/ports/lang/rust/work/rustc-1.23.0-src/build/aarch64-unknown-freebsd/stage0-rustc/aarch64-unknown -freebsd/release/build/rustc_binaryen-cfb76adb9420e94c/out/build' gmake[4]: Leaving directory '/usr/ports/lang/rust/work/rustc-1.23.0-src/build/aarch64-unknown-freebsd/stage0-rustc/aarch64-unknown -freebsd/release/build/rustc_binaryen-cfb76adb9420e94c/out/build' --- stderr c++: error: the clang compiler does not support '-march=native' c++: error: the clang compiler does not support '-march=native' gmake[7]: *** [src/asmjs/CMakeFiles/asmjs.dir/build.make:63: src/asmjs/CMakeFiles/asmjs.dir/asm_v_wasm.cpp.o] Error 1 gmake[7]: *** [src/ir/CMakeFiles/ir.dir/build.make:63: src/ir/CMakeFiles/ir.dir/ExpressionAnalyzer.cpp.o] Error 1 gmake[6]: *** [CMakeFiles/Makefile2:610: src/asmjs/CMakeFiles/asmjs.dir/all] Error 2 gmake[6]: *** Waiting for unfinished jobs.... gmake[6]: *** [CMakeFiles/Makefile2:555: src/ir/CMakeFiles/ir.dir/all] Error 2 c++: error: the clang compiler does not support '-march=native' gmake[7]: *** [src/wasm/CMakeFiles/wasm.dir/build.make:63: src/wasm/CMakeFiles/wasm.dir/literal.cpp.o] Error 1 gmake[7]: *** Waiting for unfinished jobs.... c++: error: the clang compiler does not support '-march=native' c++: error: the clang compiler does not support '-march=native' gmake[7]: *** [src/wasm/CMakeFiles/wasm.dir/build.make:87: src/wasm/CMakeFiles/wasm.dir/wasm.cpp.o] Error 1 gmake[7]: *** [src/wasm/CMakeFiles/wasm.dir/build.make:111: src/wasm/CMakeFiles/wasm.dir/wasm-binary.cpp.o] Error 1 gmake[6]: *** [CMakeFiles/Makefile2:885: src/wasm/CMakeFiles/wasm.dir/all] Error 2 gmake[5]: *** [CMakeFiles/Makefile2:171: CMakeFiles/binaryen.dir/rule] Error 2 gmake[4]: *** [Makefile:190: binaryen] Error 2 thread 'main' panicked at ' command did not execute successfully, got: exit code: 2 build script failed, must exit now', src/vendor/cmake/src/lib.rs:631:4 note: Run with `RUST_BACKTRACE=1` for a backtrace. warning: build failed, waiting for other jobs to finish... error: build failed thread 'main' panicked at 'command did not execute successfully: "/usr/ports/lang/rust/work/rustc-1.23.0-src/build/aarch64-unknown-freebsd/stage0/bin/cargo" "build" "--target" "aarch64-unknown-freebsd" "--release" "--frozen" "--features" " jemalloc llvm" "--manifest-path" "/usr/ports/lang/rust/work/rustc-1.23.0-src/src/rustc/Cargo.toml" "--message-format" "json" expected success, got: exit code: 101', src/bootstrap/compile.rs:882:8 note: Run with `RUST_BACKTRACE=1` for a backtrace. # uname -a FreeBSD build-pine64.bealak.harmless.hu 12.0-CURRENT FreeBSD 12.0-CURRENT #0 r328533M: Mon Jan 29 15:43:25 CET 2018 toor@marvin.harmless.hu:/tank/rpi3/crochet/work.pine64vanilla/obj/tank/rpi3/src/arm64.aarch64/sys/GENERIC-NODEBUG arm64 It's after the clang-6.0.0 import. Could you please fix this? Best regards, Gergely
Hi! Could you please attach the content of /etc/make.conf and provide any other local settings you may have?
My make.conf: # cat /etc/make.conf DEFAULT_VERSIONS+= python=3.6 OPTIONS_UNSET= TEST NLS DOCS EXAMPLES and the options for the port: # cat /var/db/ports/lang_rust/options # This file is auto-generated by 'make config'. # Options for rust-1.23.0 _OPTIONS_READ=rust-1.23.0 _FILE_COMPLETE_OPTIONS_LIST=DOCS GDB LLNEXTGEN SOURCES OPTIONS_FILE_UNSET+=DOCS OPTIONS_FILE_UNSET+=GDB OPTIONS_FILE_UNSET+=LLNEXTGEN OPTIONS_FILE_UNSET+=SOURCES Nothing else comes to my mind. Let me know if you need anything else for reproduction.
FreeBSD supports -march=native only on i386 and amd64 https://lists.freebsd.org/pipermail/freebsd-toolchain/2018-January/003560.html https://lists.freebsd.org/pipermail/freebsd-arm/2016-February/013190.html but since Rust 1.23 we have $ fgrep -B2 -r march=native . ./src/binaryen/CMakeLists.txt- elseif(TARGET_ARCH STREQUAL "ARM") ./src/binaryen/CMakeLists.txt- # stub for ARM-specific instructions. GCC6 adds NEON with the below flags ./src/binaryen/CMakeLists.txt: ADD_COMPILE_FLAG("-march=native") https://github.com/rust-lang/rust/commit/80ff0f74b0c4 https://github.com/alexcrichton/binaryen/commit/a0b162d13c7e https://github.com/WebAssembly/binaryen/issues/965 If the intent is to enable NEON then - aarch64 doesn't need anything, NEON is standard; GCC would barf on -mfpu=neon, anyway - armv6 needs -march=armv7-a -mfpu=neon - armv7 has NEON enabled by default; can use armv6 flags but vendor -march= may pessimize custom -march= set via CPUTYPE in /etc/make.conf
(In reply to Jan Beich from comment #3) > - armv7 has NEON enabled by default Only Clang. GCC still needs -mfpu=neon. $ cc -v FreeBSD clang version 6.0.0 (branches/release_60 323948) (based on LLVM 6.0.0) Target: armv7-unknown-freebsd12.0-gnueabihf Thread model: posix InstalledDir: /usr/bin $ cc -dM -E -</dev/null | fgrep NEON #define __ARM_NEON 1 #define __ARM_NEON_FP 0x4 #define __ARM_NEON__ 1 $ clang40 -dM -E -</dev/null | fgrep NEON #define __ARM_NEON 1 #define __ARM_NEON_FP 0x4 #define __ARM_NEON__ 1 $ gcc6 -dM -E -</dev/null | fgrep NEON $ gcc7 -dM -E -</dev/null | fgrep NEON $ gcc7 -mfpu=neon -dM -E -</dev/null | fgrep NEON #define __ARM_NEON_FP 4 #define __ARM_NEON__ 1 #define __ARM_NEON 1
pkg-fallout@ haven't reported this bustage yet because thunderx1 hit a kernel panic again. ;\
In case you weren't ware of it, I was told by the #bsdmips guys, that there are aarch64 testing machines for such purposes, they've showed me the following links: https://wiki.freebsd.org/TestClusterOneReservations https://www.freebsd.org/internal/machines.html I hope this helps.
https://github.com/WebAssembly/binaryen/pull/1192#issuecomment-367461975 has been merged. @rust guys, would it be possible to patch the port while the fix appears in a release? Another thing is, when I've manually fixed it locally similarly, there was another build failure, you guys will encounter. Could you please verify the build to succeed on aarch64?
Regarding my previous comment, I forgot I manually fixed the native bug locally, and the other error's PR is 225643.
A commit references this bug: Author: jbeich Date: Thu Feb 22 22:05:21 UTC 2018 New revision: 462646 URL: https://svnweb.freebsd.org/changeset/ports/462646 Log: lang/rust: unbreak on aarch64 after r459911 gmake: Leaving directory '.../aarch64-unknown-freebsd/release/build/rustc_binaryen-cfb76adb9420e94c/out/build' --- stderr c++: error: the clang compiler does not support '-march=native' c++: error: the clang compiler does not support '-march=native' PR: 225600 Reported by: Gergely Czuczy, pkg-fallout Obtained from: upstream (binaryen 1.37.35) Approved by: portmgr blanket Changes: head/lang/rust/files/patch-src_binaryen_CMakeLists.txt