Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[s] cross-compile/qemu-chroot, dependency resolution failure
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
Treborius
Guru
Guru


Joined: 18 Oct 2005
Posts: 585
Location: Berlin

PostPosted: Sat Dec 30, 2017 10:32 am    Post subject: [s] cross-compile/qemu-chroot, dependency resolution failure Reply with quote

i followed this guide: https://wiki.gentoo.org/wiki/Cross_build_environment
to build a cross-compiler for my arm-soc

i prefer the crosscompiler on the host because its faster (no emulation needed) BUT
it often calculates the dependency-graph for a package wrong, i.e.

Code:

#armv7a-hardfloat-linux-gnueabi-emerge -p mesa


gives me :
Code:

Calculating dependencies... done!
[ebuild  N     ] x11-libs/libxcb-1.12-r2 to /usr/armv7a-hardfloat-linux-gnueabi/ USE="-doc (-selinux) -static-libs {-test} -xkb"
[ebuild  N     ] x11-libs/libX11-1.6.5 to /usr/armv7a-hardfloat-linux-gnueabi/ USE="ipv6 -doc -static-libs {-test}"
[ebuild  N     ] sys-devel/llvm-5.0.1 to /usr/armv7a-hardfloat-linux-gnueabi/ USE="libffi ncurses -debug -doc -gold -libedit {-test}" LLVM_TARGETS="(ARM) BPF -AArch64 -AMDGPU -Hexagon -Lanai -MSP430 -Mips -NVPTX -PowerPC -Sparc -SystemZ -X86 -XCore"
[ebuild  N     ] x11-libs/libXfixes-5.0.3 to /usr/armv7a-hardfloat-linux-gnueabi/ USE="-static-libs"
[ebuild  N     ] x11-libs/libXext-1.3.3 to /usr/armv7a-hardfloat-linux-gnueabi/ USE="-doc -static-libs"
[ebuild  N     ] x11-libs/libXxf86vm-1.1.4 to /usr/armv7a-hardfloat-linux-gnueabi/ USE="-static-libs"
[ebuild  N     ] x11-libs/libXdamage-1.1.4-r1 to /usr/armv7a-hardfloat-linux-gnueabi/ USE="-static-libs"
[ebuild  N     ] media-libs/mesa-17.3.1 to /usr/armv7a-hardfloat-linux-gnueabi/ USE="classic dri3 egl gallium gbm llvm nptl -bindist -d3d9 -debug -gles1 -gles2 (-opencl) (-openmax) -osmesa -pax_kernel -pic (-selinux) -unwind (-vaapi) -valgrind (-vdpau) (-vulkan) -wayland -xa -xvmc" VIDEO_CARDS="-freedreno (-i915) (-i965) -imx (-intel) (-nouveau) (-r100) (-r200) (-r300) (-r600)


if i do the same in the chroot, i get :
Code:

