在 Gentoo 上安装 Ninja 时遇到问题

在 Gentoo 上安装 Ninja 时遇到问题

我正在尝试安装 ninja(作为 Vim 的 YouCompleteMe 的先决条件),但出现错误。这是我的总结=dev-util/ninja-1.8.2::gentoo

    Portage 2.3.31 (python 3.5.5-final-0, default/linux/amd64/17.0/no-multilib/prefix/kernel-2.6.32+, gcc-7.3.0, glibc-2.25-r11, 2.6.32-504.16.2.el6.x86_64 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-2.6.32-504.16.2.el6.x86_64-x86_64-Intel-R-_Xeon-R-_CPU_E5-2630_v3_@_2.40GHz-with-centos-6.6-Final
KiB Mem:   132052796 total,  24015248 free
KiB Swap:    8388604 total,    935832 free
Timestamp of repository gentoo: Thu, 19 Apr 2018 06:00:01 +0000
Head commit of repository gentoo: 9cc1a3f648766c962e7a465020db4820b6ba6e01
sh bash 4.4_p19
ld GNU ld (Gentoo 2.30 p1) 2.30.0
app-shells/bash:          4.4_p19::gentoo
dev-lang/perl:            5.26.1-r2::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.5.5::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.30-r1::gentoo
sys-devel/gcc:            7.3.0-r1::gentoo
sys-devel/gcc-config:     1.9.1::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r3::gentoo
sys-kernel/linux-headers: 4.16-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.25-r11::gentoo
Repositories:

gentoo
    location: /home/******/gentoo/usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: 

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/sandbox.d /etc/terminfo /home/*****/gentoo/etc/gentoo-release"
CXXFLAGS="-O2 -pipe -O2 -pipe"
DISTDIR="/home/******/gentoo/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles force-prefix merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans unprivileged"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j8"
PKGDIR="/home/*****/gentoo/usr/portage/packages"
PORTAGE_CONFIGROOT="/home/******/gentoo/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/home/******/gentoo/var/tmp"
USE="acl amd64 berkdb bzip2 cli crypt cxx dri fortran gdbm iconv ipv6 modules ncurses nls nptl openmp pcre prefix readline seccomp ssl tcpd unicode zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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 cgi cgid 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" CALLIGRA_FEATURES="karbon plan sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby22 ruby23" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, ENV_UNSET, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

这是 vim-app/youcompleteme 的 emerege 输出:

 * IMPORTANT: 11 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.


 * IMPORTANT: 3 config files in '/home/******/gentoo/etc/portage' need updating.
 * See the CONFIGURATION FILES and CONFIGURATION FILES UPDATE TOOLS
 * sections of the emerge man page to learn how to update config files.
Calculating dependencies... done!

>>> Verifying ebuild manifests
>>> Running pre-merge checks for sys-libs/libomp-6.0.0
 * Determining the location of the kernel source code
 * Unable to find kernel sources at /usr/src/linux
 * Please make sure that /usr/src/linux points at your running kernel, 
 * (or the kernel you wish to build against).
 * Alternatively, set the KERNEL_DIR environment variable to the kernel sources location
 * Unable to calculate Linux Kernel version for build, attempting to use running version
 * Found kernel object directory:
 *     /usr/src/kernels/2.6.32-504.16.2.el6.x86_64
 * Found sources for kernel version:
 *     2.6.32-504.16.2.el6.x86_64
>>> Running pre-merge checks for sys-libs/compiler-rt-6.0.0
>>> Running pre-merge checks for sys-libs/compiler-rt-sanitizers-6.0.0

>>> Emerging (1 of 15) dev-util/ninja-1.8.2::gentoo
 * ninja-1.8.2.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                            [ ok ]
>>> Unpacking source...
>>> Unpacking ninja-1.8.2.tar.gz to /home/******/gentoo/var/tmp/portage/dev-util/ninja-1.8.2/work
>>> Source unpacked in /home/*******/gentoo/var/tmp/portage/dev-util/ninja-1.8.2/work
>>> Preparing source in /home/******/gentoo/var/tmp/portage/dev-util/ninja-1.8.2/work/ninja-1.8.2 ...
>>> Source prepared.
>>> Configuring source in /home/*****/gentoo/var/tmp/portage/dev-util/ninja-1.8.2/work/ninja-1.8.2 ...
>>> Source configured.
>>> Compiling source in /home/******/gentoo/var/tmp/portage/dev-util/ninja-1.8.2/work/ninja-1.8.2 ...
bootstrapping ninja...
"./src/inline.sh" kBrowsePy < ./src/browse.py > build/browse_py.h
x86_64-pc-linux-gnu-g++ -MMD -MT build/browse.o -MF build/browse.o.d -g -Wall -Wextra -Wno-deprecated -Wno-missing-field-initializers -Wno-unused-parameter -fno-rtti -fno-exceptions -fvisibility=hidden -pipe '-DNINJA_PYTHON="python3.5"' -O2 -DNDEBUG -fdiagnostics-color -DUSE_PPOLL -DNINJA_HAVE_BROWSE -I. -O2 -pipe -O2 -pipe -c ./src/browse.cc -o build/browse.o
re2c: /home/******/usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by re2c)
re2c: /home/*******/usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by re2c)
Traceback (most recent call last):
  File "configure.py", line 466, in <module>
    if has_re2c():
  File "configure.py", line 463, in has_re2c
    return int(proc.communicate()[0], 10) >= 1103
