View previous topic :: View next topic |
Author |
Message |
Tractor Girl Apprentice
Joined: 16 May 2013 Posts: 159
|
Posted: Mon Jul 29, 2013 10:59 pm Post subject: [Solved] Gentoo installation from within Debian |
|
|
I'm trying to install Gentoo amd64 from within Debian Jessie also amd64.
The problem is - I cannot compile anything inside chroot. There's always the same GCC error no matter what I try to emerge:
Code: | checking for x86_64-pc-linux-gnu-gcc... (cached) ccache gcc
checking whether the C compiler works... no |
Is it because there's different gcc version in my Debian than in Gentoo?
Gentoo:
Code: | # gcc-config -l
[1] x86_64-pc-linux-gnu-4.6.3 * |
Debian:
Code: | # dpkg -l | grep gcc
ii gcc 4:4.7.2-1 amd64 GNU C compiler
ii gcc-4.7 4.7.3-4 amd64 GNU C compiler
ii gcc-4.7-base:amd64 4.7.3-4 amd64 GCC, the GNU Compiler Collection (base package)
ii gcc-4.7-plugin-dev 4.7.3-4 amd64 Files for GNU GCC plugin development.
ii gcc-4.8-base:amd64 4.8.1-2 amd64 GCC, the GNU Compiler Collection (base package)
ii libgcc-4.7-dev:amd64 4.7.3-4 amd64 GCC support library (development files)
ii libgcc1:amd64
|
It is Debian's fault for sure, because from within Gentoo-livecd everything is working as it should.
Last edited by Tractor Girl on Tue Jul 30, 2013 7:19 pm; edited 1 time in total |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Mon Jul 29, 2013 11:13 pm Post subject: |
|
|
from the chroot, what does Code: | grep -i ccache /etc/portage/make.conf | show? _________________ Defund the FCC. |
|
Back to top |
|
|
Tractor Girl Apprentice
Joined: 16 May 2013 Posts: 159
|
Posted: Mon Jul 29, 2013 11:15 pm Post subject: |
|
|
No ccache here just plain stage3.
As I said everything works fine when I'm using gentoo-minimal-install.iso, so make.conf is ok I guess. Anyway here it is:
Code: | CFLAGS="-march=k8 -msse3 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
# 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="x86_64-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"
MAKEOPTS="-j3" |
Quote: |
from the chroot, what does
Code:
grep -i ccache /etc/portage/make.conf
show? |
nothing |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
Tractor Girl Apprentice
Joined: 16 May 2013 Posts: 159
|
Posted: Mon Jul 29, 2013 11:34 pm Post subject: |
|
|
I did that several times both on my custom 3.10 and distro 3.2
Chroot steps for both Debian and Gentoo-minimal-install.iso:
Code: | mount -t proc none /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash |
|
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
Tractor Girl Apprentice
Joined: 16 May 2013 Posts: 159
|
Posted: Mon Jul 29, 2013 11:50 pm Post subject: |
|
|
It's not helping, still same thing |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
Posted: Tue Jul 30, 2013 12:19 am Post subject: |
|
|
Alright, let's make sure all facts are correct. You can boot from Gentoo CD and everything is fine in chroot? If this is true, why don't you go forward and install Gentoo next to your Debian installation? Or I'm missing something here? _________________ My Gentoo installation notes.
Please learn how to denote units correctly! |
|
Back to top |
|
|
Tractor Girl Apprentice
Joined: 16 May 2013 Posts: 159
|
Posted: Tue Jul 30, 2013 12:36 am Post subject: |
|
|
Yes it's true, and I already did that, but now I'm trying to setup Gentoo inside encrypted LVM, and I have some issues with generating proper initrd.
It seem that I'll need to use Dracut which is completly new for me. So I really need access to firefox to setup dracut properly. It would be prefect if I could do that from Debian where I've got all the links and stuff about dracut. I don't want to use live cd even with gui, because I'll have to retype my insanely long password to wifi every time.
So it's a matter of convenience for me. |
|
Back to top |
|
|
vaxbrat l33t
Joined: 05 Oct 2005 Posts: 731 Location: DC Burbs
|
Posted: Tue Jul 30, 2013 4:35 am Post subject: still back on k8 so you can't virtualize? |
|
|
Why are you way back on march=k8? Is this an old athlon core that doesn't support svm? If worst comes to worst, you could always install one and then use xen or kvm or something with libvirt to virtualize the other.
Can you even get the gcc in the chroot to -dumpspecs or --version? |
|
Back to top |
|
|
Tractor Girl Apprentice
Joined: 16 May 2013 Posts: 159
|
Posted: Tue Jul 30, 2013 3:08 pm Post subject: |
|
|
Code: | #uname -p
AMD Turion(tm) 64 X2 Mobile Technology TL-52 |
Isn't march=k8 a proper flag for this CPU?
Quote: | Can you even get the gcc in the chroot to -dumpspecs or --version? |
I can.
gcc --version
Code: | gcc (Gentoo 4.6.3 p1.13, pie-0.5.2) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
gcc -dumpspecs:
http://pastebin.com/jwXbVMxz
And here's a example log from failed compilation:
http://pastebin.com/bf6F9cfF |
|
Back to top |
|
|
rg.viza n00b
Joined: 23 Mar 2012 Posts: 11
|
Posted: Tue Jul 30, 2013 4:49 pm Post subject: |
|
|
Jaglover wrote: | Debian gcc has nothing to do with Gentoo gcc in chroot. There may be a typo in your make.conf, and what's the business with ccache? Do you have it installed? |
you might need to recompile the gentoo gcc using debian's gcc before starting. There are a LOT of kernel settings that influence how your compiler was built. Debian's kernel is probably set up differently than the gentoo minimal install kernel. Trying to run a compiler binary compiled for gentoo's min install kernel is almost guaranteed to fail at some point.
I think that's what Tractor Girl might have been getting at.
What happens is when you run ./configure, it examines alllll your kernel settings when configuring the source. Very important stuff. Then, gcc compiles it based on how the source is configured which is configured based on how the kernel is set up. So gentoo's gcc in the stage3 might be configured bass ackwards to work with the debian kernel. Remember gcc is compiled from source too, so it has to be configured for the kernel you are using to run the compiler binary.
generally you want to use the gcc that was built for the kernel that is running, to compile anything. That's why you need to recompile gcc pretty soon after you compile your kernel.
I'm actually surprised you got this far using a debian kernel with stage3. This is called "binary compatibility" and isn't guaranteed between distributions.
from: http://luv.asn.au/overheads/compile.html
"There is no easy way to find out the options used to configure your current kernel."
I can attest to this. even if you have the source package for the current kernel running in your distro, there's no guarantee that the makefile and .config is remotely similar to the running kernel.
If you don't believe me, fire up a red hat distro and recompile the kernel using the src rpm from the cdrom you installed from, without changing it, then reboot. Let me know how that works out for you
This operation used to result in kernel panics, broken binaries, and mass hardware failures lol. |
|
Back to top |
|
|
rg.viza n00b
Joined: 23 Mar 2012 Posts: 11
|
Posted: Tue Jul 30, 2013 4:56 pm Post subject: |
|
|
Tractor Girl wrote: | Code: | #uname -p
AMD Turion(tm) 64 X2 Mobile Technology TL-52 |
Isn't march=k8 a proper flag for this CPU?
Quote: | Can you even get the gcc in the chroot to -dumpspecs or --version? |
I can.
gcc --version
Code: | gcc (Gentoo 4.6.3 p1.13, pie-0.5.2) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
gcc -dumpspecs:
http://pastebin.com/jwXbVMxz
And here's a example log from failed compilation:
http://pastebin.com/bf6F9cfF |
run gcc -dumpspecs > dumpspec.gentoo in chroot, then run it out of chroot (gcc -dumpspecs > dumpspec.debian), and diff the results. |
|
Back to top |
|
|
Tractor Girl Apprentice
Joined: 16 May 2013 Posts: 159
|
Posted: Tue Jul 30, 2013 5:20 pm Post subject: |
|
|
diff gcc.gentoo gcc.debian:
Code: | 2c2
< %{m32:--32} %{!m32:--64} %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}
---
> %{m32:--32} %{m32|mx32:;:--64} %{mx32:--x32} %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}
11c11
< %{-target-help:%:print-asm-header()} %a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}
---
> %{-target-help:%:print-asm-header()} %{v} %{w:-W} %{I*} %a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}
21c21
< %(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w} %{f*} %{g*:%{!g0:%{g*} %{!fno-working-directory:-fworking-directory}}} %{O*} %{undef} %{save-temps*:-fpch-preprocess} %(esp_cpp_options)
---
> %(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w} %{f*} %{g*:%{!g0:%{g*} %{!fno-working-directory:-fworking-directory}}} %{O*} %{undef} %{save-temps*:-fpch-preprocess}
51c51
< %{!static:--eh-frame-hdr} %{!m32:-m elf_x86_64} %{m32:-m elf_i386} %{shared:-shared} %{!shared: %{!static: %{rdynamic:-export-dynamic} %{m32:-dynamic-linker %{muclibc:/lib/ld-uClibc.so.0;:%{mbionic:/system/bin/linker;:/lib/ld-linux.so.2}}} %{!m32:-dynamic-linker %{muclibc:/lib/ld64-uClibc.so.0;:%{mbionic:/system/bin/linker64;:/lib64/ld-linux-x86-64.so.2}}}} %{static:-static}}
---
> %{!r:--build-id} %{!static:--eh-frame-hdr} %{m32|mx32:;:-m elf_x86_64} %{m32:-m elf_i386} %{mx32:-m elf32_x86_64} --hash-style=gnu %{shared:-shared} %{!shared: %{!static: %{rdynamic:-export-dynamic} %{m32:-dynamic-linker %{muclibc:/lib/ld-uClibc.so.0;:%{mbionic:/system/bin/linker;:/lib/ld-linux.so.2}}} %{m32|mx32:;:-dynamic-linker %{muclibc:/lib/ld64-uClibc.so.0;:%{mbionic:/system/bin/linker64;:/lib64/ld-linux-x86-64.so.2}}} %{mx32:-dynamic-linker %{muclibc:/lib/ldx32-uClibc.so.0;:%{mbionic:/system/bin/linkerx32;:/libx32/ld-linux-x32.so.2}}}} %{static:-static}}
57c57
< %{static: %{fmudflap|fmudflapth: --wrap=malloc --wrap=free --wrap=calloc --wrap=realloc --wrap=mmap --wrap=munmap --wrap=alloca} %{fmudflapth: --wrap=pthread_create}} %{fmudflap|fmudflapth: --wrap=main}
---
> %{static: %{fmudflap|fmudflapth: --wrap=malloc --wrap=free --wrap=calloc --wrap=realloc --wrap=mmap --wrap=mmap64 --wrap=munmap --wrap=alloca} %{fmudflapth: --wrap=pthread_create}} %{fmudflap|fmudflapth: --wrap=main}
75c75
< 4.6.3
---
> 4.7.3
78c78
< . !m64 !m32;64:../lib64 m64 !m32;32:../lib32 !m64 m32;
---
> .::x86_64-linux-gnu !m32 !m64 !mx32;32:../lib32:i386-linux-gnu m32 !m64 !mx32;64:../lib:x86_64-linux-gnu !m32 m64 !mx32;x32:../libx32:x86_64-linux-gnux32 !m32 !m64 mx32;
87c87
< m64 m64;m32 m32;
---
> m32 m32;m64 m64;mx32 mx32;
93c93
< m64/m32
---
> m32/m64/mx32
131,134c131
< *esp_options:
<
<
< *esp_cpp_options:
---
> *self_spec:
141c138
< %{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S: %(linker) %{fuse-linker-plugin: -plugin %(linker_plugin_file) -plugin-opt=%(lto_wrapper) -plugin-opt=-fresolution=%u.res %{!nostdlib:%{!nodefaultlibs:%:pass-through-libs(%(link_gcc_c_sequence))}} } %{flto|flto=*:%<fcompare-debug*} %{flto} %{flto=*} %l %{pie:-pie} %X %{o*} %{e*} %{N} %{n} %{r} %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} %{static:} %{L*} %(mfwrap) %(link_libgcc) %o %{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)} %(mflib) %{fsplit-stack: --wrap=pthread_create} %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}} %{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}}
---
> %{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S: %(linker) %{!fno-use-linker-plugin:%{flto|flto=*|fuse-linker-plugin: -plugin %(linker_plugin_file) -plugin-opt=%(lto_wrapper) -plugin-opt=-fresolution=%u.res %{!nostdlib:%{!nodefaultlibs:%:pass-through-libs(%(link_gcc_c_sequence))}} }}%{flto|flto=*:%<fcompare-debug*} %{flto} %{flto=*} %l %{pie:-pie} %{fuse-ld=*:-fuse-ld=%*} %X %{o*} %{e*} %{N} %{n} %{r} %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} %{static:} %{L*} %(mfwrap) %(link_libgcc) %o %{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)} %{fgnu-tm:%:include(libitm.spec)%(link_itm)} %(mflib) %{fsplit-stack: --wrap=pthread_create} %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}} %{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}}
|
|
|
Back to top |
|
|
Tractor Girl Apprentice
Joined: 16 May 2013 Posts: 159
|
Posted: Tue Jul 30, 2013 7:18 pm Post subject: |
|
|
Quote: | what's the business with ccache? Do you have it installed? |
Well It isn't installed on Gentoo but I forgot that I actually installed it on Debian !
It was Debian's ccache fault all the time |
|
Back to top |
|
|
|