Cross compiler riscv64 building
Jonathan Wakely
jwakely.gcc@gmail.com
Thu Feb 9 14:31:08 GMT 2023
On Thu, 9 Feb 2023 at 11:20, Sagar Acharya wrote:
>
> I built binutils. Installed it at /usr/local/riscv64-unknown-elf directory
>
> Now, I tried building gcc with
> ./configure --host=riscv64-unknown-elf
Why would you do that? That's not what I suggested, and not what the
links I gave suggest. And it's wrong.
> make
>
> However, the gcc directory within gcc-12.2.0 has no Makefile made during configure command. So it enters gcc-12.2.0/gcc dir, sees no Makefile prepared, exits with error.
>
> How do I solve this?
>
> Thanking you
> Sagar Acharya
> https://designman.org
>
>
>
> 8 Feb 2023, 16:48 by jwakely.gcc@gmail.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
> >
More information about the Gcc-help
mailing list