Calculating dependencies... done!
[ebuild  N     ] app-crypt/rhash-1.3.5  USE="nls -debug -openssl -static-libs"
[ebuild  N     ] media-fonts/font-util-1.3.1
[ebuild  N     ] x11-misc/util-macros-1.19.1
[ebuild  N     ] x11-proto/dri2proto-2.8-r1
[ebuild  N     ] x11-proto/presentproto-1.1
[ebuild  N     ] x11-proto/dri3proto-1.0
[ebuild  N     ] x11-proto/glproto-1.4.17-r1
[ebuild  N     ] x11-proto/xf86driproto-2.1.1-r1
[ebuild  N     ] dev-libs/libuv-1.18.0  USE="-static-libs"
[ebuild  N     ] net-misc/curl-7.57.0  USE="ipv6 ssl -adns -http2 -idn -kerberos -ldap -metalink -rtmp -samba -ssh -static-libs {-test} -threads" CURL_SSL="openssl -axtls -gnutls -libressl -mbedtls -nss (-winssl)"
[ebuild  N     ] app-arch/libarchive-3.3.2  USE="acl bzip2 e2fsprogs iconv lzma threads xattr zlib -expat -libressl -lz4 -lzo -nettle -static-libs"
[ebuild  N     ] x11-proto/xcb-proto-1.12-r2  PYTHON_TARGETS="python2_7 python3_5 -python3_4 -python3_6"
[ebuild  N     ] x11-libs/libxcb-1.12-r2  USE="-doc (-selinux) -static-libs {-test} -xkb"
[ebuild  N     ] dev-util/cmake-3.10.1  USE="ncurses -doc -emacs -qt5 -server -system-jsoncpp {-test}"
[ebuild  N     ] x11-libs/libX11-1.6.5  USE="ipv6 -doc -static-libs {-test}"
[ebuild  N     ] sys-devel/llvm-5.0.1  USE="libffi ncurses -debug -doc -gold -libedit {-test}" LLVM_TARGETS="(ARM) BPF -AArch64 -AMDGPU -Hexagon -Lanai -MSP430 -Mips -NVPTX -PowerPC -Sparc -SystemZ -X86 -XCore"
[ebuild  N     ] x11-libs/libXfixes-5.0.3  USE="-static-libs"
[ebuild  N     ] x11-libs/libXext-1.3.3  USE="-doc -static-libs"
[ebuild  N     ] x11-libs/libXdamage-1.1.4-r1  USE="-static-libs"
[ebuild  N     ] x11-libs/libXxf86vm-1.1.4  USE="-static-libs"
[ebuild  N     ] media-libs/mesa-17.3.1  USE="classic dri3 egl gallium gbm llvm nptl -bindist -d3d9 -debug -gles1 -gles2 (-opencl) (-openmax) -osmesa -pax_kernel -pic (-selinux) -unwind (-vaapi) -valgrind (-vdpau) (-vulkan) -wayland -xa -xvmc" VIDEO_CARDS="-freedreno (-i915) (-i965) -imx (-intel) (-nouveau) (-r100) (-r200) (-r300) (-r600) (-radeon) (-radeonsi) -vc4 -virgl -vivante (-vmware)"


just to note : portage in the chroot calculates the right deps!

the strange thing is : #emerge --info outputs the same in both environments
Code:

Portage 2.3.19 (python 3.5.4-final-0, default/linux/arm/17.0/armv7a, gcc-7.2.0, glibc-2.26-r3, 4.14.8-gentoo-r1 armv7l)
=================================================================
System uname: Linux-4.14.8-gentoo-r1-armv7l-Intel-R-_Core-TM-_i5-6400_CPU_@_2.70GHz-with-gentoo-2.4.1
KiB Mem:     8116284 total,   3499044 free
KiB Swap:    8191996 total,   5486152 free
Timestamp of repository gentoo: Fri, 29 Dec 2017 20:00:01 +0000
Head commit of repository gentoo: dbf18dc1588ec9531de896551fcffc5aa038793b
sh bash 4.4_p12
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.4_p12::gentoo
dev-lang/perl:            5.26.1-r1::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.5.4-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.11::gentoo
sys-apps/sandbox:         2.12::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, 2.29.1-r1::gentoo
sys-devel/gcc:            7.2.0::gentoo
sys-devel/gcc-config:     1.9.1::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.2.1-r1::gentoo
sys-kernel/linux-headers: 4.14::gentoo (virtual/os-headers)
sys-libs/glibc:           2.26-r3::gentoo
Repositories:

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

ACCEPT_KEYWORDS="arm ~arm"
ACCEPT_LICENSE="* -@EULA"
CBUILD="armv7a-hardfloat-linux-gnueabi"
CFLAGS="-Os -pipe -march=armv7-a -mfpu=neon -mfloat-abi=hard"
CHOST="armv7a-hardfloat-linux-gnueabi"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-Os -pipe -march=armv7-a -mfpu=neon -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 nodoc noinfo noman 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="de_DE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/armv7a-hardfloat-linux-gnueabi/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="/usr/armv7a-hardfloat-linux-gnueabi/tmp/"
USE="acl arm armv5te armv6 armv6t2 berkdb bzip2 cli cracklib crypt cxx dri fortran gdbm iconv ipv6 modules ncurses nls nptl openmp 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 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_5" 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, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


