2

I'm currently attempting a build of the Raspbian kernel using both a cross-compiler (for the Raspberry Pi 2's ARM processor) and distcc, based on the instructions posted at the Raspberry Pi website. I have two computers, my laptop and an older gaming rig that I've adapted to use as a compile node. Both run Ubuntu Linux 15.04 x86-64 and can complete a compile of the Linux kernel for Raspberry Pi when run independently. Of course, there's no fun in that, so I am working on a project to use both computers at once with distcc. I have successfully compiled a simple "Hello, world!" program between the two nodes. However, moving on up to the kernel code, I begin getting major errors. The commands (and subsequent errors) are below:

user@user-ThinkPad-T420:~/linux$ make clean
  CLEAN   .tmp_versions
user@user-ThinkPad-T420:~/linux$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2709_defconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/bin2c
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
user@user-ThinkPad-T420:~/linux$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- CC=distcc -j12 zImage modules dtbs
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/pnmtologo
  HOSTCC  scripts/conmakehash
  HOSTCC  scripts/recordmcount
  HOSTCC  scripts/genksyms/genksyms.o
  CC      scripts/mod/empty.o
cc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
cc: note: valid arguments to ‘-mabi=’ are: ms sysv
cc: error: unrecognized command line option ‘-mlittle-endian’
cc: error: unrecognized command line option ‘-mapcs’
cc: error: unrecognized command line option ‘-mno-sched-prolog’
cc: error: unrecognized command line option ‘-mno-thumb-interwork’
cc: error: unrecognized command line option ‘-mfpu=vfp’
distcc[27109] ERROR: compile scripts/mod/empty.c on compiler failed
distcc[27109] (dcc_build_somewhere) Warning: remote compilation of 'scripts/mod/empty.c' failed, retrying locally
distcc[27109] Warning: failed to distribute scripts/mod/empty.c to compiler, running locally instead
  HOSTCC  scripts/dtc/flattree.o
cc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
cc: note: valid arguments to ‘-mabi=’ are: ms sysv
cc: error: unrecognized command line option ‘-mlittle-endian’
cc: error: unrecognized command line option ‘-mapcs’
cc: error: unrecognized command line option ‘-mno-sched-prolog’
cc: error: unrecognized command line option ‘-mno-thumb-interwork’
cc: error: unrecognized command line option ‘-mfpu=vfp’
distcc[27109] ERROR: compile scripts/mod/empty.c on localhost failed
scripts/Makefile.build:258: recipe for target 'scripts/mod/empty.o' failed
make[2]: *** [scripts/mod/empty.o] Error 1
scripts/Makefile.build:403: recipe for target 'scripts/mod' failed
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/genksyms/parse.tab.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/genksyms/lex.lex.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTLD  scripts/genksyms/genksyms
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/util.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
make[1]: 'include/generated/mach-types.h' is up to date.
  CC      kernel/bounds.s
distcc[27382] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
cc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
cc: note: valid arguments to ‘-mabi=’ are: ms sysv
cc: error: unrecognized command line option ‘-mlittle-endian’
cc: error: unrecognized command line option ‘-mapcs’
cc: error: unrecognized command line option ‘-mno-sched-prolog’
cc: error: unrecognized command line option ‘-mno-thumb-interwork’
cc: error: unrecognized command line option ‘-mfpu=vfp’
distcc[27382] ERROR: compile kernel/bounds.c on localhost failed
Kbuild:43: recipe for target 'kernel/bounds.s' failed
make[1]: *** [kernel/bounds.s] Error 1
Makefile:990: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2
make: *** Waiting for unfinished jobs....
Makefile:555: recipe for target 'scripts' failed
make: *** [scripts] Error 2

Using distcc, I seem to get quite a few errors related to unrecognized command options. Given my main make command:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- CC=distcc -j12 zImage modules dtbs

is there anything that immediately sticks out as wrong? Am I biting off more than I can chew with cross-compiling and distributed compilation at the same time?

  • The issue seems to be that you are using a native toolchian with distcc instead of a cross-compiling toolchain. Was your helloworld a proper arm binary? aapcs-linux is EABI so it should be know by any sufficiently recent ARM toolchain – Alexandre Belloni Oct 14 '15 at 8:44
  • @AlexandreBelloni It was compiled for x86, but that was just a simple hello world program. I can compile an x86-64 binary on distcc, and can compile an ARM binary for the kernel... it just seems like maybe I'm not combining the two, if that makes any sense. Are there any variables that I need to set in order to get it to use the ARM toolchain instead of x86-64? – nerdenator Oct 16 '15 at 2:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.