Linaro: fix various build errors