好好住家居指南 pdf:crosstool编译过程中gcc版本问题
来源:百度文库 编辑:中财网 时间:2024/10/05 12:20:06
crosstool编译过程中gcc版本问题
在使用crosstool构建工具链的过程中,出现了如下问题,导致arm-linux-gcc没有生成:
> checking version of gcc... 4.0.0, bad
> checking for gnumake... no
> checking for gmake... gmake
> checking version of gmake... 3.80, ok
> configure: error:
> *** These critical programs are missing or too old: gcc
> *** Check the INSTALL file for required versions.
察看crosstool目录中的contrib/inbox.txt文件,有关于这个问题的邮件描述:
> checking build system type... i686-pc-linux-gnu
> checking host system type... mipsel-unknown-linux-gnu
> checking sysdep dirs... sysdeps/mips/elf sysdeps/unix/sysv/linux/mips
> sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common
> sysdeps/unix/mman sysdeps/unix/inet sysdeps/unix/sysv sysdeps/unix/mips
> sysdeps/unix sysdeps/posix sysdeps/mips/mipsel sysdeps/mips/fpu
> sysdeps/mips sysdeps/wordsize-32 sysdeps/ieee754/flt-32
> sysdeps/ieee754/dbl-64 sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether ln -s works... yes
> checking for pwd... /bin/pwd
> checking for mipsel-unknown-linux-gnu-gcc... gcc
> checking version of gcc... 4.0.0, bad
> checking for gnumake... no
> checking for gmake... gmake
> checking version of gmake... 3.80, ok
> configure: error:
> *** These critical programs are missing or too old: gcc
> *** Check the INSTALL file for required versions.
>
I have had the same problem. What I found was that the glibc configure
script was testing for a version of gcc 3.2.* or later. It does not test
for a major number above 3 so the test fails. I do not know where this
test is initiated, but once you have reached that point you can patch
the configure script and run demo-*.sh with the --nounpack option added
to your desired toolchain build.
This patch worked for me:
--- configure.orig 2005-09-19 21:31:45.000000000 -0400
+++ configure 2005-09-19 21:32:13.000000000 -0400
@@ -2274,6 +2274,8 @@
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
3.[2-9]*)
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+ 4.*)
+ ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
esac
I hope that this helps. Good Luck.
-Mike Joyce
其意思就是说,在glibc的configure脚本里会检查gcc的版本,当不是需要的版本就保错, glibc的configure中有如下检查:
if test -z "$CC"; then
ac_verc_fail=yes
else
# Found it, now check the version.
echo "$as_me:$LINENO: checking version of $CC" >&5
echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
ac_prog_version=`$CC -v 2>&1 | sed -n 's/^.*version \([egcygnustpi-]*[0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
3.[2-9]*)
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
esac
echo "$as_me:$LINENO: result: $ac_prog_version" >&5
echo "${ECHO_T}$ac_prog_version" >&6
fi
if test $ac_verc_fail = yes; then
critic_missing="$critic_missing gcc"
fi
在上面的gcc版本检查中,只使用了模式3.[2-9]*即只支持3.xxx版本的gcc,在crosstool自己的patches目录下有一个patch:patches/glibc-2.3.3-allow-gcc-4.0-configure.patch,他会在编译glic-2.3.2的时候给这个configure文件先打补丁,那个补丁来修复这个bug,但是这个补丁文件也不是很好,其内容是:
--- glibc-2.3.3/configure.old Mon Mar 14 12:01:10 2005
+++ glibc-2.3.3/configure Mon Mar 14 12:02:03 2005
@@ -3899,7 +3899,7 @@
ac_prog_version=`$CC -v 2>&1 | sed -n 's/^.*version \([egcygnustpi-]*[0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
- 3.[2-9]*)
+ 3.[2-9]*|4.[01]*)
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
即,它只是增加了对4.0xxx或者4.1xxx的支持,还是不够,我现在用的是4.2.1因此还是会出错,因此,修改这个patch,改为3.[2-9]*|4.*)就可以过去了。
总之,在编译glibc的时候,其configure脚本对gcc的限定是比较严格的,而且并没有将后来的较新的版本考虑在内,这种严格的检查是我们在configure是出了错。但是如果我们直接修改glibc原码中的configure文件,又会造成crosstool在用他自己的patches给glibc的configure打补丁的时候出错,呵呵,还是去修改crosstool的补丁文件吧,glibc就留着不要动了。
在使用crosstool构建工具链的过程中,出现了如下问题,导致arm-linux-gcc没有生成:
> checking version of gcc... 4.0.0, bad
> checking for gnumake... no
> checking for gmake... gmake
> checking version of gmake... 3.80, ok
> configure: error:
> *** These critical programs are missing or too old: gcc
> *** Check the INSTALL file for required versions.
察看crosstool目录中的contrib/inbox.txt文件,有关于这个问题的邮件描述:
> checking build system type... i686-pc-linux-gnu
> checking host system type... mipsel-unknown-linux-gnu
> checking sysdep dirs... sysdeps/mips/elf sysdeps/unix/sysv/linux/mips
> sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common
> sysdeps/unix/mman sysdeps/unix/inet sysdeps/unix/sysv sysdeps/unix/mips
> sysdeps/unix sysdeps/posix sysdeps/mips/mipsel sysdeps/mips/fpu
> sysdeps/mips sysdeps/wordsize-32 sysdeps/ieee754/flt-32
> sysdeps/ieee754/dbl-64 sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether ln -s works... yes
> checking for pwd... /bin/pwd
> checking for mipsel-unknown-linux-gnu-gcc... gcc
> checking version of gcc... 4.0.0, bad
> checking for gnumake... no
> checking for gmake... gmake
> checking version of gmake... 3.80, ok
> configure: error:
> *** These critical programs are missing or too old: gcc
> *** Check the INSTALL file for required versions.
>
I have had the same problem. What I found was that the glibc configure
script was testing for a version of gcc 3.2.* or later. It does not test
for a major number above 3 so the test fails. I do not know where this
test is initiated, but once you have reached that point you can patch
the configure script and run demo-*.sh with the --nounpack option added
to your desired toolchain build.
This patch worked for me:
--- configure.orig 2005-09-19 21:31:45.000000000 -0400
+++ configure 2005-09-19 21:32:13.000000000 -0400
@@ -2274,6 +2274,8 @@
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
3.[2-9]*)
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+ 4.*)
+ ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
esac
I hope that this helps. Good Luck.
-Mike Joyce
其意思就是说,在glibc的configure脚本里会检查gcc的版本,当不是需要的版本就保错, glibc的configure中有如下检查:
if test -z "$CC"; then
ac_verc_fail=yes
else
# Found it, now check the version.
echo "$as_me:$LINENO: checking version of $CC" >&5
echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
ac_prog_version=`$CC -v 2>&1 | sed -n 's/^.*version \([egcygnustpi-]*[0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
3.[2-9]*)
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
esac
echo "$as_me:$LINENO: result: $ac_prog_version" >&5
echo "${ECHO_T}$ac_prog_version" >&6
fi
if test $ac_verc_fail = yes; then
critic_missing="$critic_missing gcc"
fi
在上面的gcc版本检查中,只使用了模式3.[2-9]*即只支持3.xxx版本的gcc,在crosstool自己的patches目录下有一个patch:patches/glibc-2.3.3-allow-gcc-4.0-configure.patch,他会在编译glic-2.3.2的时候给这个configure文件先打补丁,那个补丁来修复这个bug,但是这个补丁文件也不是很好,其内容是:
--- glibc-2.3.3/configure.old Mon Mar 14 12:01:10 2005
+++ glibc-2.3.3/configure Mon Mar 14 12:02:03 2005
@@ -3899,7 +3899,7 @@
ac_prog_version=`$CC -v 2>&1 | sed -n 's/^.*version \([egcygnustpi-]*[0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
- 3.[2-9]*)
+ 3.[2-9]*|4.[01]*)
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
即,它只是增加了对4.0xxx或者4.1xxx的支持,还是不够,我现在用的是4.2.1因此还是会出错,因此,修改这个patch,改为3.[2-9]*|4.*)就可以过去了。
总之,在编译glibc的时候,其configure脚本对gcc的限定是比较严格的,而且并没有将后来的较新的版本考虑在内,这种严格的检查是我们在configure是出了错。但是如果我们直接修改glibc原码中的configure文件,又会造成crosstool在用他自己的patches给glibc的configure打补丁的时候出错,呵呵,还是去修改crosstool的补丁文件吧,glibc就留着不要动了。
gcc编译问题
gcc编译的一个问题
gcc编译Fortran的命令是什么?
Linux上安装GCC编译器过程
C语言编译过程中为什么显示警告?
linux gcc 编译结果不能运行是怎么了 ?
(Linux)gcc进行优化编译的参数是什么?
linux下的gcc编译问题。比较简单,请指教!
如何在linux中安装gcc编译器?
请问那里有cygwin的老版本的gcc安装包下载?gcc 2.9x的
vc在编译过程中经常死机(包括程序没有错误时)是怎么回事?
x86-64上怎么安装GCC,编译32位和64位程序,谢谢。
(请留步)我用Cygwin GCC交叉编译某程序时,make后发生了问题
在vb 编译的过程中出现错误:在该对象模块派生的对象模块中成员已存在
gcc 中 -s -o -c -lm都是什么意思?
英文版本XP怎样才能默认中问...?
问一下,在命令行中,C#用csc编译,vb用什么呢?
编译的具体过程请教能人
运行程序的过程不是编译的过程吗?
在面试过程中,老总问些什么多?
问大家装系统过程中出现的问题?
VC中编译的问题
asp.net中编译问题
是不是所有版本的gcc都支持标准C++呢?