To provide some context, I need to use the libgcc unwind functionality in parts of the kernel, but prefer not to incur the complexity of supporting SIMD usage outside of user space. As things stand, with an out-of-the-box build, even the unwind portions of libgcc end up using SIMD instructions.
Building libgcc with -mgeneral-regs-only seems to fail because of all the soft-fp stuff and more. While I have been able to build it by explicitly excluding problematic bits via the below target makefile fragment, this impacts all the multilib builds (i.e., regular libgcc build as well as the build with -mcmodel=kernel,-mno-red-zone), which breaks things for user space. If it is possible to modify only one of the multilib builds, then that would be much better. Otherwise, the only options are using a chimerical mix of libgcc builds extracted from gcc built with/without the below fragment, or using separate compilers for kernel and user space.
Any tips or suggestions are welcome.
Code: Select all
HOST_LIBGCC2_CFLAGS += -mgeneral-regs-only
LIB2FUNCS_EXCLUDE += \
_powisf2 _powidf2 _powixf2 _powitf2 \
_mulhc3 _mulsc3 _muldc3 _mulxc3 _multc3 \
_divhc3 _divsc3 _divdc3 _divxc3 _divtc3 \
_floatdidf _floatdisf _fixunsdfsi _fixunssfsi \
_fixunsdfdi _fixdfdi _fixunssfdi _fixunsxfdi _fixunsxfsi \
_fixsfdi _floatundidf _floatundisf _floattixf _floatdixf \
_floatuntixf _floatundixf
softfp_wrap_start := '\#if 0'
softfp_wrap_end := '\#endif'