LinuxSir.cn,穿越时空的Linuxsir!

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

[求助]编译gcc-4.3.1-r1无法通过[已经编译成功]

[复制链接]
发表于 2008-7-18 19:34:28 | 显示全部楼层 |阅读模式
错误信息如下
  1. libtool: compile:  /var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/build/./gcc/gfortran -B/var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/build/./gcc/ -B/usr/i686-pc-linux-gnu/bin/ -B/usr/i686-pc-linux-gnu/lib/ -isystem /usr/i686-pc-linux-gnu/include -isystem /usr/i686-pc-linux-gnu/sys-include -I . -Wall -fno-repack-arrays -fno-underscoring -fallow-leading-underscore -c /var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/gcc-4.3.1/libgfortran/intrinsics/selected_int_kind.f90  -fPIC -o .libs/selected_int_kind.o
  2. /var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/gcc-4.3.1/libgfortran/intrinsics/selected_int_kind.f90:35.5:

  3.    do i = 1, c
  4.      1
  5. Error: Syntax error in array constructor at (1)
  6. /var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/gcc-4.3.1/libgfortran/intrinsics/selected_int_kind.f90:36.27:

  7.      if (r <= int_infos (i) % range) then
  8.                            1
  9. Error: Syntax error in IF-expression at (1)
  10. /var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/gcc-4.3.1/libgfortran/intrinsics/selected_int_kind.f90:37.6:

  11.        _gfortran_selected_int_kind = int_infos (i) % kind
  12.       1
  13. Error: Unclassifiable statement at (1)
  14. /var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/gcc-4.3.1/libgfortran/intrinsics/selected_int_kind.f90:39.7:

  15.      end if
  16.        1
  17. Error: Expecting END FUNCTION statement at (1)
  18. /var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/gcc-4.3.1/libgfortran/intrinsics/selected_int_kind.f90:40.5:

  19.    end do
  20.      1
  21. Error: Expecting END FUNCTION statement at (1)
  22. make[3]: *** [selected_int_kind.lo] 错误 1
  23. make[3]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/build/i686-pc-linux-gnu/libgfortran'
  24. make[2]: *** [all] 错误 2
  25. make[2]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/build/i686-pc-linux-gnu/libgfortran'
  26. make[1]: *** [all-target-libgfortran] 错误 2
  27. make[1]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/build'
  28. make: *** [profiledbootstrap] 错误 2
  29.   *
  30.   * ERROR: sys-devel/gcc-4.3.1-r1 failed.
  31.   * Call stack:
  32.   *               ebuild.sh, line   49:  Called src_compile
  33.   *             environment, line 4566:  Called toolchain_src_compile
  34.   *             environment, line 5081:  Called gcc_src_compile
  35.   *             environment, line 2930:  Called gcc_do_make
  36.   *             environment, line 2760:  Called die
  37.   * The specific snippet of code:
  38.   *       emake LDFLAGS="${LDFLAGS}" STAGE1_CFLAGS="${STAGE1_CFLAGS}" LIBPATH="${LIBPATH}" BOOT_CFLAGS="${BOOT_CFLAGS}" ${GCC_MAKE_TARGET} || die "emake failed with ${GCC_MAKE_TARGET}";
  39.   *  The die message:
  40.   *   emake failed with profiledbootstrap
  41.   *
  42.   * If you need support, post the topmost build error, and the call stack if relevant.
  43.   * A complete build log is located at '/var/tmp/portage/sys-devel/gcc-4.3.1-r1/temp/build.log'.
  44.   * The ebuild environment file is located at '/var/tmp/portage/sys-devel/gcc-4.3.1-r1/temp/environment'.
  45.   *

  46.   * Messages for package sys-devel/gcc-4.3.1-r1:

  47.   *
  48.   * ERROR: sys-devel/gcc-4.3.1-r1 failed.
  49.   * Call stack:
  50.   *               ebuild.sh, line   49:  Called src_compile
  51.   *             environment, line 4566:  Called toolchain_src_compile
  52.   *             environment, line 5081:  Called gcc_src_compile
  53.   *             environment, line 2930:  Called gcc_do_make
  54.   *             environment, line 2760:  Called die
  55.   * The specific snippet of code:
  56.   *       emake LDFLAGS="${LDFLAGS}" STAGE1_CFLAGS="${STAGE1_CFLAGS}" LIBPATH="${LIBPATH}" BOOT_CFLAGS="${BOOT_CFLAGS}" ${GCC_MAKE_TARGET} || die "emake failed with ${GCC_MAKE_TARGET}";
  57.   *  The die message:
  58.   *   emake failed with profiledbootstrap
  59.   *
  60.   * If you need support, post the topmost build error, and the call stack if relevant.
  61.   * A complete build log is located at '/var/tmp/portage/sys-devel/gcc-4.3.1-r1/temp/build.log'.
  62.    * The ebuild environment file is located at '/var/tmp/portage/sys-devel/gcc-4.3.1-r1/temp/environment'.
  63.    *
