VFP linker/lib issue

Asked by Lukas Steinert

Hi,

I just tried to link a project with CooCox, and the 4.6 2012q2. It's for a STM32F407ZG using the FPU in quiet some extend (port from IAR Workbench). Ld has the following problem:

       [cc] Starting link
       [cc] arm-none-eabi-gcc -O0 -nostartfiles -Wl,-Map=xM-Baseboard.map -mcpu=cortex-m4 -mthumb -LD:\xm-baseboard-software\xM-Baseboard -Wl,-TD:\xm-baseboard-software\xM-Baseboard\arm-gcc-link.ld -Wl,--gc-sections -lgcc -lc -lm -g -o xM-Baseboard.elf ..\obj\arm_mat_inverse_f32.o ..\obj\arm_add_q7.o ..\obj\arm_scale_q7.o ..\obj\arm_mat_add_f32.o ..\obj\stm32f4xx_syscfg.o ..\obj\arm_q31_to_float.o ..\obj\arm_cfft_radix4_q15.o ..\obj\arm_pid_init_q31.o ..\obj\arm_float_to_q7.o ..\obj\os_time.o ..\obj\arm_q31_to_q7.o ..\obj\stm32f4xx_sdio.o ..\obj\arm_biquad_cascade_df1_q15.o ..\obj\arm_cmplx_dot_prod_q15.o ..\obj\arm_fir_decimate_fast_q15.o ..\obj\arm_cfft_radix4_f32.o ..\obj\arm_sin_cos_q31.o ..\obj\arm_scale_q31.o ..\obj\bsp_adisIMU_protocol.o ..\obj\bsp_int.o ..\obj\arm_fir_sparse_init_q31.o ..\obj\arm_rfft_q15.o ..\obj\arm_correlate_q7.o ..\obj\arm_biquad_cascade_df1_f32.o ..\obj\arm_cmplx_dot_prod_f32.o ..\obj\arm_cmplx_mult_real_q31.o ..\obj\cpu_c.o ..\obj\stm32f4xx_hash.o ..\obj\stm32f4xx_cryp_aes.o ..\obj\lib_mem.o ..\obj\arm_q15_to_q31.o ..\obj\arm_abs_q7.o ..\obj\arm_fill_q31.o ..\obj\arm_common_tables.o ..\obj\arm_rfft_f32.o ..\obj\stm32f4xx_hash_sha1.o ..\obj\arm_q7_to_q15.o ..\obj\arm_conv_q7.o ..\obj\arm_sin_q31.o ..\obj\os_cpu_c.o ..\obj\arm_fir_sparse_q15.o ..\obj\cpu_core.o ..\obj\arm_dot_prod_q15.o ..\obj\arm_q15_to_float.o ..\obj\stm32f4xx_usart.o ..\obj\arm_correlate_fast_q15.o ..\obj\arm_biquad_cascade_df2T_init_f32.o ..\obj\arm_lms_init_q15.o ..\obj\stm32f4xx_pwr.o ..\obj\arm_correlate_q31.o ..\obj\arm_max_q31.o ..\obj\arm_fir_sparse_f32.o ..\obj\os_flag.o ..\obj\arm_conv_partial_q15.o ..\obj\arm_biquad_cascade_df1_32x64_q31.o ..\obj\arm_dot_prod_f32.o ..\obj\arm_dct4_init_q15.o ..\obj\bsp_uBlox_protocol.o ..\obj\arm_cfft_radix4_init_q31.o ..\obj\bsp_adis16204_protocol.o ..\obj\app_hooks.o ..\obj\stm32f4xx_can.o ..\obj\arm_lms_init_f32.o ..\obj\arm_rms_q15.o ..\obj\stm32f4xx_wwdg.o ..\obj\arm_conv_partial_f32.o ..\obj\arm_dct4_init_f32.o ..\obj\arm_mat_mult_q31.o ..\obj\arm_fir_interpolate_init_q31.o ..\obj\arm_fill_q7.o ..\obj\arm_iir_lattice_init_q15.o ..\obj\arm_shift_q31.o ..\obj\stm32f4xx_hash_md5.o ..\obj\arm_mult_q31.o ..\obj\arm_fir_lattice_q15.o ..\obj\arm_rms_f32.o ..\obj\stm32f4xx_dac.o ..\obj\arm_biquad_cascade_df1_init_q15.o ..\obj\arm_std_q15.o ..\obj\arm_mat_add_q31.o ..\obj\arm_iir_lattice_init_f32.o ..\obj\arm_abs_q15.o ..\obj\arm_fir_sparse_q7.o ..\obj\arm_fir_lattice_f32.o ..\obj\arm_negate_q7.o ..\obj\arm_sub_q15.o ..\obj\arm_biquad_cascade_df1_init_f32.o ..\obj\arm_std_f32.o ..\obj\startup_stm32f4xx.o ..\obj\arm_mat_init_q15.o ..\obj\arm_conv_q15.o ..\obj\arm_abs_f32.o ..\obj\arm_fir_lattice_init_q15.o ..\obj\arm_cfft_radix4_q31.o ..\obj\arm_sub_f32.o ..\obj\arm_q15_to_q7.o ..\obj\lib_str.o ..\obj\stm32f4xx_crc.o ..\obj\arm_mat_init_f32.o ..\obj\stm32f4xx_iwdg.o ..\obj\arm_conv_f32.o ..\obj\arm_fir_lattice_init_f32.o ..\obj\arm_biquad_cascade_df1_q31.o ..\obj\arm_cmplx_dot_prod_q31.o ..\obj\arm_fir_decimate_fast_q31.o ..\obj\arm_rfft_init_q15.o ..\obj\arm_conv_partial_fast_q15.o ..\obj\arm_min_q15.o ..\obj\arm_q7_to_float.o ..\obj\arm_rfft_q31.o ..\obj\arm_fir_q7.o ..\obj\stm32f4xx_rcc.o ..\obj\arm_rfft_init_f32.o ..\obj\arm_min_f32.o ..\obj\arm_fir_sparse_init_q7.o ..\obj\lib_ascii.o ..\obj\arm_q7_to_q31.o ..\obj\arm_dct4_q15.o ..\obj\arm_fir_sparse_q31.o ..\obj\arm_fir_init_q15.o ..\obj\arm_dot_prod_q31.o ..\obj\arm_correlate_fast_q31.o ..\obj\arm_cmplx_conj_q15.o ..\obj\stm32f4xx_adc.o ..\obj\arm_dct4_f32.o ..\obj\arm_lms_init_q31.o ..\obj\arm_iir_lattice_q15.o ..\obj\arm_fir_init_f32.o ..\obj\arm_conv_partial_q31.o ..\obj\os_dbg.o ..\obj\arm_dct4_init_q31.o ..\obj\stm32f4xx_dcmi.o ..\obj\arm_cmplx_conj_f32.o ..\obj\arm_power_q15.o ..\obj\arm_rms_q31.o ..\obj\arm_iir_lattice_f32.o ..\obj\arm_shift_q7.o ..\obj\arm_iir_lattice_init_q31.o ..\obj\arm_fir_fast_q15.o ..\obj\os_sem.o ..\obj\arm_fir_lattice_q31.o ..\obj\arm_power_f32.o ..\obj\arm_lms_norm_q15.o ..\obj\arm_biquad_cascade_df1_init_q31.o ..\obj\arm_cmplx_mag_q15.o ..\obj\arm_std_q31.o ..\obj\arm_fir_decimate_q15.o ..\obj\arm_abs_q31.o ..\obj\arm_copy_q15.o ..\obj\arm_pid_reset_q15.o ..\obj\arm_sub_q31.o ..\obj\arm_lms_norm_f32.o ..\obj\arm_cmplx_mag_f32.o ..\obj\bsp_os.o ..\obj\os_core.o ..\obj\stm32f4xx_cryp_des.o ..\obj\arm_fir_decimate_f32.o ..\obj\arm_mat_init_q31.o ..\obj\arm_cmplx_mag_squared_q15.o ..\obj\arm_conv_q31.o ..\obj\arm_copy_f32.o ..\obj\arm_pid_reset_f32.o ..\obj\arm_fir_lattice_init_q31.o ..\obj\arm_fir_q15.o ..\obj\arm_add_q15.o ..\obj\stm32f4xx_cryp.o ..\obj\arm_fir_interpolate_q15.o ..\obj\stm32f4xx_fsmc.o ..\obj\arm_cmplx_mag_squared_f32.o ..\obj\arm_fir_f32.o ..\obj\arm_add_f32.o ..\obj\arm_rfft_init_q31.o ..\obj\arm_conv_partial_fast_q31.o ..\obj\arm_min_q31.o ..\obj\arm_fir_interpolate_f32.o ..\obj\arm_conv_partial_q7.o ..\obj\os_mem.o ..\obj\arm_fir_init_q7.o ..\obj\bsp_Servo.o ..\obj\arm_lms_norm_init_q15.o ..\obj\arm_mean_q15.o ..\obj\stm32f4xx_gpio.o ..\obj\arm_biquad_cascade_df1_32x64_init_q31.o ..\obj\stm32f4xx_flash.o ..\obj\arm_fir_decimate_init_q15.o ..\obj\arm_float_to_q15.o ..\obj\lib_math.o ..\obj\arm_lms_norm_init_f32.o ..\obj\arm_mean_f32.o ..\obj\arm_dct4_q31.o ..\obj\arm_cos_q15.o ..\obj\system_stm32f4xx.o ..\obj\syscalls.o ..\obj\arm_lms_q15.o ..\obj\arm_fir_init_q31.o ..\obj\arm_biquad_cascade_df1_fast_q15.o ..\obj\arm_negate_q15.o ..\obj\stm32f4xx_dma.o ..\obj\arm_sqrt_q15.o ..\obj\arm_fir_decimate_init_f32.o ..\obj\arm_var_q15.o ..\obj\arm_cmplx_conj_q31.o ..\obj\arm_mat_trans_q15.o ..\obj\arm_mat_sub_q15.o ..\obj\arm_offset_q15.o ..\obj\arm_cos_f32.o ..\obj\os_q.o ..\obj\arm_iir_lattice_q31.o ..\obj\arm_lms_f32.o ..\obj\arm_negate_f32.o ..\obj\app.o ..\obj\arm_cmplx_mult_cmplx_q15.o ..\obj\os_task.o ..\obj\arm_mat_mult_fast_q15.o ..\obj\arm_var_f32.o ..\obj\arm_conv_fast_q15.o ..\obj\arm_mat_scale_q15.o ..\obj\arm_mat_trans_f32.o ..\obj\arm_mat_sub_f32.o ..\obj\arm_offset_f32.o ..\obj\arm_power_q31.o ..\obj\bsp_gumstix_protocol.o ..\obj\bsp_gps_timer.o ..\obj\arm_power_q7.o ..\obj\arm_cmplx_mult_cmplx_f32.o ..\obj\arm_fir_fast_q31.o ..\obj\arm_mat_scale_f32.o ..\obj\os_mutex.o ..\obj\arm_lms_norm_q31.o ..\obj\arm_cmplx_mag_q31.o ..\obj\arm_offset_q7.o ..\obj\arm_fir_decimate_q31.o ..\obj\arm_pid_init_q15.o ..\obj\arm_copy_q31.o ..\obj\arm_pid_reset_q31.o ..\obj\bsp_MS5611_protocol.o ..\obj\stm32f4xx_spi.o ..\obj\bsp.o ..\obj\arm_pid_init_f32.o ..\obj\stm32f4xx_i2c.o ..\obj\arm_cmplx_mag_squared_q31.o ..\obj\stm32f4xx_rng.o ..\obj\arm_scale_q15.o ..\obj\arm_fir_q31.o ..\obj\arm_mult_q7.o ..\obj\stm32f4xx_exti.o ..\obj\arm_add_q31.o ..\obj\arm_fir_sparse_init_q15.o ..\obj\os_tmr.o ..\obj\arm_fir_interpolate_q31.o ..\obj\misc.o ..\obj\arm_sin_cos_f32.o ..\obj\arm_cmplx_mult_real_q15.o ..\obj\arm_scale_f32.o ..\obj\arm_max_q7.o ..\obj\arm_min_q7.o ..\obj\arm_fill_q15.o ..\obj\arm_fir_sparse_init_f32.o ..\obj\bsp_spi.o ..\obj\arm_sin_q15.o ..\obj\arm_cmplx_mult_real_f32.o ..\obj\arm_lms_norm_init_q31.o ..\obj\arm_biquad_cascade_df2T_f32.o ..\obj\bsp_i2c.o ..\obj\arm_mean_q31.o ..\obj\arm_fill_f32.o ..\obj\arm_q31_to_q15.o ..\obj\arm_fir_decimate_init_q31.o ..\obj\arm_sin_f32.o ..\obj\arm_correlate_q15.o ..\obj\arm_float_to_q31.o ..\obj\arm_max_q15.o ..\obj\arm_mean_q7.o ..\obj\stm32f4xx_rtc.o ..\obj\os_mbox.o ..\obj\arm_cos_q31.o ..\obj\arm_cfft_radix4_init_q15.o ..\obj\arm_lms_q31.o ..\obj\arm_biquad_cascade_df1_fast_q31.o ..\obj\arm_negate_q31.o ..\obj\arm_sqrt_q31.o ..\obj\arm_dot_prod_q7.o ..\obj\arm_correlate_f32.o ..\obj\arm_max_f32.o ..\obj\arm_var_q31.o ..\obj\stm32f4xx_cryp_tdes.o ..\obj\arm_mat_mult_q15.o ..\obj\arm_fir_interpolate_init_q15.o ..\obj\arm_mat_trans_q31.o ..\obj\arm_mat_sub_q31.o ..\obj\arm_offset_q31.o ..\obj\arm_shift_q15.o ..\obj\arm_cfft_radix4_init_f32.o ..\obj\arm_copy_q7.o ..\obj\stm32f4xx_tim.o ..\obj\arm_mult_q15.o ..\obj\arm_sub_q7.o ..\obj\arm_cmplx_mult_cmplx_q31.o ..\obj\arm_mat_mult_fast_q31.o ..\obj\bsp_uart.o ..\obj\stm32f4xx_dbgmcu.o ..\obj\arm_conv_fast_q31.o ..\obj\arm_mat_scale_q31.o ..\obj\arm_mat_mult_f32.o ..\obj\arm_fir_interpolate_init_f32.o ..\obj\arm_mat_add_q15.o ..\obj\arm_mult_f32.o
       [cc] c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/bin/ld.exe: error: xM-Baseboard.elf uses VFP register arguments, c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/armv7e-m\libgcc.a(_fixsfdi.o) does not
       [cc] c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/armv7e-m\libgcc.a(_fixsfdi.o)
       [cc] c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/bin/ld.exe: error: xM-Baseboard.elf uses VFP register arguments, c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/armv7e-m\libgcc.a(_fixunssfdi.o) does not
       [cc] c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/armv7e-m\libgcc.a(_fixunssfdi.o)
       [cc] c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/bin/ld.exe: error: xM-Baseboard.elf uses VFP register arguments, c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/armv7e-m\libgcc.a(bpabi.o) does not
       [cc] c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/armv7e-m\libgcc.a(bpabi.o)
       [cc] c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/bin/ld.exe: error: xM-Baseboard.elf uses VFP register arguments, c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/armv7e-m\libgcc.a(unwind-arm.o) does not
       [cc] c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/armv7e-m\libgcc.a(unwind-arm.o)
       [cc] c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/bin/ld.exe: error: xM-Baseboard.elf uses VFP register arguments, c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/armv7e-m\libgcc.a(pr-support.o) does not
       [cc] c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/armv7e-m\libgcc.a(pr-support.o)
       [cc] c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/bin/ld.exe: error: xM-Baseboard.elf uses VFP register arguments, c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/armv7e-m\libgcc.a(_divdi3.o) does not
       [cc] c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/armv7e-m\libgcc.a(_divdi3.o)
       [cc] c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/bin/ld.exe: error: xM-Baseboard.elf uses VFP register arguments, c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/armv7e-m\libgcc.a(_udivdi3.o) does not
       [cc] c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/armv7e-m\libgcc.a(_udivdi3.o)
       [cc] c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/bin/ld.exe: error: xM-Baseboard.elf uses VFP register arguments, c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv7e-m\libg.a(lib_a-memcpy.o) does not
       [cc] c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv7e-m\libg.a(lib_a-memcpy.o)
       [cc] c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/bin/ld.exe: error: xM-Baseboard.elf uses VFP register arguments, c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv7e-m\libg.a(lib_a-memset.o) does not
       [cc] c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file c:/coocox/coide/armgcc/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv7e-m\libg.a(lib_a-memset.o)

