Good instructions for making a GCC cross compiler?

Hi
I think this might be the best place to ask this since people probably have been making cross compilers. I am interested in trying to make a cross compiler of GCC targetting Plan9/i386. There is an old 3.0 version of GCC (http://cm.bell-labs.com/sources/extra/gcc/) ported to Plan9.
The thing that confuses me a bit about cross compilers is the use of binutils for the target architecture. How does that actually work? The host OS/architecture would not be able to execute those binaries. It feels a bit like a chicken-and-egg issure and I am not really sure how to get started. I have been trying to read up a bit on the PKGBUILDs for cross-arm but the whole theoretical issue of how to actually get the thing working in the first place is still a bit unclear to me.
Some good instructions/links/help would be appreciated
I could post my temporary PKGBUILD here if people want to help out with the actual build...

A small update to my attempts:
This is my binutils package, it has failed at multiple levels during my attempts. The binutils ported to Plan9 are relatively old so some stuff needs to be patched up to build. Now it fails on not being able to recognize arlex.o . This seems a bit odd I think.
# Adapted from cross-arm-elf, cross-i686-pc-gnu and cross-i686-pc-mingw32
pkgname=cross-i386-plan9-binutils
pkgver=2.11.2
pkgrel=1
pkgdesc="The GNU Compiler Collection - Cross compiler for Plan9 i386 target"
arch=('i686' 'x86_64')
license=('GPL')
url="http://plan9.bell-labs.com/wiki/plan9/porting_alien_software_to_plan_9/index.html"
depends=('glibc' 'zlib')
options=('!libtool' '!distcc' '!ccache')
source=('http://plan9.bell-labs.com/sources/extra/gcc/gnusrc.tgz' \
'bucommh.patch')
md5sums=('39d23b7223b68de4cf333205257112ce' \
'2945c4e40dbcd966217ed1349195e312')
_target=i386-lucent-plan9
_sysroot=/usr/lib/cross-${_target}
build() {
rm -rf ${srcdir}/build
mkdir ${srcdir}/build #starting fresh
msg "building and packaging binutils"
cp -ar ${srcdir}/binutils-2.11.2/* ${srcdir}/build/
cd ${srcdir}/build
msg "cheating broken references to Plan9-ported GNU binutils"
ln -s /usr/bin/ar "${_target}-ar"
ln -s /usr/bin/as "${_target}-as"
ln -s /usr/bin/ld "${_target}-ld"
ln -s /usr/bin/ranlib "${_target}-ranlib"
PATH=${srcdir}/build:$PATH
CFLAGS='-O2 -static'
msg "patching up stuff"
cd ${srcdir}/build/binutils
patch bucomm.h -i $srcdir/bucommh.patch
msg "going back to build directory and start configure"
cd ${srcdir}/build
./configure --prefix=${_sysroot} --bindir=/usr/bin \
--with-sysroot=${_sysroot} \
--build=$CHOST --host=$CHOST --target=${_target} \
--with-gcc --with-gnu-as --with-gnu-ld \
--enable-shared --without-included-gettext \
--disable-nls --disable-debug
msg "fixing some corrupt libraries"
cp /usr/lib/libiberty.a ${srcdir}/build/libiberty/
msg "finally making the actual binutils"
cd ${srcdir}/build
make
make DESTDIR=$pkgdir/ install
# clean-up cross compiler root
rm -r ${pkgdir}/${_sysroot}/share/{info,man}
# needed for gcc build
install -dm755 ${pkgdir}/${_sysroot}/include
this is the bucommh.patch:
81c81
< extern char *sbrk ();
> extern void *sbrk ();
Last edited by W.F.Cody (2011-09-13 18:57:17)

Similar Messages

  • Fortran code for iOS using GCC cross-compiler

    Hello everyone!
    I have some Fortran application, and i want to compile it for iOS. I'm new in iOS development and  as i understand correctly i need to configure GCC (from gcc.gnu.org) with --target=arm-apple-darwin and --enable-languages=c,c++, fortran.
    With --target=arm-elf, --target=arm-apple-darwin i got error, that it's not supported.
    With --target=arm-none-eabi i got cannot compute suffix of object files: cannot compile Maybe is that because i'm setting wrong configure parameters.
    My question is : what is correct ./confgiure parameters to create gcc cross compiler for iOS platform, which supports FORTRAN.
    Is this the only (right?) way to build cross-compiler for iOS platform, or i could use existing LLVM-GCC? Thanks!

    jasonwryan, thanks for the reply,
    I've read the ARM Dev Guide as suggested but I don't believe this will do what I'm aiming to achieve. It seems the ARM Dev Guide will install the arm-linux-gnueabi, which allows cross-compiling applications to run on LINUX built for ARM. I need something like arm-none-eabi (or arm-none-gnueabi - the whole naming scheme is a mess at the moment) which is an ARM compiler for "bare metal" ARM devices. I am aiming to program a simple ARM Cortex M4 microcontroller as opposed to an ARM microprocessor running Linux. Hence arm-linux-gnueabi is quite overkill from my understanding and it might even not work.
    So, if someone could either confirm that what the ARM Dev Guide suggests is indeed what I need to program a bare metal ARM microcontroller, or recommend an alternative path, it would be very appreciated.
    Thanks,
    -Igor

  • Were can I find a good turtorial for making a contact scheme in flash?

    I am making a flash site, and wonder were I can find a good turtorial for making a contact scheme, where people can answer questions who is sent to my email.

    Just search Google using the terms "AS3 contact tutorial" and you should find a few good tutorials.

  • NEED step-by-step instructions for making a podcast

    Please help. In desperate need of step-by-step instructions for making a podcast, along with "posting it to a publicly accessible RSS/URL thing." I do not speak nerd fluently. Understand it partially, but VERYpartially.

    "Step-by-step instructions" will depend on what software you're going to use.
    Here's a tutorial using the free Audacity software on Windows...
    http://www.zefhemel.com/archives/2004/10/11/how-to-create-your-own-podcasting-sh ow
    Here's Audacity...
    http://audacity.sourceforge.net/about/
    WinJournal is an alternative software package for Windows...
    http://www.marinersoftware.com/sitepage.php?page=114
    WebPod Studio is another...
    http://www.lionhardt.ca/wps/
    Also Propaganda...
    http://www.makepropaganda.com/
    For easy publishing of your podcast there's this...
    http://www.avmypodcast.com/
    And talking of propaganda, if you can switch to Mac, it comes with the iLife suite of programs which includes GarageBand for creating podcasts and iWeb website creation software. IWeb has integrated support for podcasting and publishing to the iTunes store:
    http://www.apple.com/support/iweb/blogs/
    Apart from Apple's software, there's also this for Mac...
    http://www.lemonzdream.com/podcastmaker/

  • Are there step by step instructions for making a two sided CD booklet?

    Are there step by step instructions for making a two sided CD booklet? And how would I setup alignment to print.

    https://www.google.com/search?sourceid=chrome-psyapi2&rlz=1C1CHFX_enUS546US546&ion=1&espv= 2&ie=UTF-8&q=Photoshop%20CD%20…

  • Is this PowerBook Good enough for making music?

    Is this powerbook : PowerBook G4 17Inch
    17-inch TFT widescreen display with 1680x1050 resolution
    1.67GHz PowerPC G4 processor
    2GB memory (DDR2)
    120GB 5400rpm hard drive
    Slot-load 8x SuperDrive (DVD+R DL/DVDRW/CD-RW)
    ATI Mobility Radeon 9700 graphics card with 128MB DDR memory
    The Latest or the last model of Powerbooks
    Is it good enough for making music or editing few video clips?
    Will Snow Leopard run on it?
    Can i upgrade more ram in it ?

    Yes, that Powerbook can be used to make music or edit video clips. When it was new, it was required at the North Carolina School of the Arts for their Film program, using Final Cut software. Having a more powerful Intel CPU would speed up the rendering and processing times, however, the 1.67Ghz Powerbook can certainly handle video editing.
    I know people that have used Garageband on it to make music.
    The last operating system you can run on it is OS X 10.5 Leopard, with the last release being 10.5.8.
    It's RAM is maxed out at 2GB. 
    As long as you don't need newer software that requires an Intel processor and aren't going to rely on that as your system to access streaming video's on the internet, it should work for you.

  • Good Resources for making Flash Games?

    I'm new to Flash, and I'm working on getting through a book on the basics.  What I'm wondering though is, are there any good resources out there for making games in Flash CS4.  I know I'm going to get some "learn the basics first" replies, and yes I know I need to get a solid grounding in those, but I want to be able to start gathering resources, and look ahead to what I'll be able to do with Flash in the future. 
    By resources I mean books, other websites, your own advice about game making, etc...

    i started developing in flash about 2 weeks ago for the same reason and have written a little animation and started writing a multiplayer game, which will be fully functional and properly skinned soon.  If you are like me, you have a vague understanding of object oriented programming, know at least one other programming language and can adapt to all this event-driven stuff.  Here's my story in brief.
    I started with some dev center videos and then went to AdobeTV for more videos, especially to newbie channels like Douge Winnie's.  I think I also played along with some flash down under videos to learn more action script 3 (very important in a game, I would say).
    I'm sure you want to get onto your game project right away, but you are probably 3-5 mini projects away from that.  If you don't do some toy projects you'll just end up doing a crappy job on your game or plain old getting stuck.  The mini projects, whether they are elements of your game, or exercises in videos, will force you to find the ressources you need to learn from.
    If you want to make a multiplayer game, try smartfoxserver - it is very well documented with little tutorials and stuff.  Some tutorials on
    this youtube channel too (where he mostly just runs you through the documentation).  Smartfox has a few good examples of nicely built interactive programs.  Just make sure you are using their actionscript 3.0 stuff.
    Lastly, understand and use Components.  They will save you a lot of work.  smartfoxserver has components (called bits) and so does flash.  I imagine you can even download extra components.  These are things like scrolling text boxes, buttons that look like buttons, etc.
    Cheers,
    Alejandro

  • I followed the instructions for making an APP TAB and succeeded BUT everytime I close Firefox, the app tab disappears upon re-opening. Can someone help please? I held the control button plus I clicked and selected the "Pin..as app tab".

    As my question asks, I followed instructions for creating an APP TAB for my web mail account, and succeeded but each time I close and re-open Firefox, the app tab disappears. Can someone tell me what I am doing wrong please?

    For better or worse, I think it's part of the design for the app tabs to be window specific. I know my first reply didn't solve your problem, but that was one way that worked for me to get the app tabs back when I restarted Firefox. Also I noticed the tag for this post is Firefox 4. I've only tried it with Firefox 5.
    I agree with you that the way it's working isn't ideal. For the time being, I've stopped using the app tabs. Maybe they'll fix/improve it soon.

  • Need good instructions for image zoom motion

    I have several old FCE2 instructions for keyframe motion instructions but none work to give me zoom + motion of an image. Can anyone direct me to such instructions for FCE4??

    Also, for occasions when you just want a general random movement of the images, as in iPhoto slideshows, try Piero's free filter.
    It will enable you to give hundreds of pictures the Ken Burns treatment in seconds:-
    http://web.mac.com/piero.fiorani/PieroFFCE_Effect/Auto_PanZoom.html

  • HT201250 I have thousands of pictures on my Mac.  If something happens to my Mac I don't want them lost.  I do time machine back ups to an external hard drive once a week.  Is this good enough for making sure my pictures don't ever get lost?

    I have thousands of photos on my Mac.  If something happens to my Mac obviously, I don't want to lose the photos.  I do Time Machine back ups to an external hard drive once a week.  Is this good enough to make sure my pictures don't get lost?

    tgs6164 wrote:
    I have thousands of photos on my Mac.  If something happens to my Mac obviously, I don't want to lose the photos.  I do Time Machine back ups to an external hard drive once a week.  Is this good enough to make sure my pictures don't get lost?
    Purchase a couple of these when they go on sale.
    Start burning all the photos onto DVDs. 
    At least you'll have all your photos if your computer, time machine or any other backup you use goes bonkers.

  • What is a good technique for making a scrollable area in Flash Professional?

    For example if I have a long list of chapters and I want users to be able to scroll up and down. In a web browser with html the scrollbar automatically appears.

    One simple option is to use a ScrollPane component.

  • Good tutorials for making objects drop or fly in?

    I've been using the Adobe CS for years now, but just getting started using After Effects.
    I'm trying to make a video where 2D images/objects appear to drop in from above, stay put for a second, and then fly out into the background. I figured tutorials for something this simple would be all over the web, but I've yet to find one exactly like this.
    So far I'm assuming it will be something easy like using the scale effect? Any tips or advice are much appreciated!

    Just pick a property like position then hold down the alt or option key and click the stop watch or with Position selected go to Animation Add Expression.
    Did you try adding the animation preset to a layer in the timeline? Save the animation preset to your animation presets file and then select the layer, position it where you want it to end, then select Animation>Apply Animation Preset> and browse to the preset I sent you. Works with 2D and 3D layers.
    The drop in and fly back animation that you want to do will work better with 3D layers and this Animation Preset could easily be modified to move in Z instead of fall out of frame.
    It doesn't sound like you are very familiar with expressions. This one is fairly complex. It uses the in point and out point of the layer along with value at time to create the motion. If this looks like greek to you you'd better explain more about what you want to do with the expression.
    sif = effect("slideIn Frames")("Slider");
    sof= effect("slideOut Frames")("Slider");
    // find in and out point
    inTime = sif * thisComp.frameDuration;
              if (effect("Match SI SO")("Checkbox") == 0) {
              outTime = sof * thisComp.frameDuration;
              else if (effect("Match SI SO")("Checkbox") == 1) {
              outTime = inTime;
    // Fix  layer size when scaled
    sf = scale - [100, 100];
    xSize = width + (width * sf[0]/100);
    ySize = height + (height * sf[1]/100);
    realSize = [xSize, ySize];
    // Set Positions
    spx = 0 - realSize[0] + realSize[0]/2 ;
    rstx = value [0];
    rsty = value[1];
    epy = thisComp.height + realSize[1] - realSize[1]/2;
    // create movement
    freq = effect("bounce Frequency")("Slider");
            amplitude = effect("bounce Amplitude")("Slider");
            decay = effect("bounce Decay")("Slider");
        posCos = Math.abs(Math.cos(freq*time*2*Math.PI));
        y = amplitude*posCos/Math.exp(decay*time);
    moveIn = Math.min(linear(time,inPoint,inPoint + inTime,spx  ,rstx-y));
    moveOut = Math.min(linear(time,outPoint - outTime,outPoint - thisComp.frameDuration,rsty ,epy));
    [moveIn, moveOut]

  • I am asked for passwords for Ancestry, iGoogle, MyYahoo! even though my passwords are saved. I've followed all the instructions for making sure they are saved.

    This happened after a recent update. I've followed all instructions and still having this issue with my home pages, etc.

    I'm not sure anyone here knows more about the Java plugin than you do...
    Were you starting the control panel from disk as administrator because it didn't work starting it through the Start menu (if you have Control Panel set to View by Category, the Java control panel is under "Programs").

  • Good instructions for reinstalling PScc.

    Reinstalling photoshop cc is very, very difficult, even if assisted by adobe telephone support (broken English.) Is there online help anywhere for lucid guidance?

    Reinstalling photoshop cc is very, very difficult, even if assisted by adobe telephone support (broken English.) Is there online help anywhere for lucid guidance?

  • Announcing availability of  x86 hosted cross compiler for SPARC/Solaris

    We are pleased to announce the release for GCC For Sun Systems 4.2.0 cross compilers!
    This is a Solaris/x86 hosted compiler with target code generation for
    SPARC/Solaris systems. If you develop on your OpenSolaris, or Solaris
    x86 laptop or desktop, you can now start compiling your sources for
    SPARC systems. Almost all features available in the
    native SPARC GCC For Sun Systems 4.2.0 compiler are available
    for use in the cross compiler. Please refer to the mini cross compiler howto
    page for additional details on install and usage, and gotchas in cross
    development environment.
    Please continue to provide us your feedback and issues, which helps
    us make the product better.
    Thanks
    GCCFSS team

    Can GCCFSS also cross compile from in reverse - from SPARC to x86/x64?
    Thank you

Maybe you are looking for