Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Trying to migrate system from x86_64 to i686 but can't
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Da_Nuke
n00b
n00b


Joined: 09 Jun 2011
Posts: 11

PostPosted: Sun Sep 08, 2013 4:27 pm    Post subject: Trying to migrate system from x86_64 to i686 but can't Reply with quote

I'm running Gentoo on an Oracle VM VirtualBox machine with 2 GB of allocated RAM and hardware virtualization enabled, running on Windows 7 Professional on a Lenovo ThinkPad T430 with an Intel Core i5 CPU with 8 GB of RAM.

I am building said virtual machine with the ultimate intent of deploying it into an old laptop I have lying around, which I believe is a Pentium 4 or something. While installing Gentoo I did the mistake of building the whole thing for x86_64 with march=native and CHOST=x86_64; however, on CPUs without hardware virtualization, VirtualBox simulates a 32-bit i686 CPU, meaning that I had built the whole thing for the wrong architecture all along.

So I looked initially into changing the CHOST as described in http://wiki.gentoo.org/wiki/Changing_the_CHOST_variable . I changed it to i686, then rebuilt successfully binutils, but then I tried to rebuild GCC and failed. On emerge --info I saw the ABI_x86 variable set to 64, so I looked into that variable in https://devmanual.gentoo.org/archs/amd64/index.html#the-abi-variable , so I set ABI=x86 on make.conf and tried to rebuild gcc. It failed.

Build log is here: https://www.dropbox.com/s/n7z777fsixo0eom/sys-devel%3Agcc-4.6.3%3A20130908-205110.log

Here are my emerge info outputs and my make.conf:

Code:
roundwavecrusher@gensokyostyle ~ $ emerge -pqv '=sys-devel/gcc-4.6.3'
[ebuild   R   ] sys-devel/gcc-4.6.3  USE="cxx fortran mudflap (multilib) nls nptl openmp (-altivec) -doc (-fixed-point) -gcj -graphite -gtk (-hardened) (-libssp) -lto -multislot -nopie -nossp -objc -objc++ -objc-gc -regression-test -vanilla"


