I am trying to rebuild gcc for aarch64 withPKGBUILD from ArchARM on aarch64 device. I get the following error:
g++ -std=gnu++98 -no-pie -g -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -o cc1plus \
cp/cp-lang.o c-family/stub-objc.o cp/call.o cp/class.o cp/constexpr.o cp/constraint.o cp/cp-gimplify.o cp/cp-objcp-common.o cp/cp-ubsan.o cp/cvt.o cp/cxx-pretty-print.o cp/decl.o cp/decl2.o cp/dump.o cp/error.o cp/except.o cp/expr.o cp/friend.o cp/init.o cp/lambda.o cp/lex.o cp/logic.o cp/mangle.o cp/method.o cp/name-lookup.o cp/optimize.o
cp/parser.o cp/pt.o cp/ptree.o cp/repo.o cp/rtti.o cp/search.o cp/semantics.o cp/tree.o cp/typeck.o cp/typeck2.o cp/vtable-class-hierarchy.o attribs.o incpath.o c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o c-family/c-format.o c-family/c-gimplify.o c-family/c-indentation.o c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o c-family/c-semantics.o c-family/c-ada-spec.o c-family/c-ubsan.o c-family/known-headers.o c-family/c-attribs.o c-family/c-warn.o c-family/c-spellcheck.o aarch64-c.o glibc-c.o cc1plus-checksum.o libbackend.a main.o libcommon-target.a libcommon.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a libcommon.a ../libcpp/libcpp.a ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -L/mnt/build/gcc/src/gcc-build/./isl/.libs -lisl -lmpc -lmpfr -lgmp -rdynamic -ldl -lz
collect2: fatal error: ld terminated with signal 9 [Killed]
compilation terminated.
make[3]: *** [/mnt/build/gcc/src/gcc/gcc/lto/Make-lang.in:81: lto1] Error 1
make[3]: *** Waiting for unfinished jobs....
collect2: fatal error: ld terminated with signal 9 [Killed]
compilation terminated.
make[3]: *** [/mnt/build/gcc/src/gcc/gcc/c/Make-lang.in:85: cc1] Error 1
make[3]: Leaving directory '/mnt/build/gcc/src/gcc-build/gcc'
make[2]: *** [Makefile:4619: all-stage1-gcc] Error 2
make[2]: Leaving directory '/mnt/build/gcc/src/gcc-build'
make[1]: *** [Makefile:25031: stage1-bubble] Error 2
make[1]: Leaving directory '/mnt/build/gcc/src/gcc-build'
make: *** [Makefile:946: all] Error 2
Are there any ideas what could cause it? I have also used Artix PKGBUILD with some modifications and got same error.
Building gcc on x86_64 machine works without problems.