OpenWrt Forum Archive

Topic: How to change -mfloat-abi to softfp from hard..?

The content of this topic has been archived on 2 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi All,

I am working on 14.08 and 16.02 openWRT code. I am getting an error when I compile my code in openWRT 16.02 and 14.08. The error is

/home/ramesh/GIT_TEST_1408_cns3xxx_2/md_es_1408/gateworks-openwrt_1408/trunk/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/../../../../arm-openwrt-linux-uclibcgnueabi/bin/ld: error: patcher uses VFP register arguments, /home/ramesh/GIT_TEST_1408_cns3xxx_2/md_es_1408/gateworks-openwrt_1408/trunk/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/usr/share/md-meshap/aes/aes_wrap.o does not

/home/ramesh/GIT_TEST_1408_cns3xxx_2/md_es_1408/gateworks-openwrt_1408/trunk/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/../../../../arm-openwrt-linux-uclibcgnueabi/bin/ld: failed to merge target specific data of file /home/ramesh/GIT_TEST_1408_cns3xxx_2/md_es_1408/gateworks-openwrt_1408/trunk/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/usr/share/md-meshap/aes/aes_wrap.o
collect2: error: ld returned 1 exit status
make[5]: *** [patcher] Error 1
make[5]: Leaving directory `/home/ramesh/GIT_TEST_1408_cns3xxx_2/md_es_1408/gateworks-openwrt_1408/trunk/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/patcher'
make[4]: *** [/home/ramesh/GIT_TEST_1408_cns3xxx_2/md_es_1408/gateworks-openwrt_1408/trunk/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/patcher/.built] Error 2
make[4]: Leaving directory `/home/ramesh/GIT_TEST_1408_cns3xxx_2/md_es_1408/gateworks-openwrt_1408/trunk/package/embeddedstudios/md-patcher'
make[3]: *** [package/embeddedstudios/md-patcher/compile] Error 2
make[3]: *** Waiting for unfinished jobs....


I have googled this error, People are saying we can correct this error by changing -mfloat-abi to softfp from hard.

I tried changing it.. But I couldn't do it .. So can anyone suggest me to change this..??


Thanks,
Ramesh

rameshbabu.p wrote:

I have googled this error, People are saying we can correct this error by changing -mfloat-abi to softfp from hard.

I tried changing it.. But I couldn't do it .. So can anyone suggest me to change this..??

There is some trouble with your toolchain.

make dirclean

will fix this.
A this pint OpenWRT creates a shiny new toolchain

Hi Elektroman,

I have tried doing make dirclean and then gave a compile. But still mfloat-abi is hard only

Please give some more info on this.

Thanks,
Ramesh

rameshbabu.p wrote:

I have tried doing make dirclean and then gave a compile. But still mfloat-abi is hard only

They must be some error in .config
The simplest way is to start from a clean (removed) one.

I checked current git with uClibc and this compiles like a charm.
For doing this enable
[ ] Advanced configuration options->Show broken platforms

Hi Elektroman,

I have enabled [ ] Advanced configuration options->Show broken platforms this flag in configuration and I given a clean build.

But still mfloat-abi is hard only

Please suggest me some more info on this.

Thanks,
Ramesh

Still am not able to make it to soft...

Soft float is an explicit CONFIG option.

make menuconfig
Advanced Configuration Options (for developers) --> Target Options --> Use software floating point by default

If you're lazy, just edit the .config and add the option CONFIG_SOFT_FLOAT=y. You will need to do a make dirclean and completely rebuild your toolchain. The soft float option depends on one of the following targets being set: arm || armeb || powerpc || mipsel || mips || mips64el || mips64

On a more fundamental level, you appear to have an ABI mismatch and blindly changing the SOFT_FLOAT option may or may not fix it. That is to say, your patcher app seems to be using hard float ABI and the aes_wrap.o component is using soft float ABI. The error message "patcher uses VFP register arguments ..... /aes/aes_wrap.o does not" indicates an ABI mismatch.

What is this "patcher" and "mdmeshapp" you are trying to compile? Are they both Openwrt packages or your own code? If it is your own code, then you might be compiling it with incorrect command line switches to GCC.

Suggest posting your Makefiles....

dl12345 wrote:

Soft float is an explicit CONFIG option.

make menuconfig
Advanced Configuration Options (for developers) --> Target Options --> Use software floating point by default

If you're lazy, just edit the .config and add the option CONFIG_SOFT_FLOAT=y. You will need to do a make dirclean and completely rebuild your toolchain. The soft float option depends on one of the following targets being set: arm || armeb || powerpc || mipsel || mips || mips64el || mips64

On a more fundamental level, you appear to have an ABI mismatch and blindly changing the SOFT_FLOAT option may or may not fix it. That is to say, your patcher app seems to be using hard float ABI and the aes_wrap.o component is using soft float ABI. The error message "patcher uses VFP register arguments ..... /aes/aes_wrap.o does not" indicates an ABI mismatch.

What is this "patcher" and "mdmeshapp" you are trying to compile? Are they both Openwrt packages or your own code? If it is your own code, then you might be compiling it with incorrect command line switches to GCC.

Suggest posting your Makefiles....


Its working for me. I have manually edited the .config file and tried its working but it is not working when I do it via make menuconfig.

But I have a doubt, If we use softap mfloat-abi will it take more CPU cycles..?

"patcher" and "mdmeshapp" these are my own source code.

Thanks,
Ramesh

rameshbabu.p wrote:

But I have a doubt, If we use softap mfloat-abi will it take more CPU cycles..?

Yes

Then I have to go with mfloat as hard only in order to reduce the usage of CPU cycle.
So Can I fix this linking error when I use hard?

rameshbabu.p wrote:

Then I have to go with mfloat as hard only in order to reduce the usage of CPU cycle.
So Can I fix this linking error when I use hard?

Yes, use the correct compiler options in your Makefiles, but you haven't posted your makefiles

The discussion might have continued from here.