This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

A newer compiler for kernel -- boot process hangs.

Other Parts Discussed in Thread: DM3730

Hi.

I have a DM3730 board running arago 2.6.37-based kernel. I tried to compile kernel with a newer cross compiler, and got "Starting kernel" only without any further booting.

Development host: Ubuntu 14.04.4 x86_64

Old compiler: arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2010q1-202) 4.4.1

New compiler: arm-none-linux-gnueabi-gcc (Sourcery CodeBench Lite 2014.05-29) 4.8.3 20140320 (prerelease)

Bootloaders (and therefore kernel parameters) are all the same.

I'd like to know why this is happening. Are there issues one should know, when compiling old kernels with newer compilers?

  • Hi Garrikus,

    The recommended cross compiler for DM3730 board and kernel 2.6.37 is gcc version 4.4.1 (Sourcery G++ Lite 2010q1. It is possible to appear some issues with different tool chains.

    BR
    Tsvetolin Shulev
  • Hello,

    Apply the following diff in your linux source for top level Makefile,

    diff --git a/Makefile b/Makefile
    index 74b2555..324a5d4 100644
    --- a/Makefile
    +++ b/Makefile
    @@ -351,7 +351,7 @@ LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include -Iinclude \
    KBUILD_CPPFLAGS := -D__KERNEL__

    KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
    - -fno-strict-aliasing -fno-common \
    + -fno-strict-aliasing -fno-common -mno-unaligned-access \
    -Werror-implicit-function-declaration \
    -Wno-format-security \
    -fno-delete-null-pointer-checks

    Cheers,
    --Prabhakar Lad
  • Thanks, Prabhakar, this seems to work.

    But what's this all about? Did default code generation change in gcc somewhere along the way? When and why did -mno-unaligned-access become necessary for kernel?

    Do you have any links to where I can find that sort of info?
  • Hello,

    The older kernel version didn’t handle, unaligned access of memory to which older version of GCC took care of, but now the newer kernel version do take care of unaligned access. So while using newer version of GCC with older kernel versions you need to specify this flag.

    Hope that helps.

    Cheers,
    --Prabhakar Lad