Code:
roundwavecrusher@gensokyostyle ~ $ emerge --info '=sys-devel/gcc-4.6.3'
Portage 2.1.12.2 (default/linux/amd64/13.0, gcc-4.6.3, glibc-2.15-r3, 3.10.7-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.10.7-gentoo-x86_64-Intel-R-_Core-TM-_i5-3320M_CPU_@_2.60GHz-with-gentoo-2.2
KiB Mem:     2056200 total,   1193804 free
KiB Swap:    1367180 total,   1321224 free
Timestamp of tree: Sun, 08 Sep 2013 03:15:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
app-shells/bash:          4.2_p45
dev-lang/python:          2.7.5-r2, 3.2.5-r2
dev-util/cmake:           2.8.10.2-r2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.10.3, 1.13.4
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=native"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ ftp://ftp.fi.muni.cz/pub/linux/gentoo/ http://ftp.jaist.ac.jp/pub/Linux/Gentoo/ http://mirror.mcs.anl.gov/pub/gentoo/ http://lug.mtu.edu/gentoo/ http://mirror.usu.edu/mirrors/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j6"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="acl amd64 berkdb bindist bzip2 cli cracklib crypt cxx dri fortran gdbm gif iconv ipv6 jpeg mmx modules mudflap multilib ncurses nls nptl openmp pam pcre png readline 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" 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 ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de en es fr pt pt_BR" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="virtualbox" 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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

sys-devel/gcc-4.6.3 was built with the following:
USE="cxx fortran mudflap (multilib) nls nptl openmp (-altivec) -doc (-fixed-point) -gcj -graphite -gtk (-hardened) (-libssp) -lto -multislot -nopie -nossp -objc -objc++ -objc-gc -regression-test -vanilla" ABI_X86="64"
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CXXFLAGS="-O2 -pipe"


Code:
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
CFLAGS="-O2 -pipe -march=native"
CXXFLAGS="${CFLAGS}"
ABI=x86

# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="i686-pc-linux-gnu"

# These are the USE flags that were used in addition to what is provided by the
# profile used for building.

USE="bindist mmx sse sse2 jpeg gif png"
LINGUAS="de en es fr pt pt_BR"

FEATURES="userfetch parallel-fetch"
MAKEOPTS="-j6"
PORT_LOGDIR="/var/log/portage"

GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ ftp://ftp.fi.muni.cz/pub/linux/gentoo/ http://ftp.jaist.ac.jp/pub/Linux/Gentoo/ http://mirror.mcs.anl.gov/pub/gentoo/ http://lug.mtu.edu/gentoo/ http://mirror.usu.edu/mirrors/gentoo/"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"

VIDEO_CARDS="virtualbox"
INPUT_DEVICES="evdev"
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 31342
Location: 56N 3W

PostPosted: Sun Sep 08, 2013 4:56 pm    Post subject: Reply with quote

Da_Nuke,

There is no migration path betwen 64bit and 32 bit, or vice versa. You need to do a new install.
CHOST is only a part of your problem.

The changing CHOST guide was written a long time ago when glibc dropped support for i386. Around glibc-2.3 I think.
At that time, many users has i386 installs on i686 hardware and either needed to change the CHOST or stay with the old glibc.
Its possible to use the changing CHOST guide to migrate from i386 to any newer iX86, where X is in the range 4..6

Vbox itself is a 32 bit program but it only intercepts things that the guest tries to run in security ring 0, which is the security level that the bare metal kernel runs at.
Guest user space programs run natively on the host CPU, which is why its so fast. Its also why it will not emulate a PPC processor on Intel/AMD based hardware.

You are now in the position of having some of your toolchain build as 32 bit code and some as 64 bit code.

If your current install supports 32 bit code - thats a kernel option, you cand use the existing install to do a 32 bit install in a chroot, almost as you did when you installed.
With a 64 bit kernel, the chroot step changes a liitle. You would need
Code:
linux32 chroot /mnt/gentoo /bin/bash
This makes the kernel advertise itself as i686.

You can salvage some of your settings in /etc and more importantly, your world file. Put your world file in place in the new install and do
Code:
emerge -e world
to rebuild everything in world and all of the dependencies.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Da_Nuke
n00b
n00b


Joined: 09 Jun 2011
Posts: 11

PostPosted: Mon Sep 09, 2013 3:12 am    Post subject: Failed to emerge baselayout on migration from 64 to 32 bits Reply with quote

I'm running Gentoo on an Oracle VM VirtualBox machine with 2 GB of allocated RAM and hardware virtualization enabled, running on Windows 7 Professional on a Lenovo ThinkPad T430 with an Intel Core i5 CPU with 8 GB of RAM.

I am building said virtual machine with the ultimate intent of deploying it into an old laptop I have lying around, which I believe is a Pentium 4 or something. While installing Gentoo I did the mistake of building the whole thing for x86_64 with march=native and CHOST=x86_64; however, on CPUs without hardware virtualization, VirtualBox simulates a 32-bit i686 CPU, meaning that I had to rebuild the whole thing for i686.

So what I did was setting up the i686 ISO on the VM, booting it, extracting an i686 stage 3 archive, and rebuilding everything. After unsuccessfully trying to do emerge -DNu --with-bdeps=y world, I decided it would only work if I emerged again everything from scratch, so I did emerge -e world.

During that process, baselayout failed to emerge with the following error:

Code:
>>> Failed to emerge sys-apps/baselayout-2.2, Log file:

>>>  '/var/log/portage/sys-apps:baselayout-2.2:20130909-024404.log'

 * Messages for package sys-apps/baselayout-2.2:

 * You need to merge /usr/lib32 into /usr/lib
 * ERROR: sys-apps/baselayout-2.2::gentoo failed (setup phase):
 *   non-empty dir found where there should be none: /usr/lib32
 *
 * Call stack:
 *               ebuild.sh, line  93:  Called pkg_setup
 *   baselayout-2.2.ebuild, line  18:  Called multilib_layout
 *   baselayout-2.2.ebuild, line 111:  Called die
 * The specific snippet of code:
 *                                                      die "non-empty dir found where there should be none: ${prefix}lib32"
 *
 * If you need support, post the output of `emerge --info '=sys-apps/baselayout-2.2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-apps/baselayout-2.2::gentoo'`.
 * The complete build log is located at '/var/log/portage/sys-apps:baselayout-2.2:20130909-024404.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/sys-apps/baselayout-2.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-apps/baselayout-2.2/temp/die.env'.
 * Working directory: '/usr/lib/portage/pym'
 * S: '/var/tmp/portage/sys-apps/baselayout-2.2/work/baselayout-2.2'


...only problem is, I don't even have a /lib32 directory.

As usual, here are the emerge info outputs:

Code:
livecd / # emerge -pqv '=sys-apps/baselayout-2.2::gentoo'
[ebuild   R   ] sys-apps/baselayout-2.2  USE="-build"


Code:
livecd / # emerge --info '=sys-apps/baselayout-2.2::gentoo'
Portage 2.2.1 (default/linux/x86/13.0, gcc-4.6.3, glibc-2.15-r3, 3.8.13-gentoo i686)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.8.13-gentoo-i686-Intel-R-_Core-TM-_i5-3320M_CPU_@_2.60GHz-with-gentoo-2.2
KiB Mem:      893256 total,     70192 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Sun, 08 Sep 2013 23:00:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
app-shells/bash:          4.2_p45
dev-lang/python:          2.7.5-r2, 3.2.5-r2
dev-util/cmake:           2.8.10.2-r2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.10.3, 1.12.6, 1.13.4
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ ftp://ftp.fi.muni.cz/pub/linux/gentoo/ http://ftp.jaist.ac.jp/pub/Linux/Gentoo/ http://mirror.mcs.anl.gov/pub/gentoo/ http://lug.mtu.edu/gentoo/ http://mirror.usu.edu/mirrors/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j6"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
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"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="acl berkdb bindist bzip2 cli cracklib crypt cxx dri fortran gdbm gif iconv ipv6 jpeg mmx modules mudflap ncurses nls nptl openmp pam pcre png readline session sse sse2 ssl tcpd unicode x86 zlib" ABI_X86="32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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" 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 ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de en es fr pt pt_BR" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="virtualbox" 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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

sys-apps/baselayout-2.2 was built with the following:
USE="-build"
Back to top
View user's profile Send private message
hadrons123
Tux's lil' helper
Tux's lil' helper


Joined: 08 Mar 2012
Posts: 90
Location: chennai

PostPosted: Mon Sep 09, 2013 4:22 am    Post subject: Reply with quote

I don't think you can switch arch in Gentoo in a same installation.
_________________
LENOVO Y580 FHD Intel® Core™ i7-3630QM CPU @ 2.40GHz × 8 |660M GTX NVIDIA | 16GB SanDisk SSD
Back to top
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 8592

PostPosted: Mon Sep 09, 2013 9:18 pm    Post subject: Reply with quote

Correct. However, it seems OP does not want to hear this. He posted a very similar problem as Trying to migrate system from x86_64 to i686 but can't yesterday, and NeddySeagoon told him the same thing.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 31342
Location: 56N 3W

PostPosted: Mon Sep 09, 2013 9:29 pm    Post subject: Reply with quote

Da_Nuke,

Please don't make multiple posts of the same question.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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