⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vxw_pt1.html

📁 vxworks 问题解答
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en"><html><head>   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">   <meta name="GENERATOR" content="VIM on Unix and Win95">   <meta name="Author" content="Johan Borkhuis">   <meta name="description" content="VxWorks / Tornado II information / FAQ">   <meta name="keywords" content="VxWorks,Tornado,FAQ">   <meta name="version" content="$Id: vxw_pt1.html,v 1.58 2002/04/08 11:47:07 borkhuis Exp $">   <title>VxWorks and Tornado II FAQ</title></head><body><center><h1><strong><font size="+4">VxWorks / Tornado II FAQ</font></strong></h1></center><p><hr WIDTH="80%"><h2><a href="#1">1. Tool problems</a></h2><blockquote><h3><a href="#1.1">1.1 Compiler and Linker</a></h3></blockquote><blockquote><h3><a href="#1.2">1.2 Debugger</a></h3></blockquote><blockquote><h3><a href="vxw_pt4.html#4.4">1.3 FTP</a></h3></blockquote><blockquote><h3><a href="#1.4">1.4 Host tools</a></h3></blockquote><blockquote><h3><a href="#1.5">1.5 Installation</a></h3></blockquote><blockquote><h3><a href="#1.6">1.6 Make</a></h3></blockquote><blockquote><h3><a href="#1.7">1.7 Project facility</a></h3><blockquote><h4><a href="project.html#1.7.1">1.7.1 Hierarchical projects</a></h3></blockquote><blockquote><h4><a href="project.html#1.7.2">1.7.2 Super projects</a></h3></blockquote></blockquote><blockquote><h3><a href="#1.8">1.8 Target Server</a></h3></blockquote><blockquote><h3><a href="#1.9">1.9 Target Shell</a></h3></blockquote><blockquote><h3><a href="#1.10">1.10 Telnet</a></h3></blockquote><blockquote><h3><a href="#1.11">1.11 Tornado</a></h3><blockquote><h4><a href="#1.11.1">1.11.1 Tornado (General)</a></h4></blockquote><blockquote><h4><a href="#1.11.2">1.11.2 Tornado (Windows)</a></h4></blockquote></blockquote><blockquote><h3><a href="#1.12">1.12 Version Control</a></h3></blockquote><blockquote><h3><a href="#1.13">1.13 Visual Studio integration</a></h3></blockquote><blockquote><h3><a href="#1.14">1.14 Windsh</a></h3></blockquote><blockquote><h3><a href="#1.15">1.15 WindView</a></h3></blockquote><blockquote><h3><a href="#index">Index</a></h3></blockquote><hr WIDTH="80%"><p><h2><a NAME="1"><center>1. Tool problems</center></a></h2><h3><a NAME="1.1"><center>1.1 Compiler and Linker</center></a></h3><a NAME="1.1-A"></a>Q: When I want to link some object files to one, there wasone error<pre>ldppc:built in linker script:43: syntax error</pre>How do I get rid of this error?<p>A: Make sure that you use the -r option for the linker.<br>(From: weber.dirk@t-online.de)<p><hr WIDTH="50%"><a NAME="1.1-B"></a><p>Q: How do I upgrade to a new version of the compiler?<p>A: Dave Korn has made a web-page about this for the PPC version of thecompiler. You can find has page at:<a href="http://www.newgcc4vxworks4ppc.cjb.net/">http://www.newgcc4vxworks4ppc.cjb.net/</a><p><hr WIDTH="50%"><a NAME="1.1-C"></a><p>Q: When compiling the code with another compiler I get many more warningsand errors. How can I get GCC to generate more warnings?<p>A: The first thing is to switch on all warnings. This can be done byadding -Wall to compiler properties. <p>Another way to get even more reports is to tell the compiler to see thefiles as C++ files. This can be done by adding "-x c++" to the compilerproperties.<br>(From: Claudio Ortega, cortega@sinfomed.org.ar)<p><a NAME="1.1-C3"></a>-Wall doesn't really turn on all warnings (or even very many).I've been using the flags recommended by Bruce Evans and since immortalized in FreeBSD'sBDECFLAGS make variable:<pre># BDECFLAGS are a set of gcc warning settings that Bruce Evans has suggested# for use in developing FreeBSD and testing changes.  They can be used by# putting "CFLAGS+=${BDECFLAGS}" in /etc/make.conf.  -Wconversion is not# included here due to compiler bugs, eg: mkdir()'s mode_t argument.#BDECFLAGS=      -W -Wall -ansi -pedantic -Wbad-function-cast -Wcast-align \                -Wcast-qual -Wchar-subscripts -Winline \                -Wmissing-prototypes -Wnested-externs -Wpointer-arith \                -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings</pre>This set of flags is *much* pickier than -Wall alone.<br>(From: W Gerald Hicks)<p><hr WIDTH="50%"><a NAME="1.1-D"></a><p>Q: When I compile my module everything is OK, but when I try to download thismodule I get an error on a missing symbol "__eabi".<p>A: In your module there probably is a function called "main". As per PPC"extended Application Binary Interface" (eabi) standard, the "main" functionmust call the special __eabi function, that supposed to set the neededenvironment to run Your program.<p>According to this, GNU compiler, inserts the call to __eabiin the "main" function.<p>Tornado DOES NOT provide that function, because in a real-time environmentyou doesn't expected to write the "main" function.VxWorks sets up the environment before the application code runand there is no need (and no sense) for "main".<br>(From: Ilia, iliab@telegate.co.il)<p><hr WIDTH="50%"><a NAME="1.1-E"></a><p>Q: I generated a version 2.95.2 version of the compiler.Everything goes fine until I start linking our image.  Here is what I amgetting for the ctdt tables during linking:<pre>ctdt.o(.data+0x3c):fake: undefined reference to `global constructors keyed to _constructor_name_</pre>... lots of those for all Cs and Ds.<br>has anybody seen this problem before?<p>A: The problem is caused by gcc having changed the way it gets staticconstructors run in between version 2.7.2 and 2.95.2. It no longer emits afunction per module that constructs the static objects for that model, whichis what the munching stage of the vxworks build/link is all about.<br>You can restore the earlier behaviour by making the following changesto the gcc 2.95.2 source code:in [source code dir]/gcc/config/arm/vxarm.h, at the very end, add:-<pre>/*     More DK patches: we undef these two in order to force the  *//*  compiler to output our static constructors and destructors    *//*  in the fashion to which it is accustomed....                  */#undef ASM_OUTPUT_CONSTRUCTOR#undef ASM_OUTPUT_DESTRUCTOR/*     This one is so that GLOBAL_THING gets a $ in it's name     */#undef NO_DOLLAR_IN_LABEL</pre>Now change into your build directory, do a "make clean", andthen rebuild and reinstall the compiler.<br>This worked for me, anyway, with the ppc version: it made thecompiler revert to its older behaviour of making munchableconstructors. Hope it helps for you too.<br>(From: Dave Korn)<p><hr WIDTH="50%"><a NAME="1.1-F"></a><p>Q: When compiling I see the following output in the build-window:<pre>nm386 -g partialImage.o @B:\Sources\Components\Common\Common_Geni_Test\Src\prjObjs.lst | \wtxtcl D:\Tornado\host\src\hutils\munch.tcl -asm 386 &gt; ctdt.c   ...cc386 -nostdlib -r -Wl,-X  partialImage.o ctdt.o -o VxWorksGeniServerTestExe.out</pre>The final step (linking partialImage.o to ...out) takes very long (about half anhour!!!). Any ideas why?<p>A: It probably is the munching, rather than the linking, that takeshalf-an-hour, a trick that someone else posted here before might buy somespeedup: interpose "<code>grep GLOBAL</code>" in the pipeline ofthe munch command, i.e.<pre>nm386 -g partialImage.o @B:\Sources\Components\Common\Common_Geni_Test\Src\prjObjs.lst | grep GLOBAL | \wtxtcl D:\Tornado\host\src\hutils\munch.tcl -asm 386 &gt; ctdt.c</pre>(From: Dave Korn)<p><hr WIDTH="50%"><a NAME="1.1-G"></a><p>Q: How do define a structure without holes in it?<p>A: I use on VxWorks with GNU Compiler<pre>struct ex {INT8  source;INT32 txSize;INT32 datSize;INT16 cmd;} __attribute__ ((packed));typedef struct ex PackedStruct;</pre><em>Important note</em> - using the compiler switch <code>-fpack-struct</code> should be avoidedif possible. We recently removed this option from a large C++ applicationand realized a 30% to 100% performance improvement. This is becauseevery access to multibyte values in structs or classes will be done byte bybyte. Use the <code>__attribute__ ((packed))</code> method instead!<p>(From: Mark Fanara, mfanara@home.cNOSPAMMom, and Francisco Pataro, fpataro@dnaent.com)<p><hr WIDTH="50%"><a NAME="1.1-H"></a><p>Q: How can I call a C++ function from within a C-file?<p>A: If you want to call a C++ function from a C file, the C++ function mustbe declared with extern "C"; otherwise the compiler mangles the function nameby adding characters to the end that specify the types of arguments andreturns that the function expects.<br>(From: Dave Korn)<p><hr WIDTH="50%"><a NAME="1.1-I"></a><p>Q: Is the <code>-fvolatile</code> flag really needed?<p>A: WRS indicated to us that we should use the <code>-fvolatile</code> forthe kernel/bsp build.  This is usually turned on by default in one of thetarget/h/make/ files.<br>We also picked up the <code>-fvolatile</code> flag in our applicationbuilds because we referenced some of the tornado make files.  When weremoved the flag for application builds we did come across a few subtlebugs where we had not explictly used the volatile keyword in the code.If you have written device drivers be careful.<br>The <code>-fvolatile</code> flag makes the compiler produce some veryconservative code.  Incrementing a variable via a pointer (p-&gt;x++) is notdone in one instruction as you might think (68k example):<pre>    addql #1,a0@(8)</pre>with <code>-fvolatile</code> you get this:<pre>    movel a0@(8),d0    addql #1,d0    movel d0,a0@(8)    movel a0@(8),d0</pre>You can imagine what a C++ application using the "this" pointer everywheregets compiled into!<br>(From: Chris Varlese, cv@no.mail.net)<p><hr WIDTH="50%"><a NAME="1.1-J"></a><p>Q: I do a link with a lot of archives, now the linker has problems resolvingthe cross references between the archives.<p>A: Try one of the following:<ol><li>$(LIBS) is substituted into:<code>$(LD_PARTIAL) -o vxWorks.tmp $(MACH_DEP) usrConfig.o version.o $(LIBS)</code>(in target/h/rules.bsp for a non-project build). Now LD_PARTIAL is ccxxx, so youneed to specify -Wl,--group-start to get cc to pass the argument to ld.</li><li>Try adding a -Usymbol for each symbol that has to be pulled in early.</li><li>If (2) make the ld line too unwieldy, generate a .s file that contains:<code>.extern symbol</code> for each undefined symbol and include that intothe link before the libraries</li><li>If your building on unix, it ought to be possible get ld to generate therequired list of undefines!  You need to add a loop!Something like this might work:<pre>        [ ! -f undefs.s ] &amp;&amp; echo "#" &gt;undefs.s        while                $(CC) -c $(CFLAGS) undefs.s                $(LD_PARTIAL) -o vxWorks.tmp $(MACH_DEP) usrConfig.o version.o \                        undefs.o $(LIBS)                $(NM) vxWorks.tmp | grep ' __' | $(MUNCH) &gt; ctdt.c                $(MAKE) CC_COMPILER="-fdollars-in-identifiers" ctdt.o        do                $(LD) $(LDFLAGS) -e $(SYS_ENTRY) $(LD_LOW_FLAGS) -o vxWorks \                   dataSegPad.o vxWorks.tmp ctdt.o tad_hook_list.o 2&gt;&amp;1 | tee ld.errs |                        while read file undef ref to symbol                        do                                [ "$undef" = "undefined" ] || continue                                [ "$ref" = "reference" ] || continue                                [ "$to" = "to" ] || continue                                oifs="$IFS"                                IFS="'/`"                                symbol="`echo $symbol`"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -