public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Burning Thumb <burningthumb@gmail.com>
Cc: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: Re: Cross compile helloworld.c
Date: Wed, 26 Jun 2013 16:19:00 -0000	[thread overview]
Message-ID: <CAH6eHdQXAQ-8FRJJNOB_igbLDWA+E8F8h6GOBB5Jt2syvwnNvw@mail.gmail.com> (raw)
In-Reply-To: <00D81422-8185-4281-AC4D-5ABF82A35526@gmail.com>

On 26 June 2013 16:57, Burning Thumb wrote:
> You know I thought this would be so easy, and maybe it is...
>
> I'm running Ubuntu 13.04 on an intel machine and I want to cross compile helloworld.c so that the resulting binary will execute on Ubuntu on a powerpc machine.
>
> So something simple like:
>  gcc helloworld.c --target powerpc-linux -o helloworldppc
>
> But the answer seems to always come back how to cross compile gcc itself...
>
> Anyone have a one liners on how to simply cross compile helloworld.c for ubuntu ppc?

You need a cross compiler.  The target is fixed when GCC is built, so
you cannot use a GCC built for the intel target to build binaries for
the powerpc target.

  reply	other threads:[~2013-06-26 16:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-26 16:10 Burning Thumb
2013-06-26 16:19 ` Jonathan Wakely [this message]
2013-06-26 17:10   ` burningthumb
2013-06-26 17:35     ` Jonathan Wakely
2013-06-26 16:25 ` Andrew Haley
2013-06-26 16:33 ` Marc Glisse
2013-06-27 23:19   ` Ángel González

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=CAH6eHdQXAQ-8FRJJNOB_igbLDWA+E8F8h6GOBB5Jt2syvwnNvw@mail.gmail.com \
    --to=jwakely.gcc@gmail.com \
    --cc=burningthumb@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).