can somebody explain this to me, or even can solve my little problem?
_________________
Systems running gentoo :
Desktop, Laptop, ZOTAC AD-10 media-center, odroid-xu4 server / wLan-router


Last edited by Treborius on Sat Dec 30, 2017 5:31 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Dec 30, 2017 10:46 am    Post subject: Reply with quote

Treborius,

Add --tree to your emerge commands. It will show the dependencies.
That may shed some light on things.
_________________
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
Treborius
Guru
Guru


Joined: 18 Oct 2005
Posts: 585
Location: Berlin

PostPosted: Sat Dec 30, 2017 11:35 am    Post subject: Reply with quote

NeddySeagoon wrote:
Treborius,

Add --tree to your emerge commands. It will show the dependencies.
That may shed some light on things.


--tree makes me wonder even more 8O

#armv7a-hardfloat-linux-gnueabi-emerge -pvt mesa
Code:

Calculating dependencies... done!
[ebuild  N     ] media-libs/mesa-17.3.1::gentoo to /usr/armv7a-hardfloat-linux-gnueabi/ USE="classic dri3 egl gallium gbm llvm nptl -bindist -d3d9 -debug -gles1 -gles2 (-opencl) (-openmax) -osmesa -pax_kernel -pic (-selinux) -unwind (-vaapi) -valgrind (-vdpau) (-vulkan) -wayland -xa -xvmc" VIDEO_CARDS="-freedreno (-i915) (-i965) -imx (-intel) (-nouveau) (-r100) (-r200) (-r300) (-r600) (-radeon) (-radeonsi) -vc4 -virgl -vivante (-vmware)" 0 KiB
[ebuild  N     ]  x11-libs/libXdamage-1.1.4-r1::gentoo to /usr/armv7a-hardfloat-linux-gnueabi/ USE="-static-libs" 0 KiB
[ebuild  N     ]  x11-libs/libXxf86vm-1.1.4::gentoo to /usr/armv7a-hardfloat-linux-gnueabi/ USE="-static-libs" 0 KiB
[ebuild  N     ]   x11-libs/libXext-1.3.3::gentoo to /usr/armv7a-hardfloat-linux-gnueabi/ USE="-doc -static-libs" 0 KiB
[ebuild  N     ]  x11-libs/libXfixes-5.0.3::gentoo to /usr/armv7a-hardfloat-linux-gnueabi/ USE="-static-libs" 0 KiB
[ebuild  N     ]   x11-libs/libX11-1.6.5::gentoo to /usr/armv7a-hardfloat-linux-gnueabi/ USE="ipv6 -doc -static-libs {-test}" 0 KiB
[ebuild  N     ]    x11-libs/libxcb-1.12-r2:0/1.12::gentoo to /usr/armv7a-hardfloat-linux-gnueabi/ USE="-doc (-selinux) -static-libs {-test} -xkb" 0 KiB


in the chroot :
Code:

[ebuild  N     ] media-libs/mesa-17.3.1::gentoo  USE="classic dri3 egl gallium gbm llvm nptl -bindist -d3d9 -debug -gles1 -gles2 (-opencl) (-openmax) -osmesa -pax_kernel -pic (-selinux) -unwind (-vaapi) -valgrind (-vdpau) (-vulkan) -wayland -xa -xvmc" VIDEO_CARDS="-freedreno (-i915) (-i965) -imx (-intel) (-nouveau) (-r100) (-r200) (-r300) (-r600) (-radeon) (-radeonsi) -vc4 -virgl -vivante (-vmware)" 0 KiB
[ebuild  N     ]  x11-libs/libXdamage-1.1.4-r1::gentoo  USE="-static-libs" 0 KiB
[ebuild  N     ]  x11-libs/libXxf86vm-1.1.4::gentoo  USE="-static-libs" 0 KiB
[ebuild  N     ]   x11-libs/libXext-1.3.3::gentoo  USE="-doc -static-libs" 0 KiB
[ebuild  N     ]  x11-libs/libXfixes-5.0.3::gentoo  USE="-static-libs" 0 KiB
[ebuild  N     ]   x11-libs/libX11-1.6.5::gentoo  USE="ipv6 -doc -static-libs {-test}" 0 KiB
[ebuild  N     ]    x11-libs/libxcb-1.12-r2:0/1.12::gentoo  USE="-doc (-selinux) -static-libs {-test} -xkb" 0 KiB
[ebuild  N     ]     x11-proto/xcb-proto-1.12-r2::gentoo  PYTHON_TARGETS="python2_7 python3_5 -python3_4 -python3_6" 0 KiB
[ebuild  N     ]  x11-proto/glproto-1.4.17-r1::gentoo  0 KiB
[ebuild  N     ]  x11-proto/dri3proto-1.0::gentoo  0 KiB
[ebuild  N     ]  x11-proto/dri2proto-2.8-r1::gentoo  0 KiB


