Linux增加swap空间大小解决编译错误collect2:ld terminated with signal 9(或11)

时间:2023-12-06 09:02:14

编译llvm的时候:collect2:ld terminated with signal 9(或11)

1 Creating a file for 1024 MB size you want:

We will create a /mnt/1024MB.swap swap file and set the permissions so that users cannot read it directly.

[root@localhost mnt]# dd if=/dev/zero of=1024MB.swap bs= count=

Linux增加swap空间大小解决编译错误collect2:ld terminated with signal 9(或11)

chmod  /mnt/1024MB.swap

2 Formatting that file to create a swapping device:

mkswap /mnt/1024MB.swap

3 Adding the swap to the running system:

 swapon /mnt/1024MB.swap

The additional swap is now available and can be seen by "cat /proc/meminfo or swapon"

Linux增加swap空间大小解决编译错误collect2:ld terminated with signal 9(或11)

4 Making the change permanent:

Edit the /etc/fstab:

vim /etc/fstab

Add this line at the end of the file:

/mnt/1024MB.swap swap swap sw 0 0

Save. After the next reboot the swap will be used automatically.