Configuration options are not completely independent. For example the C library's strtod() and atof() functions rely on the math library package to provide certain functionality. If the math library package is removed then the C library can no longer provide these functions. Each package describes constraints like these in CDL "requires" properties. If a constraint is not satisfied, then the configuration contains a conflict. For any given conflict there can be several resolution options. For example, it would be possible to add the math library package back to the configuration, or to disable the strtod() and atof() functions.
The eCos configuration tools will report any conflicts in the current configuration. If there are any such conflicts then the configuration is usually unsafe and it makes no sense to build and run eCos in such circumstances. In fact, any attempt at building eCos is likely to fail. In exceptional cases it is possible to override this by using e.g. the --ignore-errors qualifier with ecosconfig.
Many constraints are fairly simple in nature, and the configuration tools contain an inference engine which can resolve the associated conflicts automatically. For example, if the math library package is removed then the inference engine can resolve the resulting conflict by disabling the configuration option for strtod() and atof(). All such changes will be reported. Sometimes the inference engine cannot resolve a conflict, for example it is not allowed to override a change that has been made explicitly by the user. Sometimes it will find a solution which does not match the application's requirements.
A typical session involving conflicts would look something like this:
$ ecosconfig new pid |
For some targets there may be conflicts and the inference engine would come into play.
$ ecosconfig remove libm U CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, new inferred value 0 U CYGFUN_LIBC_strtod, new inferred value 0 U CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, new inferred value 0 |
To suppress the inference engine --no-resolve can be used:
$ ecosconfig new pid $ ecosconfig --no-resolve remove libm C CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, "requires" constraint not satisfied: CYGPKG_LIBM C CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, "requires" constraint not satisfied: CYGPKG_LIBM C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM |
The check command can be used to get the current state of the configuration, and the --verbose qualifier will provide additional information:
$ ecosconfig --srcdir /home/bartv/ecc/ecc --verbose check Target: pid Template: default Removed: CYGPKG_LIBM 3 conflict(s): C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM Possible solution: CYGFUN_LIBC_strtod -> 0 CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT -> 0 C CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, "requires" constraint not satisfied: CYGPKG_LIBM Possible solution: CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT -> 0 C CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, "requires" constraint not satisfied: CYGPKG_LIBM Possible solution: CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT -> 0 |
If the proposed solutions are acceptable, the resolve command can be used to apply them:
$ ecosconfig resolve U CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, new inferred value 0 U CYGFUN_LIBC_strtod, new inferred value 0 U CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, new inferred value 0 |
The current configuration is again conflict-free and it is possible to generate a build tree. The --quiet qualifier can be used to suppress the change messages, if desired.
When changing individual configuration options by editing the ecos.ecc file (as described below), the resulting system should be checked and any problems should be resolved. For example, if CYGFUN_LIBC_strtod is explicitly enabled in the savefile:
$ edit ecos.ecc $ ecosconfig check Target: pid Template: default Removed: CYGPKG_LIBM 1 conflict(s): C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM $ ecosconfig resolve C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM |
$ ecosconfig --srcdir /home/bartv/ecc/ecc tree C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM Unable to generate build tree, this configuration still contains conflicts. Either resolve the conflicts or use --ignore-errors |
It is still possible to generate a build tree:
$ ecosconfig --srcdir /home/bartv/ecc/ecc --ignore-errors tree C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM $ make |