conflicts-and-constraints.html
来自「有关ecos2。0介绍了实时嵌入式的结构以及线程调度的实现和内存的管理等」· HTML 代码 · 共 402 行
HTML
402 行
<!-- Copyright (C) 2003 Red Hat, Inc. --><!-- This material may be distributed only subject to the terms --><!-- and conditions set forth in the Open Publication License, v1.0 --><!-- or later (the latest version is presently available at --><!-- http://www.opencontent.org/openpub/). --><!-- Distribution of the work or derivative of the work in any --><!-- standard (paper) book form is prohibited unless prior --><!-- permission is obtained from the copyright holder. --><HTML><HEAD><TITLE>Conflicts and constraints</TITLE><meta name="MSSmartTagsPreventParsing" content="TRUE"><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="eCos User Guide"HREF="ecos-user-guide.html"><LINKREL="UP"TITLE="Manual Configuration"HREF="manual-configuration.html"><LINKREL="PREVIOUS"TITLE="Creating the Build Tree"HREF="creating-build-tree.html"><LINKREL="NEXT"TITLE="Building the System"HREF="building-the-system.html"></HEAD><BODYCLASS="SECT1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">eCos User Guide</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="creating-build-tree.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 28. Manual Configuration</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="building-the-system.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="CONFLICTS-AND-CONSTRAINTS">Conflicts and constraints</H1><P>Configuration options are not completely independent. For examplethe C library's <TTCLASS="FUNCTION">strtod()</TT> and <TTCLASS="FUNCTION">atof()</TT>functions rely on the math library package to provide certain functionality. If the math library package is removed then the Clibrary can no longer provide these functions. Each package describes constraints like these in CDL <SPANCLASS="emphasis"><ICLASS="EMPHASIS">"requires"</I></SPAN> properties. If a constraint is not satisfied, then the configuration contains a conflict. For any given conflict there canbe several resolution options. For example, it would be possible to add the math library package back to theconfiguration, or to disable the <TTCLASS="FUNCTION">strtod()</TT> and <TTCLASS="FUNCTION">atof()</TT> functions.</P><P>The <SPANCLASS="PRODUCTNAME">eCos</SPAN> configuration tools will report any conflicts in the current configuration. If there are any such conflictsthen the configuration is usually unsafe and it makes no sense to build and run <SPANCLASS="PRODUCTNAME">eCos</SPAN> in such circumstances. In fact,any attempt at building <SPANCLASS="PRODUCTNAME">eCos</SPAN> is likely to fail. In exceptional cases it is possible to override this by using e.g. the<TTCLASS="OPTION">--ignore-errors</TT> qualifier with ecosconfig. </P><P>Many constraints are fairly simple in nature, and the configuration tools contain an inference engine which canresolve the associated conflicts automatically. For example, if the math library package is removed then theinference engine can resolve the resulting conflict by disabling the configuration option for <TTCLASS="FUNCTION">strtod()</TT> and <TTCLASS="FUNCTION">atof()</TT>. Allsuch changes will be reported. Sometimes the inference engine cannot resolve a conflict, for example it is notallowed to override a change that has been made explicitly by the user. Sometimes it will find a solution which doesnot match the application's requirements. </P><P>A typical session involving conflicts would look something like this: <TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">$ ecosconfig new pid</PRE></TD></TR></TABLE>This creates a new configuration with the default template. For most targets this will not result in any conflicts,because the default settings for the various options meet the requirements of the default template.</P><P> For some targetsthere may be conflicts and the inference engine would come into play. <TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">$ 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 </PRE></TD></TR></TABLE>ecosconfig reports that this change caused three conflicts, all in the C library. The inference engine was able toresolve all the conflicts and update the relevant configuration options accordingly. </P><P>To suppress the inference engine <TTCLASS="OPTION">--no-resolve</TT> can be used: <TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">$ 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 </PRE></TD></TR></TABLE>Three unresolved conflicts are reported.</P><P>The <BCLASS="COMMAND">check</B> command can be used to get the current state of theconfiguration, and the <TTCLASS="OPTION">--verbose</TT> qualifier will provide additional information: </P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">$ 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 </PRE></TD></TR></TABLE><P>If the proposed solutions are acceptable, the resolve command can be used to apply them: <TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">$ 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 </PRE></TD></TR></TABLE></P><P>The current configuration is again conflict-free and it is possible to generate a build tree. The <TTCLASS="OPTION">--quiet</TT> qualifier canbe used to suppress the change messages, if desired.</P><P>When changing individual configuration options by editing the ecos.ecc file (as described below), the resultingsystem should be checked and any problems should be resolved. For example, if CYGFUN_LIBC_strtod isexplicitly enabled in the savefile:<TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">$ 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 </PRE></TD></TR></TABLE>In this case the inference engine cannot resolve the conflict automatically because that would involve changing auser setting. Any attempt to generate a build tree will fail: <TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">$ ecosconfig --srcdir /home/bartv/ecc/ecc tree C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBMUnable to generate build tree, this configuration still contains conflicts.Either resolve the conflicts or use --ignore-errors </PRE></TD></TR></TABLE></P><P>It is still possible to generate a build tree: <TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">$ ecosconfig --srcdir /home/bartv/ecc/ecc --ignore-errors tree C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM $ make </PRE></TD></TR></TABLE>In this case <SPANCLASS="PRODUCTNAME">eCos</SPAN> will fail to build. In other cases of unresolved conflicts <SPANCLASS="PRODUCTNAME">eCos</SPAN> may build, but may not run. Ingeneral all conflicts should be resolved by editing the <TTCLASS="FILENAME">ecos.ecc</TT> file, by letting the inference engine make appropriatechanges, or by other means, before any attempt is made to build or run <SPANCLASS="PRODUCTNAME">eCos</SPAN>. </P></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="creating-build-tree.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="ecos-user-guide.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="building-the-system.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Creating the Build Tree</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="manual-configuration.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Building the System</TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?