Enable soft-float

Hi All,

I am working on a custom defined architecture which implements Sparc
ISA but without floating point instructions.
I have two questions regarding using LLVM:
1. How to enable soft-float when building llvm-gcc?
2. How to let llvm-gcc generate native code (binaries) for Sparc? Do I
have to compile glibc or newlib for Sparc and link with it together?
I am kinda confused so it would be great if anyone could offer some help.
Thanks!

Hi All,

I am working on a custom defined architecture which implements Sparc
ISA but without floating point instructions.
I have two questions regarding using LLVM:
1. How to enable soft-float when building llvm-gcc?

There might be an option when configuring llvm-gcc. Check the GCC docs to see if such an option exists. Maybe someone who has used LLVM on Sparc recently can comment.

2. How to let llvm-gcc generate native code (binaries) for Sparc? Do I
have to compile glibc or newlib for Sparc and link with it together?
I am kinda confused so it would be great if anyone could offer some help.

llvm-gcc assumes that there's already a native code C library available to use. All the systems of which I know already come with a C library. If you somehow don't have a C library for your system, you'll have to compile one.

-- John T.

Hi All,

I am working on a custom defined architecture which implements Sparc
ISA but without floating point instructions.
I have two questions regarding using LLVM:
1. How to enable soft-float when building llvm-gcc?

There might be an option when configuring llvm-gcc. Check the GCC docs to
see if such an option exists. Maybe someone who has used LLVM on Sparc
recently can comment.

Thanks.
It seems to me that soft-float is generated at the backend, i.e. there
are soft-float options when building binutils for gcc.
But now llvm-gcc is only a frontend and llvm takes care of the
backend. If llvm is not supporting soft-float then I am out of luck.

2. How to let llvm-gcc generate native code (binaries) for Sparc? Do I
have to compile glibc or newlib for Sparc and link with it together?
I am kinda confused so it would be great if anyone could offer some help.

llvm-gcc assumes that there's already a native code C library available to
use. All the systems of which I know already come with a C library. If you
somehow don't have a C library for your system, you'll have to compile one.

Yes every system comes with C library implementations but if the
target architecture is different from the host, e.g. I am running llvm
on x86 but I am generating code for sparc then I won't have libraries
directly available. Is that right? How do people normally handle this?

Hi,

> llvm-gcc assumes that there's already a native code C library available to
> use. 鼦ll the systems of which I know already come with a C library. 狢f you
> somehow don't have a C library for your system, you'll have to compile one.
>

Yes every system comes with C library implementations but if the
target architecture is different from the host, e.g. I am running llvm
on x86 but I am generating code for sparc then I won't have libraries
directly available. Is that right? How do people normally handle this?

  Cross compiling?

Regards,
chenwj

Hi,

> llvm-gcc assumes that there's already a native code C library available to
> use. 鼦ll the systems of which I know already come with a C library. 狢f you
> somehow don't have a C library for your system, you'll have to compile one.
>

Yes every system comes with C library implementations but if the
target architecture is different from the host, e.g. I am running llvm
on x86 but I am generating code for sparc then I won't have libraries
directly available. Is that right? How do people normally handle this?

Cross compiling?

I don't think it would be a cross compiling. The main difference
between llvm and gcc backend is that llvm directly support generating
code for different target while in gcc you have to cross compile.
Cross compiling for llvm means "create LLVM executables and libraries
to be hosted on a platform different from the platform where they are
build (a Canadian Cross build)" based on the llvm documentation.

I was just curious now that llvm supports that many targets, how
should users deal with libraries of those targets?