Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo prefix installation fails (locale error)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
tuetschek
n00b
n00b


Joined: 08 Nov 2016
Posts: 2

PostPosted: Tue Nov 08, 2016 12:02 pm    Post subject: Gentoo prefix installation fails (locale error) Reply with quote

Hi,

I'm trying to install Gentoo prefix on a machine with old CentOS 6.7. Unfortunately, I am getting this strange error message:

Code:

>>> Emerging (1 of 1) sys-apps/baselayout-prefix-2.2-r5::gentoo_prefix
Traceback (most recent call last):
  File "/home/do8/gentoo/tmp/usr/bin/emerge", line 50, in <module>
    retval = emerge_main()
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/main.py", line 1185, in emerge_main
    return run_action(emerge_config)
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/actions.py", line 3273, in run_action
    emerge_config.args, spinner)
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/actions.py", line 506, in action_build
    retval = mergetask.merge()
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/Scheduler.py", line 1032, in merge
    rval = self._merge()
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/Scheduler.py", line 1434, in _merge
    self._main_loop()
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/Scheduler.py", line 1401, in _main_loop
    self._schedule()
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/PollScheduler.py", line 127, in _schedule
    self._schedule_tasks()
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/Scheduler.py", line 1602, in _schedule_tasks
    if self._schedule_tasks_imp():
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/Scheduler.py", line 1732, in _schedule_tasks_imp
    self._task_queues.jobs.add(task)
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/SequentialTaskQueue.py", line 23, in add
    self.schedule()
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/SequentialTaskQueue.py", line 45, in schedule
    task.start()
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 30, in start
    self._start()
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/MergeListItem.py", line 85, in _start
    self._start_task(build, self._default_final_exit)
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/CompositeTask.py", line 151, in _start_task
    task.start()
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 30, in start
    self._start()
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/EbuildBuild.py", line 95, in _start
    self._prefetch_exit(prefetcher)
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/EbuildBuild.py", line 164, in _prefetch_exit
    self._start_task(pre_clean_phase, self._pre_clean_exit)
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/CompositeTask.py", line 151, in _start_task
    task.start()
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 30, in start
    self._start()
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/EbuildPhase.py", line 132, in _start
    self._start_lock()
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/EbuildPhase.py", line 152, in _start_lock
    self._start_ebuild()
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/EbuildPhase.py", line 184, in _start_ebuild
    self._start_task(ebuild_process, self._ebuild_exit)
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/CompositeTask.py", line 151, in _start_task
    task.start()
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 30, in start
    self._start()
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/AbstractEbuildProcess.py", line 170, in _start
    SpawnProcess._start(self)
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/SpawnProcess.py", line 112, in _start
    retval = self._spawn(self.args, **kwargs)
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/_emerge/EbuildProcess.py", line 25, in _spawn
    actionmap=actionmap, **kwargs)
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/portage/package/ebuild/doebuild.py", line 170, in _doebuild_spawn
    return spawn(cmd, settings, **portage._native_kwargs(kwargs))
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/portage/package/ebuild/doebuild.py", line 1710, in spawn
    return spawn_func(mystring, env=mysettings.environ(),
  File "/home/do8/gentoo/tmp/usr/lib/portage/pym/portage/package/ebuild/config.py", line 2809, in environ
    raise AssertionError("C locale did not pass the test!")
AssertionError: C locale did not pass the test!


However, my current locale seems reasonable:
Code:

LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=en_GB.UTF-8


Do you have any ideas how to proceed?
Back to top
View user's profile Send private message
i3v
n00b
n00b


Joined: 01 Jan 2013
Posts: 10

PostPosted: Thu Nov 24, 2016 4:19 pm    Post subject: Reply with quote

Hi tuetschek,

I just ran into the similar error, while bootstraping gentoo prefix on CentOS 6.5.
The error occurs in the very beginning of the "step2".
My error message is just like yours, so I won't post it once again.

I've started from inserting some print() functions into "/home/username/gentoo/tmp/usr/lib/portage/pym/portage/package/ebuild/config.py", (to get some idea, what's happening down there) and was able to track it down to "/home/username/gentoo/tmp/usr/lib/portage/pym/portage/util/locale.py":

I've edited the "_check_locale" function like this:

Code:

def _check_locale(silent):
   """
   The inner locale check function.
   """

   libc_fn = find_library("c")
   if libc_fn is None:
      print("_check_locale:libc_fn is none")
      return None
   libc = LoadLibrary(libc_fn)
   if libc is None:
      print("_check_locale:libc is none")
      return None

   print("_check_locale:LoadLibrary OK")

