# Build freedom-u-sdk with soft-float?

**URL:** <https://forums.sifive.com/t/build-freedom-u-sdk-with-soft-float/467>\
**Category:** Freedom U500\
**Created:** [April 7, 2017, 12:45am UTC](https://forums.sifive.com/t/build-freedom-u-sdk-with-soft-float/467 "2017-04-07T00:45:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aharris](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@aharris](https://forums.sifive.com/u/aharris)\
**Post date:** [April 7, 2017, 12:45am UTC](https://forums.sifive.com/t/build-freedom-u-sdk-with-soft-float/467/1 "2017-04-07T00:45:37Z")

</div>

Hey guys,

I noticed the current freedom unleashed config disables the FPU, but the freedom-u-sdk build assumes the FPU is enabled (the bbl image dies in fp\_init in minit.c if I run the current config.) I tried a few different -msoft-float, -mno-float, -march CFLAGS, and the --disable-float configure option but I still get linker errors for mixing hard-float and soft-float. Is there some trivial option I am missing? If not I can include the FPU and alter my design to lower the clock frequency.

Thanks,  
Austin

---

<div class="post-metadata">

**Author:** ![terpstra](https://avatars.discourse-cdn.com/v4/letter/t/7c8e57/32.png) [@terpstra](https://forums.sifive.com/u/terpstra)\
**Post date:** [April 7, 2017, 5:38pm UTC](https://forums.sifive.com/t/build-freedom-u-sdk-with-soft-float/467/2 "2017-04-07T17:38:53Z")

</div>

You’re mistaken. The freedom-u-sdk DISABLES the FPU. Are you sure you have the correct submodule version of riscv-pk? Your risc-pk/Makefile.in should contain:  
CFLAGS := @CFLAGS@ $(CFLAGS) -DBBL\_PAYLOAD="$(bbl\_payload)" -msoft-float

… this is assuming you are building freedom-u-sdk/master.

---

<div class="post-metadata">

**Author:** ![aharris](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@aharris](https://forums.sifive.com/u/aharris)\
**Post date:** [April 7, 2017, 8:23pm UTC](https://forums.sifive.com/t/build-freedom-u-sdk-with-soft-float/467/3 "2017-04-07T20:23:52Z")

</div>

I just cloned a fresh master of freedom-u-sdk, and riscv-pk 423f0b6c3b2f0360a5ceebfae5ee75c61ba7b6ee [Makefile.in](http://Makefile.in) contains:  
CFLAGS := @CFLAGS@ $(CFLAGS) -DBBL\_PAYLOAD="$(bbl\_payload)" -mno-float

I tried spike --isa=RV64IMAC ./bbl after running make and I still get:  
…/machine/minit.c:59: FPU not found; recompile pk with -msoft-float

Perhaps there is a discrepancy between the riscv-gnu-toolchain and riscv-pk pointed to by freedom-u-sdk with regards to the usage of -mno-float versus -msoft-float?

Thanks!

---

<div class="post-metadata">

**Author:** ![terpstra](https://avatars.discourse-cdn.com/v4/letter/t/7c8e57/32.png) [@terpstra](https://forums.sifive.com/u/terpstra)\
**Post date:** [April 7, 2017, 9:26pm UTC](https://forums.sifive.com/t/build-freedom-u-sdk-with-soft-float/467/4 "2017-04-07T21:26:40Z")

</div>

There was a change to gcc at some point where it went from no-float to soft-float. Both are now obsolete and the correct option is -mabi=lp64 -march=rv64imac. freedom-u-sdk includes a toolchain that should expect -mno-float or -msoft-float… I’m not sure any more which. If your RISCV environment variable is set, though, it will use your installed toolchain which may expect a different compile option.

This gcc transition was kind of a mess. Hopefully now that gcc is upstreamed, the next time we update freedom-u-sdk/master people won’t run into this any more.
