编译内核出错

20 views
Skip to first unread message

feng jing

unread,
Nov 24, 2009, 12:54:43 AM11/24/09
to tmlinux
我的环境是cygwin
编译系统是TCS5.01(windows版)
其它:NDK5.5, ocaml9.02, cil1.3.4
编译时出错如下:
jingfeng@jingfeng ~/worktest/linux
$ make HOST_LOADLIBES="-lintl -lncurses"
CHK include/linux/version.h
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/split-include
HOSTCC scripts/basic/docproc
HOSTCC scripts/basic/convert-depfile
SPLIT include/linux/autoconf.h -> include/config/*
SYMLINK include/asm-trimedia/target -> include/asm-trimedia/target-
pnx1500
GEN include/asm-trimedia/asm-offsets.h
HOSTCC scripts/conmakehash
CC init/main.o
Catastrophic error: could not open source file "\home\jingfeng\.ccache
\tmp.stdou
t.jingfeng.1300.i"

1 catastrophic error detected in the compilation of "\home\jingfeng
\.ccache\tmp.
stdout.jingfeng.1300.i".
Compilation terminated.
tmcc.exe: tmcfe command failed
make[1]: *** [init/main.o] Error 1
make: *** [init] Error 2

请问怎么解决

Guo Hongruan

unread,
Nov 24, 2009, 1:27:05 AM11/24/09
to tml...@googlegroups.com
我重来没有在cygwin下编译过tmlinux。也不建议你这样做。你最好安装一个linux发行版,比如redhat、suse等,然后编译tmlinux。

另外,要编译tmlinux,你最好安装上ccache软件包。
> --
>
> You received this message because you are subscribed to the Google
> Groups "tmlinux" group.
> To post to this group, send email to tml...@googlegroups.com.
> To unsubscribe from this group, send email to
> tmlinux+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/tmlinux?hl=en.
>
>


--
Guo Hongruan, Embedded Linux Consultant
Mobile: +86-0-13484056007
Skype: camelguo
http://www.gulessoft.com

feng jing

unread,
Nov 24, 2009, 8:19:15 PM11/24/09
to tmlinux
cygwin 的确小问题很多,但我的编译系统是for windows的,目前还没有 for linux 的 TCS。只能先在cygwin下
做。

On 11月24日, 下午2时27分, "Guo Hongruan" <guo.hongr...@gulessoft.com> wrote:
> 我重来没有在cygwin下编译过tmlinux。也不建议你这样做。你最好安装一个linux发行版,比如redhat、suse等,然后编译tmlinux-。
>
> 另外,要编译tmlinux,你最好安装上ccache软件包。
> Skype: camelguohttp://www.gulessoft.com- 隐藏被引用文字 -
>
> - 显示引用的文字 -

Guo Hongruan

unread,
Nov 24, 2009, 8:44:16 PM11/24/09
to tml...@googlegroups.com
你们有TCS for window的就应该有TCShelp的账户,有账户肯定就会有TCS for
linux。


如果实在不行,你只有试试wine + TCS for
windows了。很早的时候用过,后来出了TCS for linux就不在用这种方式了。

feng jing

unread,
Nov 25, 2009, 2:11:36 AM11/25/09
to tmlinux
我在fedora7下安装了wine rpm包, 用一个简单的hello小程序试了一下:
wine /opt/NXP/TCS501/bin/tmcc
结果出现如下错误:
./tmcc: tmcfe command failed
编译tmlinux时,出现同样的错误。
请问为什么会这样

On 11月25日, 上午9时44分, "Guo Hongruan" <camel...@gmail.com> wrote:
> 你们有TCS for window的就应该有TCShelp的账户,有账户肯定就会有TCS for
> linux。
>
> 如果实在不行,你只有试试wine + TCS for
> windows了。很早的时候用过,后来出了TCS for linux就不在用这种方式了。
>
> >> Skype: camelguohttp://www.gulessoft.com-隐藏被引用文字 -

Guo Hongruan

unread,
Nov 25, 2009, 2:14:36 AM11/25/09
to tml...@googlegroups.com
很长时间没有用过wine + tcs了。还真不知道。我估计是wine的设置的问题。
Twitter: camelguo
http://www.gulessoft.com

feng jing

unread,
Dec 2, 2009, 3:14:32 AM12/2/09
to tmlinux
wine的问题解决了,又出现了一个找不到文件的错误(没有提示缺什么文件)。看了一下,
编译init/main.o所需的文件都在(包括隐藏文件),main.o也出现了。搞了几天,没找到原因,
贴出来帮忙看一看。make 是 3.81版的

[root@localhost linux]# make
set -e; echo ' CHK include/linux/version.h'; mkdir -p include/
linux/; if [ `echo -n "2.6.14.7-tiny1" | wc -c ` -gt 64 ]; then
echo '"2.6.14.7-tiny1" exceeds 64 characters' >&2; exit 1; fi; (echo
\#define UTS_RELEASE \"2.6.14.7-tiny1\"; echo \#define
LINUX_VERSION_CODE `expr 2 \\* 65536 + 6 \\* 256 + 14`; echo '#define
KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; ) < /home/
jingfeng/worktest/linux/Makefile > include/linux/version.h.tmp; if [ -
r include/linux/version.h ] && cmp -s include/linux/version.h include/
linux/version.h.tmp; then rm -f include/linux/version.h.tmp; else echo
' UPD include/linux/version.h'; mv -f include/linux/version.h.tmp
include/linux/version.h; fi
CHK include/linux/version.h
make -f scripts/Makefile.build obj=scripts/basic
if test ! /home/jingfeng/worktest/linux -ef /home/jingfeng/worktest/
linux; then \
/bin/sh /home/jingfeng/worktest/linux/scripts/
mkmakefile \
/home/jingfeng/worktest/linux /home/jingfeng/worktest/
linux 2 6 \
> /home/jingfeng/worktest/linux/
Makefile; \
echo ' GEN /home/jingfeng/worktest/linux/
Makefile'; \
fi
rm -rf .tmp_versions
mkdir -p .tmp_versions
make -f scripts/Makefile.build obj=.
mkdir -p arch/trimedia/kernel/
gcc -nostdinc -D__KERNEL__ -Iinclude -U__GNUC__ -D__TCS__ -
D__TCS_VERSION__=500 -D__ASM_OFFSETS -S arch/trimedia/kernel/asm-
offsets.c -o arch/trimedia/kernel/asm-offsets.s
mkdir -p include/asm-trimedia/; cat arch/trimedia/kernel/asm-
offsets.s | (set -e; echo "#ifndef __ASM_OFFSETS_H__"; echo "#define
__ASM_OFFSETS_H__"; echo "/*"; echo " * DO NOT MODIFY."; echo " *";
echo " * This file was generated by /home/jingfeng/worktest/linux/
Kbuild"; echo " *"; echo " */"; echo ""; sed -ne "/^->/{s:^->\
([^ ]*\) [\$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}";
echo ""; echo "#endif" ) > include/asm-trimedia/asm-offsets.h
make -f scripts/Makefile.build obj=scripts
make -f scripts/Makefile.build obj=init
ccache wine /opt/NXP/TCS501/bin/tmcc -M -D__KERNEL__ -Iinclude -
w0 -D__inline=inline -D__restrict=restrict -O2 -host ttisim -
target pnx1500 -el -fp64 -DNO_DP -DKBUILD_BASENAME=main -
DKBUILD_MODNAME=main init/main.c > init/.main.o.d ; ccache wine /opt/
NXP/TCS501/bin/tmcc -D__KERNEL__ -Iinclude -w0 -D__inline=inline -
D__restrict=restrict -O2 -host ttisim -target pnx1500 -el -fp64 -
DNO_DP -DKBUILD_BASENAME=main -DKBUILD_MODNAME=main -E init/
main.c > init/main.E; cilly.asm.exe --keepunused --doGeneral --doTpcvt
--doShadow init/main.E --out init/main.cil.c; ccache wine /opt/NXP/
TCS501/bin/tmcc -D__KERNEL__ -Iinclude -w0 -D__inline=inline -
D__restrict=restrict -O2 -host ttisim -target pnx1500 -el -fp64 -
DNO_DP -DKBUILD_BASENAME=main -DKBUILD_MODNAME=main -c -o init/
main.o init/main.cil.c
: No such file or directory
make[1]: *** [init/main.o] 错误 2
make: *** [init] 错误 2
[root@localhost linux]# ls -a init
. do_mounts.c do_mounts_initrd.c initramfs.c
main.cil.c .main.o.d version.c
.. do_mounts_devfs.c do_mounts_md.c Kconfig
main.E .main.o.tmp
calibrate.c do_mounts.h do_mounts_rd.c main.c
main.o Makefile
[root@localhost linux]#

