public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kai Ruottu <kai.ruottu@wippies.com>
To: Jonathan Wakely <jwakely.gcc@gmail.com>,
	"R. Diez" <rdiezmail-gcc@yahoo.de>
Cc: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: Re: Specifying where Binutils is and what it is called
Date: Mon, 20 Apr 2020 08:25:28 +0300	[thread overview]
Message-ID: <31522021-107a-71bd-4914-8b2415453711@wippies.com> (raw)
In-Reply-To: <CAH6eHdSGBuVJ6CwjuvL3vDWTnX0NvLfVC68ayLju-cEx_WBZ2w@mail.gmail.com>

Jonathan Wakely via Gcc-help kirjoitti 19.4.2020 klo 21.49:

> On Sun, 19 Apr 2020 at 16:16, R. Diez via Gcc-help <gcc-help@gcc.gnu.org> wrote:
>> Hi all:
>>
>> I have been building cross-compiler toolchains for years with makefiles similar to this one:
>>
>> https://github.com/rdiez/JtagDue/blob/master/Toolchain/Makefile
>>
>> I have always been worried that installing GCC phase 2 on top of GCC phase 1 (with the same --prefix=/my/dir) may leave some undesired remnants behind.
> That seems like an unnecessary worry. Why would the phase 1 compiler
> install *more* than the final one?
>
>> So I thought I should build and install GCC phase 1 somewhere else. After all, GCC phase 1 is not needed after the toolchain is complete.
>>
>> The steps would look like this:
>>
>> - Build and install Binutils with --prefix=/final/destination
>> - Build and install GCC phase 1 (minimal compiler) with --prefix=/temporary/destination
>> - Build and install Newlib with GCC phase 1 with --prefix=/final/destination
>> - Build and install GCC phase 2 with --prefix=/final/destination
>> - At this point, we could delete /temporary/destination

Meanwhile one cannot build the standard C libraries for "system targets" 
(those which have the "native GCC" as the default) at the same
time with GCC, it is the assumption with the "embedded targets" using 
newlib (those which have the "cross GCC" as the default). Maybe
in the distant past of GCC there were some problems with this "combined 
build of GCC and newlib" but someone suggesting a separate
build somewhere nowadays is really weird. Already in the gcc-2.95 age 
the instructions were like this :

 1. Link the following directories from Newlib to the main GCC
    directory, /source/gcc-2.95.3/ :
      * ln -s ../newlib-1.8.2/newlib newlib
      * ln -s ../newlib-1.8.2/libgloss libgloss
 2. Change to the /build/gcc directory to configure the compiler:


        /source/gcc-2.95.3/configure \
             --verbose --target=m68k-rtems \
             --prefix=/gcc-m68k --with-gnu-as --with-gnu-ld \
             --with-newlib

In :
https://docs.rtems.org/releases/4.5.1-pre3/rtemsdoc/html/started/started00072.html

In the generic newlib build instructions this same thing should be seen.

Symlinking the 'newlib' and 'libgloss' subdirectories from the newlib 
sources into the GCC sources main directory is what should be
tried first and if doing that there are problems, they should be 
reported here or in other suitable places.


  reply	other threads:[~2020-04-20  5:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <921250919.1086849.1587309283539.ref@mail.yahoo.com>
2020-04-19 15:14 ` R. Diez
2020-04-19 18:49   ` Jonathan Wakely
2020-04-20  5:25     ` Kai Ruottu [this message]
2020-04-20  5:32       ` Kai Ruottu
2020-04-20 18:55   ` Jim Wilson
     [not found] <590749852.1515706.1587371249089.ref@mail.yahoo.com>
2020-04-20  8:27 ` R. Diez
2020-04-20  8:47   ` Jonathan Wakely
     [not found] <2007965762.1537196.1587376378163.ref@mail.yahoo.com>
2020-04-20  9:52 ` R. Diez
     [not found] <238241866.1719021.1587558240444.ref@mail.yahoo.com>
2020-04-22 12:24 ` R. Diez
2020-04-23  8:24   ` Christer Solskogen

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=31522021-107a-71bd-4914-8b2415453711@wippies.com \
    --to=kai.ruottu@wippies.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=jwakely.gcc@gmail.com \
    --cc=rdiezmail-gcc@yahoo.de \
    /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).