Search code examples
linuxgcccross-compilingrpmchroot

How to create a cross-compilation sysroot for Linux?


I'm trying to build a GCC cross-compiler with --host=x86_64-apple-darwin10 and --target=ppc64-linux.

I need to have a sysroot for my target. What I have available to me is an .iso that's designed to boot and setup that target. On it are a giant pile of rpms.

I'd like to know the Linux guru incantations that will unpack the proper rpms into an empty directory on OS X successfully and make that sysroot.


Solution

  • You should be able to build rpm2cpio on OSX, and then unpack thus:

    mkdir /desired/sysroot && cd /desired/sysroot
    for j in /path/to/iso/*.rpm; do
       rpm2cpio $j | cpio -idmB
    done
    

    But it might be easier to just unpack on a Linux host (perhaps inside a VM).