[LLVMdev] how to add some default target flags?

Daniel Sanders Daniel.Sanders at imgtec.com
Wed Jun 3 03:59:47 PDT 2015


Hi,

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?

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.

> 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.

> -----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