Skip to content

arm-bcm2708-linux-gnueabi-gcc: Syntax error: word unexpected (expecting ")") #437

Closed

Description

@TKR-US

Hello,

I search to compile my own kernel 3.6.11 because i've a problem with ax88179_178a driver (i can compile it, install it, but he said in syslog "disagrees about version of symbol module_layout", and modprobe said "ERROR: could not insert 'ax88179_178a': Exec format error")

So, i use http://elinux.org/RPi_Kernel_Compilation method (after trying lot of methods, since.... one week now :( ):
cd /usr/src
git init
git fetch git://github.com/raspberrypi/linux.git rpi-3.6.y:refs/remotes/origin/rpi-3.6.y
mkdir linux && cd linux/
git checkout rpi-3.6.y
cd ..
git clone git://github.com/raspberrypi/tools.git

export KERNEL_SRC=/usr/src/linux
export CCPREFIX=/usr/src/tools/arm-bcm2708/arm-bcm2708-linux-gnueabi/bin/arm-bcm2708-linux-gnueabi-

cd /usr/src/linux

make mrproper
gzip -dc /proc/config.gz > .config
ARCH=arm CROSS_COMPILE=${CCPREFIX} make oldconfig
ARCH=arm CROSS_COMPILE=${CCPREFIX} make menuconfig
ARCH=arm CROSS_COMPILE=${CCPREFIX} make

/usr/src/tools/arm-bcm2708/arm-bcm2708-linux-gnueabi/bin/arm-bcm2708-linux-gnueabi-gcc: 1: /usr/src/tools/arm-bcm2708/arm-bcm2708-linux-gnueabi/bin/arm-bcm2708-linux-gnueabi-gcc: Syntax error: word unexpected (expecting ")")
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: « include/generated/mach-types.h » est à jour.
CC kernel/bounds.s
/usr/src/tools/arm-bcm2708/arm-bcm2708-linux-gnueabi/bin/arm-bcm2708-linux-gnueabi-gcc: 1: /usr/src/tools/arm-bcm2708/arm-bcm2708-linux-gnueabi/bin/arm-bcm2708-linux-gnueabi-gcc: Syntax error: word unexpected (expecting ")")
make[1]: *** [kernel/bounds.s] Erreur 2
make: *** [prepare0] Erreur 2

have you an idea?

Activity

  1. notro commented on Nov 19, 2013

    @notro
    Contributor

    gzip -dc /proc/config.gz > .config

    Are you doing this on the Pi or on the build machine? If you do it on the build machine, you get the wrong config.

    This will give you the default config used in the Raspian kernel:
    ARCH=arm CROSS_COMPILE=${CCPREFIX} make bcmrpi_defconfig

    I did a build with bcmrpi_defconfig on rpi-3.6.y yesterday, and it worked fine for me.

  2. stegmannt commented on Nov 19, 2013

    @stegmannt

    @BzH35 From here it looks like you're trying to compile the kernel on the pi using the instructions for crosscompilation. In that case you don't need to crosscompile anything, see http://elinux.org/RPi_Kernel_Compilation#1._On_the_RPi

    If not then I'd still recommend not to use /usr/src/ as your base directory. Depending on your setup, your distro's kernel sources might mix up with the Pi's sources.

  3. TKR-US commented on Nov 20, 2013

    @TKR-US
    Author

    I'm doing it on the PI, i've some problem with qemu to launch my img (i look this problem later)

    i use /usr/src as base directory :)

    I'm going to try the compilation with 3.2.0-4- rpi because i make an successful install ax88179 driver

    i'll come back later :)

  4. TKR-US commented on Nov 20, 2013

    @TKR-US
    Author

    @notro

    if you compil on raspberry, can you tell me how do you do it?

    make mrproper
    gzip -dc /proc/config.gz > .config
    make oldconfig
    make menuconfig
    make (or debian method (but i've error with this method), make-kpkg kernel_image modules_image and after? dpkg -i deb ? i've no problem under debian with intel or amd, but with raspberry......)

    ?
    or another method ?

  5. notro commented on Nov 20, 2013

    @notro
    Contributor

    This is how I do it on the Pi

    # I'm working in the home dir
    cd
    
    # shallow clone to speed up download, git pull won't work when done like this
    git clone --depth 1 git://github.com/raspberrypi/linux.git
    
    cd linux/
    
    # not really necessary as the repo hasn't been touched
    make mrproper
    
    # default config as is used in the Raspian image
    make bcmrpi_defconfig
    
    # or if you run a custom kernel which config you want to use
    zcat /proc/config.gz > .config
    
    # config changes
    make menuconfig
    
    # this takes 8-9 hours
    make
    
    # install kernel and modules
    sudo make modules_install
    sudo cp arch/arm/boot/zImage /boot/kernel.img
    
  6. TKR-US commented on Nov 21, 2013

    @TKR-US
    Author

    @notro

    3.2.0-4 compilation and installation works fine, thanks a lot!!!

  7. reopened this on Nov 21, 2013
  8. jiapei100 commented on May 28, 2014

    @jiapei100

    I followed notro with the newest kernel 3.14.
    But after rebooting RPI, uname -r still gives me
    $ uname -r
    3.12.20+

    Why is it so?

    Cheers
    Pei

  9. notro commented on May 28, 2014

    @notro
    Contributor

    Have you replaced /boot/kernel.img?

    You can check the version of an uncompressed kernel like this:

    $ strings arch/arm/boot/Image | grep "Linux version"
    Linux version 3.14.3 (pi@raspi2) (gcc version 4.7.1 20120402 (prerelease) (crosstool-NG 1.15.2) ) #1 Wed May 28 14:28:14 CEST 2014
    

    Running kernel:

    $ cat /proc/version
    Linux version 3.10.25+ (dc4@dc4-arm-01) (gcc version 4.7.2 20120731 (prerelease) (crosstool-NG linaro-1.13.1+bzr2458 - Linaro GCC 2012.08) ) #622 PREEMPT Fri Jan 3 18:41:00 GMT 2014
    

    zImage is a compressed version of Image. It unpacks itself before booting:

    Uncompressing Linux... done, booting the kernel.
    

    It doens't matter which one you copy to /boot/kernel.img.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions