[LLVMdev] how to add some default target flags?

Manuel Lauss manuel.lauss at gmail.com
Wed Jun 3 07:28:00 PDT 2015


On Wed, Jun 3, 2015 at 12:59 PM, Daniel Sanders
<Daniel.Sanders at imgtec.com> wrote:
> We haven't implemented host detection yet. However, I'm not sure it would help in
> this case since lacking an FPU isn't always a good reason to use soft-float. This is because
> soft-float binaries are incompatible with hard-float binaries (see below).
> Could you tell me more about the target?

It's alchemy chips (mips32r1 le).  I maintain a complete soft-float
gentoo userland for them,
and a kernel patch which kills all fpu users with SIGILL.


> Many fpu-less targets (particularly those running linux distributions) should generate
> hard-float code regardless and rely on fpu emulation in the kernel. For example, I have
> an EdgeRouter Pro running Debian Jessie. This target lacks an fpu but I can't use
> soft-float because that would change the calling convention and therefore break
> compatibility with the libraries installed on the system.

the in-kernel emulator is slow, so years ago I started maintaining my
own softfloat
userland.  I routinely try new things and with llvm I noticed that it
defaults to hardfloat
(i.e. when used by mesa).


>> Is there a way to have llc/llvm always use "-march=mipsle -mcpu=mips32
>> -mattr=+soft-float" as a default command line, something similar to
>> gcc's "--with-arch=mips32 --with-float=soft" configure switches?
>
> Not that I know of. The triple is the only thing you could use in LLVM and that doesn't specify soft-float vs hard-float.

Well, gcc is configured as "mipsel-softfloat-linux-gnu-gcc" and that works
beautifully.

Thanks!
        Manuel



>> -----Original Message-----
>> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
>> On Behalf Of Manuel Lauss
>> Sent: 31 May 2015 16:26
>> To: llvmdev at dcs-maillist2.engr.illinois.edu
>> Subject: [LLVMdev] how to add some default target flags?
>>
>> Hello,
>>
>> I've built LLVM natively on a fpu-less (soft-float) mips32 target, and
>> built mesa to use it.
>> However llvm apparently cannot determine what machine it's running on and
>> builds
>> code for a generic mips target with fpu.
>>
>> Is there a way to have llc/llvm always use "-march=mipsle -mcpu=mips32
>> -mattr=+soft-float" as a default command line, something similar to
>> gcc's "--with-arch=mips32 --with-float=soft" configure switches?
>>
>> Thanks!
>>     Manuel Lauss
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



More information about the llvm-dev mailing list