Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 684896 - >=dev-lang/rust-1.34.0 : please add rust_target for thumbv7neon-unknown-linux-gnueabihf
Summary: >=dev-lang/rust-1.34.0 : please add rust_target for thumbv7neon-unknown-linux...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Rust Project
URL:
Whiteboard:
Keywords: PullRequest
Depends on: 747760
Blocks:
  Show dependency tree
 
Reported: 2019-05-01 20:30 UTC by tt_1
Modified: 2024-02-11 06:00 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
split patch against the tree (rust-1.34.2.patch,5.36 KB, patch)
2019-07-22 11:47 UTC, tt_1
Details | Diff
split patch against the tree (rust-1.36.0.patch,4.93 KB, patch)
2019-07-27 13:04 UTC, tt_1
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tt_1 2019-05-01 20:30:16 UTC
firefox is going to ask for it from v67 or v68 on, if rust is at least v1.34, and if --enable-neon is passed. the ebuild would have to be configured for armv7-unknown-linux-gnueabihf plus the additional std, just as it's done for the wasm32 target right now. 

thank you
Comment 1 tt_1 2019-07-22 11:47:12 UTC
Created attachment 584004 [details, diff]
split patch against the tree

This is my patch against the tree. 

What keeps you from fixing this?
Comment 2 Georgy Yakovlev archtester gentoo-dev 2019-07-27 06:53:53 UTC
last patch mixes 2 useflags and is incomplete.profile changes use thumbv7neon, but ebuild uses neon.

also it may need *hf guard like 

pkg_pretend() {
......
        if [[ "$(tc-is-softfloat)" != "no" ]]; then
                die "Neon support requires hardfloat system."
        fi
}

or maybe there is a better way I don't know about.

my arm box is down so I would not be able to test it anytime sooner than couple of weeks.

adding neon flag makes sense, but we also have cpu_flags_arm_neon, which kinda fits the purpose.
Comment 3 Georgy Yakovlev archtester gentoo-dev 2019-07-27 06:56:13 UTC
of course hardfloat check has to trigger only if neon is set.
Comment 4 tt_1 2019-07-27 13:04:12 UTC
Created attachment 584830 [details, diff]
split patch against the tree

updated patch against rust-1.36.0
Comment 5 tt_1 2019-07-27 13:07:34 UTC
I honestly forgot why I made the decision to rename the useflag from thumbv7-neon to neon, however it collides somehow with the idea of the neon useflag. This doesn't build the rust compiler with neon instructions, but it adds a second rust-std with the thumbv7-neon use flag. 

If you agree to it, I can offer to crunch the numbers for you on my hardware.
Comment 6 Steve Arnold archtester gentoo-dev 2020-10-15 23:55:57 UTC
Mainly I've been using rust-bin on armv7, so I just hit this from the spidermonkey path instead.  Instead of trying to build a modified rust, I added some previous firefox arm config snippets and spidermonkey was happy again.

Note this was an upgrade; the failed build was triggered by adding "neon" to global USE flags (even though it was already in CFLAGS).  The workarounds are basically forcing enable-neon and disabling thumb:

--- dev-lang/spidermonkey/spidermonkey-78.3.1.ebuild.orig	2020-10-06 18:09:25.000000000 -0700
+++ dev-lang/spidermonkey/spidermonkey-78.3.1.ebuild	2020-10-14 18:31:46.550950213 -0700
@@ -172,9 +172,15 @@
 
 		if ! tc-is-clang ; then
 			# thumb options aren't supported when using clang, bug 666966
-			myeconfargs+=( --with-thumb=yes )
+			myeconfargs+=( --with-thumb=no )
 			myeconfargs+=( --with-thumb-interwork=no )
 		fi
+	else
+		# fall back to generic armv7-a vfp
+		myeconfargs+=( --with-fpu=vfpv3-d16 )
+	fi
+	if [[ ${CHOST} == armv*h* ]] ; then
+		myeconfargs+=( --with-float-abi=hard )
 	fi
 
 	# Tell build system that we want to use LTO


