Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Illegal instruction on RPi2 With vim & eix
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
fredbear5150
Tux's lil' helper
Tux's lil' helper


Joined: 11 Oct 2003
Posts: 113

PostPosted: Fri Jul 16, 2021 2:36 pm    Post subject: [SOLVED] Illegal instruction on RPi2 With vim & eix Reply with quote

I am doing a new Gentoo build on a Raspberry Pi 2 v1.1, it boots fine from an SD card with my own compiled kernel to a console login prompt.

I've emerged vim (8.2.0814-r100) and vim-core (8.2.0814) and when I try to run it I get the following:

Code:

┌─╼ root ╺─╸ io [~]
└╼ vi
Vim: Caught deadly signal ILL
Vim: Finished.
Illegal instruction


I've also emerged eix (0.34.12) and when I try to do an eix-update I get the following:

Code:

┌─╼ root ╺─╸ io [~]
└────╼ eix-update
Reading Portage settings...
Building database (/var/cache/eix/portage.eix)...
[0] "gentoo" /var/db/repos/gentoo (cache: metadata-md5-or-flat)
     Reading category  11|167 (  6): app-dicts...Illegal instruction


Apart from those, I've so far emerged nano, gentoolkit and portage-utils and those seem to work fine. I've also built what appears to be a perfectly good booting kernel with raspberrypi-sources.

Here's the relevant lines in make.conf:

Code:
┌─╼ root ╺─╸ io [~]
└╼ cat /etc/portage/make.conf
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
# COMMON_FLAGS="-O2 -pipe -march=armv7ve+simd -mfpu=neon-vfpv4 -mfloat-abi=hard"
COMMON_FLAGS="-O2 -pipe -march=native -mfpu=neon-vfpv4 -mfloat-abi=hard"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult https://wiki.gentoo.org/wiki/Changing_the_CHOST_variable before changing.
CHOST="armv7a-unknown-linux-gnueabihf"
MAKEOPTS="-j5"


I have done an "emerge -1" on vim, vim-core and eix using both the "COMMON_FLAGS" lines above, I've also used "-march=armv7a" in there also. On all three occasions, both applications crash with illegal instruction.

Illegal instruction usually means a CPU FLAG or CHOST error, but I can't see anything here that's wrong. Has anyone got any ideas?


Last edited by fredbear5150 on Fri Jul 16, 2021 6:21 pm; edited 2 times in total
Back to top
View user's profile Send private message
fredbear5150
Tux's lil' helper
Tux's lil' helper


Joined: 11 Oct 2003
Posts: 113

PostPosted: Fri Jul 16, 2021 2:37 pm    Post subject: Reply with quote

emerge --info:

Code:

┌─╼ root ╺─╸ io [~]
└────╼ emerge --info
Portage 3.0.18 (python 3.9.5-final-0, default/linux/arm/17.0/armv7a, gcc-10.3.0, glibc-2.33, 5.10.11 armv7l)
=================================================================
System uname: Linux-5.10.11-armv7l-ARMv7_Processor_rev_5_-v7l-with-glibc2.33
KiB Mem:      763840 total,    404504 free
KiB Swap:    1048572 total,   1048572 free
Timestamp of repository gentoo: Tue, 29 Jun 2021 10:45:01 +0000
Head commit of repository gentoo: 8622f8857c58e7dface6c002f7abe9301ccb8e30
sh bash 5.1_p8
ld GNU ld (Gentoo 2.35.2 p1) 2.35.2
app-shells/bash:          5.1_p8::gentoo
dev-lang/perl:            5.32.1::gentoo
dev-lang/python:          3.9.5_p2::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1-r1::gentoo
sys-apps/sandbox:         2.24::gentoo
sys-devel/autoconf:       2.69-r5::gentoo
sys-devel/automake:       1.16.3-r1::gentoo
sys-devel/binutils:       2.35.2::gentoo
sys-devel/gcc:            10.3.0::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://arcturus/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts:
    sync-rsync-verify-metamanifest: yes

ACCEPT_KEYWORDS="arm"
ACCEPT_LICENSE="@FREE"
CBUILD="armv7a-unknown-linux-gnueabihf"
CFLAGS="-O2 -pipe -march=native -mfpu=neon-vfpv4 -mfloat-abi=hard"
CHOST="armv7a-unknown-linux-gnueabihf"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=native -mfpu=neon-vfpv4 -mfloat-abi=hard"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=5 --load-average=4"
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="-O2 -pipe -march=native -mfpu=neon-vfpv4 -mfloat-abi=hard"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs 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 strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=native -mfpu=neon-vfpv4 -mfloat-abi=hard"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5 -l4"
PKGDIR="/var/cache/binpkgs"
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="acl arm berkdb bzip2 cli crypt dri fortran gdbm iconv ipv6 libglvnd ncurses nls nptl openmp pam pcre readline seccomp split-usr ssl tcpd unicode xattr zlib" ADA_TARGET="gnat_2018" 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 thumb thumb2 v4 v5 v6 v7 vfp" 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" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="exynos fbdev omap dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54331
Location: 56N 3W

PostPosted: Fri Jul 16, 2021 4:32 pm    Post subject: Reply with quote

fredbear5150,

After the illegal instruction error, dmesg should tell the file that it occurred in.
That may or may not be useful.

Its not your CHOST setting, that's only used by the toolchain, that leaves CFLAGS or CPU_FLAGS_ARM.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
fredbear5150
Tux's lil' helper
Tux's lil' helper


Joined: 11 Oct 2003
Posts: 113

PostPosted: Fri Jul 16, 2021 6:20 pm    Post subject: Reply with quote

Quote:
Its not your CHOST setting, that's only used by the toolchain, that leaves CFLAGS or CPU_FLAGS_ARM.


I found the cause in the end - this works for Raspberry Pi 2:

Code:
COMMON_FLAGS="-O2 -pipe -march=armv7ve+simd -mtune=cortex-a53 -mfpu=vfp -mfloat-abi=hard"


I came across ShorTie8's Github pages and this script that gave me most of the settings:

https://github.com/ShorTie8/Gentoo-imager/blob/master/Gentoo-imager.sh

I don't like using "march=native" so got the actual "march" setting with this:

Code:
gcc -march=native -Q --help=target


I recompiled vim and eix and they now work fine.
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30967
Location: here

PostPosted: Fri Jul 16, 2021 6:30 pm    Post subject: Reply with quote

There is also a wiki page for set safe cflags.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum