Transforming my toolchain style (in gentoo)

This is rather gentoo-specific, so I'll clarify it because context, after that attempt to abstract it to a common linux equipment.

I accidently set my CHOST to "i686-pc-linux-gnu" at first, not listening, when my equipment is a Athlon64. I would love to transform it to "x86_64-pc-linux-gnu". There is a guide for this. It does not function.

The very first step is "Recompile binutils, after that recompile gcc"

Here's the trouble highlighted:

  1. Compile binutils making use of gcc - this does well generating new as, ar, and so on documents
  2. This breaks gcc. gcc is currently attempting to make use of the new/ usr/bin/as - yet it can not collaborate with them
  3. Given that gcc can not compile anything, I can not compile gcc. I need to change as, ar, etc; after that change the CHOST adjustment, and also recompile binutils.

So I attempted the adhering to:

  1. back up as, ar, etc
  2. Compile binutils, providing gcc inoperabe
  3. link ar, as, etc to the old variations I supported
  4. attempt to compile gcc

The gcc compile falls short with:

/usr/x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc
/usr/x86_64-pc-linux-gnu/bin/ld: cannot find -lc
collect2: ld returned 1 exit status

This is a glibc mistake (finishing the chain).

So it appears:

  1. for gcc to compile it has a dependence on the new variation glibc
  2. for gcc to run, binutils have to be the older variation

The actions I have not attempted, due to the fact that it's so difficult I intended to interview first, are:

  1. compile binutils under new style,
  2. relink as, ar, etc to old executables
  3. compile new glibc with old-gcc and also old-binutils
  4. compile new-gcc with old-gcc and also old-binutils yet new-glibc
  5. relink as, ars, etc to new-binutils
  6. recompile every little thing like an employer

Exists any kind of opportunity of # 4 over functioning? Do I have any kind of hope of completing this without a full reinstall?

0
2019-05-04 09:16:04
Source Share
Answers: 3

If your bit is 64 - little bit (therefore you can run 64 - little bit binaries), you can start a new x86_64 Gentoo install in a chroot, adhering to the common guidelines. I've done comparable in the past-- properly a reinstall, yet while still running the old system. If you do not have an extra block tool to install to, you can make use of a subdirectory and also either boot with init=chroot\040/new\040/bin/sinit or fall to a marginal setting to shuffle directory sites around.

If your bit is 32 - little bit, locate a 64 - little bit kernel or construct a cross - compiler to 64 - little bit to construct a 64 - little bit kernel, boot it, after that see above.

0
2019-05-17 01:58:31
Source

As much as I recognize it is not feasible. Please bear in mind that toolchain does not exist in vaccum and also is interlinked.

What could function is to construct cross-compiler of new framework yet I actually question it - the "atomicity" on upgrade of glibc will certainly damage every little thing.

I would certainly suggestions back-up & reinstall of system.

0
2019-05-07 23:12:13
Source

Have you attempted downloading and install the amd64 stage3 tarball and also making use of the duplicate of gcc with that said?

0
2019-05-07 22:53:24
Source