Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 17
Like Tree5Likes
hi all I was trying to compile a kernel for my android phone then I got this: Code: scripts/kconfig/conf -s arch/arm/Kconfig CHK include/linux/version.h SYMLINK include/asm -> include/asm-arm make[1]: `include/asm-arm/mach-types.h' is ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2012
    Posts
    19

    Error during compiling kernel (Werror=unused-but-set-variable)


    hi all

    I was trying to compile a kernel for my android phone then I got this:

    Code:
    scripts/kconfig/conf -s arch/arm/Kconfig
      CHK     include/linux/version.h
      SYMLINK include/asm -> include/asm-arm
    make[1]: `include/asm-arm/mach-types.h' is up to date.
      CHK     include/linux/utsrelease.h
      UPD     include/linux/utsrelease.h
      CC      scripts/mod/empty.o
      MKELF   scripts/mod/elfconfig.h
      HOSTCC  scripts/mod/file2alias.o
      HOSTCC  scripts/mod/modpost.o
    scripts/mod/modpost.c: In function ‘get_markers’:
    scripts/mod/modpost.c:1542:12: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result]
    scripts/mod/modpost.c: In function ‘add_marker’:
    scripts/mod/modpost.c:1962:10: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result]
      HOSTCC  scripts/mod/sumversion.o
      HOSTLD  scripts/mod/modpost
      CC      kernel/bounds.s
      GEN     include/linux/bounds.h
      CC      arch/arm/kernel/asm-offsets.s
      GEN     include/asm/asm-offsets.h
      CALL    scripts/checksyscalls.sh
      CC      init/main.o
      HOSTCC  usr/gen_init_cpio
      GEN     usr/initramfs_data.cpio.gz
    In file included from include/linux/mempolicy.h:62:0,
                     from init/main.c:51:
    include/linux/pagemap.h: In function 'fault_in_pages_readable':
    include/linux/pagemap.h:416:16: error: variable 'c' set but not used [-Werror=unused-but-set-variable]
      AS      usr/initramfs_data.o
      LD      usr/built-in.o
    cc1: all warnings being treated as errors
    
    make[1]: *** [init/main.o] Error 1
    make: *** [init] Error 2
    make: *** Waiting for unfinished jobs....
    what if I just remove/disable werror options from compiler,is that a good idea?so how to do that?

    could you help me remove werror options?this is the toolchain I use:
    Code:
    https://github.com/DooMLoRD/android_prebuilt_toolchains

  2. #2
    Just Joined!
    Join Date
    Apr 2012
    Posts
    23
    Take a look in the makefile , there will be -Werror option in it , egrep for it in all make files and remove it . BTW have you modified the kernel?
    amin021023 likes this.

  3. #3
    Just Joined!
    Join Date
    Aug 2012
    Posts
    19
    Quote Originally Posted by kartikkg View Post
    Take a look in the makefile , there will be -Werror option in it , egrep for it in all make files and remove it . BTW have you modified the kernel?
    thank you problem solved , I removed this:
    Code:
    -Werror \
    -Werror-implicit-function-declaration
    but now I get another error:
    Code:
      CC      scripts/mod/empty.o
    arm-eabi-gcc: error: KBUILD_AFLAGS: No such file or directory
    arm-eabi-gcc: error: :=: No such file or directory
    make[2]: *** [scripts/mod/empty.o] Error 1
    make[1]: *** [scripts/mod] Error 2
    make: *** [scripts] Error 2
    make: INTERNAL: Exiting with 3 jobserver tokens available; should be 2!
    and this is the kernel source:
    Code:
    https://github.com/freexperia/semc-kernel-qsd8k-ics

  4. #4
    Just Joined!
    Join Date
    Apr 2012
    Posts
    23
    Can you use the cross compiler arm-none-linux-gnueabi- , download it from code sourcery and try to get this one arm-none-linux-gnueabi-gcc-4.5.2 and then at command line issue this "make j1 ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-"
    amin021023 likes this.

  5. #5
    Just Joined!
    Join Date
    Aug 2012
    Posts
    19
    Quote Originally Posted by kartikkg View Post
    Can you use the cross compiler arm-none-linux-gnueabi- , download it from code sourcery and try to get this one arm-none-linux-gnueabi-gcc-4.5.2 and then at command line issue this "make j1 ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-"
    I found this:
    Code:
    https://github.com/Evanok/arm-none-linux-gnueabi
    Then I tried it but get this error:
    Code:
    /home/amin/android/kernel/kernel/scripts/gcc-version.sh: 25: /home/amin/android/kernel/kernel/scripts/gcc-version.sh: arm-none-linux-gnueabi-gcc: not found
    /home/amin/android/kernel/kernel/scripts/gcc-version.sh: 26: /home/amin/android/kernel/kernel/scripts/gcc-version.sh: arm-none-linux-gnueabi-gcc: not found
    make: arm-none-linux-gnueabi-gcc: Command not found
      CHK     include/linux/version.h
    make[1]: `include/asm-arm/mach-types.h' is up to date.
      CHK     include/linux/utsrelease.h
      SYMLINK include/asm -> include/asm-arm
      CC      kernel/bounds.s
    /bin/sh: 1: arm-none-linux-gnueabi-gcc: not found
    make[1]: *** [kernel/bounds.s] Error 127
    make: *** [prepare0] Error 2

  6. #6
    Just Joined!
    Join Date
    Apr 2012
    Posts
    23
    Ha, thats because you've not installed the tool chain , get it from here.
    hxxp://processors.wiki.ti.com/index.php/Installing_CodeSourcery_Toolchain
    You may need to edit the bashrc file of your linux distro .
    amin021023 likes this.

  7. #7
    Just Joined!
    Join Date
    Aug 2012
    Posts
    19
    Quote Originally Posted by kartikkg View Post
    Ha, thats because you've not installed the tool chain , get it from here.
    hxxp://processors.wiki.ti.com/index.php/Installing_CodeSourcery_Toolchain
    You may need to edit the bashrc file of your linux distro .
    Dude I already have toolchain

    could you please tell me what I need to do with bashrcfile(I'm running ubuntu 12.04 32bit)

    edit: I have toolchain 2011.3 and the prebuilds too, is that make problem?

  8. #8
    Just Joined!
    Join Date
    Aug 2012
    Posts
    19
    HOT NEWS!!!!!!

    finally I could compile a kernel almost seccesfull but it wasn't my source I compiled , I did it just for testing...

  9. #9
    Just Joined!
    Join Date
    Aug 2012
    Posts
    19
    I get this error when I try my source:
    Code:
    In file included from arch/arm/mach-msm/board-es209ra.c:108:0:
    include/linux/usb/android.h:47:8: error: redefinition of 'struct usb_composition'
    arch/arm/mach-msm/include/mach/msm_hsusb.h:54:8: note: originally defined here
    make[1]: *** [arch/arm/mach-msm/board-es209ra.o] Error 1
    make: *** [arch/arm/mach-msm] Error 2
    and this is the source:
    Code:
    https://github.com/freexperia/semc-kernel-qsd8k-ics
    please help me solve this!

  10. #10
    Just Joined!
    Join Date
    Aug 2012
    Posts
    19
    I fixed that error but another one showed up...Why do I keep getting error?

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •