FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Embedded

 
 
LinkBack Thread Tools
 
Old 04-28-2008, 09:45 AM
Mike Frysinger
 
Default Emerging into SYSROOT causes packages to install in host system

On Sunday 27 April 2008, Dave Bender wrote:
> I am attempting to cross compile x86 packages on an x86_64 host. In
> particular, when I attempt to emerge baselayout-2 into my SYSROOT path,
> emerge wants to emerge baselayout-2 into my host system. PORTAGE_CONFIGROOT
> is also set to the SYSROOT, so I do not understand why for example,
> package.mask on my host system is taken into account at all when emerge
> determines dependencies.
> I am following the instructions in Chapter 5 of the Embedded Gentoo
> Handbook to the letter and do not understand why this behaviour is
> occurring.

please post the exact commands as well as resulting output. us guessing at
what exactly you're doing simply causes confusion and wastes yours and our
time.
-mike
 
Old 04-28-2008, 05:29 PM
"Dave Bender"
 
Default Emerging into SYSROOT causes packages to install in host system

Ned,
That is exactly the behaviour I see when I try to emerge other
packages like Xorg or cups on my server system. A year ago, I heard
the workaround is to determine all dependencies of a package and then
emerge each one with no-deps. That doesn't seem to be in the handbook
however.

Dave

On Mon, Apr 28, 2008 at 12:54 PM, Ned Ludd <solar@gentoo.org> wrote:
>
>
> On Mon, 2008-04-28 at 05:45 -0400, Mike Frysinger wrote:
> > On Sunday 27 April 2008, Dave Bender wrote:
> > > I am attempting to cross compile x86 packages on an x86_64 host. In
> > > particular, when I attempt to emerge baselayout-2 into my SYSROOT path,
> > > emerge wants to emerge baselayout-2 into my host system. PORTAGE_CONFIGROOT
> > > is also set to the SYSROOT, so I do not understand why for example,
> > > package.mask on my host system is taken into account at all when emerge
> > > determines dependencies.
> > > I am following the instructions in Chapter 5 of the Embedded Gentoo
> > > Handbook to the letter and do not understand why this behaviour is
> > > occurring.
> >
> > please post the exact commands as well as resulting output. us guessing at
> > what exactly you're doing simply causes confusion and wastes yours and our
> > time.
>
> Mike, actually I think I know the bug he is hitting.
> If portage sees that you have a dep not installed on / even if you pass
> ROOT=/somedir SYSCONFIG=/usr/$CTARGET ARCH=arm CHOST=arm-something
> emerge -pvq someapp ; you will get
> [ebuild N ] app-foo/bar
> [ebuild N ] app-foo/bar $ROOT
>
> So if you are using a wrapper and blindly start merging.. Cross compiled
> shit will end up on / despite you not asking for it. Zac says this is
> current expected behavior but I'd outright call it the most fscked up
> portage behavior ever along with the recent INSTALL_MASK= no longer
> working when using -K
>
>
--
gentoo-embedded@lists.gentoo.org mailing list
 
Old 04-28-2008, 06:47 PM
"Dave Bender"
 
Default Emerging into SYSROOT causes packages to install in host system

Extended report:

As I mention in my earlier email, build host is x86_64, target is x86
(specifically c3 processor).
The xmerge command is an exact duplicate of the one presented in the
gentoo embedded handbook.

Here is what I do (play by play):

export SYSROOT=/usr/i686-pc-linux-gnu
export ac_cv_func_malloc_0_nonnull=yes
export ac_cv_func_calloc_0_nonnull=yes
export ac_cv_func_realloc_0_nonnull=yes

I have added the following to SYSROOT directory:

/etc/make.conf
/etc/make.globals -> /etc/make.globals
/etc/make.profile -> /usr/portage/profiles/default-linux/x86/2007.0
/etc/portage/package.keywords

Contents of /etc/make.conf

