All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aron Griffis <aron@hp.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>,
	Keir Fraser <keir@xensource.com>,
	Alex Williamson <alex.williamson@hp.com>,
	xen-ia64-devel <xen-ia64-devel@lists.xensource.com>
Subject: Re: Re: [Xen-ia64-devel] cross compiling xen/ia64
Date: Fri, 27 Jun 2008 20:47:46 -0400	[thread overview]
Message-ID: <20080628004745.GA5499@fc.hp.com> (raw)
In-Reply-To: <18522.35708.278831.376228@mariner.uk.xensource.com>

[-- Attachment #1: Type: text/plain, Size: 3320 bytes --]

Hi Ian,

Sorry this took so long.  Xen Summit got in the way of work. ;-)

I've managed to get the cross-building working in an etch chroot.
I think the main difference between your build and mine is that
my build is running in a cron job, so stdin is /dev/null.  That
allows the kernel config to go through without prompting
(accepting defaults, which isn't necessarily ideal, but at least
it allows the automated build to progress).

If it's helpful, here are most of the steps I did after creating
the chroot with debootstrap, bind-mounting some dirs into it, and
installing sudo...

1. Move aside invoke-rc.d so that daemons aren't started in the
   chroot.  Using dpkg-divert makes it stick for future updates.
   See http://www.debian-administration.org/articles/118

   $ sudo dpkg-divert --add --rename --divert /usr/sbin/invoke-rc.d{.real,} 
   $ sudo ln -s /bin/true /usr/sbin/invoke-rc.d

2. Install most of the stuff we need for building the
   cross-compiler and xen.  The underscore on mawk_ causes it to
   be uninstalled so gawk can take its place.

   $ sudo aptitude install mawk_ gawk mercurial dpkg-cross fakeroot 
   $ sudo apt-get build-dep binutils gcc-4.1

3. Install the pre-built cross toolchain from the emdebian
   project.  Unfortunately the emdebian-provided toolchain
   doesn't use the sysroot, but installing it makes things easier
   since it fulfills some cross-deps...

   $ echo 'deb http://www.emdebian.org/debian/ stable main' | \
      sudo tee -a /etc/apt/sources.list
   $ wget -O- http://www.emdebian.org/0x97BB3B58.txt | sudo apt-key add -
   $ sudo aptitude update
   $ sudo aptitude install gcc-4.1-ia64-linux-gnu

4. Prepare to rebuild the toolchain.

   $ echo 'deb-src ftp://ftp.us.debian.org/debian/ stable main' | \
      sudo tee -a /etc/apt/sources.list
   $ sudo aptitude update
   $ mkdir cross-debs
   $ cd cross-debs

5. Rebuild binutils to use the sysroot.

   $ apt-get source binutils
   $ cd binutils-2.17/
   $ patch -p0 < binutils-debian-sysroot.patch  # see attachment
   $ TARGET=ia64 fakeroot debian/rules binary-cross  # see debian/README.cross
   $ cd ..
   $ sudo dpkg -i binutils-ia64-linux-gnu_2.17-3_amd64.deb

6. Unpack the chroot since it's required to build gcc with
   sysroot capability.

   $ wget http://free.linux.hp.com/~agriffis/cross/sys-roots/etch-ia64.tar.gz
   $ sudo tar xzf etch-ia64.tar.gz -C /usr/ia64-linux-gnu
   $ sudo ln -s etch-root /usr/ia64-linux-gnu/sys-root

7. Install another requirement for rebuilding gcc.

   $ wget ftp://ftp.us.debian.org/debian/pool/main/liba/libatomic-ops/libatomic-ops-dev_1.1-4_ia64.deb
   $ sudo dpkg-cross -i -a ia64 libatomic-ops-dev_1.1-4_ia64.deb 

8. Rebuild gcc-4.1 to use the sysroot.

   $ apt-get source gcc-4.1
   $ cd gcc-4.1_4.1.1ds2
   $ export GCC_TARGET=ia64 DEB_CROSS_INDEPENDENT=yes with_sysroot=yes
   $ debian/rules  # see debian/README.cross
   $ dpkg-buildpackage -rfakeroot
   $ cd ..
   $ sudo dpkg -i *amd64.deb *all.deb

9. Build xen.

   $ cd
   $ hg clone http://xenbits.xen.org/xen-unstable.hg
   $ hg clone http://xenbits.xen.org/linux-2.6.18-xen.hg
   $ cd xen-unstable.hg
   $ make XEN_TARGET_ARCH=ia64 CROSS_COMPILE=ia64-linux-gnu- world </dev/null

10. Profit!!!

I'll try to update the wiki to include both Fedora-based and
Debian-based setups.

Thanks,
Aron

[-- Attachment #2: binutils-debian-sysroot.patch --]
[-- Type: text/x-diff, Size: 364 bytes --]

--- debian/rules.sysroot	2008-06-27 17:27:46.000000000 +0000
+++ debian/rules	2008-06-27 17:27:54.000000000 +0000
@@ -501,6 +501,7 @@
 	cd builddir-$(TARGET) \
 	    && env CC="$(CC)" ../configure --host=$(DEB_HOST_GNU_TYPE) \
 	        --build=$(DEB_BUILD_GNU_TYPE) --target=$(TARGET) --prefix=/usr \
+		--with-sysroot=yes \
 		$(ADDITIONAL_TARGETS)
 	touch $@
 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

  parent reply	other threads:[~2008-06-28  0:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m2n.s.1JWJRb-000DP2@chiark.greenend.org.uk>
2008-06-16 15:22 ` cross compiling xen/ia64 Ian Jackson
2008-06-17 12:51   ` Re: [Xen-ia64-devel] " Ian Campbell
2008-06-17 14:09     ` [Xen-devel] " Ian Jackson
2008-06-17 15:25   ` Re: [Xen-ia64-devel] " Aron Griffis
2008-06-17 15:46     ` Ian Jackson
2008-06-17 19:58       ` Aron Griffis
2008-06-18  9:09         ` [Xen-devel] " Ian Jackson
2008-06-19 16:27           ` Re: [Xen-ia64-devel] " Aron Griffis
2008-06-19 16:38             ` Ian Jackson
2008-06-19 16:44               ` Aron Griffis
2008-06-28  0:47               ` Aron Griffis [this message]
2008-07-01 19:36                 ` [Xen-devel] " Aron Griffis
2008-07-02 10:25                   ` Re: [Xen-ia64-devel] " Ian Jackson
2008-07-07 14:57                     ` Aron Griffis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080628004745.GA5499@fc.hp.com \
    --to=aron@hp.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=alex.williamson@hp.com \
    --cc=keir@xensource.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=xen-ia64-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.