From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fgw23-4.mail.saunalahti.fi (fgw23-4.mail.saunalahti.fi [62.142.5.110]) by sourceware.org (Postfix) with ESMTPS id 9AEDD3851C09 for ; Thu, 18 Jun 2020 11:26:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9AEDD3851C09 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 [10.0.0.19] (mobile-access-6df018-164.dhcp.inet.fi [109.240.24.164]) by fgw23.mail.saunalahti.fi (Halon) with ESMTPSA id 81499516-b156-11ea-8ccc-005056bdfda7; Thu, 18 Jun 2020 14:26:08 +0300 (EEST) Subject: Re: Problem creating cross-compiler To: Jonathan Wakely , Jouk Jansen Cc: gcc-help References: <20061810485711_32800155@hrem.nano.tudelft.nl> From: Kai Ruottu Message-ID: <7d23ba40-85d9-497c-6d54-abeed4e62937@wippies.com> Date: Thu, 18 Jun 2020 14:26:08 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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: Thu, 18 Jun 2020 11:26:13 -0000 Jonathan Wakely via Gcc-help kirjoitti 18.6.2020 klo 13.52: > On Thu, 18 Jun 2020 at 09:59, Jouk Jansen via Gcc-help > wrote: >> Hi, >> >> I'm trying to build a cross-compiler which should be running on a Fedora 32 >> system building objects for a IA64-OpenVMS system. I'm running the >> compilation on a "up-to-date" Fedora 32 system. >> >> What do I do wrong? >> >> ./configure --prefix=/home/joukj/openvms --exec-prefix=/home/joukj/openvms --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=ia64-hp-openvms > Don't run configure in the source tree, see > https://gcc.gnu.org/wiki/InstallingGCC > > >> make >> >> >> ... >> g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtt >> i -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qu >> al -Wno-error=format-diag -Wmissing-format-attribute -Woverloaded-virtual -pedan >> tic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_ >> H -DGENERATOR_FILE -fno-PIE -I. -Ibuild -I../.././gcc -I../.././gcc/build -I../ >> .././gcc/../include -I../.././gcc/../libcpp/include \ >> -o build/genmodes.o ../.././gcc/genmodes.c >> ./as: line 106: exec: -I: invalid option > This means you don't have an assembler for the cross target. I would guess this coming somehow from configuring in the source directory.  The 'genmodes' executable is produced for the BUILD system so the 'as' required here would be the native one. The './as' script is somehow broken. What seems also to be missing is the prerequisite : "In order to build GCC, the C standard library and headers must be present for all target variants for which target libraries will be built (and not only the variant of the host C++ compiler)." https://gcc.gnu.org/install/prerequisites.html When there is no "--with-sysroot=" to point to the required  'ia64-hp-openvms' target libraries and headers (the assumption nowadays being a separate $sysroot for the target stuff), this mistake seems obvious.  The "prerequisites" talks about producing a native GCC but just the same prerequisite is true for a cross GCC. People may have installed only the 64-bit libs and headers but the GCC build tries to build also 32-bit stuff and needs 32-bit libs and headers in this task. The same "--with-sysroot=" is required in the binutils configure to tell the target linker where the target libraries are.