This is very confusing to me. The error message you get seems to be about the linker, ld
, and it seems to come from the host, because of the list of supported emulations. The weird thing about this is that distcc
should never attempt to run the linker on the host (only the compiler), and also that the line that fails really has nothing to do with the linker.
So this is the line that is run on the host and fails:
Digital-Larry distccd[14755] (dcc_spawn_child) forking to execute: clang++-3.9-arm -march=armv7-a -mfpu=vfp3 -fasynchronous-unwind-tables -O3 -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon -ftree-vectorize -ffast-math -std=c++11 -Wno-varargs -Wall -c -fmessage-length=0 -o /tmp/distccd_27a96794.o /tmp/distccd_261c6794.ii
As you see, it tries to compile the pre-processed file /tmp/distccd_261c6794.ii
into the object file /tmp/distccd_27a96794.o
. The pre-processed file is generated by distcc
on the client (Bela), where it runs cpp
(the C-preprocessor) on the file to bring in all the includes and apply all the defines and resolve the macros, generating a stand-alone C++ file that has no dependency on any external files.
Let's troubleshoot this with incremental steps. Create a simple C++ file with no includes on the host:
- Create a simple C++ file with no includes on the HOST: create a file called
test.ii
:
and then run the same command as above (except for the file paths at the end) :int func() { return 0; }
if this is successful, make sure the generated fileclang++-3.9-arm -march=armv7-a -mfpu=vfp3 -fasynchronous-unwind-tables -O3 -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon -ftree-vectorize -ffast-math -std=c++11 -Wno-varargs -Wall -c -fmessage-length=0 -o ./test.o ./test.ii
test.o
is indeed an ARM binary:$ file test.o test.o: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped
- if the above worked fine, then copy the
test.ii
file to the board and run ON THE BOARD:
and if this is successful, check that the generated file is indeed an ARM binary:distcc-clang++ -march=armv7-a -mfpu=vfp3 -fasynchronous-unwind-tables -O3 -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon -ftree-vectorize -ffast-math -std=c++11 -Wno-varargs -Wall -c -fmessage-length=0 -o ./test.o ./test.ii
$ file test.o test.o: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped
- if this is still good, then rename
test.ii
totest.cpp
and run the same line again, this time withtest.cpp
at the end:distcc-clang++ -march=armv7-a -mfpu=vfp3 -fasynchronous-unwind-tables -O3 -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon -ftree-vectorize -ffast-math -std=c++11 -Wno-varargs -Wall -c -fmessage-length=0 -o ./test.o ./test.cpp
- if this is still good, still on the board, do
cd /root/Bela/
and there try to re-run the full line that was failing while building your project:
does this successfully generated the filedistcc-clang++ -I/root/Bela/projects/FXChaine2 -I./include -I./build/pru/ -I/usr/xenomai/include/cobalt -I/usr/xenomai/include -march=armv7-a -mfpu=vfp3 -D_GNU_SOURCE -D_REENTRANT -fasynchronous-unwind-tables -D__COBALT__ -D__COBALT_WRAP__ -DXENOMAI_SKIN_posix -DXENOMAI_MAJOR=3 -O3 -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon -ftree-vectorize -ffast-math -DNDEBUG -DBELA_USE_RTDM -I/root/Bela/resources/stretch/include -std=c++11 -Wno-varargs -DNDEBUG -Wall -c -fmessage-length=0 -U_FORTIFY_SOURCE -MMD -MP -MF"/root/Bela/projects/FXChaine2/build/render.d" -o "/root/Bela/projects/FXChaine2/build/render.o" "/root/Bela/projects/FXChaine2/render.cpp"
/root/Bela/projects/FXChaine2/build/render.o
? And is it an ARM binary?