From: Kai Ruottu <kai.ruottu@wippies.com>
To: Dingjun Chen <Dingjun.Chen@geotechairborne.com>,
Xi Ruoyao <xry111@xry111.site>,
Jonathan Wakely <jwakely.gcc@gmail.com>
Cc: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: What caused my executable file not to run on a Linux of old version 2.4.36.1
Date: Tue, 10 Oct 2023 20:41:52 +0300 [thread overview]
Message-ID: <1da940be-77b6-de1f-95e5-1500f426755b@wippies.com> (raw)
In-Reply-To: <YT2P288MB00739A5C2DF9401721FD348C97CDA@YT2P288MB0073.CANP288.PROD.OUTLOOK.COM>
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)<https://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/>
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!
prev parent reply other threads:[~2023-10-10 17:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-06 14:43 Dingjun Chen
2023-10-06 15:33 ` Fw: " Dingjun Chen
2023-10-06 17:07 ` Jonathan Wakely
2023-10-07 6:18 ` Xi Ruoyao
2023-10-07 11:19 ` Kai Ruottu
2023-10-10 10:28 ` Dingjun Chen
2023-10-10 12:36 ` Xi Ruoyao
2023-10-10 12:30 ` Dingjun Chen
2023-10-10 17:13 ` Dingjun Chen
2023-10-10 17:41 ` Kai Ruottu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1da940be-77b6-de1f-95e5-1500f426755b@wippies.com \
--to=kai.ruottu@wippies.com \
--cc=Dingjun.Chen@geotechairborne.com \
--cc=gcc-help@gcc.gnu.org \
--cc=jwakely.gcc@gmail.com \
--cc=xry111@xry111.site \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).