and now it was evident, that find_library("c") is None.

This function was imported from "~/gentoo/tmp/usr/lib/portage/pym/portage/util/_ctypes.py". I've edited the beginning of the file like this:
Code:

# Copyright 2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

try:
   import ctypes
   import ctypes.util
   print("_ctypes:import")
except ImportError as e:
   print("_ctypes:importError: {0}").format(e)
   import sys
   print("sys.path=")
   print(sys.path)
   print("*********")
   ctypes = None
else:
   try:
      print("_ctypes:import:ctypes.cdll")
      ctypes.cdll
   except AttributeError:
      print("_ctypes:import:ctypes.cdll:AttributeError")
      ctypes = None

and got:
Code:

_ctypes:importError: libffi.so.6: cannot open shared object file: No such file or directory
sys.path=
['/home/username/gentoo/tmp/usr/lib/portage/bin', '/home/username/gentoo/tmp/usr/lib/portage/pym', '/home/username/gentoo/tmp/usr/lib/python27.zip', '/home/username/gentoo/tmp/usr/lib/python2.7', '/home/username/gentoo/tmp/usr/lib/python2.7/plat-linux2', '/home/username/gentoo/tmp/usr/lib/python2.7/lib-tk', '/home/username/gentoo/tmp/usr/lib/python2.7/lib-old', '/home/username/gentoo/tmp/usr/lib/python2.7/lib-dynload', '/home/username/gentoo/tmp/usr/lib/python2.7/site-packages']
*********



I found one similar file within "gentoo" folder: "~/gentoo/tmp/usr/lib64/libffi.so.6.0.4"
also, there's a link : "~/gentoo/tmp/usr/lib64/libffi.so.6", which points to the same file.

Here's what's inside those folders:
Code:

[username@pcname lib64]$ pwd
/home/username/gentoo/tmp/usr/lib64
[username@pcname lib64]$ ls
libffi.a  libffi.la  libffi.so  libffi.so.6  libffi.so.6.0.4
[username@pcname lib64]$ cd ../lib
[username@pcname lib]$ ls
libcurses.so         libmenu.so.6        libpanelw.so.6
libform.so           libmenu.so.6.0      libpanelw.so.6.0
libform.so.6         libmenuw.so         libreadline.la
libform.so.6.0       libmenuw.so.6       libreadline.so
libformw.so          libmenuw.so.6.0     libreadline.so.6
libformw.so.6        libncurses.so       libreadline.so.6.0.3
libformw.so.6.0      libncurses.so.6     libz.so
libhistory.la        libncurses.so.6.0   libz.so.1
libhistory.so        libncursesw.so      libz.so.1.2.8
libhistory.so.6      libncursesw.so.6    pkgconfig
libhistory.so.6.0.3  libncursesw.so.6.0  portage
liblzma.so           libpanel.so         python2.7
liblzma.so.5         libpanel.so.6       terminfo
liblzma.so.5.2.2     libpanel.so.6.0
libmenu.so           libpanelw.so
[username@pcname lib]$




The solution:

I'm not sure, why this is happening. But I've just copied the contents of the "/home/username/gentoo/tmp/usr/lib64" to "/home/username/gentoo/tmp/usr/lib" and now this bug is gone (I've re-started the step2 by following this manual, but skipping the "./bootstrap-prefix.sh $EPREFIX stage1" part . (The installation is still in progress, though, so I'm still not 100% sure it would finally make it)
Back to top
View user's profile Send private message
i3v
n00b
n00b


Joined: 01 Jan 2013
Posts: 10

PostPosted: Thu Nov 24, 2016 6:55 pm    Post subject: Reply with quote

Just in case: next issue I ran into was the following:
Code:

https://gcc.gnu.org/ml/gcc-help/2011-12/msg00144.html