复制代码

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

  1.   # emerge --info
  2. Portage 2.2_rc1 (default/linux/x86/2008.0/desktop, gcc-4.3.1, glibc-2.8_p20080602-r0, 2.6.25-gentoo-r6 i686)
  3. =================================================================
  4. System uname: Linux-2.6.25-gentoo-r6-i686-Intel-R-_Core-TM-2_CPU_6600_@_2.40GHz-with-glibc2.0
  5. Timestamp of tree: Fri, 18 Jul 2008 09:16:01 +0000
  6. ccache version 2.4 [enabled]
  7. app-shells/bash:     3.2_p39
  8. dev-lang/python:     2.4.4-r13, 2.5.2-r5
  9. dev-python/pycrypto: 2.0.1-r6
  10. dev-util/ccache:     2.4-r7
  11. sys-apps/baselayout: 2.0.0
  12. sys-apps/openrc:     0.2.5
  13. sys-apps/sandbox:    1.2.18.1-r3
  14. sys-devel/autoconf:  2.13, 2.62-r1
  15. sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1-r1
  16. sys-devel/binutils:  2.18-r3
  17. sys-devel/gcc-config: 1.4.0-r4
  18. sys-devel/libtool:   2.2.4
  19. virtual/os-headers:  2.6.25-r4
  20. ACCEPT_KEYWORDS="x86 ~x86"
  21. CBUILD="i686-pc-linux-gnu"
  22. CFLAGS="-march=core2 -O2 -pipe -fomit-frame-pointer"
  23. CHOST="i686-pc-linux-gnu"
  24. CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
  25. CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
  26. CXXFLAGS="-march=core2 -O2 -pipe -fomit-frame-pointer"
  27. DISTDIR="/usr/portage/distfiles"
  28. FEATURES="ccache distlocks parallel-fetch preserve-libs sandbox sfperms strict unmerge-orphans userfetch"
  29. GENTOO_MIRRORS="ftp://gentoo.anheng.com.cn/gentoo "
  30. LANG="zh_CN.UTF-8"
  31. LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,-s -Wl,--enable-new-dtags -Wl,--as-needed"
  32. LINGUAS="en en_US zh zh_CN"
  33. MAKEOPTS="-j3"
  34. PKGDIR="/usr/portage/packages"
  35. PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
  36. PORTAGE_TMPDIR="/var/tmp"
  37. PORTDIR="/usr/portage"
  38. SYNC="rsync://rsync.au.gentoo.org/gentoo-portage"
  39. USE="X acl acpi alsa avahi bash-completion berkdb bluetooth branding bzip2 cairo cdr cjk cli cracklib crypt cups dbus dri dvd dvdr dvdread eds emboss encode esd evo fam firefox fortran gconf gdbm gif gnome gpm gstream gstreamer gtk gtk2 hal iconv ipv6 isdnlog jack jpeg kde kerberos ldap libnotify mad midi mikmod mp3 mpeg mudflap ncurses nls nptl nptlonly ogg opengl openmp pam pcre pdf perl png ppds pppd python qt3 qt3support qt4 quicktime readline reflection sdl session spell spl ssl startup-notification svg tcpd tiff truetype unicode vorbis wav win32codecs wma x86 xml xorg xv zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US zh zh_CN" USERLAND="GNU" VIDEO_CARDS="nvidia"
  40. Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
