Bug 206446 - sys/boot/efi/Makefile.inc includes -msoft-float CFLAGS overrides -mfloat-abi=hard from src.conf
Summary: sys/boot/efi/Makefile.inc includes -msoft-float CFLAGS overrides -mfloat-abi=...
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Ian Lepore
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-20 21:13 UTC by mmitchel
Modified: 2018-01-04 16:56 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mmitchel 2016-01-20 21:13:55 UTC
creates incompatible object modules that refuse to link with other system libraries. the flag -msoft-float should probably be conditional to the specific architecture(s) it applies to, and not applied all the time.

this can be seen by using CFLAGS of 

# TARGET=arm TARGET_ARCH=armv6hf
CFLAGS.armv6hf+=        -mfloat-abi=hard -mfpu=vfpv3-d16 #-march=armv7-a
CXXFLAGS.armv6hf+=      -mfloat-abi=hard -mfpu=vfpv3-d16 #-march=armv7-a

in /etc/src.conf and then doing a buildworld with TARGET_ARCH=armv6hf

typical failure output appears as during the link process

driere/jails/11_0-CURRENT-armv6hf/usr/src/sys/boot/efi/loader/../../../../lib/libstand/libstand.a
/usr/obj/arm.armv6hf/usr/local/poudriere/jails/11_0-CURRENT-armv6hf/usr/src/tmp/usr/bin/ld: ERROR: /usr/obj/arm.armv6hf/usr/loca
l/poudriere/jails/11_0-CURRENT-armv6hf/usr/src/sys/boot/efi/loader/../../ficl/libficl.a(vm.o) uses VFP register arguments, loade
r.sym.full does not
Comment 1 Warner Losh freebsd_committer freebsd_triage 2016-01-20 21:18:55 UTC
We should compile all of boot / libstand as -msoft-float *or* as -mhard-float. Mixing and matching is wrong.

I'm of the opinion that the boot loader does so little floating point that we're better off avoiding hard FP.

Also, setting CFLAGS.armv6hf likely is going to have no effect in the near future since we're transition the entire port to hard float ABI in the next 30 days or so once all the issues I'm aware of are nailed down.
Comment 2 Ian Lepore freebsd_committer freebsd_triage 2016-01-20 21:23:46 UTC
The -msoft-float flag is specifically for arm (and probably other arches too).  The floating point hardware is not available in the standalone environment which the loader code runs in, so it has to be built as softfloat.

The real problem is that the softfloat flags need to be applied to all the libraries involved in the loader, and we seem to have missed a few.  We've got a similar problem with needing to pass the -mno-movt option to all components linked into the loader, and we haven't come up with the right build mechanism for doing that yet.

I'm not sure the loader does any floating point now, but it will when the lua support comes in.
Comment 3 Warner Losh freebsd_committer freebsd_triage 2016-01-20 21:25:26 UTC
There are ficl words for floating point support. Don't know that we necessarily use them, but the reason it matters at all is because of these. Lua will definitely want them as well, and that's one of the issues for its integration...
Comment 4 Ian Lepore freebsd_committer freebsd_triage 2018-01-04 16:43:51 UTC
It appears this issue is basically OBE.  All armv6/armv7 stuff is now hardfloat by default, except the stuff in sys/boot, which must be soft-float due to lack of a runtime support environment for the VFP hardware in that environment.
Comment 5 Warner Losh freebsd_committer freebsd_triage 2018-01-04 16:56:30 UTC
Agreed. The ficl floating point stuff I saw is specifically disabled, so there's no need for even soft float that I can tell...