Building Polkadot internal compiler error: Segmentation fault [solved]

[Solved] I had a problem building Polkadot with gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0:

error: failed to run custom build command for librocksdb-sys v6.2.4

cargo:warning=In file included from /usr/include/c++/7/vector:64:0,
cargo:warning=                 from rocksdb/utilities/write_batch_with_index/write_batch_with_index_internal.h:11,
cargo:warning=                 from rocksdb/utilities/write_batch_with_index/write_batch_with_index_internal.cc:8:
cargo:warning=/usr/include/c++/7/bits/stl_vector.h: In instantiation of ‘std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = rocksdb::DbPath; _Alloc = std::allocator<rocksdb::DbPath>]’:
cargo:warning=/usr/include/c++/7/bits/stl_vector.h:435:33:   required from ‘std::vector<_Tp, _Alloc>::~vector() [with _Tp = rocksdb::DbPath; _Alloc = std::allocator<rocksdb::DbPath>]’
cargo:warning=rocksdb/include/rocksdb/options.h:358:8:   required from here
cargo:warning=/usr/include/c++/7/bits/stl_vector.h:163:36: internal compiler error: Segmentation fault
cargo:warning=         - this->_M_impl._M_start); }

error occurred: Command "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "rocksdb/include/" "-I" "rocksdb/" "-I" "rocksdb/third-party/gtest-1.7.0/fused-src/" "-I" "snappy/" "-I" "lz4/lib/" "-I" "." "-Wall" "-Wextra" "-std=c++11"
"-Wno-unused-parameter" "-msse2" "-msse4.1" "-msse4.2" "-mpclmul" "-DSNAPPY=1" "-DLZ4=1" "-DNDEBUG=1" "-DHAVE_PCLMUL=1" "-DHAVE_SSE42=1" "-DOS_LINUX=1" "-DROCKSDB_PLATFORM_POSIX=1" "-DROCKSDB_LIB_IO_POSIX=1" "-o" "/home/aeron/Code/polkadot/target/debug/build/librocksdb-sys-2a9c8a5
51301d37e/out/rocksdb/utilities/write_batch_with_index/write_batch_with_index_internal.o" "-c" "rocksdb/utilities/write_batch_with_index/write_batch_with_index_internal.cc" with args "c++" did not execute successfully (status code exit code: 1).

Solution:

Add to Cargo.toml the following to disable multi-core compiling

[build]
jobs = 1                  # number of parallel jobs, defaults to # of CPUs