public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Christer Solskogen <christer.solskogen@gmail.com>
To: gcc-help@gcc.gnu.org
Subject: Re: Cross compiling 4.7.2 for arm on x86_64
Date: Wed, 22 Oct 2014 10:57:00 -0000	[thread overview]
Message-ID: <m282ir$5si$1@ger.gmane.org> (raw)
In-Reply-To: <CAExBR=txGBPryCdT1pTJatGYCk5_D9TjPnj5Ow3rmd9XJJfOvw@mail.gmail.com>

On 20.10.2014 23:27, Diederick Huijbers wrote:
> Dear gcc people,
>
> Last many hours, I've been reading up on how to create a cross
> compiler for educational purposes and although I have a pretty clear
> view on what parts are involved I haven't been able to get further
> then building binutils and bootstrapping gcc.  I've read  many, many
> articles online and all follow mostly the same steps, although some
> use different options. I have read the linux from scratch how to, this
> post from Jim Blandy:
> http://www.eglibc.org/archives/patches/msg00078.html,  this post
> http://how-to-build-for-arm.wikispaces.com/gcc-4_7_2 and many more but
> I keep running into errors with glibc.  Therefore I was wondering if
> someone got a build script that creates a cross compiler using glibc
> 2.17, gcc 4.7.2, binutils 2.32.1, kernel 3.6.11 for arm?
>
> I have build the binutils and have a bootstrapped gcc (first step).
> But no matter what options or approaches I take, I cannot get glibc to
> compile (first step). Currently it seems that it cannot find stdio.h.
> I'm not sure if this is the stdio.h from the glibc library itself (?)
> and if so why can't it find it's own headers?  I have pasted my
> config.log, configure and make log here
> https://gist.github.com/roxlu/0aed9c86c74ce015f6f5
>

Forget eglibc. Use glibc.

Something like this might help:
binutils: configure --prefix=/opt/arm-cross --target=arm-linux-gnueabi 
--with-sysroot=/opt/arm-cross/sysroot
gcc-stage1: configure --prefix=/opt/arm-cross --target-arm-linux-gnueabi 
--disable-shared --disable-threads --without-headers 
--disable-decimal-float --disable-multilib --enable-languages=c 
--with-glibc-version=2.20
make all-gcc all-target-libgcc ${MAKEOPTS} &&
make install-gcc install-target-libgcc

Linux headers:
make headers_install INSTALL_HDR_PATH=/opt/arm-cross/sysroot/usr  ARCH=arm

Glibc:

configure --prefix=/usr 
--with-headers=/opt/arm-cross/sysroot/usr/include --host=arm-linux-gnueabi
make
make install DESTDIR=/opt/arm-cross/sysroot

Gcc-Final:
configure --prefix=/opt/arm-cross --target=arm-linux-gnueabi 
--enable-languages=c,c++ --with-sysroot=/opt/arm-cross/sysroot

-- 
chs

      reply	other threads:[~2014-10-22 10:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-20 21:27 Diederick Huijbers
2014-10-22 10:57 ` Christer Solskogen [this message]

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='m282ir$5si$1@ger.gmane.org' \
    --to=christer.solskogen@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).