CFLAGS="-march=c3 -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j3"
ACCEPT_KEYWORDS=""
USE="hal dbus unicode mmx cups jpeg ncurses nls nptl nptlonly pam pdf
pdflib png posix ssl tcpd tiff udev userland_GNU x86 zlib -python
-ipv6 -gtk -gtk2 -gnome -kde -qt -qt3 -qt4 -X -perl"
FEATURES="nodoc"
INPUT_DEVICES=""
VIDEO_CARDS=""
LINGUAS="en_US es_MX zh_CN"

/etc/portage/package.keywords
sys-apps/baselayout ~x86
sys-apps/openrc ~x86

When I run the emerge command:

embedded # ./xmerge baselayout -vp

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

Calculating dependencies |
!!! All ebuilds that could satisfy ">=sys-apps/baselayout-2.0.0" have
been masked.
!!! One of the following masked packages is required to complete your request:
- sys-apps/baselayout-2.0.0 (masked by: ~amd64 keyword)

For more information, see MASKED PACKAGES section in the emerge man page or
refer to the Gentoo Handbook.
(dependency required by "sys-apps/openrc-0.2.2" [ebuild])


So baselayout appears to be masked by ~amd64 keyword, which should be
irrelevant for cross compiling.

Thanks,
Dave

Other notes:

SYSROOT is populated with a /var and /tmp directory. /var contains
further subdirectories.

Here is the output of xmerge ---info

Portage 2.1.4.4 (default-linux/x86/2007.0, gcc-4.2.3, unavailable,
2.6.23-gentoo-r3 x86_64)
================================================== ===============
System uname: 2.6.23-gentoo-r3 x86_64 AMD Athlon(tm) 64 X2 Dual Core
Processor 3800+
Timestamp of tree: Mon, 28 Apr 2008 01:34:01 +0000
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port
3632) [disabled]
app-shells/bash: 3.2_p17-r1
dev-lang/python: 2.4.4-r9
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox: 1.2.18.1-r2
sys-devel/autoconf: 2.13, 2.61-r1
sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils: 2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool: 1.5.26
virtual/os-headers: 2.6.25-r1
ACCEPT_KEYWORDS="x86"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=c3 -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild
/etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=c3 -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer nodoc sandbox sfperms strict
unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org
http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LINGUAS="en_US es_MX zh_CN"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times
--compress --force --whole-file --delete --stats --timeout=180
--exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acl berkdb cli cracklib crypt cups dbus dri fortran gdbm gpm hal
iconv isdnlog jpeg midi mmx mudflap ncurses nls nptl nptlonly openmp
pam pcre pdf pdflib png posix pppd readline reflection session spl ssl
tcpd tiff udev unicode x86 xorg zlib" ALSA_CARDS="ali5451 als4000
atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370
ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3
trident usb-audio via82xx via82xx-modem ymfpci"
ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty
extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw
multi null plug rate route share shm softvol" APACHE2_MODULES="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 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"
ELIBC="glibc" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk
hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_US es_MX zh_CN"
USERLAND="GNU"
Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG,
LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS,
PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

