Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dev-lang/rust/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<flag name="system-llvm">Use the system LLVM install</flag>
<flag name="rls">Install rls component</flag>
<flag name="rustfmt">Install rustfmt component</flag>
<flag name="thumbv7neon">Build support for the thumbv7-neon target</flag>
<flag name="wasm">Build support for the wasm32-unknown-unknown
target</flag>
</use>
Expand Down
23 changes: 22 additions & 1 deletion dev-lang/rust/rust-1.36.0.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}

LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA"

IUSE="clippy cpu_flags_x86_sse2 debug doc libressl rls rustfmt system-llvm wasm ${ALL_LLVM_TARGETS[*]}"
IUSE="clippy cpu_flags_x86_sse2 debug doc libressl rls rustfmt system-llvm thumbv7neon wasm ${ALL_LLVM_TARGETS[*]}"

# Please keep the LLVM dependency block separate. Since LLVM is slotted,
# we need to *really* make sure we're not pulling one than more slot
Expand Down Expand Up @@ -112,6 +112,12 @@ pre_build_checks() {

pkg_pretend() {
pre_build_checks

use arm && use thumbv7neon && if [[ "$(tc-is-softfloat)" != "no" ]]; then
die "Neon support requires hardfloat system."
else # don't do anything
:;
fi
}

pkg_setup() {
Expand Down Expand Up @@ -140,6 +146,11 @@ src_configure() {
if use wasm; then
rust_targets="${rust_targets},\"wasm32-unknown-unknown\""
fi

if use thumbv7neon; then
rust_targets="${rust_targets},\"thumbv7neon-unknown-linux-gnueabihf\""
fi

rust_targets="${rust_targets#,}"

local extended="true" tools="\"cargo\","
Expand Down Expand Up @@ -222,6 +233,16 @@ src_configure() {
linker = "$(usex system-llvm lld rust-lld)"
EOF
fi

if use thumbv7neon; then
cat <<- EOF >> "${S}"/config.toml
[target.thumbv7neon-unknown-linux-gnueabihf]
cc = "$(tc-getBUILD_CC)"
cxx = "$(tc-getBUILD_CXX)"
linker = "$(tc-getCC)"
ar = "$(tc-getAR)"
EOF
fi
}

src_compile() {
Expand Down
2 changes: 2 additions & 0 deletions profiles/arch/arm/armv7a/use.mask
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
-armv6
-armv6t2

-thumbv7neon

-cpu_flags_arm_v4
-cpu_flags_arm_v5
-cpu_flags_arm_v6
Expand Down
4 changes: 4 additions & 0 deletions profiles/arch/base/package.use.mask
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Steffen Kuhn <nielson2@yandex.com> (17 May 2019)
# thumbv7neon can only be built for armv7
dev-lang/rust thumbv7neon

# Craig Andrews <candrews@gentoo.org> (2019-07-03)
# Raspberry Pi support is only available on arm.
# Mask raspberry-pi USE globally, unmask on arm.
Expand Down