ValueError: invalid literal for int() with base 10: b''
 * ERROR: dev-util/ninja-1.8.2::gentoo failed (compile phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line 124:  Called src_compile
 *   environment, line 2139:  Called die
 * The specific snippet of code:
 *       run_for_build "${PYTHON}" configure.py --bootstrap --verbose || die;
 * 
 * If you need support, post the output of `emerge --info '=dev-util/ninja-1.8.2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-util/ninja-1.8.2::gentoo'`.
 * The complete build log is located at '/home/******/gentoo/var/tmp/portage/dev-util/ninja-1.8.2/temp/build.log'.
 * The ebuild environment file is located at '/home/******/gentoo/var/tmp/portage/dev-util/ninja-1.8.2/temp/environment'.
 * Working directory: '/home/******/gentoo/var/tmp/portage/dev-util/ninja-1.8.2/work/ninja-1.8.2'
 * S: '/home/******/gentoo/var/tmp/portage/dev-util/ninja-1.8.2/work/ninja-1.8.2'

>>> Failed to emerge dev-util/ninja-1.8.2, Log file:

>>>  '/home/*******/gentoo/var/tmp/portage/dev-util/ninja-1.8.2/temp/build.log'

 * Messages for package sys-libs/libomp-6.0.0:

 * Unable to find kernel sources at /usr/src/linux
 * Unable to calculate Linux Kernel version for build, attempting to use running version

 * Messages for package dev-util/ninja-1.8.2:

 * ERROR: dev-util/ninja-1.8.2::gentoo failed (compile phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line 124:  Called src_compile
 *   environment, line 2139:  Called die
 * The specific snippet of code:
 *       run_for_build "${PYTHON}" configure.py --bootstrap --verbose || die;
 * 
 * If you need support, post the output of `emerge --info '=dev-util/ninja-1.8.2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-util/ninja-1.8.2::gentoo'`.
 * The complete build log is located at '/home/********/gentoo/var/tmp/portage/dev-util/ninja-1.8.2/temp/build.log'.
 * The ebuild environment file is located at '/home/******/gentoo/var/tmp/portage/dev-util/ninja-1.8.2/temp/environment'.
 * Working directory: '/home/*******/gentoo/var/tmp/portage/dev-util/ninja-1.8.2/work/ninja-1.8.2'
 * S: '/home/*******/gentoo/var/tmp/portage/dev-util/ninja-1.8.2/work/ninja-1.8.2'

更新2: 我的 GCC 版本: [1] x86_64-pc-linux-gnu-7.3.0 *

答案1

观察1

为什么你要把你的 portage 树存储在你的主目录中? 别担心,写完观察2后,我明白为什么了。看到这让我感到畏缩。默认位置应该是:/usr/portage。该位置有助于创建本地覆盖(usr/local/portage将本地树与您同步的树区分开来),即具有自定义版本号的包或主 Portage 树中不存在的包。人们普遍认为 Gentoo 系统上的树和/或覆盖层是一个系统组件,因此应该位于系统目录中。 Portage 功能由驻留在/etc/portage.请参阅Gentoo Portage 维基。您的主目录应该用于您下载或创建的内容。这在系统和用户之间创建了边界。 该边界是任何 *NIX 系统的基础

观察2

尽管您的 GCC 编译器当前不稳定,但这并不是问题的原因。看Gentoo 软件包 - sys-devel/gcc。问题是版本系统库/glibc。 Portage 认为您拥有版本 2.25-r11,但您的主机系统(因此是观察 1 的原因。预感,我相信您的安装是在运行另一个版本或 Linux 发行版的系统内)包含并链接到版本 3.4.20 。 Portage 从主机收集链接信息,因为它认为您的主机系统是它自己安装的系统,作为一个正在运行的系统。请参阅观察#1。

单个主机上的多个 glibc 库。简而言之,您有几个选择:

  1. 使用我链接的问题中描述的方法 1,将 Portage 指向正确的环境变量,或者
  2. 从主目录中删除您的安装,然后遵循手册(arch 不相关),并省略设置引导加载程序章节以及完成安装。始终使用chroot命令进入环境。在chroot中创建一个用户,并且su user每次进入chroot。

    提示:创建/home/用户名/mnt/gentoo

然后使用 Chrooting 过程中概述Gentoo 手册:Chrooting,将 chroot 指向/home/username/mnt/gentoo。 chroot 之后,创建观察 1 的边界。这会让 portage 相信它安装在自己的主机上,因为它尊重 chroot 环境。

  1. 使用这个脚本:与现有系统并行安装 GNU libc 版本,为了简化选项 1,尽管如果您与其他用户共享主机,我建议您不要这样做,因为如果您将该--prefix选项设置为主目录中的某个位置,然后与其他用户共享您的程序,它将无法运行。

相关内容