On 11月25日, 下午3时14分, Guo Hongruan <guo.hongr...@gulessoft.com> wrote:
> 很长时间没有用过wine + tcs了。还真不知道。我估计是wine的设置的问题。
>

Guo Hongruan

unread,
Dec 2, 2009, 3:19:00 AM12/2/09
to tml...@googlegroups.com
我猜测应该还是wine的问题把。你试验国用wine +
tmcc编译最简单的应用程序吗?比如hello wrold。这样可以断定是不是wine的错误。

feng jing

unread,
Dec 2, 2009, 3:38:45 AM12/2/09
to tmlinux
我试了一下,下面的命令执行没有问题
[root@localhost ~]# wine /opt/NXP/TCS501/bin/tmcc -o test test.c
[root@localhost ~]#

再下面这个出问题了
[root@localhost ~]# wine /opt/NXP/TCS501/bin/tmcc -E test.c >
test.E;cilly.asm.exe test.E --out test.cil.c;/opt/NXP/TCS501/bin/tmcc -
c -o test.o test.cil.c
bash: /opt/NXP/TCS501/bin/tmcc: 没有那个文件或目录

On 12月2日, 下午4时19分, "Guo Hongruan" <camel...@gmail.com> wrote:
> 我猜测应该还是wine的问题把。你试验国用wine +
> tmcc编译最简单的应用程序吗?比如hello wrold。这样可以断定是不是wine的错误。
>

