RTEMS | Ensure -msoft-float is seen in linking via make (!825)

Martin Werner (@martinerikwerner) gitlab at rtems.org
Tue Nov 4 22:26:52 UTC 2025



Martin Werner created a merge request: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/825

Project:Branches: martinerikwerner/rtems:ensure-soft-float-seen-in-linking-via-make to rtems/rtos/rtems:main
Author:   Martin Werner




## Summary

Ensure -msoft-float is seen in linking via make

In order for the linker to pick the correct soft-float libraries when
building for a target without an FPU the -msoft-float flag needs to be
present.

This is already the case in the pkg-config file where ABI_FLAGS are
included in Ldflags:

  Ldflags: ${ABI_FLAGS} -B${libdir} -qrtems -Wl,--gc-sections

But this is not present in the custom make includes:

  LDFLAGS = -B$(exec_prefix)/$(RTEMS_BSP)/lib -qrtems -Wl,--gc-sections

The RTEMS template make rule for linking includes all of CFLAGS:

  define bsp-link-c
  	$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) \
  	    -o $(basename $@)$(EXEEXT) $(LINK_OBJS) $(LINK_LIBS)
  endef

The standard (GNU) built-in make rule for linking does not include
CFLAGS when linking:

  $(CC) $(LDFLAGS) $* $(LOADLIBES) $(LDLIBS) -o $@

Add ABI_FLAGS to LDFLAGS in the custom make includes such that building
soft-float applications works with the default built-in make rules as
well.


<!-- Default settings, if it is a dropdown it will set after submission -->

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/825
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20251104/e1081f01/attachment.htm>


More information about the bugs mailing list