On Mon, Apr 28, 2008 at 1:29 PM, Dave Bender <codehero@gmail.com> wrote:
> Ned,
> That is exactly the behaviour I see when I try to emerge other
> packages like Xorg or cups on my server system. A year ago, I heard
> the workaround is to determine all dependencies of a package and then
> emerge each one with no-deps. That doesn't seem to be in the handbook
> however.
>
> Dave
>
> On Mon, Apr 28, 2008 at 12:54 PM, Ned Ludd <solar@gentoo.org> wrote:
> >
> >
>
>
> > On Mon, 2008-04-28 at 05:45 -0400, Mike Frysinger wrote:
> > > On Sunday 27 April 2008, Dave Bender wrote:
> > > > I am attempting to cross compile x86 packages on an x86_64 host. In
> > > > particular, when I attempt to emerge baselayout-2 into my SYSROOT path,
> > > > emerge wants to emerge baselayout-2 into my host system. PORTAGE_CONFIGROOT
> > > > is also set to the SYSROOT, so I do not understand why for example,
> > > > package.mask on my host system is taken into account at all when emerge
> > > > determines dependencies.
> > > > I am following the instructions in Chapter 5 of the Embedded Gentoo
> > > > Handbook to the letter and do not understand why this behaviour is
> > > > occurring.
> > >
> > > please post the exact commands as well as resulting output. us guessing at
> > > what exactly you're doing simply causes confusion and wastes yours and our
> > > time.
> >
> > Mike, actually I think I know the bug he is hitting.
> > If portage sees that you have a dep not installed on / even if you pass
> > ROOT=/somedir SYSCONFIG=/usr/$CTARGET ARCH=arm CHOST=arm-something
> > emerge -pvq someapp ; you will get
> > [ebuild N ] app-foo/bar
> > [ebuild N ] app-foo/bar $ROOT
> >
> > So if you are using a wrapper and blindly start merging.. Cross compiled
> > shit will end up on / despite you not asking for it. Zac says this is
> > current expected behavior but I'd outright call it the most fscked up
> > portage behavior ever along with the recent INSTALL_MASK= no longer
> > working when using -K
> >
> >
>
--
gentoo-embedded@lists.gentoo.org mailing list
 
Old 04-28-2008, 07:21 PM
"Dave Bender"
 
Default Emerging into SYSROOT causes packages to install in host system

Matthijs,
That is currently the solution I use for x86. The drawbacks are
slower compilation performance (cross compilers running on 64 bit
empirically seem faster) and other overhead caused by chrooting. The
approach also does not extend to other architectures like ARM.
Essentially this approach is a lightweight emulation; taken to its
fullest extent you would be running QEMU to build for these other
architectures.

Dave

On Mon, Apr 28, 2008 at 3:07 PM, Matthijs Kooijman <matthijs@stdin.nl> wrote:
> Hi,
>
>
> > As I mention in my earlier email, build host is x86_64, target is x86
> > (specifically c3 processor).
> If your host is x86_64, wouldn't it make sense to use a x86 chroot as
> development host instead (which would run on your normal x86_64 kernel)? I
> have exactly this setup, and this prevents any sort of cross compilation from
> being necessary.
>
> Gr.
>
> Matthijs
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFIFiCAz0nQ5oovr7wRAs5SAJ0eT0RJIvSzemoFleJhgh skBTzSKQCfQIK3
> xnvNGgZ/hIiUxEUkNWMtFS0=
> =1dkQ
> -----END PGP SIGNATURE-----
>
>
--
gentoo-embedded@lists.gentoo.org mailing list
 
Old 05-04-2008, 12:46 PM
Mike Frysinger
 
Default Emerging into SYSROOT causes packages to install in host system

On Monday 28 April 2008, Dave Bender wrote:
> That is currently the solution I use for x86. The drawbacks are
> slower compilation performance (cross compilers running on 64 bit
> empirically seem faster) and other overhead caused by chrooting. The
> approach also does not extend to other architectures like ARM.
> Essentially this approach is a lightweight emulation; taken to its
> fullest extent you would be running QEMU to build for these other
> architectures.

you could distcc with the host system. i dont know about "other overhead
caused by chrooting" though ... being in a chroot really adds no overhead at
all. while you can argue the non-native point if you were targeting
something non-native, Matthijs point is pretty clear: since you can easily do
native, you probably should as over all it will be a much smoother
development cycle.
-mike
 
Old 05-04-2008, 01:31 PM
"Alon Bar-Lev"
 
Default Emerging into SYSROOT causes packages to install in host system

This is:
http://bugs.gentoo.org/show_bug.cgi?id=201499

Alon.

On 4/28/08, Dave Bender <codehero@gmail.com> wrote:
> Dear list,
> I am attempting to cross compile x86 packages on an x86_64 host. In particular,
> when I attempt to emerge baselayout-2 into my SYSROOT path, emerge wants to
> emerge baselayout-2 into my host system. PORTAGE_CONFIGROOT is also set to the
> SYSROOT, so I do not understand why for example, package.mask on my host system
> is taken into account at all when emerge determines dependencies.
> I am following the instructions in Chapter 5 of the Embedded Gentoo Handbook
> to the letter and do not understand why this behaviour is occurring.
>
> Thanks
> Dave
>
>
> --
> gentoo-embedded@lists.gentoo.org mailing list
>
>
--
gentoo-embedded@lists.gentoo.org mailing list
 
