2.1.11 警告"trigraphs occured"是什么意思? A: 对Tornado或Vxoworks没什么要做的。 你可能在你代码(也可能在注释里)中有三字符序列--参看K&R (Kernighan & Ritchie; A12.1 - 这是ANSI 新引进的。-- 但是GNU手册里提示"You don't want to know about this brain-damage..." 使用-ansi或-trigraphs开关,或更好的办法消除任何包含三字符序列'??X'的注释。 (参看K&R书中对X的定义)。 (From: Michael.Ben-Ari@ecitele.com) 2.1.12 为什么编译的最后步骤时间这么长? 生成.out步骤如下: 1) 链接应用程序和库到partialImage.o 2) 使用partialImage.o解析出所有静态类(munch) 3) 编译上面发现的(ctdt.o) 4) 用ctdt.o链接第一个obj文件partialImage.o 我们的应用程序.out文件有10M,但是多数是调试信息,size386返回只有1M。 我们的下载文件生成需要超过5分钟,Step #1-3正常需要35秒!但是step #4 需要很多时间,整个过程需要5分30秒。 A: 我不知道为什么这样?但是我们在step #4不重新使用partialImage.o 而是重新生成它,整个过程45s. (是ld386没有对符号过滤进行优化的原因吗?) 我只是修改了tornado\target\h\make\rules.vxApp文件,它包含制作应用程序的规则。我修改了上面提到的step $4代码如下: 把$(LD_PARTIAL) $(LD_PARTIAL_LAST_FLAGS) partialImage.o ctdt.o -o $@ 替换成$(LD_PARTIAL) $(PRJ_OBJS_FOR_LD_PARTIAL) $(PRJ_LIBS) ctdt.o -o $@ (From: Ole Asbjorn Fadum, OleAsbjornF@scanmar.no) Some more information. For a variety of reasons I've had to do a few build on a slow system. One bit that seemed exceptionally slow is the 'binToAsm' call (just after the 'deflate' generating vxWorks.Z.s). This is done by od -bv $infile | sed -e "s/^[0-9]*[ ]*//; s/ /, 0/g; /^[0-9a-fA-F][0-9a-fA-F]/s/^/ .byte 0/" (ie use od to generate a list of octal bytes, remove the offset, change the spaces to comma, add the directive - an extra 0 is added to each number to ensure they are octal). The above is terribly slow... Slightly faster (under solaris) is: od -An -v -tu1 $infile | tr ' ' ',' | sed -e 's/,00*\([0-9]\)/,\1/g;s/^,/ .byte /' However it is clear that a C program would be even faster... It was still sluggish using printf, so... char map[256][4]; for (count = 0; count <= 256; count ) sprintf( map[ count ], "%d", count ); for (;;) { count = read( input_fd, buf, BLK_SZ ); if (count <= 0) break; for (off = 0; off < count; off ) { if (off & 15) putchar( ',' ); else fputs( "\n .byte ", stdout ); fputs( map[ buf[ off ] ], stdout ); } } now the system is spending very little of its time doing this bit (it was a lot slower than the deflate!). If you are using gcc/gas you can pipe EXTRACT_BIN, COMPRESS, BINTOASM directly into AS - saving that massive intermediate file... Build (compiling one small object) just took 6m50 - was over 10 minutes before I played with binToAsm! Ages ago I sped up 'munch' - by grepping out most of the symbols it isn't interested in... nmarm vxWorks.tmp | tee vxWorks.nm | grep " __" | munch > ctdt.c (I use the symbol table from this stage for a variety of things...) (From: David Laight, David.Laight@btinternet.com) 2.1.13 怎样把一个段装载到特定的绝对地址? A: 我曾包含一个脚本做这些工作,最方便得到这个脚本的方法是使用--verbose开关运行你的链接器,例如: "ldarm --verbose". 编辑这个文件加入类似如下的段落, .text 0x8000 : { [omit] . = ALIGN(0x8000); /* Create a 8k section of all 0xffff, first value is jump. */ FILL(0xffff); LONG(0xeb000004); . = ALIGN(0x2000); [...] 这将把数据放到任何你想放的地方,在程序被链接时新的链接器脚本必须使用-T参数。 (From: Bill Pringlemeir, bpringlemeir@yahoo.com) 2.1.14 我在使用C 类型的注释时,出现错误,怎样改变它? A: 一种方法是移除-ansi开关。然而,你可能希望保留你的源代码与ANSI兼容;所以我更喜欢代码能在每个地方都能编译。传递"-Wp,-lang-c"参数只能使CPP的注释方法可以使用。下面来自预编译器文档 `-lang-c', `-lang-c89', `-lang-c ' `-lang-objc', `-lang-objc ' Specify the source language. `-lang-c' is the default; it allows recognition of C comments (comments that begin with `//' and end at end of line), since this is a common feature and it will most likely be in the next C standard. `-lang-c89' disables recognition of C comments. `-lang-c ' handles C comment syntax and includes extra default include directories for C . `-lang-objc' enables the Objective C `#import' directive. `-lang-objc ' enables both C and Objective C extensions. These options are generated by the compiler driver gcc, but not passed from the `gcc' command line unless you use the driver's `-Wp' option . (From: Bill Pringlemeir, bpringlemeir@yahoo.com) 2.1.15 我在编译时碰到了关于cc1参数/选项的错误? A: 这个可能是由于安装了Cygwin 或DJGPP引起的。当该版本的编译器在路径里先于Tornado版本Cygwin的GCC被调用时,这个版本不知道这些参数或选项。这个问题可以通过卸载该软件或确定Tornado版本的编译器在路径环境变量里是头一个后解决。 |