Trying to set up a PowerPC cross compiler in Linux, IBM float error

Viewed 517

I've been trying to set up a cross compiler for powerpc64 (specifically the G5) on my amd64 core i7 machine running Arch Linux. I've been trying to set this up all day and I've run into some snags. I've been using this guide on setting up a cross compiler but have adapted it for PowerPC.

The toolchain I am attempting to set up has:

  • Linux kernel 5.4.80-gentoo-r1, I use this kernel because I hear that distros that maintain ppc variants often have special/never upstreamed patches that make everything more usable.

  • binutils 2.35

  • gcc 10.2.0

  • glibc 2.32

So far, I was able to get the Kernel headers installed just fine. I used the commands:

export TARGET=powerpc64-g5-elf
export PREFIX=/usr/local/$TARGET
export PATH=$PATH:$PREFIX/bin
export SYSROOTDIR=$PREFIX/powerpc64-g5-linux-glibc/sysroot

make g5_defconfig
sudo make ARCH=powerpc INSTALL_HDR_PATH=$SYSROOTDIR/usr headers_install

After that, I built and installed stage-1 gcc:

../gcc-10.2.0/configure --target=powerpc64-g5-linux-gnu \
--disable-fast-install \
--with-endian=big \
--disable-werror \ 
--disable-multilib \
--enable-languages=c \
--prefix=$PREFIX \ 
--without-headers \
--enable-shared \
--without-newlib \
--disable-c99 \
--with-sysroot=$SYSROOTDIR


make all-gcc -j6
sudo make install-gcc

This builds just fine. Now onto glibc...

../glibc-2.32/configure --target=powerpc64-g5-linux-gnu \
--build=x86_64-pc-linux-gnu \
--host=powerpc64-g5-linux-gnu \
--with-headers=$SYSROOTDIR/usr/include \ 
--prefix=$PREFIX \
--disable-werror

This is when I get the error:

configure: error: this configuration requires -mlong-double-128 IBM extended format support

I have unfortunately not been able to fix this. I attempted to rebuild gcc stage 1 with the option --with-long-double-format=ibm, but then the build fails because the G5 didn't have IBM long doubles.

# Despite saying "configure error" this happens at build time
configure: error: Configuration option --with-long-double-format is only supported if the default cpu is power7 or newer

I also tried --with-long-double-128, and gcc will build but glibc still complains about needing IBM floats. Out of curiosity, I changed the gcc target to powerpc64-power7-linux-gnu, powerpc64-linux-gnu, and powerpc64-unkown-linux-gnu, and I still got the error.

0 Answers
Related