From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sonic306-20.consmr.mail.ir2.yahoo.com (sonic306-20.consmr.mail.ir2.yahoo.com [77.238.176.206]) by sourceware.org (Postfix) with ESMTPS id 37A2B3858D31 for ; Sun, 19 Apr 2020 15:14:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 37A2B3858D31 X-YMail-OSG: 5x0QTsgVM1lC0lj_C.fPsVGNHzRZ666ouzXdpf1Dtxg9z.Fp8XKxGfhaHUyqKid 50uGHRvZ1GZiTmaxtNdng2PfP5N5foEOVXKgyNjHwJEAGx2LkmYyyJLQvj7RcsqN3S6GR5VgLerl v_xMBTHEtqfWkb2XXSvPe_lemZueHum1Q0HWGba0oObNPe4tCLCYmNfYV9gNXp3tnP80Kb78gPmD DHlUWm0MPpJlG.Zx7.DJFshzFj1ZGSgrfqj0sDll2FRSb4hcveufguc.SkFaCXBa1GUkYSwkapS2 Zk6.OBz3UEa.Ce7MOzVEqruGsucUEMaNmohu1_AiUET7WuAVliqge4.ZO4sCleArykGlEXd4MWoL 7Pu8iVJJ3dSaCv4LpAy8DO8ks8foufkIVeWcKl7TOSUO9t.gbd3F8MTFdmGkv3KHFoKXGLOp1ziw 7AMOT.I4bGX.rJJD6BgvC.bXFRS8yj.8Q8MKMBsm1gN9buv8fUAvtcot1ogYYY6wMo_c.rqpfvXE E3A.XQ2ehKsgVBqOW69xtHGi5zs3aV9HYNU6HBM5ynIPVEc6Dt_VFAhCgmnRZ7Fhu4rN_roK2hVT d0p5cJN7iEx46y5NHC3PGBhMUsHHQ8ardZXU3mhoGUU9oRhy5KvjZy9PzRMAAadoj.PqY719mNc4 psX9dT81mMVOwEIhAwRkxv8v1IQAAg96zcC8zZc8VToxhTRqScdfmRRg7kytqk91PUfduPEwMgQW Lds0g97hTnqXs843WoAHG874QzrW.ldFPL4Klyp2wGVBJKofa8XOT_oCFTKXn6t7RHd7bxDVL7l8 bvJUusTvr1xHPe1PzttrHFRlbWPvsyl2MEtAvHc7eqNtGa9YxdLkU0fo5K4H7Z..VjwuFlA233rj 6PyKJcJK4bFz2XgfDPyLxTQC53ov9HB.vhEQg.aPG0qgbYgQUOZEHjV0wz_Ixh.JbUIe5YyqHGzK KPkQ1Ud7liNSJ5QKpbnl2JQgaiz6ATBjMOyURXoHAI5YNW0PD.kNBbmfMGdqPpiAezSqvJeifBXW tGN_SDn3KeHHstpklDZtfCQ0vnwyBH.ZH7HTzFR488kPzMiVo1GFPTh6JOqicvgHKYCititxNTsM 3eNUhAZwkiOrQ9TpnZBQTQLM5uI88QDwkY7xd2lVm4kO20bQpy2RRDtpP8Ds7P2YUWTDOb3AbfPe 2OOkVQNPeqfTUWdlkS4LNJK03IOZ3DC97mnKToIzGPa0BuKyebGihu2hRUFbkBhiZVgCv76GXliy Mi7rb9obCbYFjnk8ljmHA1oU3GIvEQPMjO_l1seTLC_8k5sVk9L..fM4w.6ef6kKIpcZdrS8vCUb juco4G6f_iwoqp7F6cpGe1RVMhwoqbLXYnw-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ir2.yahoo.com with HTTP; Sun, 19 Apr 2020 15:14:46 +0000 Date: Sun, 19 Apr 2020 15:14:43 +0000 (UTC) From: "R. Diez" To: "gcc-help@gcc.gnu.org" Message-ID: <921250919.1086849.1587309283539@mail.yahoo.com> Subject: Specifying where Binutils is and what it is called MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable References: <921250919.1086849.1587309283539.ref@mail.yahoo.com> X-Mailer: WebService/1.1.15723 YMailNorrin Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 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: Sun, 19 Apr 2020 15:14:51 -0000 Hi all: I have been building cross-compiler toolchains for years with makefiles sim= ilar 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=3D/my/dir) may leave some undesired remnants behi= nd. So I thought I should build and install GCC phase 1 somewhere else. Aft= er all, GCC phase 1 is not needed after the toolchain is complete. The steps would look like this: - Build and install Binutils with --prefix=3D/final/destination - Build and install GCC phase 1 (minimal compiler) with --prefix=3D/tempora= ry/destination - Build and install Newlib with GCC phase 1 with --prefix=3D/final/destinat= ion - Build and install GCC phase 2 with --prefix=3D/final/destination - At this point, we could delete /temporary/destination Unfortunately, I am having trouble with GCC phase 1 and Newlib: a) If I configure GCC phase 1 with --prefix=3D/final/destination, it picks = up the Binutils correctly. The names it finds are arm-none-eabi-ar etc. But that is not what I want after all. b) If I configure GCC phase 1 with --prefix=3D/temporary/destination, it do= es not find arm-none-eabi-ar and the like, even if they are in the PATH. It then picks up 'ar' for the host. Compilation fails later on with a messa= ge like this: Assembler messages: Fatal error: invalid -march=3D option: `armv7-m' It took some time to build everything and to realise what the error cause w= as. I wish that GCC checked during the configuration phase that the found '= ar' etc. actually support the asked target architecture. c) I can specify --with-build-time-tools=3D/some/dir , but then GCC does no= t pick full names like arm-none-eabi-ar . I have to specify a path like /ho= me/rdiez/rdiez/arduino/toolchain-test-09-bin/arm-none-eabi/bin , which cont= ains the same tools but with short names like "ar". The trouble is, GCC needs then those 'ar' etc. tool on the path when buildi= ng Newlib. Because 'ar' for the host has then the same name as 'ar' for the= cross-compilation target, the host tools are not available anymore, which = causes problems later on. I really need --with-build-time-tools to pick ful= l names like "arm-none-eabi-ar". d) I guess I could use --with-as and --with-ld to manually specify the righ= t Binutils. The trouble is, there are other tools like objdump. GCC's own d= ocumentation warns about this: "When you use this option, you should ensure that dir includes ar, as, ld, = nm, ranlib and strip if necessary, and possibly objdump. Otherwise, GCC may= use an inconsistent set of tools." e) I could use the same --prefix for both GCC phase 1 and phase 2, delete t= he /final/destination when Newlib is complete, and reinstall to that /final= /destination Binutils, Newlib and GCC phase 2. But that does not play well = with Makefiles that are building in parallel. So I wish there is another wa= y. Can somebody help me with these issues? Thanks in advance, =C2=A0 rdiez