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: Specifying where Binutils is and what it is called
Date: Thu, 23 Apr 2020 10:24:08 +0200	[thread overview]
Message-ID: <r7rjb8$25g2$1@ciao.gmane.io> (raw)
In-Reply-To: <238241866.1719021.1587558240444@mail.yahoo.com>

On 22.04.2020 14:24, R. Diez via Gcc-help wrote:
>> It looks like the simple solution is to just build and install
>> binutils twice.  Once into temporary destination and once into
>> final destination.  Then each compiler will be able to find binutils.
>>    If you want to optimize this, you might be able to build binutils
>> once, and install it twice, overriding prefix at install time to put it
>> in the other install dir.
> 
> Finally good advice! Thanks!
> 
> That has worked. In case anybody is interested, the result is here:
> 
> https://github.com/rdiez/JtagDue/blob/master/Toolchain/Makefile
> 
> Search for INSTALL_GCC_PHASE_1_TO_SEPARATE_DIR in there for more information.
> 
> Best regards,
>    rdiez
> 


I guess it would be a lot easier to create a combined source tree with 
gcc, binutils and newlib and to everything only once.

Download and unpack binutils,gcc,gmp,mpfr,mpc,isl(optional) and newlib.

$ cd gcc-*
$ ln -s ../gmp-* gmp
$ ln -s ../mpfr-* mpfr
$ ln -s ../mpc-* mpc
$ ln -s ../isl-* isl

$ for i in bfd binutils gas ld opcodes; do ln -s ../binutils-*/$i; done

for newlib
$ ln -s ../newlib-*/newlib
$ ln -s ../newlib-*/libgloss


$ mkdir ${HOME}/obj; cd ${HOME}/obj
$ (TARGET=m68k-elf && ${HOME}/src/gcc-*/configure --prefix=/${TARGET} 
--libexecdir=/${TARGET}/lib --target=${TARGET} --enable-languages=c,c++ 
--disable-libstdcxx-pch --with-newlib)

(optional: fix compiler flags)
sed -i 's/\-g /-pipe /' Makefile
sed -i '/^CFLAGS / s/$/ -march=native/' Makefile
sed -i '/^CXXFLAGS / s/$/ -march=native/' Makefile
sed -i '/^CFLAGS_FOR_BUILD/ s/$/ -march=native/' Makefile
sed -i '/^CXXFLAGS_FOR_BUILD/ s/$/ -march=native/' Makefile

Compile and install into staging area
$ make -j$(nproc)
$ make -j2 install-strip DESTDIR=$(pwd)/dest

(install-strip might fail for libgloss, so the workaround I've used is 
to do a "make install -j2" first, and a "make -j2 install-strip -k" 
aferwords)

-- 
chs


  reply	other threads:[~2020-04-23  8:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <238241866.1719021.1587558240444.ref@mail.yahoo.com>
2020-04-22 12:24 ` R. Diez
2020-04-23  8:24   ` Christer Solskogen [this message]
     [not found] <2007965762.1537196.1587376378163.ref@mail.yahoo.com>
2020-04-20  9:52 ` R. Diez
     [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] <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
2020-04-20  5:32       ` Kai Ruottu
2020-04-20 18:55   ` Jim Wilson

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='r7rjb8$25g2$1@ciao.gmane.io' \
    --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).