My guess is, that somehow the libs used here aren't supporting the hard-fpu option. Any clues on how to fix this one? I'm quiet new to gcc, still learning the basics...

Thx,
Cheers, Stoney

Question information

Language:
English Edit question
Status:
Answered
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
chengbin (can-finner) said :
#1

Hi,
Thank for trying the tool.

FPU version library for armv7e-m is supported as multilib in our toolchain. See gcc-arm-none-eabi-4_6-2012q2\arm-none-eabi\lib\armv7e-m, there are sub-directories like fpu and softfp, which hold libraries supporting fpu, one for hard float-abi and the other for softfp float-abi.

To use/link these version libraries, you have to specify correct multilib options in compilation/link command line, for examle, you may give following options along with others in your compilation/link command line:

    -mfloat-abi=hard -mfpu=fpv4-sp-d16
Or:
    -mfloat-abi=softfp -mfpu=fpv4-sp-d16

It depends on float-abi to decide which one should be used.

Please refer to readme.txt(section * Architecture options usage *) in the package, there is detailed explanation about this.

Hoping this help.

Revision history for this message
IgorKossak (imah) said :
#2

Don't use ld for linking. Use gcc or g++ instead.

Can you help with this problem?

Provide an answer of your own, or ask Lukas Steinert for more information if necessary.

To post a message you must log in.