How to add a dependency on start.o to the test executables in waf?

Sebastian Huber sebastian.huber at
Thu Oct 24 13:12:31 UTC 2019


I have a problem in the new build system, which I am not able to solve 
with my novice waf knowledge.

You can check out the prototype with these steps:

git clone git://
cd rtems
git checkout --track origin/build
./waf bsp_defaults --rtems-bsps=sparc > bsps.ini
./waf configure

To build a test executable, we need:

1. the test program objects,

2. the libraries, e.g. librtemscpu.a and librtemsbsp.a

3. the linker command file (source or configuration file, see 
ConfigFileItem in wscript)

4. the start file start.o

The dependencies on 1. and 2. work. The 3. is basically read-only for a 
build. The problem is 4.

The start file is build with:

class StartItem(Item):
     def __init__(self, uid, data):
         super(StartItem, self).__init__(uid, data)

     def build(self, bld):
             rule="${CC} -DASM ${CFLAGS} ${CPPFLAGS} 

The test executables are built with:

class ExecutableItem(Item):
     def __init__(self, uid, data):
         super(ExecutableItem, self).__init__(uid, data)

     def build(self, bld):
         if self.is_enabled(bld):
             includes = bld.env["INCLUDES"]
             bld.env["INCLUDES"] = (
                 includes + bld.bsp_includes + 
             bld.use = ["rtemstest", "rtemscpu", "rtemsbsp"]
             for p in self.links():
             bld.env["INCLUDES"] = includes
       ["target"] + ".exe",
                 features="c cprogram",
             del bld.use

How can I add a dependency on start.o to the test executables? I tried 
several variants of bld.add_manual_dependency(), but nothing worked.

Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

More information about the devel mailing list