Files
rtems/spec/build/bsps/makecustom.yml
Martin Erik Werner a72c0e0583 spec: Ensure -msoft-float is in make linking flags
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.
2025-12-04 19:02:42 -06:00

16 lines
520 B
YAML

SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
build-type: config-file
content: |
include $$(RTEMS_ROOT)/make/custom/default.cfg
CPU_DEFINES = -isystem$$(exec_prefix)/$$(RTEMS_BSP)/lib/include
CPU_CFLAGS = ${ABI_FLAGS}
CFLAGS_OPTIMIZE_V = ${OPTIMIZATION_FLAGS}
LDFLAGS = ${ABI_FLAGS} -B$$(exec_prefix)/$$(RTEMS_BSP)/lib ${PKGCONFIG_LDFLAGS}
copyrights:
- Copyright (C) 2020 embedded brains GmbH & Co. KG
enabled-by: true
install-path: ${PREFIX}/make/custom
links: []
target: ${BSP_NAME}.cfg
type: build