Find the answer to your Linux question:
Results 1 to 6 of 6
Dear friends, I encountered the trouble of compiling kernel failed.Ten days ago,I compiled it successfully.But today I am failed to do it again.The error is as below: arch/arm/mm/alignment.c: In function ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2013
    Posts
    10

    Cool compile kernel error


    Dear friends,

    I encountered the trouble of compiling kernel failed.Ten days ago,I compiled it successfully.But today I am failed to do it again.The error is as below:

    arch/arm/mm/alignment.c: In function ‘do_alignment’:
    arch/arm/mm/alignment.c:298:15: error: ‘offset.un’ may be used uninitialized in this function [-Werror=uninitialized]
    arch/arm/mm/alignment.c:720:21: note: ‘offset.un’ was declared here
    cc1: all warnings being treated as errors
    make[1]: *** [arch/arm/mm/alignment.o] Error 1


    My host OS is ubuntu10.04 and the cross-compile is arm-2012.09/bin/arm-none-linux-gnueabi-.

    I check it,but some's suggestion is about GCC.I have upgraded it.It is not OK.
    Thank you in advance.

    Mark

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,755
    I've had similar problems in the past. You may need to either change your compiler options so uninitialized variables only emit a warning vs. an error, or edit the source code (if you really need this module - otherwise disable in the .config file) and zero out the variable.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Jun 2013
    Posts
    10
    Quote Originally Posted by Rubberman View Post
    I've had similar problems in the past. You may need to either change your compiler options so uninitialized variables only emit a warning vs. an error, or edit the source code (if you really need this module - otherwise disable in the .config file) and zero out the variable.
    Hi Rubberman,
    I am so sorry that I can't discover the compiler options so uninitialized variables only emit a warning vs. an error.Would you mind showing me the details?
    The second solution you gave me is not available.I need the module.

    Mark

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,755
    In you Makefile(s) there should be a CFLAGS variable that has the flags passed to gcc on compiling. Two flags you need to look for are -Werror and -Wall or -Wuninitialized. -Wall will turn on -Wuninitialized and -Werror will either turn all warnings into errors, or -Werror=uninitialized will turn unitialized warnings into errors. If you do get some other compiler warnings when building your kernel that aren't errors, then I would expect the latter -Werror=uninitialized flag is set.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  6. #5
    Just Joined!
    Join Date
    Jun 2013
    Posts
    10
    Dear Rubberman,
    I appreciate your reply.According your recommend,I compare the host Makefile with other kernel and find something about -Werror.So I mask it and eventually, it compiles successfully.

    Mark

  7. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,755
    Quote Originally Posted by envi View Post
    Dear Rubberman,
    I appreciate your reply.According your recommend,I compare the host Makefile with other kernel and find something about -Werror.So I mask it and eventually, it compiles successfully.

    Mark
    Glad you got it to work. Just a caveat that you should look at those issues carefully. In the past, I found it better (for me) to initialize the variables with sane values. It never caused me a problem. Masking the error/warning may cause problems in some cases.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

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