Compiling libgcc not optimized

Good moorning,

I am trying to compile libgcc for arm-none-eabi target from scratch, since I need to compare Floating Point SW emulation on an ARM Cortex-M4 and Risc-V based processors. The problem is that by default GCC includes the optimized version of FP SW emulation functions which is ieee754-sf.S. 

Does anyone knows how to exclude ieee754-sf.S in the libgcc compilation process? In particular how to configure GCC?

Thanks,

Parents
  • IANAE, but below is a hack one can try. No warranty of any kind.

    The asm sources for the optimized routines are collected inside the LIB1ASMFUNCS make variable.

    gccsrc/libgcc/Makefile.in has

    libgcc-objects += $(lib1asmfuncs-o)
    ...
    ...
    libgcc-s-objects += $(lib1asmfuncs-s-o)

    Comment the two lines to avoid including the optimized routines.

    The inclusion of softftp routines is controlled by gccsrc/libgcc/config/arm/t-softfp:

    softfp_wrap_start := '\#if !__ARM_ARCH_ISA_ARM && __ARM_ARCH_ISA_THUMB == 1'
    softfp_wrap_end := '\#endif'

    Change it to:

    softfp_wrap_start := '\#if 1'
    softfp_wrap_end := '\#endif'

    Build.


    Or, one may rely on utilizing -nostdlib on unmodified builds to prevent linking with -lgcc. You may also want to consult gcc dev's mailing lists.

Reply
  • IANAE, but below is a hack one can try. No warranty of any kind.

    The asm sources for the optimized routines are collected inside the LIB1ASMFUNCS make variable.

    gccsrc/libgcc/Makefile.in has

    libgcc-objects += $(lib1asmfuncs-o)
    ...
    ...
    libgcc-s-objects += $(lib1asmfuncs-s-o)

    Comment the two lines to avoid including the optimized routines.

    The inclusion of softftp routines is controlled by gccsrc/libgcc/config/arm/t-softfp:

    softfp_wrap_start := '\#if !__ARM_ARCH_ISA_ARM && __ARM_ARCH_ISA_THUMB == 1'
    softfp_wrap_end := '\#endif'

    Change it to:

    softfp_wrap_start := '\#if 1'
    softfp_wrap_end := '\#endif'

    Build.


    Or, one may rely on utilizing -nostdlib on unmodified builds to prevent linking with -lgcc. You may also want to consult gcc dev's mailing lists.

Children
More questions in this forum