public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Sagar Acharya <sagaracharya@tutanota.com>
Cc: Gcc Help <gcc-help@gcc.gnu.org>
Subject: Re: Cross compiler riscv64 building
Date: Wed, 8 Feb 2023 11:18:10 +0000	[thread overview]
Message-ID: <CAH6eHdQR1psBp0Q4ftL9TCvDWHvj+rhHw4aDa03gqJv7P-DwFg@mail.gmail.com> (raw)
In-Reply-To: <NNkiC8b--3-9@tutanota.com>

On Wed, 8 Feb 2023 at 11:12, Sagar Acharya via Gcc-help
<gcc-help@gcc.gnu.org> wrote:
>
> How do I configure and build a cross compiler for target riscv64 of latest gcc on aarch64 musl based void linux.
>
> I have it's default gcc installed which I want to use for compiling.

See https://wiki.osdev.org/GCC_Cross-Compiler

In summary:
Download the gcc and binutils source.
Configure binutils with --prefix=$DIR --target=riscv64-unknown-elf for
some $DIR.
Run make && make install.
Configure gcc with the same --prefix and --target options.
Run make && make install.

If you want a hosted target like riscv64-unknown-linux-gnu for
compiling user-space programs, then you'll need to have a copy of the
target headers and libraries available, and point GCC to them with the
--sysroot option.
See https://wiki.osdev.org/Hosted_GCC_Cross-Compiler

  reply	other threads:[~2023-02-08 11:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-08 11:11 Sagar Acharya
2023-02-08 11:18 ` Jonathan Wakely [this message]
2023-02-09 11:20   ` Sagar Acharya
2023-02-09 13:28     ` David Brown
2023-02-13 12:02       ` Sagar Acharya
2023-02-13 12:42         ` David Brown
2023-02-09 14:31     ` Jonathan Wakely
2023-02-08 12:45 ` David Brown

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=CAH6eHdQR1psBp0Q4ftL9TCvDWHvj+rhHw4aDa03gqJv7P-DwFg@mail.gmail.com \
    --to=jwakely.gcc@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=sagaracharya@tutanota.com \
    /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).