https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123757

--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
> Compiler 1, from the host system:
> Build/Host/Target
> x86_64-redhat-linux-gnu/x86_64-redhat-linux-gnu/x86_64-redhat-linux-gnu
Native compiler

> Compiler 2:
> Build/Host/Target
> x86_64-redhat-linux-gnu/x86_64-redhat-linux-gnu/x86_64-unknown-linux-gnu
cross to x86_64-unknown-linux-gnu

> Compiler 3:
> Build/Host/Target
> x86_64-redhat-linux-gnu/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu

Cross back to x86_64-unknown-linux-gnu.

The cross back you don't need to build the libraries as you already did with
compiler #2. Copy the libraries from compiler #2 into the sysroot.
That is just:
```
CC="$target-gcc -L${libs}/lib -I${libs}/include" \
CXX="$target-g++ -L${libs}/lib -I${libs}/include" \
${TOP}/src/configure $GCC_CONFIG_ARGS $ENABLE_CHECKING $extra_config
--target=${target} --host=${target} --enable-languages=${languages}
--prefix=/usr --with-sysroot=/ --with-build-sysroot=${SYSROOT}  
--with-pkgversion="$pkgversion"  --with-bugurl="$bugurl"
--with-libexpat-prefix=${libs} 
$PMAKE all-host
make install-host DESTDIR=${SYSROOT}
```
(copy the libraries is seperate).

And yes I have used done this on x86_64-linux-gnu cross to x86_64 and then a
(native) cross back.

Reply via email to