Old 05-04-2008, 02:35 PM
"Dave Bender"
 
Default Emerging into SYSROOT causes packages to install in host system

On Sun, May 4, 2008 at 8:46 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Monday 28 April 2008, Dave Bender wrote:
>> That is currently the solution I use for x86. The drawbacks are
>> slower compilation performance (cross compilers running on 64 bit
>> empirically seem faster) and other overhead caused by chrooting. The
>> approach also does not extend to other architectures like ARM.
>> Essentially this approach is a lightweight emulation; taken to its
>> fullest extent you would be running QEMU to build for these other
>> architectures.
>
> you could distcc with the host system. i dont know about "other overhead

That's an interesting suggestion, I'll look into it.

> caused by chrooting" though ... being in a chroot really adds no overhead at
> all. while you can argue the non-native point if you were targeting

When I use 32bit chroots, some factor slows down file I/O a great
deal. For example I notice that emerge -uDN takes much
longer to do in a 32bit chroot. I use mount bind to share the
/usr/portage directory with the chroot, so I don't think its that
mechanism.
All I know is that updating inside the chroot is much slower.

> something non-native, Matthijs point is pretty clear: since you can easily do
> native, you probably should as over all it will be a much smoother
> development cycle.

Of course working natively always presents the fewest headaches. What
bugs me is that it seems so easy from the Embedded Handbook...

> -mike
>
--
gentoo-embedded@lists.gentoo.org mailing list
 
Old 05-04-2008, 08:03 PM
"Gareth McClean"
 
Default Emerging into SYSROOT causes packages to install in host system

>When I use 32bit chroots, some factor slows down file I/O a great
>deal. For example I notice that emerge -uDN takes much
>longer to do in a 32bit chroot. I use mount bind to share the
>/usr/portage directory with the chroot, so I don't think its that
>mechanism.
>All I know is that updating inside the chroot is much slower.



Do you also mount /proc and /dev to your chroot using the --bind option?



-----Original Message-----
From: Dave Bender [mailto:codehero@gmail.com]
Sent: 04 May 2008 15:35
To: Mike Frysinger
Cc: gentoo-embedded@lists.gentoo.org
Subject: Re: [gentoo-embedded] Emerging into SYSROOT causes packages to
install in host system

<snip>


--
gentoo-embedded@lists.gentoo.org mailing list
 
Old 05-04-2008, 09:46 PM
"Dave Bender"
 
Default Emerging into SYSROOT causes packages to install in host system

I mount bind to /dev; I just mount proc and sysfs normally (which I
think is OK, because they are not block devices)

On Sun, May 4, 2008 at 4:03 PM, Gareth McClean <disneysw@hotmail.com> wrote:
>>When I use 32bit chroots, some factor slows down file I/O a great
>>deal. For example I notice that emerge -uDN takes much
>>longer to do in a 32bit chroot. I use mount bind to share the
>>/usr/portage directory with the chroot, so I don't think its that
>>mechanism.
>>All I know is that updating inside the chroot is much slower.
>
>
>
> Do you also mount /proc and /dev to your chroot using the --bind option?
>
>
>
> -----Original Message-----
> From: Dave Bender [mailto:codehero@gmail.com]
> Sent: 04 May 2008 15:35
> To: Mike Frysinger
> Cc: gentoo-embedded@lists.gentoo.org
> Subject: Re: [gentoo-embedded] Emerging into SYSROOT causes packages to
> install in host system
>
> <snip>
>
>
> --
> gentoo-embedded@lists.gentoo.org mailing list
>
>
--
gentoo-embedded@lists.gentoo.org mailing list
 

Thread Tools




All times are GMT. The time now is 01:09 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org