#3846 closed defect (fixed)

Build system does not track the dependencies of start.o files

Reported by: Sebastian Huber Owned by: Sebastian Huber
Priority: normal Milestone: 6.1
Component: build Version: 6
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

This defect relates to the new waf based build system.

Most start.o are generated from start.S files which use the C preprocessor. The start.o files are not re-generated if header files (e.g. cpuopts.h, bspopts.h) change. The problem is that the automatic dependency generation via the GCC -MMD flags doesn't work with the current asm rule:

    def asm(self, bld, bic, source, target=None, deps=[], cppflags=[]):
        if target is None:
            target = os.path.splitext(source)[0] + ".o"
        bld(
            asflags=self.data["asflags"],
            before=["cstlib"],
            cppflags=cppflags + self.data["cppflags"],
            features="asm c",
            includes=bic.includes + self.data["includes"],
            rule="${CC} ${ASFLAGS} ${CPPFLAGS} ${DEFINES_ST:DEFINES} ${CPPPATH_ST:INCPATHS} -c ${SRC[0]} -o ${TGT}",
            source=[source] + deps,
            target=target,
        )
        return target

Change History (1)

comment:1 Changed on Sep 17, 2020 at 6:58:03 AM by Sebastian Huber <sebastian.huber@…>

Resolution: fixed
Status: assignedclosed

In 4eea8d4/rtems:

build: Fix dependencies for start and asm files

Add a feature to enforce an explicit target file for assembler sources.
Add a build start file node list and use it as a test program
dependency.

The fix for #3846 and #4080 needs to be combined, because the fix
for #3846 requires the removal of 'before=cstlib?'. This patch fixes
two issues:

  1. The tracking of start file dependencies.
  1. Reflect that executables depend on the start files.

We need a start.o file in the right path so that the linker can find is
as specified by the linker script, and not for example a start.S.17.o
file in some path. This part is addressed by the "explicit_asm_target"
feature.

This build process extension

@after("apply_link")
@feature("cprogram", "cxxprogram")
def process_start_files(self):

if getattr(self, "start_files", False):

self.link_task.dep_nodes.extend(self.bld.start_files)

addresses 2.

Close #3846.
Close #4080.

Note: See TracTickets for help on using tickets.