LinuxSir.cn,穿越时空的Linuxsir!

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

请教:编译错误【已解决】

[复制链接]
发表于 2009-2-26 20:27:07 | 显示全部楼层 |阅读模式

  1. >>> Unpacking source...
  2. >>> Unpacking rsync-3.0.5.tar.gz to /var/tmp/portage/net-misc/rsync-3.0.5/work
  3. >>> Source unpacked in /var/tmp/portage/net-misc/rsync-3.0.5/work
  4. >>> Compiling source in /var/tmp/portage/net-misc/rsync-3.0.5/work/rsync-3.0.5 ...
  5. * econf: updating rsync-3.0.5/config.guess with /usr/share/gnuconfig/config.guess
  6. * econf: updating rsync-3.0.5/config.sub with /usr/share/gnuconfig/config.sub
  7. ./configure --prefix=/usr --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --without-included-popt --enable-acl-support --disable-xattr-support --disable-ipv6 --enable-iconv --with-rsyncd-conf=/etc/rsyncd.conf --build=i686-pc-linux-gnu
  8. configure.sh: Configuring rsync 3.0.5
  9. checking build system type... i686-pc-linux-gnu
  10. checking host system type... i686-pc-linux-gnu
  11. checking target system type... i686-pc-linux-gnu
  12. checking for i686-pc-linux-gnu-gcc... i686-pc-linux-gnu-gcc
  13. checking for C compiler default output file name...
  14. configure.sh: error: C compiler cannot create executables
  15. See `config.log' for more details.

  16. !!! Please attach the following file when seeking support:
  17. !!! /var/tmp/portage/net-misc/rsync-3.0.5/work/rsync-3.0.5/config.log
  18. *
  19. * ERROR: net-misc/rsync-3.0.5 failed.
复制代码


config.log

  1. configure.sh:2228: $? = 0
  2. configure.sh:2235: i686-pc-linux-gnu-gcc -v >&5
  3. Using built-in specs.
  4. Target: i686-pc-linux-gnu
  5. Configured with: /var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.1.2 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --disable-libgcj --with-arch=i686 --enable-languages=c,c++,treelang,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
  6. Thread model: posix
  7. gcc version 4.1.2 (Gentoo 4.1.2 p1.1)
  8. configure.sh:2238: $? = 0
  9. configure.sh:2245: i686-pc-linux-gnu-gcc -V >&5
  10. i686-pc-linux-gnu-gcc: '-V' option must have argument
  11. configure.sh:2248: $? = 1
  12. configure.sh:2271: checking for C compiler default output file name
  13. configure.sh:2298: i686-pc-linux-gnu-gcc -march=i686 -O2 -pipe  -Wl,-O1 --as-needed conftest.c  >&5
  14. cc1: error: unrecognized command line option "-fas-needed"
  15. configure.sh:2301: $? = 1
  16. configure.sh:2339: result:
  17. configure.sh: failed program was:
  18. | /* confdefs.h.  */
复制代码


make.conf

  1. CHOST="i686-pc-linux-gnu"
  2. CFLAGS="-march=i686 -O2 -pipe"
  3. CXXFLAGS="${CFLAGS}"
  4. LDFLAGS="-Wl,-O1 --as-needed
复制代码


LDFLAGS是刚刚从一兄弟的帖子里学来的

不知道--as-needed是什么意思

怎么config.log里面 给弄成--fas-needed?
发表于 2009-2-26 20:30:14 | 显示全部楼层
贴emerge --info

看置顶,报告问题这一步是必需的
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-2-26 20:32:34 | 显示全部楼层
Post by zhllg;1953155
贴emerge --info

看置顶,报告问题这一步是必需的


我这边 发帖子的时候刚开始 编辑框只有一个字符宽度 所以每次我都是先写几个字 发表后再编辑
回复 支持 反对

使用道具 举报

发表于 2009-2-26 21:59:57 | 显示全部楼层
就是这个错了
-Wl,--as-needed
-Wl,表示这个参数是传递给ld的
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-2-26 22:36:10 | 显示全部楼层
Post by zhllg;1953236
就是这个错了
-Wl,--as-needed
-Wl,表示这个参数是传递给ld的


主要是参考了一些文章中:
LDFLAGS="-Wl,-O1,-Wl,--as-needed,Wl,--***"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"

如上这两种设置在我这是错误的

LDFLAGS="-W1,O1,--as-need"
这样才能工作
!!-W1 只能出现一次后面还得带逗号
传递给ld的参数也用逗号分隔
!!!
回复 支持 反对

使用道具 举报

发表于 2009-2-27 21:37:58 | 显示全部楼层
cat /etc/make.conf |grep LDFLAGS
LDFLAGS="-Wl,-O2 -Wl,--as-needed"

正常工作。。。或者你直接复制粘贴重新试试?
回复 支持 反对

使用道具 举报

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

本版积分规则

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