From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fgw21-4.mail.saunalahti.fi (fgw21-4.mail.saunalahti.fi [62.142.5.108]) by sourceware.org (Postfix) with ESMTPS id 163373858D35 for ; Tue, 10 Oct 2023 17:41:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 163373858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=wippies.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=wippies.com Received: from [10.0.0.41] (mobile-access-56736b-197.dhcp.inet.fi [86.115.107.197]) by fgw21.mail.saunalahti.fi (Halon) with ESMTPSA id 4ce22a74-6794-11ee-abf4-005056bdd08f; Tue, 10 Oct 2023 20:41:55 +0300 (EEST) Message-ID: <1da940be-77b6-de1f-95e5-1500f426755b@wippies.com> Date: Tue, 10 Oct 2023 20:41:52 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: What caused my executable file not to run on a Linux of old version 2.4.36.1 To: Dingjun Chen , Xi Ruoyao , Jonathan Wakely Cc: gcc-help References: From: Kai Ruottu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,KAM_NUMSUBJECT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Dingjun Chen kirjoitti 10.10.2023 klo 20.13: > Hi, Ruoyao, > > Could you please tell me how to build cross compiler for Linux of different versions? > > I followed the following method, but I failed. I look forward to your help! > > How to Build a GCC Cross-Compiler (preshing.com) This "method" belongs in the group "Linux from scratch", not in "producing a cross compiler for existing Linux target". The idea in the latter is "to do same things on another host system as one could do on the existing Linux target system". What already exists, it is available and there isn't any reason to "reinvent the wheel". So you only need to produce GNU binutils and GCC from their sources to work on another host system and to produce stuff for the target system there. For the "Linux distros" their install RPMs, '.deb' packages etc will provide the required "run-time libraries" usually natively in '/lib' on the target system, the "development libraries" in '/usr/lib' and "development headers & kernel headers" in '/usr/include'.  These are the basic "sysroot" stuff required during the GCC build Xi told about. So please choose your install $prefix for the cross binutils and cross GCC binaries (the same for both) and $sysroot for the C library etc coming from / belonging to the target system. Then configure and build the sources and be happy!  It really isn't complicated at all!