I set up a distcc cross-compiling infrastructure with armv8 on RPI4 as the distcc client and an x86_64 Archlinux as distcc volunteer. On the volunteer I installed distccd-alarm-armv8 and started the distccd-armv8 systemd unit, and on the client I modified /etc/makepkg.conf as follows:
$this->bbcode_second_pass_code('', '
BUILDENV=(distcc color !ccache check !sign)
DISTCC_HOSTS="192.168.1.162:3636,cpp,lzo"
')
As a noob I expected that at this point I could dist-cross-compile a CMake project (specifically, plasma-bigscreen-git from AUR) using makepkg, but I'm facing two issues:
1) the CMake configuration done by makepkg seems to not use distcc. No compilation job is sent to the volunteer and if I stop the makepkg run with Ctrl-C and then run make from the build folder I see that distcc is not invoked at all:
$this->bbcode_second_pass_code('', '
cd /home/myuser/build/.... && /usr/bin/c++ -DKCOREADDONS_LIB ...
')
When manually configuring CMake, the use of distcc can be configured as:
$this->bbcode_second_pass_code('', '
cmake -DCMAKE_C_COMPILER_LAUNCHER=distcc -DCMAKE_CXX_COMPILER_LAUNCHER=distcc /path/to/source
')
and I thought that makepkg would automatically add the above variables to cmake invocations specified in the PKGBUILD, but now I guess I was wrong. So how does makepkg is supposed to handle distcc with CMake projects?
2) when bypassing makepkg and configuring distcc manually as in 1), the compilation jobs are sent to my volunteer but then fail. I tracked down the problem to CMake invoking the compilation as:
$this->bbcode_second_pass_code('', '
distcc /usr/bin/c++ -DKCOREADDONS_LIB ...
')
so I guess that distcc executes /usr/bin/c++ on the volunteer, generating a compiler mismatch with the client and thus the error. I verified this hypothesis by manually launching a single compilation job from the launcher with:
$this->bbcode_second_pass_code('', '
distcc c++ -DKCOREADDONS_LIB ...
')
This succeeds, so I think that the distccd environment is correctly configured on the volunteer, and that the absolute path in the compiler name is the culprit.
Can anyone help me in solving the above issues?
Sorry for the long post, and thanks in advance for any help.