复制代码


  1. GraySky / # gcc-config -l
  2. [1] i686-pc-linux-gnu-4.1.2
  3. [2] i686-pc-linux-gnu-4.2.4
  4. [3] i686-pc-linux-gnu-4.3.1 *
  5. GraySky / # binutils-config -l
  6. [1] i686-pc-linux-gnu-2.18 *
  7. GraySky / # eselect profile list
  8. Available profile symlink targets:
  9.   [1]   default-linux/x86/2006.1
  10.   [2]   default-linux/x86/2006.1/desktop
  11.   [3]   default-linux/x86/2007.0
  12.   [4]   default-linux/x86/2007.0/desktop
  13.   [5]   hardened/x86/2.6
  14.   [6]   selinux/2007.0/x86
  15.   [7]   selinux/2007.0/x86/hardened
  16.   [8]   default/linux/x86/2008.0
  17.   [9]   default/linux/x86/2008.0/desktop *
  18.   [10]  default/linux/x86/2008.0/developer
  19.   [11]  default/linux/x86/2008.0/no-nptl
  20.   [12]  default/linux/x86/2008.0/server
  21.   [13]  hardened/linux/x86
复制代码


郁闷
一直找不到原因
如何才可以编译通过呢
thanks
发表于 2008-7-18 21:45:04 | 显示全部楼层
楼主还没过吗?我这里做了一次 -e system过了。我也找不到原因,如果SYSTEM不是太多包的话,不妨作一次 -e -u -D -N system 。ps:我这有120个包。
Gentoo ~ # gcc -v
使用内建 specs。
目标:i686-pc-linux-gnu
配置为:/var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/gcc-4.3.1/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.3.1 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.1/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.1 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.1/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.1/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.1/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 --enable-cld --disable-libgcj --with-arch=i686 --enable-languages=c,c++,treelang,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.3.1-r1 p1.1'
线程模型:posix
gcc 版本 4.3.1 (Gentoo 4.3.1-r1 p1.1)
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-7-19 12:24:03 | 显示全部楼层
add "-fortran" to the USE variable in "/etc/make.conf".

这样就成功了:)

http://forums.gentoo.org/viewtopic-p-5156552.html#5156552
回复 支持 反对

使用道具 举报

发表于 2008-7-20 10:02:33 | 显示全部楼层
portage 里面 fortran 编写的程序多不?
回复 支持 反对

使用道具 举报

发表于 2008-7-20 11:07:44 | 显示全部楼层
Post by 江涛;1876598
portage 里面 fortran 编写的程序多不?


如果不搞数值计算,可以认为没有
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-7-20 21:22:01 | 显示全部楼层
Post by 江涛;1876598
portage 里面 fortran 编写的程序多不?

现在是有个疑问  万一以后有package以来这个fortran怎么办呢

我咨询过其他人,同样也是stage3的安装别人却不用-fortran也可以编译成功:(

郁闷
回复 支持 反对

使用道具 举报

发表于 2008-7-28 02:51:47 | 显示全部楼层
根据
http://bugs.gentoo.org/show_bug.cgi?id=226651
的提示,我使用
  1. /bin/sh /var/tmp/portage/sys-devel/gcc-4.3.1/work/gcc-4.3.1/libgfortran/mk-sik-inc.sh '/var/tmp/portage/sys-devel/gcc-4.3.1/work/build/./gcc/gfortran -B/var/tmp/portage/sys-devel/gcc-4.3.1/work/build/./gcc/ -B/usr/i686-pc-linux-gnu/bin/ -B/usr/i686-pc-linux-gnu/lib/ -isystem /usr/i686-pc-linux-gnu/include -isystem /usr/i686-pc-linux-gnu/sys-include -I . -Wall -fno-repack-arrays -fno-underscoring -g -O2' > selected_int_kind.inc
复制代码

命令检查了各种版本的gfortran编译器在各种环境下的表现,发现无论如何都会产生错误,但在LC_ALL=C的情况下似乎可以产生正确的输出(虽然说还是会出错)。猜想用LC_ALL=C来编译可能可以解决这个问题。
正在编译中,等结束了再来报告结果。
回复 支持 反对

使用道具 举报

发表于 2008-7-28 11:22:19 | 显示全部楼层
确定LC_ALL=C可以解决问题
回复 支持 反对

使用道具 举报

发表于 2008-7-28 20:07:44 | 显示全部楼层
emerge -e system才是王道.
回复 支持 反对

使用道具 举报

发表于 2008-7-28 22:13:04 | 显示全部楼层
emerge -e system好像没什么作用,应该不是环境的问题,而是gcc包内部的问题,因为gcc都是用自己编译自己的,和环境关系不大吧。据说有人system了N次也没解决一些gcc的编译问题。
回复 支持 反对

使用道具 举报

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

本版积分规则

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