LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 3326|回复: 22

求助:编译gcc时候找不到host类型!谢谢

[复制链接]
发表于 2006-4-11 23:52:19 | 显示全部楼层 |阅读模式
我在安装FC4下的AVR开发环境时,编译gcc-core-4.1.0.tar.bz2.命令是:
./configure --target=avr --prefix=/usr/local --disable-nls --enable-language=c
结果提示说找不到host类型:
config.guess timestamp = 2005-11-11

uname -m = i686
uname -r = 2.6.11-1.1369_FC4
uname -s = Linux
uname -v = #1 Thu Jun 2 22:55:56 EDT 2005

/usr/bin/uname -p =
/bin/uname -X     =

hostinfo               =
/bin/universe          =
/usr/bin/arch -k       =
/bin/arch              = i686
/usr/bin/oslevel       =
/usr/convex/getsysinfo =

UNAME_MACHINE = i686
UNAME_RELEASE = 2.6.11-1.1369_FC4
UNAME_SYSTEM  = Linux
UNAME_VERSION = #1 Thu Jun 2 22:55:56 EDT 2005
configure: error: can not guess host type; you must specify one
请问个位大哥这个该怎么解决啊?
发表于 2006-4-12 00:17:34 | 显示全部楼层
需要完整的 toolchain。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-12 00:25:09 | 显示全部楼层
哈哈。谢谢。没想到斑竹回复这么快。我几乎是同时在这里找到说明了http://lfs.linuxsir.cn/htdocs/faq/
我虚心学习。刚才找的不仔细,漏过了。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-12 07:38:05 | 显示全部楼层
版主,还是搞不定./usr/bin下面有cc到gcc的符号联接.config.log只有这么一行:
configure:600: checking host system type
我是不是要手动指定啊?该用哪个参数?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-12 08:20:00 | 显示全部楼层
这回搞定了,原来是$PATH有问题,前面安装binutils时候,在PATH里面添加了/usr/loacl/avr/bin,导致出现这个问题。暂时把这个路径删掉就没事了。
checking host system type... i686-pc-linux-gnu
呵呵。为什么以前的哥哥们这么设置却没有遇到问题呢?
回复 支持 反对

使用道具 举报

发表于 2006-4-12 08:34:21 | 显示全部楼层
我不知道你读了什么文章,我无法进一步确定你的问题。
PATH中添加的那个路径,应该放在最前边的。
host system 那里有啥问题么?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-12 10:43:53 | 显示全部楼层
我前面是这么装的:
先装binutils-2.16
mkdir binutils-build
cd binutils-build
../binutils-2.16/configure --target=avr --prefix=/usr/local
make
make install
这样,在/usr/local/avr目录下安装了binutils的软件,让新安装的库加入系统的搜索路径:
echo "/usr/local/avr/lib" >>/etc/ld.so.conf
/sbin/ldconfig
没遇到error。
然后在~/.bashrc文件中加入export PATH=/usr/local/atmel/bin{PATH}, 并且在命令行下也输入该语句。
下一步,编译gcc-core-4.1.0:
mkdir gcc-build
cd gcc-build
../gcc-4.1.0/configure --target=avr --prefix=/usr/local --disable-nls --enable-language=c
make

在configure的时候,出现error: can not guess host type; you must specify one
我把刚才设的PATH删掉之后,configure就过去了。

