Bug 248680 - lang/rust: add aarch64-unknown-none and riscv64gc-unknown-none-elf targets
Summary: lang/rust: add aarch64-unknown-none and riscv64gc-unknown-none-elf targets
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: FreeBSD Rust Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-16 03:25 UTC by Sreehari S
Modified: 2020-08-20 05:05 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (rust)


Attachments
(svn diff) Added aarch64-unknown-none and riscv64gc-unknown-none-elf targets and enabled by default (1.10 KB, patch)
2020-08-16 03:25 UTC, Sreehari S
tobik: maintainer-approval-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sreehari S 2020-08-16 03:25:47 UTC
Created attachment 217248 [details]
(svn diff) Added aarch64-unknown-none and riscv64gc-unknown-none-elf targets and enabled by default

Currently rust and by extension rust-nightly only have support for the default targets and wasm32-unknown-unknown. I've added options to build the aarch64-unknown-none and riscv64gc-unknown-none-elf targets, and enabled them by default just like wasm32. Technically you could get the two targets I added by using rustup, but I found that targets added by rustup do not play along with FreeBSD's lld at all unless you pass some arcane RUSTFLAGS and enable certain components, which is not immediately obvious to most people. This is especially frustrating for anyone who does bare metal programming with Rust on FreeBSD, since it causes confusing build errors, and even googling could yield little results. I've build rust-nightly on my machine using my patch, and I was able to successfully compile my project, and it wouldn't compile without giving me issues with the current rust-nightly port or rustup.
Comment 1 Tobias Kortkamp freebsd_committer 2020-08-20 05:05:08 UTC
Comment on attachment 217248 [details]
(svn diff) Added aarch64-unknown-none and riscv64gc-unknown-none-elf targets and enabled by default

It doesn't build:

running: "/wrkdirs/usr/ports/lang/rust/work/bootstrap/bin/cargo" "rustdoc" "--target" "aarch64-unknown-none" "-Zbinary-dep-depinfo" "-j" "8" "-v" "--release" "--frozen" "-p" "alloc" "--manifest-path" "/wrkdirs/usr/ports/lang/rust/work/rustc-1.45.2-src/src/liballoc/Cargo.toml" "--features" "compiler-builtins-mem compiler-builtins-c" "-p" "alloc" "--" "--markdown-css" "rust.css" "--markdown-no-toc" "--generate-redirect-pages" "-Z" "unstable-options" "--resource-suffix" "1.45.2" "--index-page" "/wrkdirs/usr/ports/lang/rust/work/rustc-1.45.2-src/src/doc/index.md"
error: The argument '--package <SPEC>' was provided more than once, but cannot be used multiple times

USAGE:
    cargo rustdoc --features <FEATURES>... --frozen --jobs <N> --manifest-path <PATH> --package <SPEC> --release --target <TRIPLE> -Z <FLAG>... --verbose

For more information try --help


command did not execute successfully: "/wrkdirs/usr/ports/lang/rust/work/bootstrap/bin/cargo" "rustdoc" "--target" "aarch64-unknown-none" "-Zbinary-dep-depinfo" "-j" "8" "-v" "--release" "--frozen" "-p" "alloc" "--manifest-path" "/wrkdirs/usr/ports/lang/rust/work/rustc-1.45.2-src/src/liballoc/Cargo.toml" "--features" "compiler-builtins-mem compiler-builtins-c" "-p" "alloc" "--" "--markdown-css" "rust.css" "--markdown-no-toc" "--generate-redirect-pages" "-Z" "unstable-options" "--resource-suffix" "1.45.2" "--index-page" "/wrkdirs/usr/ports/lang/rust/work/rustc-1.45.2-src/src/doc/index.md"
expected success, got: exit code: 1