feng jing

unread,
Dec 2, 2009, 3:42:00 AM12/2/09
to tmlinux
我试了一下:
[root@localhost ~]# wine /opt/NXP/TCS501/bin/tmcc -E test.c >
test.E;cilly.asm.exe test.E --out test.cil.c;/opt/NXP/TCS501/bin/tmcc -
c -o test.o test.cil.c
bash: /opt/NXP/TCS501/bin/tmcc: 没有那个文件或目录
这个也一样的问题,但下面的没问题:
[root@localhost ~]# wine /opt/NXP/TCS501/bin/tmcc -o test test.c
[root@localhost ~]#

On 12月2日, 下午4时19分, "Guo Hongruan" <camel...@gmail.com> wrote:
> 我猜测应该还是wine的问题把。你试验国用wine +
> tmcc编译最简单的应用程序吗?比如hello wrold。这样可以断定是不是wine的错误。
>

feng jing

unread,
Dec 2, 2009, 4:04:09 AM12/2/09
to tmlinux
把命令单独提出来执行也没有问题,如下:
[root@localhost ~]# wine /opt/NXP/TCS501/bin/tmcc -E test.c > test.E
[root@localhost ~]# cilly.asm.exe --out test.cil.c test.E
[root@localhost ~]# wine /opt/NXP/TCS501/bin/tmcc -o test test.cil.c
[root@localhost ~]# wine /opt/NXP/TCS501/bin/tmcc -o test.o test.cil.c
[root@localhost ~]# wine /opt/NXP/TCS501/bin/tmsim test
kkkkk
[root@localhost ~]#
> ...
>
> 阅读更多 >>

Guo Hongruan

unread,
Dec 2, 2009, 5:38:07 AM12/2/09
to tml...@googlegroups.com

wine /opt/NXP/TCS501/bin/tmcc -E test.c >
test.E;cilly.asm.exe test.E --out test.cil.c;/opt/NXP/TCS501/bin/tmcc -
c -o test.o test.cil.c

第二次调用tmcc的时候没有用wine,你仔细看看

在 Wed, 02 Dec 2009 16:38:45 +0800,feng jing <jingf...@gmail.com> 写道:

> wine /opt/NXP/TCS501/bin/tmcc -E test.c >
> test.E;cilly.asm.exe test.E --out test.cil.c;/opt/NXP/TCS501/bin/tmcc -
> c -o test.o test.cil.c


feng jing

unread,
Dec 2, 2009, 8:20:12 PM12/2/09
to tmlinux
对,是我疏忽了,补上wine后执行正常。但通过make仍然出错,会不会是
cmd_cc_o_c = $(CC) -M $(c_flags) $< > $(depfile);$(CC) $(c_flags) -E
$< > $(cppfile); \
cilly.asm.exe $(cil_flags) $(cppfile) --out $(cilfile); \
$(CC) $(c_nodep_flags) -c -o $@ $(cilfile)
中的dep文件的原因呢,我不知道cmd_cc_o_c中,"-M"和"depfile"这些字眼起什么作用。
On 12月2日, 下午6时38分, "Guo Hongruan" <camel...@gmail.com> wrote:
> wine /opt/NXP/TCS501/bin/tmcc -E test.c >
> test.E;cilly.asm.exe test.E --out test.cil.c;/opt/NXP/TCS501/bin/tmcc -
> c -o test.o test.cil.c
>
> 第二次调用tmcc的时候没有用wine,你仔细看看
>

