Error while compiling kernel modules


#1

Hello! I apologize for my knowledge of English. I’m going to write kernel modules for embedded linux according to the WS3_Developing_Drivers_for_Altera_SoC instruction from this site on a computer with Ubuntu 12.04. I follow the instructions to run a script that downloads the toolchain and the Linux kernel for which I will write modules to the / home / pavel / my_lab_directory / toolchain and /home/pavel/my_lab_directory/socfpga-4.1-ltsi folders. Also, the script configures the kernel and compiles the kernel modules. But when the script runs the following statement:

echo "Make modules."
make -C “${socfpga-4.1-ltsi}” “KBUILD_BUILD_VERSION=${KBUILD_BUILD_VERSION}” “INSTALL_MOD_PATH=${socfpga-4.1-ltsi}” modules || {
echo ""
echo "ERROR: making modules"
echo ""
exit 1
}

Error occurs:

Make modules.
/home/pavel/my_lab_directory/toolchain/bin/arm-linux-gnueabihf-gcc: 5: /home/pavel/my_lab_directory/toolchain/bin/arm-linux-gnueabihf-gcc: Syntax error: word unexpected (expecting “)”)
make: Entrance to the catalog /home/pavel/my_lab_directory/socfpga-4.1-ltsi' scripts/kconfig/conf --silentoldconfig Kconfig make: Exit from the catalog/home/pavel/my_lab_directory/socfpga-4.1-ltsi’
/home/pavel/my_lab_directory/toolchain/bin/arm-linux-gnueabihf-gcc: 5: /home/pavel/my_lab_directory/toolchain/bin/arm-linux-gnueabihf-gcc: Syntax error: word unexpected (expecting “)”)
make: Entrance to the catalog /home/pavel/my_lab_directory/socfpga-4.1-ltsi' CHK include/config/kernel.release UPD include/config/kernel.release WRAP arch/arm/include/generated/asm/bitsperlong.h WRAP arch/arm/include/generated/asm/cputime.h WRAP arch/arm/include/generated/asm/current.h WRAP arch/arm/include/generated/asm/emergency-restart.h WRAP arch/arm/include/generated/asm/errno.h WRAP arch/arm/include/generated/asm/exec.h WRAP arch/arm/include/generated/asm/ioctl.h WRAP arch/arm/include/generated/asm/ipcbuf.h WRAP arch/arm/include/generated/asm/irq_regs.h WRAP arch/arm/include/generated/asm/kdebug.h WRAP arch/arm/include/generated/asm/local.h WRAP arch/arm/include/generated/asm/local64.h WRAP arch/arm/include/generated/asm/mcs_spinlock.h WRAP arch/arm/include/generated/asm/msgbuf.h WRAP arch/arm/include/generated/asm/msi.h WRAP arch/arm/include/generated/asm/param.h WRAP arch/arm/include/generated/asm/parport.h WRAP arch/arm/include/generated/asm/poll.h WRAP arch/arm/include/generated/asm/preempt.h WRAP arch/arm/include/generated/asm/resource.h WRAP arch/arm/include/generated/asm/rwsem.h WRAP arch/arm/include/generated/asm/scatterlist.h WRAP arch/arm/include/generated/asm/seccomp.h WRAP arch/arm/include/generated/asm/sections.h WRAP arch/arm/include/generated/asm/segment.h WRAP arch/arm/include/generated/asm/sembuf.h WRAP arch/arm/include/generated/asm/serial.h WRAP arch/arm/include/generated/asm/shmbuf.h WRAP arch/arm/include/generated/asm/siginfo.h WRAP arch/arm/include/generated/asm/simd.h WRAP arch/arm/include/generated/asm/sizes.h WRAP arch/arm/include/generated/asm/socket.h WRAP arch/arm/include/generated/asm/sockios.h WRAP arch/arm/include/generated/asm/termbits.h WRAP arch/arm/include/generated/asm/termios.h WRAP arch/arm/include/generated/asm/timex.h WRAP arch/arm/include/generated/asm/trace_clock.h WRAP arch/arm/include/generated/asm/unaligned.h CHK include/generated/uapi/linux/version.h UPD include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h UPD include/generated/utsrelease.h HOSTCC scripts/basic/bin2c Generating include/generated/mach-types.h CC kernel/bounds.s /home/pavel/my_lab_directory/toolchain/bin/arm-linux-gnueabihf-gcc: 5: /home/pavel/my_lab_directory/toolchain/bin/arm-linux-gnueabihf-gcc: Syntax error: word unexpected (expecting ")") make[1]: *** [kernel/bounds.s]Error 2 make: *** [prepare0] Error 2 make: Exit from the catalog/home/pavel/my_lab_directory/socfpga-4.1-ltsi’

ERROR: making modules

How can I correct this error?


#2

You probably figured it out by now but it looks like your host can’t run your compiler. Try running /my_lab_directory/toolchain/bin/arm-linux-gnueabihf-gcc directly, I suspect that it will fail with a similar error.

Either your toolchain is corrupted or it’s not built for your host.


#3

gost, have you solved your problem? I have the same problem with arm-linux-gnueabihf-gcc now.