From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from vs2-21.mail.saunalahti.fi (vs2-21.mail.saunalahti.fi [62.142.5.140]) by sourceware.org (Postfix) with ESMTPS id A57973858D31 for ; Mon, 20 Apr 2020 05:25:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A57973858D31 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=wippies.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kai.ruottu@wippies.com Received: from vs2-21.mail.saunalahti.fi (localhost [127.0.0.1]) by vs2-21.mail.saunalahti.fi (Postfix) with ESMTP id 705A260039; Mon, 20 Apr 2020 08:25:34 +0300 (EEST) Received: from gw02.mail.saunalahti.fi (gw02.mail.saunalahti.fi [195.197.172.116]) by vs2-21.mail.saunalahti.fi (Postfix) with ESMTP id 6557460035; Mon, 20 Apr 2020 08:25:34 +0300 (EEST) Received: from [10.0.0.4] (mobile-access-bcee9f-158.dhcp.inet.fi [188.238.159.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kai.ruottu@wippies.com) by gw02.mail.saunalahti.fi (Postfix) with ESMTPSA id 1FC0D40004; Mon, 20 Apr 2020 08:25:30 +0300 (EEST) Subject: Re: Specifying where Binutils is and what it is called To: Jonathan Wakely , "R. Diez" Cc: "gcc-help@gcc.gnu.org" References: <921250919.1086849.1587309283539.ref@mail.yahoo.com> <921250919.1086849.1587309283539@mail.yahoo.com> From: Kai Ruottu Message-ID: <31522021-107a-71bd-4914-8b2415453711@wippies.com> Date: Mon, 20 Apr 2020 08:25:28 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, HTML_MESSAGE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Mon, 20 Apr 2020 05:25:39 -0000 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 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.