This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GCC 5 snapshots produce broken kernel for powerpc-e500v2-linux-gnuspe?


Hello,

I've recently faced an issue I'm afraid I currently unable to debug. When
building an arbitrary version of Linux kernel for powerpc-e500v2-linux-gnuspe
target, it seems gcc prior to 5 produces a good image which boots just fine, and
current gcc 5 snapshots (4.10.0-alpha20140810 for example) produce an image
which hangs just after U-Boot hands over to the kernel.

This behavior is well reproducible on real hardware as well as under qemu. I've
prepared a minimal kernel config which is dysfunctional as is but still enough
to demonstrate the problem in qemu. I believe the exact Linux version number
doesn't actually matter here, but see the attachment for details.

Compare the output produced by u-boot and this minified kernel build using
gcc 4.9.1 and 4.10.0-alpha20140810 snapshot.

% qemu-system-ppc --version
QEMU emulator version 2.1.0, Copyright (c) 2003-2008 Fabrice Bellard

% qemu-system-ppc -cpu e500v2 -M mpc8544ds -bios /usr/share/qemu/u-boot.e500 \
> -kernel arch/powerpc/boot/uImage-gcc4.9.1 -nographic


U-Boot 2014.07-rc1-00079-g2072e72-dirty (May 16 2014 - 13:04:54)

CPU:   Unknown, Version: 0.0, (0x00000000)
Core:  e500, Version: 2.2, (0x80210022)
Clock Configuration:
       CPU0:400  MHz,
       CCB:400  MHz,
       DDR:200  MHz (400 MT/s data rate), LBC: unknown (LCRR[CLKDIV] = 0x00)
L1:    D-cache 32 KiB enabled
       I-cache 32 KiB enabled
DRAM:  128 MiB
L2:    disabled
Using default environment


PCI: base address e0008000
  00:11.0     - 1af4:1000 - Network controller
PCI1: Bus 00 - 00

In:    serial
Out:   serial
Err:   serial
Net:   No ethernet found.
Hit any key to stop autoboot:  0
## Booting kernel from Legacy Image at 02000000 ...
   Image Name:   Linux-2.6.35+
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    507635 Bytes = 495.7 KiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at e8000000
   Booting using the fdt blob at 0xe8000000
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 03fec000, end 03ffefff ... OK
setup_arch: bootmem
mpc85xx_ds_setup_arch()
arch: exit
<qemu terminated by user>

% qemu-system-ppc -cpu e500v2 -M mpc8544ds -bios /usr/share/qemu/u-boot.e500 \
> -kernel arch/powerpc/boot/uImage-gcc5 -nographic


U-Boot 2014.07-rc1-00079-g2072e72-dirty (May 16 2014 - 13:04:54)

<hardware enumeration output just as above>

Hit any key to stop autoboot:  0
## Booting kernel from Legacy Image at 02000000 ...
   Image Name:   Linux-2.6.35+
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    505303 Bytes = 493.5 KiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at e8000000
   Booting using the fdt blob at 0xe8000000
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 03fec000, end 03ffefff ... OK
<hang>

I also have another seemingly related issue: kernel module built
w/ 4.10.0-alpha20140810 against a kernel configured
for powerpc-e500v2-linux-gnuspe snapshot lacks .gnu.linkonce.this_module and
.rela.gnu.linkonce.this_module sections. Current stable versions of gcc emit
these sections but also drop it (and, consequently, init_module() and
cleanup_module() symbols) when CFLAGS_MODULE is modified in any way, even w/
CFLAGS_MODULE="-mno-isel" for example.

I now have completely no idea what to do next to find a cause of (1) gcc 5
snapshots producing unbootable kernel, and (2) different gcc versions producing
garbled kernel modules when configured for SPE target. As for modules, I've
compared assembler output of gcc configured for powerpc-e300c3-linux-gnu and
powerpc-e500v2-linux-gnuspe and failed to spot real differences, but installed
version of binutils is exactly the same for both configurations, and I'm
completely sure my setup is correct.


Regards.

Attachment: kernel-config
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]