In general I would vote "yes" on cpu_flags_arm_neon and "no" on USE=neon and just handle each ebuild as appropriate.
Comment 7 Georgy Yakovlev archtester gentoo-dev 2020-10-16 04:57:50 UTC
(In reply to Steve Arnold from comment #6)
> Mainly I've been using rust-bin on armv7, so I just hit this from the
> spidermonkey path instead.  Instead of trying to build a modified rust, I
> added some previous firefox arm config snippets and spidermonkey was happy
> again.
> 
> Note this was an upgrade; the failed build was triggered by adding "neon" to
> global USE flags (even though it was already in CFLAGS).  The workarounds
> are basically forcing enable-neon and disabling thumb:
> 
> --- dev-lang/spidermonkey/spidermonkey-78.3.1.ebuild.orig	2020-10-06
> 18:09:25.000000000 -0700
> +++ dev-lang/spidermonkey/spidermonkey-78.3.1.ebuild	2020-10-14
> 18:31:46.550950213 -0700
> @@ -172,9 +172,15 @@
>  
>  		if ! tc-is-clang ; then
>  			# thumb options aren't supported when using clang, bug 666966
> -			myeconfargs+=( --with-thumb=yes )
> +			myeconfargs+=( --with-thumb=no )
>  			myeconfargs+=( --with-thumb-interwork=no )
>  		fi
> +	else
> +		# fall back to generic armv7-a vfp
> +		myeconfargs+=( --with-fpu=vfpv3-d16 )
> +	fi
> +	if [[ ${CHOST} == armv*h* ]] ; then
> +		myeconfargs+=( --with-float-abi=hard )
>  	fi
>  
>  	# Tell build system that we want to use LTO
> 
> 
> In general I would vote "yes" on cpu_flags_arm_neon and "no" on USE=neon and
> just handle each ebuild as appropriate.

check rust ebuild, you can define any additional rust target when building it nowadays.

this in env file
> I_KNOW_WHAT_I_AM_DOING_CROSS=yes
> RUST_CROSS_TARGETS=( "ARM:thumbv7neon-unknown-linux-gnueabihf:armv7a-unknown-linux-gnueabihf" )

should probably give you working rust capable of building spidermonkey/firefox with no ebuild modifications at all.

but it's just a hack for now. RUST_TARGETS should address this officially and correctly in https://bugs.gentoo.org/747760
Comment 8 tt_1 2020-10-16 05:36:58 UTC
(In reply to Steve Arnold from comment #6)
> Mainly I've been using rust-bin on armv7, so I just hit this from the
> spidermonkey path instead.  Instead of trying to build a modified rust, I
> added some previous firefox arm config snippets and spidermonkey was happy
> again.
> 
> Note this was an upgrade; the failed build was triggered by adding "neon" to
> global USE flags (even though it was already in CFLAGS).  The workarounds
> are basically forcing enable-neon and disabling thumb:
> 
> --- dev-lang/spidermonkey/spidermonkey-78.3.1.ebuild.orig	2020-10-06
> 18:09:25.000000000 -0700
> +++ dev-lang/spidermonkey/spidermonkey-78.3.1.ebuild	2020-10-14
> 18:31:46.550950213 -0700
> @@ -172,9 +172,15 @@
>  
>  		if ! tc-is-clang ; then
>  			# thumb options aren't supported when using clang, bug 666966
> -			myeconfargs+=( --with-thumb=yes )
> +			myeconfargs+=( --with-thumb=no )
>  			myeconfargs+=( --with-thumb-interwork=no )
>  		fi
> +	else
> +		# fall back to generic armv7-a vfp
> +		myeconfargs+=( --with-fpu=vfpv3-d16 )
> +	fi
> +	if [[ ${CHOST} == armv*h* ]] ; then
> +		myeconfargs+=( --with-float-abi=hard )
>  	fi
>  
>  	# Tell build system that we want to use LTO
> 
> 
> In general I would vote "yes" on cpu_flags_arm_neon and "no" on USE=neon and
> just handle each ebuild as appropriate.


you're right, I've been playing around with the spidermonkey:78 ebuilds lately and it seems as if --enable-fpu=neon does *not* need the additional thumbv7neon-unknown-linux-gnueabihf target, right? 

but I still have to check out what happens with neon + lto useflag enabled
Comment 9 Steve Arnold archtester gentoo-dev 2020-10-28 21:10:25 UTC
I generally use default gold/lto on everything possible; default arm flags are below.  With the ebuild changes above I didn't need any changes to defaults for spidermonkey.

# emerge --info
Portage 3.0.8 (python 3.7.9-final-0, default/linux/arm/17.0/armv7a/desktop, gcc-10.2.0, glibc-2.32-r2, 4.19.63-tegra-r0 armv7l)
=================================================================
System uname: Linux-4.19.63-tegra-r0-armv7l-ARMv7_Processor_rev_3_-v7l-with-gentoo-2.7
KiB Mem:     2057868 total,   1109488 free
KiB Swap:    2047996 total,   2040316 free
Timestamp of repository gentoo: Tue, 13 Oct 2020 00:45:01 +0000
sh bash 5.0_p18
ld GNU gold (Gentoo 2.34 p6 2.34.0) 1.16
app-shells/bash:          5.0_p18::gentoo
dev-lang/perl:            5.30.3-r1::gentoo
dev-lang/python:          3.7.9::gentoo, 3.8.6::gentoo, 3.9.0::gentoo
dev-util/cmake:           3.18.4::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.2::gentoo
sys-devel/binutils:       2.34-r2::gentoo, 2.35.1::gentoo
sys-devel/gcc:            10.2.0-r2::gentoo
sys-devel/gcc-config:     2.3.2::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.9::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: webrsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-webrsync-verify-signature: true

nerdboy
    location: /usr/local/portage/nerdboy
    masters: gentoo
    priority: 0

arm_nerdboy
    location: /usr/local/portage/arm
    masters: gentoo
    priority: 1

ACCEPT_KEYWORDS="arm ~arm"
ACCEPT_LICENSE="@FREE CC-Sampling-Plus-1.0 linux-fw-redistributable no-source-code BSL-1.1"
CBUILD="armv7a-unknown-linux-gnueabihf"
CFLAGS="-march=armv7-a+mp+sec+simd -mtune=generic-armv7-a -O2 -pipe -mfpu=neon-fp16 -mfp16-format=ieee -mfloat-abi=hard -ftree-vectorize -ftree-loop-distribution -fvect-cost-model=cheap -flto"
CHOST="armv7a-unknown-linux-gnueabihf"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=armv7-a+mp+sec+simd -mtune=generic-armv7-a -O2 -pipe -mfpu=neon-fp16 -mfp16-format=ieee -mfloat-abi=hard -ftree-vectorize -ftree-loop-distribution -fvect-cost-model=cheap -flto"
DISTDIR="/var/cache/portage/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-march=armv7-a+mp+sec+simd -mtune=generic-armv7-a -O2 -pipe -mfpu=neon-fp16 -mfp16-format=ieee -mfloat-abi=hard -ftree-vectorize -ftree-loop-distribution -fvect-cost-model=cheap -flto"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms split-elog strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=armv7-a+mp+sec+simd -mtune=generic-armv7-a -O2 -pipe -mfpu=neon-fp16 -mfp16-format=ieee -mfloat-abi=hard -ftree-vectorize -ftree-loop-distribution -fvect-cost-model=cheap -flto"
GENTOO_MIRRORS="https://gentoo.osuosl.org/"
INSTALL_MASK=" /usr/lib/systemd *.la"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -flto -fuse-linker-plugin"
LINGUAS="en"
MAKEOPTS="-j3"
PKGDIR="/var/cache/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl alsa appindicator arm berkdb bluetooth branding bzip2 cairo caps cdda cdr cli crypt cups dbus dri dts dvd dvdr egl elogind emboss encode exif flac fortran gdbm gif gles2 gpm gtk gui iconv icu ipv6 jpeg lcms libglvnd libnotify logrotate lto mad mng mp3 mp4 mpeg ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds qt5 readline sdl seccomp spell split-usr ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vala vorbis wayland wxwidgets x264 xattr xcb xml xv xvid zlib" ADA_TARGET="gnat_2018" ALSA_CARDS="tegrahda VEYRONI2S usb-audio" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_ARM="edsp neon thumb vfp vfpv3 vfpv4 vfp-d32 v7 thumb2 v4 v5 v6" CURL_SSL="openssl" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en en-US" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="pdfimport presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" QEMU_SOFTMMU_TARGETS="arm" QEMU_USER_TARGETS="arm" RUBY_TARGETS="ruby25 ruby26" USERLAND="GNU" VIDEO_CARDS="tegra exynos panfrost vc4" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 10 tt_1 2020-10-29 20:57:03 UTC
can you please provide output of:

emerge -pv dev-lang/rust
cat /etc/portage/env/dev-lang/rust
emerge -pv spidermonkey 

so I can give you a reproducer. This has been tricky with my setup for the longest time, so maybe we can settle the debate.