so the cross-compiler is somehow missing dri{2,3}proto ...
_________________
Systems running gentoo :
Desktop, Laptop, ZOTAC AD-10 media-center, odroid-xu4 server / wLan-router
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Dec 30, 2017 12:31 pm    Post subject: Reply with quote

Treborius,

I have a sort of theory but no idea how to test it.

If
Code:
[ebuild  N     ]     x11-proto/xcb-proto-1.12-r2::gentoo  PYTHON_TARGETS="python2_7 python3_5 -python3_4 -python3_6" 0 KiB
[ebuild  N     ]  x11-proto/glproto-1.4.17-r1::gentoo  0 KiB
[ebuild  N     ]  x11-proto/dri3proto-1.0::gentoo  0 KiB
[ebuild  N     ]  x11-proto/dri2proto-2.8-r1::gentoo  0 KiB
are build time dependencies only and they are installed outside the chroot, then the cross compiler can use them.
That is, the build process requires them but they are not used at run time, so they are not required in the chroot.

In the chroot, these packages are not available and are required by the build process.
Lets look at one example ebuild

x11-libs/libxcb-1.12-r2.ebuild:
RDEPEND=">=dev-libs/libpthread-stubs-0.3-r1[${MULTILIB_USEDEP}]
        >=x11-libs/libXau-1.0.7-r1[${MULTILIB_USEDEP}]
        >=x11-libs/libXdmcp-1.1.1-r1[${MULTILIB_USEDEP}]"
# Note: ${PYTHON_USEDEP} needs to go verbatim
DEPEND="${RDEPEND}
        test? ( dev-libs/check[${MULTILIB_USEDEP}] )
        doc? ( app-doc/doxygen[dot] )
        dev-libs/libxslt
        ${PYTHON_DEPS}
        $(python_gen_any_dep \
                ">=x11-proto/xcb-proto-1.12-r1[${MULTILIB_USEDEP},\${PYTHON_USEDEP}]")"


RDEPEND means RuntimeDEPEND
DEPEND means things needed to build. ${RDEPEND} is included here.

Notice that x11-proto/xcb-proto is a build time dependency of x11-libs/libxcb, not a run time dependency, so if you are cross compiling and already have x11-proto/xcb-proto, its not needed to be installed inside the chroot.

I've had a quick look at the DEPEND in media-libs/mesa-17.3.1.ebuild and it looks to need the other things at build time. mesa is a much more complex ebuild.

It looks like both emerge lists are correct.
_________________
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
Treborius
Guru
Guru


Joined: 18 Oct 2005
Posts: 585
Location: Berlin

PostPosted: Sat Dec 30, 2017 5:30 pm    Post subject: Reply with quote

ok, i always wondered what rdepend means :P

and you seem to be right, see also

https://forums.gentoo.org/viewtopic-t-1071238.html?sid=38eb7a181b127d438ae08076ff0e913a

edit : so the solution is to add
Code:

--root-deps

to the host emerge
_________________
Systems running gentoo :
Desktop, Laptop, ZOTAC AD-10 media-center, odroid-xu4 server / wLan-router
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