checking LIBRARY_PATH variable... contains current directory
configure: error:
*** LIBRARY_PATH shouldn't contain the current directory when
*** building gcc. Please change the environment variable
*** and run configure again.
8
checking for clearerr_unlocked... make[1]: *** [configure-gcc] Error 1
make[1]: *** Waiting for unfinished jobs....
yes
checking for feof_unlocked... yes
checking for ferror_unlocked... yes
checking for fflush_unlocked... yes
checking for fgetc_unlocked... yes
checking for fgets_unlocked... yes
checking for fileno_unlocked... yes
checking for fprintf_unlocked... no
checking for fputc_unlocked... yes
checking for fputs_unlocked... yes
checking for fread_unlocked... yes
checking for fwrite_unlocked... yes
checking for getchar_unlocked... yes
checking for getc_unlocked... yes
checking for putchar_unlocked... yes
checking for putc_unlocked... yes
checking whether abort is declared... yes
checking whether asprintf is declared... yes
checking whether basename is declared... yes
checking whether errno is declared... no
checking whether getopt is declared... yes
checking whether vasprintf is declared... yes
checking whether clearerr_unlocked is declared... yes
checking whether feof_unlocked is declared... yes
checking whether ferror_unlocked is declared... yes
checking whether fflush_unlocked is declared... yes
checking whether fgetc_unlocked is declared... yes
checking whether fgets_unlocked is declared... yes
checking whether fileno_unlocked is declared... yes
checking whether fprintf_unlocked is declared... no
checking whether fputc_unlocked is declared... yes
checking whether fputs_unlocked is declared... yes
checking whether fread_unlocked is declared... yes
checking whether fwrite_unlocked is declared... yes
checking whether getchar_unlocked is declared... yes
checking whether getc_unlocked is declared... yes
checking whether putchar_unlocked is declared... yes
checking whether putc_unlocked is declared... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for ANSI C header files... (cached) yes
checking for nl_langinfo and CODESET... yes
checking whether NLS is requested... no
checking for uchar...
checking for ld used by GCC... x86_64-pc-linux-gnu-ld
checking if the linker (x86_64-pc-linux-gnu-ld) is GNU ld... yes
checking for shared library run path origin... done
checking for iconv... yes
checking for iconv declaration... install-shextern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
configure: updating cache ./config.cache
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depdir commands
mkdir -p -- .deps
make[1]: Leaving directory `/home/username/gentoo/tmp/var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build'
make: *** [all] Error 2
emake failed
 * ERROR: sys-devel/gcc-4.7.3-r1::gentoo_prefix failed (compile phase):
 *   emake failed with all
 *
 * Call stack:
 *     ebuild.sh, line  133:  Called src_compile
 *   environment, line 3965:  Called toolchain_src_compile
 *   environment, line 4923:  Called gcc_do_make 'all'
 *   environment, line 2036:  Called die
 * The specific snippet of code:
 *       emake T= LDFLAGS="${LDFLAGS}" STAGE1_CFLAGS="${STAGE1_CFLAGS}" LIBPATH="${EPREFIX}${LIBPATH}" BOOT_CFLAGS="${BOOT_CFLAGS}" ${GCC_MAKE_TARGET} || die "emake failed with ${GCC_MAKE_TARGET}";
 *
 * If you need support, post the output of `emerge --info '=sys-devel/gcc-4.7.3-r1::gentoo_prefix'`,
 * the complete build log and the output of `emerge -pqv '=sys-devel/gcc-4.7.3-r1::gentoo_prefix'`.
 *
 * Please include /home/username/gentoo/tmp/var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/gcc-build-logs.tar.bz2 in your bug report.
 *
 * The complete build log is located at '/home/username/gentoo/tmp/var/tmp/portage/sys-devel/gcc-4.7.3-r1/temp/build.log'.
 * The ebuild environment file is located at '/home/username/gentoo/tmp/var/tmp/portage/sys-devel/gcc-4.7.3-r1/temp/environment'.
 * Working directory: '/home/username/gentoo/tmp/var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build'
 * S: '/home/username/gentoo/tmp/var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/gcc-4.7.3'

>>> Failed to emerge sys-devel/gcc-4.7.3-r1, Log file:

>>>  '/home/username/gentoo/tmp/var/tmp/portage/sys-devel/gcc-4.7.3-r1/temp/build.log'

 * Messages for package sys-devel/gcc-4.7.3-r1:

 * Can't read /config.sub, skipping..
 * Can't read /config.guess, skipping..
 * ERROR: sys-devel/gcc-4.7.3-r1::gentoo_prefix failed (compile phase):
 *   emake failed with all
 *
 * Call stack:
 *     ebuild.sh, line  133:  Called src_compile
 *   environment, line 3965:  Called toolchain_src_compile
 *   environment, line 4923:  Called gcc_do_make 'all'
 *   environment, line 2036:  Called die
 * The specific snippet of code:
 *       emake T= LDFLAGS="${LDFLAGS}" STAGE1_CFLAGS="${STAGE1_CFLAGS}" LIBPATH="${EPREFIX}${LIBPATH}" BOOT_CFLAGS="${BOOT_CFLAGS}" ${GCC_MAKE_TARGET} || die "emake failed with ${GCC_MAKE_TARGET}";
 *
 * If you need support, post the output of `emerge --info '=sys-devel/gcc-4.7.3-r1::gentoo_prefix'`,
 * the complete build log and the output of `emerge -pqv '=sys-devel/gcc-4.7.3-r1::gentoo_prefix'`.
 *
 * Please include /home/username/gentoo/tmp/var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/gcc-build-logs.tar.bz2 in your bug report.
 *
 * The complete build log is located at '/home/username/gentoo/tmp/var/tmp/portage/sys-devel/gcc-4.7.3-r1/temp/build.log'.
 * The ebuild environment file is located at '/home/username/gentoo/tmp/var/tmp/portage/sys-devel/gcc-4.7.3-r1/temp/environment'.
 * Working directory: '/home/username/gentoo/tmp/var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build'
 * S: '/home/username/gentoo/tmp/var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/gcc-4.7.3'
[username@pcname gentoo]$ emerge --info '=sys-devel/gcc-4.7.3-r1::gentoo_prefix'
_ctypes:import
_ctypes:import:ctypes.cdll
!!! No gcc found. You probably need to 'source /etc/profile'
!!! to update the environment of this terminal and possibly
!!! other terminals also.
Portage 2.2.28-prefix (python 2.7.3-final-0, prefix/linux/amd64, [unavailable], unavailable, 2.6.32-642.4.2.el6.x86_64 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-2.6.32-642.4.2.el6.x86_64-x86_64-with-centos-6.5-Final
KiB Mem:   198219916 total, 142996284 free
KiB Swap:    4194300 total,   4194300 free
Timestamp of repository gentoo_prefix: Mon, 14 Nov 2016 23:03:40 +0000
sh bash 4.3_p48
ld GNU ld (Gentoo 2.24 p1.3) 2.24
Repositories:

gentoo_prefix
    location: /home/username/gentoo/usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.prefix.bitzolder.nl/gentoo-portage-prefix
    priority: -1000

ACCEPT_KEYWORDS="~amd64-linux"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf"
CXXFLAGS="-O2 -pipe -O2 -pipe"
DISTDIR="/home/username/gentoo/tmp/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs case-insensitive-fs collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles force-prefix merge-sync 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"
LANG="en_US.utf-8"
LC_ALL="en_US.utf-8"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j20"
PKGDIR="/home/username/gentoo/tmp/usr/portage/packages"
PORTAGE_CONFIGROOT="/home/username/gentoo/tmp/"
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/username/gentoo/tmp/var/tmp"
USE="amd64 berkdb bzip2 cli cracklib crypt cxx dri fortran gdbm iconv ipv6 mmx mmxext modules ncurses nls nptl openmp pcre prefix prefix-guest readline seccomp session sse sse2 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="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" 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 itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" 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" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4 python3_5" RUBY_TARGETS="ruby20 ruby21" 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, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON


As explained here this is simply due to presence of ":" character in $LIBRARY_PATH. So, the most simple fix is to "unset LIBRARY_PATH" and re-run the secong stage. (I'm reporting this, in a hope that this might help some other centOS user). I wish such a thing would have been checked in the very beginning...


Also, at the very beginning of the "stage3", it turned out that those my "print()" stuff is not that harmless as I thought :D - I found some stuff, printed by those code inside environment variables, LDFLAGS, in particular. o_O.
I had to remove those edits, and re-run "stage3" :roll:
Back to top
View user's profile Send private message
i3v
n00b
n00b


Joined: 01 Jan 2013
Posts: 10

PostPosted: Fri Nov 25, 2016 12:28 pm    Post subject: Reply with quote

Next, somewhere in the middle of stage3, during

Code:

 Emerging (14 of 40) app-misc/pax-utils-1.1.6::gentoo_prefix
 


I ran into
Code:

 In file included from paxinc.h:14:0,
                 from scanelf.c:11:
porting.h:48:31: fatal error: linux/securebits.h: No such file or directory
compilation terminated.


Searching through the whole filesystem, I found only two files with a name like this:

Code:

/lib/modules/2.6.32-642.4.2.el6.x86_64/build/include/linux
/lib/modules/2.6.32-642.4.2.el6.x86_64.debug/build/include/linux


So, I've tried to add first one to CPATH and re-start stage3
Code:

export CPATH=/lib/modules/2.6.32-642.4.2.el6.x86_64/build/include
./bootstrap-prefix.sh $EPREFIX stage3


Few seconds later it fails with another error:
Code:

make[2]: Entering directory '/home/username/gentoo/tmp/var/tmp/portage/app-misc/pax-utils-1.1.6/work/pax-utils-1.1.6'
  CC       paxelf.lo
  CC       paxinc.lo
  CC       paxmacho.lo
  CC       security.lo
  CC       xfuncs.lo
  CC       scanelf.o
cp lddtree.sh lddtree
cp symtree.sh symtree
  CC       dumpelf.o
  CC       pspax.o
  CC       scanmacho.o
security.c: In function 'security_init':
security.c:253:3: error: 'SECBIT_KEEP_CAPS_LOCKED' undeclared (first use in this function)
   SECBIT_KEEP_CAPS_LOCKED |
   ^
security.c:253:3: note: each undeclared identifier is reported only once for each function it appears in
security.c:254:3: error: 'SECBIT_NO_SETUID_FIXUP' undeclared (first use in this function)
   SECBIT_NO_SETUID_FIXUP |
   ^
security.c:255:3: error: 'SECBIT_NO_SETUID_FIXUP_LOCKED' undeclared (first use in this function)
   SECBIT_NO_SETUID_FIXUP_LOCKED |
   ^
security.c:256:3: error: 'SECBIT_NOROOT' undeclared (first use in this function)
   SECBIT_NOROOT |
   ^
security.c:257:3: error: 'SECBIT_NOROOT_LOCKED' undeclared (first use in this function)
   SECBIT_NOROOT_LOCKED, 0, 0, 0);




The first statement in "security.c" file is "#include "paxinc.h", which was already mentioned in the previous error. So... it looks like the "securebits.h" I've provided is not applicable. The contents of my "securebits.h":
Code:

#ifndef _LINUX_SECUREBITS_H
#define _LINUX_SECUREBITS_H 1

#define SECUREBITS_DEFAULT 0x00000000

/* When set UID 0 has no special privileges. When unset, we support
   inheritance of root-permissions and suid-root executable under
   compatibility mode. We raise the effective and inheritable bitmasks
   *of the executable file* if the effective uid of the new process is
   0. If the real uid is 0, we raise the effective (legacy) bit of the
   executable file. */
#define SECURE_NOROOT         0
#define SECURE_NOROOT_LOCKED      1  /* make bit-0 immutable */

/* When set, setuid to/from uid 0 does not trigger capability-"fixup".
   When unset, to provide compatiblility with old programs relying on
   set*uid to gain/lose privilege, transitions to/from uid 0 cause
   capabilities to be gained/lost. */
#define SECURE_NO_SETUID_FIXUP      2
#define SECURE_NO_SETUID_FIXUP_LOCKED   3  /* make bit-2 immutable */

/* When set, a process can retain its capabilities even after
   transitioning to a non-root user (the set-uid fixup suppressed by
   bit 2). Bit-4 is cleared when a process calls exec(); setting both
   bit 4 and 5 will create a barrier through exec that no exec()'d
   child can use this feature again. */
#define SECURE_KEEP_CAPS      4
#define SECURE_KEEP_CAPS_LOCKED      5  /* make bit-4 immutable */

/* Each securesetting is implemented using two bits. One bit specifies
   whether the setting is on or off. The other bit specify whether the
   setting is locked or not. A setting which is locked cannot be
   changed from user-level. */
#define issecure_mask(X)   (1 << (X))
#define issecure(X)      (issecure_mask(X) & current_cred_xxx(securebits))

#define SECURE_ALL_BITS      (issecure_mask(SECURE_NOROOT) | \
             issecure_mask(SECURE_NO_SETUID_FIXUP) | \
             issecure_mask(SECURE_KEEP_CAPS))
#define SECURE_ALL_LOCKS   (SECURE_ALL_BITS << 1)

#endif /* !_LINUX_SECUREBITS_H */


Firstly, there's no SECBIT_KEEP_CAPS_LOCKED.
After short googling, I found this file : https://github.com/torvalds/linux/blob/master/include/uapi/linux/securebits.h (commit 746bf6d on Sep 5, 2015), it seem to provide all necessary constants. Moreover, it's a great luck, that it just defines some constants and does not depend on any other files.

So, I've downloaded this file to "/home/username/gentoo/downloaded/linux", and replaced the old value in CPATH with new one.
Code:

export CPATH=/home/username/gentoo/downloaded


The package was successfully compiled after that.

I'm sorry for the style of my messages - hope this "all my trials and errors" stuff would be useful for someone.


Last edited by i3v on Fri Nov 25, 2016 7:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
tuetschek
n00b
n00b


Joined: 08 Nov 2016
Posts: 2

PostPosted: Fri Nov 25, 2016 2:13 pm    Post subject: Reply with quote

Thank you! It sounds really hard to get to the end of the installation, but I'll try :-).
Back to top
View user's profile Send private message
i3v
n00b
n00b


Joined: 01 Jan 2013
Posts: 10

PostPosted: Fri Nov 25, 2016 8:03 pm    Post subject: Reply with quote

Next, deeper in stage3, during "emerge dev-lang/python-3.5.1-r3", I ran into

Code:

*** WARNING: renaming "_crypt" since importing it failed: build/lib.linux-x86_64-3.5/_crypt.cpython-35-x86_64-linux-gnu.so: undefined symbol: crypt
*** WARNING: renaming "nis" since importing it failed: build/lib.linux-x86_64-3.5/nis.cpython-35-x86_64-linux-gnu.so: undefined symbol: yp_master

Python build finished successfully!
The necessary bits to build these optional modules were not found:
_dbm                  _gdbm                 _sqlite3           
_tkinter                                                       
To find the necessary bits, look in setup.py in detect_modules() for the module's name.


Following modules built successfully but were removed because they could not be imported:
_crypt                nis                   



After short googling, I foung this:
https://archives.gentoo.org/gentoo-alt/message/36b88be98c6d45812411796abc22418d -> https://archives.gentoo.org/gentoo-alt/message/7f049ffbcbbed9edcf9aac5531ac670d -> https://wiki.gentoo.org/wiki/Prefix/libc
Wow, there's CentOS 6.8 and even CentOS 5.6 there, explicitly mentioned as supported. Wish I found this before :)


Hoever, even here, following "./bootstrap-rap.sh" guide, I ran into a small trouble:
Code:

Updating 'mktables.lst'
 * ERROR: dev-lang/perl-5.24.1_rc4::gentoo failed (compile phase):
 *   emake failed



I found this and this and noticed, that "perl-5.24.1_rc4" is "yellow", which looks suspicious. I've tried to install a "green", stable release via "emerge -av1O =dev-lang/perl-5.22.2*" (which was already availible). But the result was the same.

I've scrolled the log a bit up and found another suspicious line in the log:
Code:

GDBM_File.xs:7:18: fatal error: gdbm.h: No such file or directory


I found this, but there's no such file anywhere in "~/gentoo".

I've noticed, that in
Code:
These are the packages that would be merged, in order:

[ebuild  N     ] dev-lang/perl-5.20.2-r1:0/5.20::gentoo  USE="berkdb gdbm -debug -doc -ithreads" 13412 KiB

"berkdb" and "gdbm" are red ( http://www.gossamer-threads.com/lists/gentoo/user/220993 ). Probably, they are not necessary, not sure.

Still, the "emerge 'sys-libs/gdbm'" worked, and completed successfully.

However "emerge -av1O =dev-lang/perl-5.22.2*" still fails.

Next, I've googled "perl error: invalid application of 'sizeof' to incomplete type 'struct pollfd'" error and found these answers:
http://serverfault.com/a/293231 -> http://www.gossamer-threads.com/lists/gentoo/user/227321#227321 -> https://forums.gentoo.org/viewtopic-p-3084537.html#3084537


So, I've tried the following:
Code:

[username@pcname gentoo]$ CPATH="" emerge -av1O =dev-lang/perl-5.20.2*

and it helped.

It looks like it might be a good idea to set CPATH to "" even before starting the "./bootstrap-rap.sh". In this case, it should probably work without any issue at all.

Next, I've started the "stage3" again.

And... stage 3 is now finished. Looks like everything is fine.
Back to top
View user's profile Send private message
tcat
n00b
n00b


Joined: 17 Jul 2007
Posts: 4

PostPosted: Thu Jan 26, 2017 11:26 pm    Post subject: Install libffi6 Reply with quote

Hi!

libffi.so.6 should be in the os (outside prefix).

In my case (OpenSUSE), the libffi6 package contains the required library. (libffi4 was installed, but that's not the required version). So after "zypper in libffi6", problem solved. You should do same with yum.

Hope it helps.

GT
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum