LinuxSir.cn,穿越时空的Linuxsir!

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

编译 gcc 通不过求助

[复制链接]
发表于 2006-6-10 10:09:24 | 显示全部楼层 |阅读模式
输入下面命令
../gcc-3.4.3/configure --prefix=/tools
--libexecdir=/tools/lib--with-local-prefix=/tools --disable-nls--enab
le-shared --enable-languages=c
输出
loading cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking build system type... i686-pc-linux-gnu
checking for a BSD compatible install... /usr/bin/install -c
*** This configuration is not supported in the following subdirectorie
s:
     target-libstdc++-v3 target-libf2c target-libffi target-boehm-gc t
arget-zlib target-libjava zlib fastjar target-libobjc
    (Any other directories should still work fine.)
/tools/bin/ld: warning: ld-linux.so.2, needed by /lib/libc.so.6, not f
ound (try using -rpath or -rpath-link)
/lib/libc.so.6: undefined reference to `_rtld_global@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `__libc_enable_secure@GLIBC_PRI        VATE'
/lib/libc.so.6: undefined reference to `__libc_stack_end@GLIBC_2.1'
/lib/libc.so.6: undefined reference to `_rtld_global_ro@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_dl_out_of_memory@GLIBC_PRIVAT        E'
/lib/libc.so.6: undefined reference to `___tls_get_addr@GLIBC_2.3'
/lib/libc.so.6: undefined reference to `_r_debug@GLIBC_2.0'
/lib/libc.so.6: undefined reference to `_dl_argv@GLIBC_PRIVATE'
collect2: ld returned 1 exit status
*** The command 'gcc -o conftest -g -O2   conftest.c' failed.
*** You must set the environment variable CC to a working compiler.
我该怎么做
Post by d00m3d
楼上发问前,请说明:

1. 你的 host 系统
2. 你在做哪一版的 LFS
3. 用哪一版的 LFS 手册,做到哪一节
Post by 终极幻想
[QUOTE]输入下面命令
../gcc-3.4.3/configure --prefix=/tools[color="Red"]
--libexecdir=/tools/lib--with-local-prefix=/tools--disable-nls--enab
le-shared --enable-languages=c

是抄错了,还是你命令打错了?[/QUOTE]
Post by 味精
HOST:more /proc/version

Linux version 2.6.15.3 (KanKer@MagicLinux) (gcc version 3.4.4 20050721
(Red Hat 3.4.4-1mgc)) #1 Fri Feb 10 01:51:55 CST 2006

是MAGICLINUX2.0

GCC:gcc -v
Reading specs from /usr/lib/gcc/i686-magic-linux/3.4.4/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=i686-magic-linux
Thread model: posix
gcc version 3.4.4 20050721 (Red Hat 3.4.4-1mgc)
Post by 味精
是抄的命令;

是6.1.tar,手册是金步国的2006.6.1的最终正式版

也看了几位大侠的贴
Post by 味精
昨晚编译了两个包,binutils和gcc,可是gcc安装不了,是一个文件夹无权创建,结果没装关机睡觉了,今天想继续,出问题了,
You must set the environment variable CC to a working compiler
这个variable CC怎么设

以前做过两次5.1的,都是在chroot时过不去,没人指点就没做了,希望这次在几位大侠的帮助下能成功
Post by 味精
是抄的命令;

是6.1.tar,手册是金步国的2006.6.1的最终正式版
Post by 味精
export
declare -x HOME="/home/lfs"
declare -x LC_ALL="OSIX"
declare -x LFS="/mnt/lfs"
declare -x OLDPWD
declare -x PATH="/tools/bin:/bin:/usr/bin"
declare -x PS1="\\u:\\w\\\$"
declare -x PWD="/home/lfs"
declare -x SHLVL="1"
declare -x TERM="xterm"
[quote]Post by 味精
î改了à次总有à个乱码,不å道是我显示的î˜Ø是??? “是抄的命䔓Ñ步ý(csfrank)的手册2006.6.1”
看不到你写什麽,乱码问题请參考这里解决

http://www.linuxsir.cn/bbs/showthread.php?t=259968[/QUOTE]
Post by d00m3d
还未看懂幻想老大给你的提示吗?

那句 configure 是要一次性输入的,或者按手册加上 " \"来分行

还有些空格漏打了!
Post by 味精
想偷懒,从GCC开始,不行,只好又从Binutils从新开始,反正也才编译了一个包,结果连Binutils都不能编译了,出错“checking whether the C compiler (gcc  ) works... no”,一狠心从头开始,连lfs用户都删除了从新加,可以make         Binutils了可以又不能安装了还是“Permission denied”和昨晚Gcc一样的错
命令:make
OK
接着:make install
/bin/sh ../binutils-2.15.94.0.2.2/mkinstalldirs /tools--disable-nls /tools--disable-nls
mkdir -p -- /tools--disable-nls /tools--disable-nls
mkdir: cannot create directory `/tools--disable-nls': Permission denied
mkdir: cannot create directory `/tools--disable-nls': Permission denied
Post by 味精
原来上面的“/tools--disable-nls”少了个空格;应是 “/tools --disable-nls”没把参数路径分开
Post by 味精
在用youbest的速成手册安装,有点疑问。
cp -Rv include/asm-i386 /tools/include/asm
cp -Rv include/linux /tools/include
为什么不改成
mv -Rv include/asm-i386 /tools/include/asm
mv -Rv include/linux /tools/include
发表于 2006-6-10 16:07:40 | 显示全部楼层
非常抱歉!原意是想把主题独立出来,应该是移动帖子,但不小心按了合并帖子,按错钮结果把帖子弄糟了,敬请各位原谅!:sorry

:beat :beat :beat
回复 支持 反对

使用道具 举报

发表于 2006-6-10 17:03:53 | 显示全部楼层
按照提示来说,,主系统的  gcc 似乎没装。。

你试试 gcc -V  看看结果是?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-6-11 19:33:42 | 显示全部楼层
我还奇怪,那几楼怎么没了,

我的宿主系统的gcc没问题,可能是因为编译gcc时改了什么,又因为参数出错,不能安装,所以想重头编译binutils时就不行了,后来删了lfs用户,再重新设置环境,就可以了。

发现那个参数会影响安装之后(原因应该是少了空格使参数变成目录名,而又无权创建目录,所以安装停止。),就没有自己输入参数;直接复制youbest的速成手册贴的命令,只输入少量几个自己知道又没有参数的命令;原来编译5.1时也都是copy ,没发现问题。这次学到了不少东西,编译、打补丁、配置fstab

youbest速成手册贴有很多测试,到凌晨1点时去看LFS的才知道那不是一定要的,后面就都跳过了。
到早晨5点完工。ID:17385  
回复 支持 反对

使用道具 举报

发表于 2006-6-11 19:55:43 | 显示全部楼层
那是我严重的操作失误,非常抱歉!
回复 支持 反对

使用道具 举报

发表于 2006-6-12 22:54:43 | 显示全部楼层
mkdir: cannot create directory `/tools--disable-nls': Permission denied
mkdir: cannot create directory `/tools--disable-nls': Permission denied
是不是没有用这个命令chown -v lfs $LFS/tools
回复 支持 反对

使用道具 举报

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

本版积分规则

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