When cross-compiling GCC into stage3, set gcc_cv_as_leb128=no
authorRichard W.M. Jones <rjones@redhat.com>
Fri, 12 Aug 2016 08:04:30 +0000 (09:04 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Fri, 12 Aug 2016 08:06:24 +0000 (09:06 +0100)
The GCC configure script checks for .sleb128 and .uleb128 assembler
directives.  These are disabled on RISC-V binutils.  However GCC
checks /usr/bin/as, not the real assembler, so the check fails.

See also the sw-dev thread
".uleb128 directives in GCC 6.1.0 output not understood by binutils 2.27"

This should fix the stage3 RPM build of glibc.

Makefile

index 9ab8e98..c06a79d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -529,6 +529,7 @@ stage3-chroot/usr/bin/gcc: gcc-$(GCC_X_VERSION).tar.gz
        patch -p1 < ../0001-HACKS-TO-GET-GCC-TO-COMPILE.patch
        mkdir riscv-gcc-riscv-gcc-$(GCC_X_VERSION)/build
        cd riscv-gcc-riscv-gcc-$(GCC_X_VERSION)/build && \
+       gcc_cv_as_leb128=no \
        PATH=$(ROOT)/fixed-gcc:$$PATH \
        ../configure \
            --host=riscv64-unknown-linux-gnu \
@@ -541,7 +542,7 @@ stage3-chroot/usr/bin/gcc: gcc-$(GCC_X_VERSION).tar.gz
            --disable-libquadmath \
            --disable-nls \
            --disable-multilib
-       cd riscv-gcc-riscv-gcc-$(GCC_X_VERSION)/build && PATH=$(ROOT)/fixed-gcc:$$PATH make
+       cd riscv-gcc-riscv-gcc-$(GCC_X_VERSION)/build && gcc_cv_as_leb128=no PATH=$(ROOT)/fixed-gcc:$$PATH make
        cd riscv-gcc-riscv-gcc-$(GCC_X_VERSION)/build && make install DESTDIR=$(ROOT)/stage3-chroot
        rm -f stage3-chroot/usr/lib64/*.la