# Hard float ABI on Android with Clang

**URL:** <https://qa.fmod.com/t/hard-float-abi-on-android-with-clang/12358>\
**Category:** FMOD Engine\
**Created:** [March 5, 2016, 11:04am UTC](https://qa.fmod.com/t/hard-float-abi-on-android-with-clang/12358 "2016-03-05T11:04:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mj1](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@mj1](https://qa.fmod.com/u/mj1)\
**Post date:** [March 5, 2016, 11:04am UTC](https://qa.fmod.com/t/hard-float-abi-on-android-with-clang/12358/1 "2016-03-05T11:04:12Z")

</div>

Hi all,

My project uses hard float ABI, i.e. armeabi-v7a-hard, but unfortunately FMOD uses the soft one (armeabi-v7a).

In fmod\_common.h F\_STDCALL ensures that all FMOD’s functions will be called using soft float, but there is an exception for Clang.

Is it possible to include soft float attribute for Clang as well?  
Or maybe there are known workarounds for this issue?

Maybe it should be based on the version of Clang; according to info present in NDK’s header it should work from Clang 3.4 onwards:

> NOTE: Disable for clang for now unless \_NDK\_MATH\_NO\_SOFTFP=1, because  
> clang before 3.4 doesn’t allow change of calling convension for  
> builtin and produces error message reads

Thanks for help!

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [March 7, 2016, 2:22am UTC](https://qa.fmod.com/t/hard-float-abi-on-android-with-clang/12358/2 "2016-03-07T02:22:05Z")

</div>

> [@](#):
>
> Hi all,
> 
> My project uses hard float ABI, i.e. armeabi-v7a-hard, but unfortunately FMOD uses the soft one (armeabi-v7a).
> 
> In fmod\_common.h F\_STDCALL ensures that all FMOD’s functions will be called using soft float, but there is an exception for Clang.
> 
> Is it possible to include soft float attribute for Clang as well?  
> Or maybe there are known workarounds for this issue?
> 
> Maybe it should be based on the version of Clang; according to info present in NDK’s header it should work from Clang 3.4 onwards:
> 
> > NOTE: Disable for clang for now unless \_NDK\_MATH\_NO\_SOFTFP=1, because  
> > clang before 3.4 doesn’t allow change of calling convension for  
> > builtin and produces error message reads
> 
> Thanks for help!

We have our header configured the same as the NDK header, it might be possible to change but I’m unsure.

Can you verify that removing “&& !defined( **clang** )” from fmod\_common.h works?

---

<div class="post-metadata">

**Author:** ![mj1](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@mj1](https://qa.fmod.com/u/mj1)\
**Post date:** [March 7, 2016, 7:16pm UTC](https://qa.fmod.com/t/hard-float-abi-on-android-with-clang/12358/3 "2016-03-07T19:16:23Z")

</div>

Hi Mathew,

I’ve checked this with versions 1.07.06 and 1.08.00 and it works fine.  
But I guess it could cause problems when using older clang…

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [March 7, 2016, 10:04pm UTC](https://qa.fmod.com/t/hard-float-abi-on-android-with-clang/12358/4 "2016-03-07T22:04:59Z")

</div>

We will look at making the FMOD header compatible with hard float and modern versions of Clang for a future release.

For now the recommended work around is to remove the “&& !defined(\__clang_\_)” section from fmod\_common.h if you know you are using a compatible version of Clang.