现在又出现新的问题,make进行到的gcc-build/avr/libssp时候报错:
error: C compiler cannot create executables See `config.log' for more details.
gcc-build下的config.log最后两行:
configure:6018: checking whether to enable maintainer-specific portions of Makefiles
configure:6065: checking if symbolic links between directories work
gcc-build/avr/libssp下的config.log中找到:
configure:2281: /home/eraser/打造编程环境/gcc-build/./gcc/xgcc -B/home/eraser/打造编程环境/gcc-build/./gcc/ -B/usr/local/avr/bin/ -B/usr/local/avr/lib/ -isystem /usr/local/avr/include -isystem /usr/local/avr/sys-include -V </dev/null >&5
xgcc: '-V' must come at the start of the command line
configure:2284: $? = 1
configure:2307: checking for C compiler default output file name
configure:2310: /home/eraser/打造编程环境/gcc-build/./gcc/xgcc -B/home/eraser/打造编程环境/gcc-build/./gcc/ -B/usr/local/avr/bin/ -B/usr/local/avr/lib/ -isystem /usr/local/avr/include -isystem /usr/local/avr/sys-include -O2 -g -O2    conftest.c  >&5
/usr/local/avr/bin/ld: crts8515.o: No such file: No such file or directory
configure:2313: $? = 1
configure: failed program was:
| /* confdefs.h.  */
|
| #define PACKAGE_NAME "libssp"
| #define PACKAGE_TARNAME "libssp"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "libssp 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "libssp"
| #define VERSION "1.0"
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:2352: error: C compiler cannot create executables
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=i686-pc-linux-gnu
ac_cv_build_alias=i686-pc-linux-gnu
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_build_alias_set=set
ac_cv_env_build_alias_value=i686-pc-linux-gnu
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=avr
ac_cv_env_target_alias_set=set
ac_cv_env_target_alias_value=avr
ac_cv_host=avr-unknown-none
ac_cv_host_alias=avr
ac_cv_prog_AWK=gawk
ac_cv_prog_CC='/home/eraser/打造编程环境/gcc-build/./gcc/xgcc -B/home/eraser/打造编程环境/gcc-build/./gcc/ -B/usr/local/avr/bin/ -B/usr/local/avr/lib/ -isystem /usr/local/avr/include -isystem /usr/local/avr/sys-include'
ac_cv_prog_STRIP=avr-strip
ac_cv_prog_make_make_set=yes
ac_cv_target=avr-unknown-none
ac_cv_target_alias=avr

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${SHELL} /home/eraser/打造编程环境/gcc-core-4.1.0/gcc-4.1.0/missing --run aclocal-1.9'
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR='${SHELL} /home/eraser/打造编程环境/gcc-core-4.1.0/gcc-4.1.0/missing --run tar'
AUTOCONF='${SHELL} /home/eraser/打造编程环境/gcc-core-4.1.0/gcc-4.1.0/missing --run autoconf'
AUTOHEADER='${SHELL} /home/eraser/打造编程环境/gcc-core-4.1.0/gcc-4.1.0/missing --run autoheader'
AUTOMAKE='${SHELL} /home/eraser/打造编程环境/gcc-core-4.1.0/gcc-4.1.0/missing --run automake-1.9'
AWK='gawk'
CC='/home/eraser/打造编程环境/gcc-build/./gcc/xgcc -B/home/eraser/打造编程环境/gcc-build/./gcc/ -B/usr/local/avr/bin/ -B/usr/local/avr/lib/ -isystem /usr/local/avr/include -isystem /usr/local/avr/sys-include'
CCDEPMODE=''
CFLAGS='-O2 -g -O2 '
CPP=''
CPPFLAGS=''
CYGPATH_W='echo'
DEFS=''
DEPDIR=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
INSTALL_DATA='/usr/bin/install -c -m 644'
INSTALL_PROGRAM='/usr/bin/install -c'
INSTALL_SCRIPT='/usr/bin/install -c'
INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'
LIBOBJS=''
LIBS=''
LIBSSP_USE_SYMVER_FALSE=''
LIBSSP_USE_SYMVER_TRUE=''
LIBTOOL=''
LN_S=''
LTLIBOBJS=''
MAINT='#'
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE='#'
MAKEINFO='makeinfo --split-size=5000000'
OBJEXT=''
PACKAGE='libssp'
PACKAGE_BUGREPORT=''
PACKAGE_NAME='libssp'
PACKAGE_STRING='libssp 1.0'
PACKAGE_TARNAME='libssp'
PACKAGE_VERSION='1.0'
PATH_SEPARATOR=':'
RANLIB='avr-ranlib'
SET_MAKE=''
SHELL='/bin/sh'
STRIP='avr-strip'
VERSION='1.0'
ac_ct_CC=''
ac_ct_RANLIB=''
ac_ct_STRIP=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__include=''
am__leading_dot='.'
am__quote=''
am__tar='${AMTAR} chof - "$$tardir"'
am__untar='${AMTAR} xf -'
bindir='${exec_prefix}/bin'
build='i686-pc-linux-gnu'
build_alias='i686-pc-linux-gnu'
build_cpu='i686'
build_os='linux-gnu'
build_vendor='pc'
datadir='${prefix}/share'
enable_shared=''
enable_static=''
exec_prefix='NONE'
host='avr-unknown-none'
host_alias='avr'
host_cpu='avr'
host_os='none'
host_vendor='unknown'
includedir='${prefix}/include'
infodir='${prefix}/info'
install_sh='/home/eraser/打造编程环境/gcc-core-4.1.0/gcc-4.1.0/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
mkdir_p='mkdir -p --'
multi_basedir='../../../gcc-core-4.1.0/gcc-4.1.0/libssp/..'
oldincludedir='/usr/include'
prefix='/usr/local'
program_transform_name='s,^,avr-,;'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
ssp_have_usable_vsnprintf=''
sysconfdir='${prefix}/etc'
target='avr-unknown-none'
target_alias='avr'
target_cpu='avr'
target_noncanonical='avr'
target_os='none'
target_vendor='unknown'
toolexecdir=''
toolexeclibdir=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

#define PACKAGE "libssp"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_NAME "libssp"
#define PACKAGE_STRING "libssp 1.0"
#define PACKAGE_TARNAME "libssp"
#define PACKAGE_VERSION "1.0"
#define VERSION "1.0"

configure: exit 77

好像很多人在编译gcc的时候都会有这样的问题,但我仍没找到解决方法。
1.我尝试增加export CC=gcc,失败。
2.现在正在升级系统gcc到最新。
回复 支持 反对

使用道具 举报

发表于 2006-4-12 11:08:07 | 显示全部楼层
../gcc-4.1.0/configure --target=avr --prefix=/usr/local --disable-nls --enable-language=c
->
../gcc-4.1.0/configure --target=avr --prefix=/usr/local --disable-nls --enable-language=c --host=i686-pc-linux-gnu

试试?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-12 11:35:16 | 显示全部楼层
不成,我试了两次。
第一次:不设PATH,运行加host参数的configure没问题,make依然报错,这次看清楚了:
Checking multilib configuration...
multilib.out is unchanged
Configuring in avr/libssp
configure: loading cache ./config.cache
checking build system type... i686-pc-linux-gnu
checking host system type... avr-unknown-none
checking target system type... avr-unknown-none
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for avr-strip... avr-strip
checking for --enable-version-specific-runtime-libs... no
checking whether to enable maintainer-specific portions of Makefiles... no
checking for avr-gcc... /home/eraser/打造编程环境/gcc-build/./gcc/xgcc -B/home/eraser/打造编程环境/gcc-build/./gcc/ -B/usr/local/avr/bin/ -B/usr/local/avr/lib/ -isystem /usr/local/avr/include -isystem /usr/local/avr/sys-include
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.
make[1]: *** [configure-target-libssp] 错误 1
make[1]: Leaving directory `/home/eraser/打造编程环境/gcc-build'
make: *** [all] 错误 2
奇怪的是,这之前的编译也用到gcc,就没有报错。似乎问题出在avr-gcc上。我没找到这个命令。不知道该怎么解决。.log文件的内容和前面的一样。

第二次:
export CC=gcc
export PATH=/usr/local/avr/binPATH
运行加host参数的configure时候就报错:
loading cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking target system type... avr-unknown-none
checking build system type... i686-pc-linux-gnu
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether ln works... (cached) yes
checking whether ln -s works... (cached) yes
checking for gcc... (cached) gcc
checking whether the C compiler (gcc  ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.

请教。
回复 支持 反对

使用道具 举报

发表于 2006-4-12 11:53:55 | 显示全部楼层
设置 CC 是干嘛的?
你的 PATH 为啥不是 /usr/local/bin,而是 /usr/local/avr/bin?

最好别在 /usr/local 下操作,开一个新目录,比如 /opt/avr 这类的。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表