Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Troubles with Cross Compiling and portage
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
MarkCu
n00b
n00b


Joined: 28 Nov 2012
Posts: 19

PostPosted: Tue Oct 17, 2017 12:54 am    Post subject: Troubles with Cross Compiling and portage Reply with quote

All,

Some background - I'm trying to prepare for a gentoo install on a Raspberry Pi 3, per the instructions here:
https://wiki.gentoo.org/wiki/Raspberry_Pi

I'm trying to follow the "Cross Compile" options instead of using QEMU/chroot.

(My background - I understand cross compiling environments quite well. I'm a mediocre portage user. I'm able to maintain my various gentoo boxes - both real and virtual - without too much fumbling about. I understand at a high level well portage is doing, but don't get into the nitty gritty details all too often. I've hacked an ebuild once or twice successfully)

The cross-compiled environment is setup, and seems to work - (cross toolchain installed, and tested).

I'm moving on to doing my first cross-compile emerge, per the instructions. I've setup my CBUILD, CHOST, ROOT, and PORTAGE_CONFIGROOT are all set. I run the emerge and it fails quickly:
Code:
mace:/data/raspberry_pi/image2) # echo $CHOST
armv7a-hardfloat-linux-gnueabi
(mace:/data/raspberry_pi/image2) # echo $CBUILD
x86_64-pc-linux
(mace:/data/raspberry_pi/image2) # echo $ROOT
/data/raspberry_pi/image2
(mace:/data/raspberry_pi/image2) # echo $PORTAGE_CONFIGROOT
/data/raspberry_pi/image2
mace:/data/raspberry_pi/image2) # armv7a-hardfloat-linux-gnueabi-emerge -av sys-kernel/raspberrypi-sources


The errors: (build.log)
Code:

(mace:/data/raspberry_pi/image2) # more /var/tmp/portage/sys-kernel/raspberrypi-sources-4.14.9999/temp/build.log
 * Package:    sys-kernel/raspberrypi-sources-4.14.9999
 * Repository: gentoo
 * Maintainer: xmw@gentoo.org
 * USE:        arm elibc_glibc kernel_linux userland_GNU
 * FEATURES:   preserve-libs sandbox userpriv usersandbox
