From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ciao.gmane.io (ciao.gmane.io [159.69.161.202]) by sourceware.org (Postfix) with ESMTPS id 4AC81385DC0B for ; Thu, 23 Apr 2020 08:24:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4AC81385DC0B Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1jRX9a-000Idl-3Y for gcc-help@gcc.gnu.org; Thu, 23 Apr 2020 10:24:14 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: gcc-help@gcc.gnu.org From: Christer Solskogen Subject: Re: Specifying where Binutils is and what it is called Date: Thu, 23 Apr 2020 10:24:08 +0200 Message-ID: References: <238241866.1719021.1587558240444.ref@mail.yahoo.com> <238241866.1719021.1587558240444@mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 In-Reply-To: <238241866.1719021.1587558240444@mail.yahoo.com> Content-Language: en-US X-Spam-Status: No, score=3.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD, FORGED_MUA_MOZILLA, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NML_ADSP_CUSTOM_MED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: *** X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Apr 2020 08:24:16 -0000 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