1

I'm building the riscv-gnu-toolchain here on the latest Arch Linux. https://github.com/riscv-collab/riscv-gnu-toolchain like this:

sudo pacman -Syyu autoconf automake curl python3 libmpc mpfr gmp gawk base-devel bison flex texinfo gperf libtool patchutils bc zlib expat
 cd /tmp
 git clone --recursive  https://github.com/riscv-collab/riscv-gnu-toolchain
 cd riscv-gnu-toolchain
 mkdir build
 cd build
 ../configure --prefix=${HOME}/riscv64_github
 make -j$(nproc)

When compiling during the build of gcc I get this error:

/tmp/riscv-gnu-toolchain/gcc/gcc/fold-const.cc:16842:1: fatal error: error writing to /tmp/ccNNtXpB.s: No space left on device
16842 | }
      | ^
compilation terminated.
make[2]: *** [Makefile:1143: fold-const.o] Error 1
make[2]: *** Waiting for unfinished jobs....
rm gfdl.pod gcc.pod gcov-dump.pod gcov-tool.pod fsf-funding.pod gpl.pod cpp.pod gcov.pod lto-dump.pod
make[2]: Leaving directory '/tmp/riscv-gnu-toolchain/build/build-gcc-newlib-stage1/gcc'
make[1]: *** [Makefile:4607: all-gcc] Error 2
make[1]: Leaving directory '/tmp/riscv-gnu-toolchain/build/build-gcc-newlib-stage1'
make: *** [Makefile:552: stamps/build-gcc-newlib-stage1] Error 2

What should I do?

DDDSSD
  • 19
  • 1
  • 1
    I'm not sure what part of _fatal error: error writing to /tmp/ccNNtXpB.s: No space left on device_ is confusing... you don't have enough space in your `/tmp` partition. You'll have to make it bigger, or else use `TMPDIR` environment variable to put temporary files somewhere else with more space. – MadScientist Sep 18 '22 at 18:12
  • Are you running these commands in a virtual machine or chroot? IIRC, `/tmp` is allocated very small in chroot (10% of real tmpfs) and I can't remember which env var adjusts it. Maybe you could try not building `riscv-gnu-toolchain` in `/tmp` so that it should have enough space for real temporary files. – Sprite Sep 19 '22 at 02:44
  • 1
    I could build to change "--prefix=/opt/riscv". Thank you. – DDDSSD Sep 19 '22 at 14:45

1 Answers1

0

Go to the directory where you have build first, for instance, cd riscv-gnu-toolchain and run the following commands:

  1. sudo apt install build-essential git autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev gawk bison flex texinfo gperf libtool patchutils zlib1g-dev
  2. sudo make distclean

and rebuild again.

toyota Supra
  • 3,181
  • 4
  • 15
  • 19