Guo Hongruan

unread,
Dec 2, 2009, 8:21:32 PM12/2/09
to tml...@googlegroups.com
具体什么错误?-M的用途你看看tmcc使用文档就知道了。
> --
>
> You received this message because you are subscribed to the Google
> Groups "tmlinux" group.
> To post to this group, send email to tml...@googlegroups.com.
> To unsubscribe from this group, send email to
> tmlinux+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/tmlinux?hl=en.
>
>


feng jing

unread,
Dec 2, 2009, 8:32:34 PM12/2/09
to tmlinux
就是昨天下午我贴出来的那个找不到文件的错误,我把后面一段信息贴上:
make -f scripts/Makefile.build obj=scripts
make -f scripts/Makefile.build obj=init
ccache wine /opt/NXP/TCS501/bin/tmcc -M -D__KERNEL__ -Iinclude -
w0 -D__inline=inline -D__restrict=restrict -O2 -host ttisim -
target pnx1500 -el -fp64 -DNO_DP -DKBUILD_BASENAME=main -
DKBUILD_MODNAME=main init/main.c > init/.main.o.d ; ccache wine /opt/
NXP/TCS501/bin/tmcc -D__KERNEL__ -Iinclude -w0 -D__inline=inline -
D__restrict=restrict -O2 -host ttisim -target pnx1500 -el -fp64 -
DNO_DP -DKBUILD_BASENAME=main -DKBUILD_MODNAME=main -E init/
main.c > init/main.E; cilly.asm.exe --keepunused --doGeneral --doTpcvt
--doShadow init/main.E --out init/main.cil.c; ccache wine /opt/NXP/
TCS501/bin/tmcc -D__KERNEL__ -Iinclude -w0 -D__inline=inline -
D__restrict=restrict -O2 -host ttisim -target pnx1500 -el -fp64 -
DNO_DP -DKBUILD_BASENAME=main -DKBUILD_MODNAME=main -c -o init/
main.o init/main.cil.c
: No such file or directory
make[1]: *** [init/main.o] 错误 2
make: *** [init] 错误 2

On 12月3日, 上午9时21分, "Guo Hongruan" <guo.hongr...@gulessoft.com> wrote:
> 具体什么错误?-M的用途你看看tmcc使用文档就知道了。
>

Guo Hongruan

unread,
Dec 2, 2009, 8:34:57 PM12/2/09
to tml...@googlegroups.com
现在看来我也不知道是怎么回事,说实话,我还没有用wine +
tmcc编译过linux内核。

feng jing

unread,
Dec 2, 2009, 8:46:44 PM12/2/09
to tmlinux
我现在没有渠道获取tmcc for linux,没办法,只能用wine+tmcc 。cygwin环境下也用过,
同样也是上面的错误。所以,应该不是make的问题。

On 12月3日, 上午9时34分, "Guo Hongruan" <camel...@gmail.com> wrote:
> 现在看来我也不知道是怎么回事,说实话,我还没有用wine +
> tmcc编译过linux内核。
>

feng jing

unread,
Dec 10, 2009, 10:31:29 PM12/10/09
to tmlinux
找不到文件的问题已解决,原因是linux系统不认识windows下的某些符号,目前,这些符号存在于
.o.d文件中,可能也会出现在其它文件中。办法:
将文件scripts/Makefile.build中的
cmd_cc_o_c = $(CC) -M $(c_flags) $< > $(depfile) ; $(CC) $(c_flags) -E
$< > $(cppfile); \
cilly.asm.exe $(cil_flags) $(cppfile) --out $(cilfile); \
$(CC) $(c_nodep_flags) -c -o $@ $(cilfile)
修改为
cmd_cc_o_c = $(CC) -M $(c_flags) $< | sed -e 's/\\/\//g' -e 's/T://g' -
e 's/^M//g' > $(depfile) ; $(CC) $(c_flags) -E $< > $(cppfile); \
cilly.asm.exe $(cil_flags) $(cppfile) --out $(cilfile); \
$(CC) $(c_nodep_flags) -c -o $@ $(cilfile)
即,增加“| sed -e 's/\\/\//g' -e 's/T://g' -e 's/^M//g'”命令 以去掉特殊符号。
“T:”是盘符,"^M"用Ctrl+v和Ctrl+m输入。
Reply all
Reply to author
Forward
0 new messages