>>> Preparing to unpack ...
>>> Unpacking source...
 * EGIT_PROJECT has been removed. Instead, the eclass determines
 * the local clone path using path in canonical EGIT_REPO_URI.
 * If the current algorithm causes issues for you, please report a bug.
 * ERROR: sys-kernel/raspberrypi-sources-4.14.9999::gentoo failed (unpack phase):
 *   EGIT_PROJECT is no longer necessary.
 *
 * Call stack:
 *     ebuild.sh, line  115:  Called src_unpack
 *   environment, line 4219:  Called git-r3_src_unpack
 *   environment, line 2344:  Called _git-r3_env_setup
 *   environment, line  317:  Called die
 * The specific snippet of code:
 *           die "EGIT_PROJECT is no longer necessary.";
 *
 * If you need support, post the output of `emerge --info '=sys-kernel/raspberrypi-sources-4.14.9999::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-kernel/raspberrypi-sources-4.14.9999::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-kernel/raspberrypi-sources-4.14.9999/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-kernel/raspberrypi-sources-4.14.9999/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-kernel/raspberrypi-sources-4.14.9999/work'
 * S: '/var/tmp/portage/sys-kernel/raspberrypi-sources-4.14.9999/work/linux-4.14.9999-raspberrypi'


emerge --info
Code:
(mace:/data/raspberry_pi/image2) # emerge --info '=sys-kernel/raspberrypi-sources-4.14.9999::gentoo'
Portage 2.3.8 (python 3.4.5-final-0, !../../usr/portage/profiles/default/linux/arm/13.0/armv7a, gcc-4.9.4, glibc-2.22-r4, 4.12.12-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.12.12-gentoo-x86_64-Intel-R-_Core-TM-_i3-6300_CPU_@_3.80GHz-with-gentoo-2.3
KiB Mem:    32617784 total,   2724556 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Mon, 16 Oct 2017 20:00:01 +0000
Head commit of repository gentoo: cb26b30a4eef99c6098f74a7963911ef8ca0c23f
sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.28.1 p1.0) 2.28.1
app-shells/bash:          4.3_p48::gentoo
dev-lang/perl:            5.22.2::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.3-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.21.7::gentoo
sys-apps/sandbox:         2.10-r1::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.4::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r4::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

ACCEPT_KEYWORDS="arm"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux"
CFLAGS="-O2 -pipe -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard"
CHOST="armv7a-hardfloat-linux-gnueabi"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe -march=armv7-a"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=armv7-a"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/data/raspberry_pi/image2/"
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 armv5te armv6 armv6t2 berkdb bzip2 cli cracklib crypt cxx dri fortran gdbm iconv ipv6 modules ncurses nls nptl openmp pam pcre readline seccomp session ssl tcpd unicode xattr zlib" 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="kexi words flow plan sheets stage tables krita karbon braindump author" 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 isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby22" 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 steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


The warnings about EGIT_PROJECT seem very suspect. It looks to me some sort of low level portage setup problem (not ARM related at all - hence the question in this group) But this is getting into very low level ebuild details, that frankly, I'm unfamiliar with. My google-fu on "EGIT_PROJECT" isn't hitting things that I think are right.

Any suggestions appreciated.

Thanks,

Mark
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Sat Oct 21, 2017 10:31 am    Post subject: Reply with quote

Hello MarkCu!

MarkCu wrote:
The warnings about EGIT_PROJECT seem very suspect. It looks to me some sort of low level portage setup problem (not ARM related at all - hence the question in this group) But this is getting into very low level ebuild details, that frankly, I'm unfamiliar with. My google-fu on "EGIT_PROJECT" isn't hitting things that I think are right.


The warning is not suspect (see also bug 633542). Look at the file /var/tmp/portage/sys-kernel/raspberrypi-sources-4.xx.xxxx/temp/environment

N.B: The exact line number is indicated in the emerge log. Replace xx.xxxx placeholders with the current ebuild version number.

environment:
if [[ -n ${EGIT_PROJECT} ]]; then
    eerror "EGIT_PROJECT has been removed. Instead, the eclass determines";
    eerror "the local clone path using path in canonical EGIT_REPO_URI.";
    eerror "If the current algorithm causes issues for you, please report a bug.";
    die "EGIT_PROJECT is no longer necessary.";
fi;


P.S: The raspberrypi sources were extracted (in my case) without error. I followed the advice: remove EGIT_PROJECT that appears in the ebuild.

helecho.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Oct 21, 2017 10:59 am    Post subject: Reply with quote

MarkCu,

This guide covers fetching, building and installing the kernel for a Raspberry Pi 3 in 64 bit mode.

Where that guide says
Code:
ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- ...
you use
Code:
ARCH=arm CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- ...
instead.

Code:
emerge sys-kernel/raspberrypi-sources-4.14.9999::gentoo
does the git clone in the above guide for you.

Hint: Use the 4.9 kernel branch to get started. It gets all the fixes first.
Not everything is supported by 4.14 yet.
_________________
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
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Oct 21, 2017 10:59 am    Post subject: Reply with quote

Moved from Portage & Programming to Gentoo on 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
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Sat Oct 21, 2017 3:21 pm    Post subject: Reply with quote

It seems that the migration to git-r3 (eclass) broke the ebuilds.
Back to top
View user's profile Send private message
MarkCu
n00b
n00b


Joined: 28 Nov 2012
Posts: 19

PostPosted: Mon Oct 23, 2017 3:09 pm    Post subject: Reply with quote

After realizing the ebuild didn't work even in my normal X86 hosts - I just ended up using git to manually pull down the Raspberry Pi sources, and manually installing them under /usr/src/linux. From my (very novice) read of the ebuild - I don't think it's applying any patches - just doing the git download.

@NeddySeagoon - thanks for the pointer to the 64-bit mode guide. However, I followed the advice in the header of that guide - noting that this should all be considered unstable. My thinking was that the 32-bit support should be more stable, and require less hacking on my part. (And nothing that I'm going to do with my first instance of the Pi would justify the need for 64-bit). I'm quickly learning that whatever solution I end with - will require (perhaps significant) hacking.

I have bootable (32-bit) image now running gentoo on the Pi. But am still having a devil of a time getting everything up at the moment. No specific show-stoppers that I don't think I can handle. It's just taken quite a bit more hacking that I imagined. Biggest problem is I can't get portage to build gcc. It's not worked in crossdev, qemu/chroot, nor NATIVELY on the Pi. I've had to add the --exclude gcc to many emerge operations.

But I'm hacking through things.

Thanks for the help.

--Mark
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Mon Oct 23, 2017 5:54 pm    Post subject: Reply with quote

MarkCu,

Cross compiling gcc itself can be a challenge but it should build on the Pi.
You will probably need MAKEOPTS="-j1" and no Xorg running or you are likely to trigger the OOM manager, which will kill a compile job.
Look in dmesg ... you won't miss it there.

The build log will say something about job ... killed.

Homework: Portage can manage per package MAKEOPTS settings, and many others too.
Set up your system to build gcc without setting MAKEOPTS either in make.conf or on the command line.
You will need this approach for a number of packages.

64 bit mostly works on the Pi. The biggest problem is that you don't know until you try it as a lot of things are not keyworded.
_________________
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
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