Some BSPs provide linker scripts which are generated during
`./waf configure`, for example the memory layout of
`spec/build/bsps/arm/fvp/linkcmds.yml`. The executable link tasks did not
depend on these generated files, so a reconfiguration which changed a linker
script did not trigger a relink of the test programs, leaving stale
executables.
Add the configuration files collected in env.cfg_files (which include the
generated linker scripts) as dependencies to all executable link tasks:
- the standard cprogram/cxxprogram links via process_start_files(),
- the custom link() task used by link_cc()/link_cxx(), and
- the gnatmake() task.
A change to any configuration file now relinks the executables.
Assisted-by: Claude:claude-opus-4-8 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
The bld.cc() and bld.cxx() helper rules compiled sources through a raw
"rule=" command string. The gccdeps.py plugin only wraps the asm, c,
and cxx task classes, so these rule-based tasks never had their
compiler-generated .d dependency files evaluated. Header changes such
as a modified `cpukit/include/rtems/score/cpuopts.h` (for example after
toggling the RTEMS_SMP option) did not trigger a recompilation of the
affected objects, resulting in stale objects and linker errors.
Add c_explicit_target and cxx_explicit_target features, analogous to the
existing asm_explicit_target feature, which create genuine c and cxx
tasks with an explicit target node. These tasks are wrapped by
gccdeps.py and thus honour the automatically generated dependency files.
Extra dependencies are attached as task dep_nodes to preserve the
build ordering for generated headers.
This makes the explicit cpuopts.h dependency workaround unnecessary.
Update #5482.
Assisted-by: Claude:claude-opus-4-8 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
Commit 3d782180ea changed the reported Git
hash to short. Change this back to the normal Git hash. Existing
support code may rely on this. The short hash is generated based on the
current repository state. The reported hash should be useful also for
future states of the repository. If Git changes the hash algorithm in
the future, then the hash length may be used as an indicator for the
hash algorithm. With a variable hash length this is more difficult.
Simplify expression.
Update #5037.
The updated waf version deletes the waf cache directory in the build
tree. This removes also the build specification item cache. Move the
cache directory so that it works across configure commands.
Doing the enabled-by processing just for the ldflags and just for the
link custom commands is confusing. Use an option instead which is
intended to be used for such use cases.
This allows for conditionally setting 'ldflags' in scripts that use
`link_cc` and `link_cxx`. The immediate use case is allowing a linker
flag to be used only for MicroBlaze builds of certain tests.
Define the RTEMS version in the wscript. Optionally use a VERSION file
to change the default values of the wscript. Allow the command line
option --rtems-version to override __RTEMS_MAJOR__. Remove support for
command line configurable options (--rtems-option).
Rename internal define RTEMS_VERSION_VC_KEY to
RTEMS_VERSION_CONTROL_KEY.
Merge the "default" and "default-by-variant" attributes. Use an
"enabled-by" expression to select the default value based on the enabled
set. This makes it possible to select default values depending on other
options. For example you could choose memory settings based on whether
RTEMS_SMP is enabled or disabled.
The change was tested by comparing the output of
./waf bspdefaults
before and after the change.
Allow separate optimization flags for the BSP, cpukit, and tests. For example,
the BSP and cpukit may be built without optimization if coverage
instrumentation is enabled, however, the tests may still use optimization.
Update #4670.
The waf build system uses lists for tool flags. The build items may use
variable substitution. Add the ability to use the variable substitution in
lists. For example:
MORE_FLAGS = ['-more', '-flags']
flags:
- -some-flag
- ${MORE_FLAGS}
Before this change, the ${MORE_FLAGS} was substituted to "-more -flags". This
would be passed by waf as a single command line argument to the tool.
After this change, the ${MORE_FLAGS} list extends the flags list:
flags = ['-some-flag', '-more', '-flags']
This list extension is performed if a list element consists of exactly one
variable.
Update #4670.
Start code for most platforms requires hand-coded ASM but some can be
bootstrapped entirely in C, especially for paravirtualized platforms.
This change allows start code to be written in C where possible instead
of requiring architecture-specific ASM to bridge to C.