public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Johannes Lorenz" <johannes89@mailueberfall.de>
To: gcc-help@gcc.gnu.org
Subject: How to compile gcc toolchain with special sysroot correctly?
Date: Wed, 27 Nov 2013 09:07:00 -0000	[thread overview]
Message-ID: <trinity-effaeca1-21ba-4bd6-a743-9db197f4704e-1385540326843@3capp-gmx-bs06> (raw)

Hello,

after posting at unix.stackexchange.com [1] (where no one knew an answer), I hope it is ok if I post the question here.

I tried to install binutils, gcc and glibc. My idea was: First compile binutils, then compile a gcc which is linked with the new binutils, and finally, these two compile a new glibc (without need of my system's glibc of /usr/lib). Maybe this is conceptually wrong?

What exactly did I try? Since I can not be root, I installed it all in ~/local. First, I set these variables:

    PREFIX=~/local && export PREFIX
    PATH=~/local/bin:$PATH && export PATH

I built binutis, gcc and glibc (in exactly this order), with this configuration:

    ../binutils-2.22/configure --prefix=$PREFIX --with-sysroot
    ../gcc-4.7.3/configure --prefix=$PREFIX
    CC='gcc --sysroot=~/local' ../glibc-2.15/configure  --prefix=$PREFIX

However, after binutils and gcc were compiled and installed correctly, gcc fails to compile a simple program while configuring glibc:

    int main() { return 0; }

Output (shortened):

    > gcc --sysroot=~/local/ test.cpp -o test
    ld: cannot find crt1.o: No such file or directory
    ld: cannot find crti.o: No such file or directory
    ld: cannot find -lc
    ld: cannot find crtn.o: No such file or directory

However, this displays no files:

    find ~/local -name crti.o

Notes: My system is a server running a 64 bit Ubuntu 12.04 ("precise"), but I think it is not system related. The versions of the three toolchain components should fit each other, since openSuSE 12.2 has this combination.

Thanks very much for any replies.

Kind regards,
Johannes

[1] http://unix.stackexchange.com/questions/102511/how-to-compile-gcc-toolchain-with-special-sysroot-correctly
-- 
Diese E-Mail wurde aus dem Sicherheitsverbund E-Mail made in
Germany versendet: http://www.gmx.net/e-mail-made-in-germany

             reply	other threads:[~2013-11-27  8:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-27  9:07 Johannes Lorenz [this message]
2013-11-27  9:11 ` Andrew Haley
2013-11-27 10:02   ` Aw: " Johannes Lorenz
2013-11-27 11:35     ` Andrew Haley
2013-11-27 13:58 ` Kai Ruottu

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=trinity-effaeca1-21ba-4bd6-a743-9db197f4704e-1385540326843@3capp-gmx-bs06 \
    --to=johannes89@mailueberfall.de \
    --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).