Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
What is wrong with my cross compile setup ?
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
costel78
Guru
Guru


Joined: 20 Apr 2007
Posts: 407

PostPosted: Sat Aug 10, 2019 8:58 pm    Post subject: What is wrong with my cross compile setup ? Reply with quote

I tried to compile for Raspberry pi 4 on my amd64 machine as fast a possible.
So I use, also, crossdev without any chroot. I said also, because not all packages compile that way.

But with aarch64-unknown-linux-gnu-emerge -pve system I got:

Code:
aarch64-unknown-linux-gnu-emerge -pve system

These are the packages that would be merged, in order:

Calculating dependencies                                          ... done!
[ebuild   R    ] sys-libs/zlib-1.2.11-r2:0/1::gentoo to /usr/aarch64-unknown-linux-gnu/ USE="minizip (split-usr) static-libs" 0 KiB
[ebuild   R    ] sys-libs/zlib-1.2.11-r2:0/1::gentoo  USE="minizip (split-usr) static-libs" 0 KiB
[ebuild   R    ] dev-lang/python-exec-2.4.6-r1:2::gentoo  PYTHON_TARGETS="(jython2_7) (pypy) (pypy3) (python2_7) (python3_5) (python3_6) (python3_7)" 0 KiB
[ebuild   R    ] virtual/libintl-0-r2::gentoo to /usr/aarch64-unknown-linux-gnu/ 0 KiB
[ebuild   R    ] virtual/libintl-0-r2::gentoo  0 KiB
[ebuild   R    ] app-arch/xz-utils-5.2.4-r3::gentoo  USE="extra-filters nls (split-usr) threads -static-libs" 0 KiB
[ebuild   R    ] sys-libs/ncurses-6.1_p20190609:0/6::gentoo to /usr/aarch64-unknown-linux-gnu/ USE="cxx (split-usr) threads (tinfo) unicode (-ada) -debug -doc -gpm -minimal -profile -static-libs -test -trace" 0 KiB
[ebuild   R    ] app-arch/bzip2-1.0.8:0/1::gentoo  USE="(split-usr) -static -static-libs" 0 KiB
[ebuild   R    ] dev-lang/python-exec-2.4.6-r1:2::gentoo to /usr/aarch64-unknown-linux-gnu/ PYTHON_TARGETS="(python2_7) (python3_5) (python3_6) (python3_7) (-jython2_7) (-pypy) (-pypy3)" 0 KiB
[ebuild   R    ] app-arch/bzip2-1.0.8:0/1::gentoo to /usr/aarch64-unknown-linux-gnu/ USE="(split-usr) -static -static-libs" 0 KiB
[ebuild   R    ] sys-apps/attr-2.4.48-r3::gentoo to /usr/aarch64-unknown-linux-gnu/ USE="nls (split-usr) static-libs -debug" 0 KiB
[ebuild   R    ] sys-apps/attr-2.4.48-r3::gentoo  USE="nls (split-usr) static-libs -debug" 0 KiB
[ebuild   R    ] dev-libs/gmp-6.1.2-r1:0/10.4::gentoo to /usr/aarch64-unknown-linux-gnu/ USE="asm cxx -doc -static-libs" 0 KiB
[ebuild   R    ] dev-libs/gmp-6.1.2-r1:0/10.4::gentoo  USE="asm cxx -doc -static-libs" 0 KiB
[ebuild   R    ] virtual/libiconv-0-r2::gentoo to /usr/aarch64-unknown-linux-gnu/ 0 KiB
[ebuild   R    ] virtual/libiconv-0-r2::gentoo  0 KiB
....
[ebuild   R    ] media-libs/libepoxy-1.5.3-r1::gentoo  USE="X egl -test" 0 KiB
[ebuild   R    ] media-libs/libepoxy-1.5.3-r1::gentoo to /usr/aarch64-unknown-linux-gnu/ USE="X egl -test" 0 KiB
[ebuild   R    ] virtual/rust-1.36.0::gentoo  0 KiB
[ebuild   R    ] dev-python/setuptools-41.0.1::gentoo to /usr/aarch64-unknown-linux-gnu/ USE="-test" PYTHON_TARGETS="python2_7 python3_7 (-pypy) (-pypy3) -python3_5 -python3_6" 0 KiB
[ebuild   R   #] app-portage/gemato-14.1m::gentoo to /usr/aarch64-unknown-linux-gnu/ USE="blake2 bzip2 gpg -lzma -sha3 -test -tools" PYTHON_TARGETS="python2_7 python3_7 (-pypy) -python3_5 -python3_6" 0 KiB
[ebuild   R    ] dev-python/pyxattr-0.6.1::gentoo to /usr/aarch64-unknown-linux-gnu/ USE="-doc -test" PYTHON_TARGETS="python2_7 python3_7* (-pypy) -python3_5 -python3_6*" 0 KiB
[ebuild   R    ] dev-python/certifi-2018.11.29::gentoo to /usr/aarch64-unknown-linux-gnu/ PYTHON_TARGETS="python2_7 python3_7 (-pypy) (-pypy3) -python3_5 -python3_6" 0 KiB

Total: 628 packages (1 upgrade, 5 new, 622 reinstalls), Size of downloads: 0 KiB


Why are the main system packages included ? It is by design ?

Code:
gentoo ~ # cat /usr/aarch64-unknown-linux-gnu/etc/portage/make.conf
CHOST="aarch64-unknown-linux-gnu"
CBUILD=x86_64-pc-linux-gnu
HOSTCC=${CBUILD}-gcc
ROOT=/usr/${CHOST}/
ACCEPT_KEYWORDS="${ARCH} ~${ARCH}"
PKG_CONFIG_PATH="${ROOT}usr/lib/pkgconfig/"

ACCEPT_LICENSE="*"
AUTOCLEAN="yes"
CLEAN_DELAY="3"
COLLISION_IGNORE="/bin /lib /lib64 /sbin /usr /var"
DISTDIR="/mnt/linux/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=3 --load-average=10 --keep-going --with-bdeps=y --complete-graph --quiet-build=n --autounmask-write"
FEATURES="assume-digests candy cgroup collision-protect -distcc distlocks -ebuild-locks fail-clean -ipc-sandbox merge-sync news nodoc noinfo parallel-fetch parallel-install -pid-sandbox preserve-libs protect-owned -sandbox sfperms strict unmerge-orphans unknown-features-filter unknown-features-warn -usersandbox"
FETCHCOMMAND="/usr/bin/wget --timeout=10 -t 2 --passive-ftp --no-check-certificate -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
GENTOO_MIRRORS="http://ftp.romnet.org/gentoo/ ftp://ftp.romnet.org/gentoo/ http://distfiles.gentoo.org/"
I_KNOW_WHAT_I_AM_DOING=1
INPUT_DEVICES="evdev synaptics"
INSTALL_MASK="${ROOT}usr/share/locale -${ROOT}usr/share/locale/ro -${ROOT}usr/share/locale/en -${ROOT}usr/share/locale/en_US"
LANG="ro_RO.UTF-8"
LC_ALL="ro_RO.UTF-8"
LC_MESSAGES=C
L10N="ro en"
LLVM_TARGETS="BPF AArch64"
MAKEOPTS="-j9 --load-average=11"
NGINX_MODULES_HTTP="access auth_basic autoindex browser charset fastcgi gunzip gzip limit_conn limit_req memcached naxsi realip referer rewrite split_clients userid"
PHP_TARGETS="php7-3"
PORTDIR="${ROOT}var/db/repos/gentoo"
PKGDIR="${ROOT}var/cache/binpkgs"
PORTAGE_NICENESS="19"
PORTAGE_RSYNC_EXTRA_OPTS="--human-readable --delete-before --progress"
PYTHON_SINGLE_TARGET="python3_7"
PYTHON_TARGETS="python2_7 python3_7"
RESUMECOMMAND="/usr/bin/wget -c --timeout=10 -t 2 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
RUBY_TARGETS="ruby26"
USE="${ARCH} -static-libs X aac acpi alsa branding cairo caps -consolekit cups dbus -doc encode fam flac gif gles1 gles2 gpm gtk gtk3 icu jpeg -ldap lm_sensors lz4 mp3 mpeg ogg opengl opus pango pdf png policykit pulseaudio -qt5 server svg systemd threads truetype udev udisks usb vhosts vorbis x264"
VIDEO_CARDS="fbdev vc4"
WANT_MP="true"

ARM_FLAGS="-march=armv8-a+crc+simd -mtune=cortex-a72"
FOPTIM="-fgraphite-identity -floop-nest-optimize -fgcse-las"
CFLAGS="-O2 -pipe -ftree-vectorize -fomit-frame-pointer ${ARM_FLAGS} ${FOPTIM}"
CXXFLAGS="${CFLAGS}"
LDFLAGS="-Wl,-O1,--sort-common,--hash-style=gnu,--enable-new-dtags,--as-needed,-z,relro,-z,now"

PORTAGE_BINHOST="https://cweb.ro/arm64"

_________________
Sorry for my English. I'm still learning this language.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Aug 10, 2019 9:11 pm    Post subject: Reply with quote

costel78,

Code:
aarch64-unknown-linux-gnu-emerge -pve system


-e means --emptytree. You are telling portage to assume that nothing is installed.

Please use @system and @world. Get used to the set namespace.
There are other predefined sets and you can define your own sets.
_________________
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
costel78
Guru
Guru


Joined: 20 Apr 2007
Posts: 407

PostPosted: Sun Aug 11, 2019 5:35 am    Post subject: Reply with quote

I forgot to mention, it is the same result with emerge -pve @system.
Is there any way to isolate and recompile only "/usr/aarch64-unknown-linux-gnu/" packages ?

Thank you!
_________________
Sorry for my English. I'm still learning this language.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun Aug 11, 2019 9:20 am    Post subject: Reply with quote

costel78,

Two things ...
Do not use the -e option. That says to pretend that noting is installed and to rebuild everything.
Your output is expected.

To update your arm64 packages use
Code:
emerge-wrapper -t aarch64-unknown-linux-gnu --init
aarch64-unknown-linux-gnu-emerge -uDUav @world --keep-going


Notice your original output says
Code:
to /usr/aarch64-unknown-linux-gnu/
so the output code is going to the right place.

If you want to recompile everything your original command is correct, although @world is safer.
To update, use the command I gave above.

Why do you want to recompile all your arm64 code?

-- edit --
I just noticed in your snippet that everything is there twice.

I suspect you missed the
Code:
emerge-wrapper -t aarch64-unknown-linux-gnu --init
is the shell that you want to run aarch64-unknown-linux-gnu-emerge in
_________________
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
costel78
Guru
Guru


Joined: 20 Apr 2007
Posts: 407

PostPosted: Thu Aug 15, 2019 10:32 am    Post subject: Reply with quote

I am very sorry for the delay, been very busy last days.

Yes I did emerge-wrapper -t aarch64-unknown-linux-gnu --init, right after crossdev -t aarch64-unknown-linux-gnu --init-target and crossdev -t aarch64-unknown-linux-gnu.
aarch64-unknown-linux-gnu-emerge and/or emerge-wrapper -t aarch64-unknown-linux-gnu does not help me to recompile all packages in /user/aarch64-unknown-linux-gnu. I want to recompile them because of gcc-9.2.0.
So, until better ideea I came up with:
Code:
#!/bin/bash
mkdir /tmp/costel &>/dev/null
cd /tmp/costel
rm system_list.txt world_list.txt /var/log/portage/elog/summary* &>/dev/null
export exclusion=`cat /home/costel/exclusions.txt`
export excluded_ebuilds='gcc-9\|llvm-8\|clang-8\|openjdk\|firefox\|thunderbird\|libreoffice-6\|chromium'
for f in `aarch64-unknown-linux-gnu-emerge -pe system | grep ebuild | grep '/usr/aarch64-unknown-linux-gnu/' | grep -v $exclusion | grep -v $excluded_ebuilds | gawk '{print $4;}'` ; do echo -n " ="$f ; done > system_list.txt
for f in `aarch64-unknown-linux-gnu-emerge -pe world | grep ebuild | grep '/usr/aarch64-unknown-linux-gnu/' | grep -v $exclusion | grep -v $excluded_ebuilds | gawk '{print $4;}'` ; do echo -n " ="$f ; done > world_list.txt
unset excluded_ebuilds
unset exclusion
MAKEOPTS="-j8 -l10" aarch64-unknown-linux-gnu-emerge -O1 `cat system_list.txt`
MAKEOPTS="-j8 -l10" aarch64-unknown-linux-gnu-emerge -O1 `cat world_list.txt`


/home/costel/exclusions.txt contain the packages which refuze to compile using "plain" cross-compile. Right now there are a little over 120 packages.
On top of everything else, raspberry pi did not arrive yet.
_________________
Sorry for my English. I'm still learning this language.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Thu Aug 15, 2019 7:24 pm    Post subject: Reply with quote

costel78,

As of yesterday, the Pi Foundation 4.19.y kernel supports 4G RAM in 64 bit mode.

You may find my BINHOST useful if you are looking for some shortcuts too.
_________________
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