Skip to content
This repository has been archived by the owner on Aug 8, 2018. It is now read-only.

gcc 4.9: No more output is seen on the console after "Starting Kernel..." #44

Closed
wongsyrone opened this issue Jun 12, 2015 · 17 comments
Closed

Comments

@wongsyrone
Copy link
Owner

official gcc 4.9 and self-added 4.9 -------- kernel boot freeze

MIPS can use gcc 4.9 and works well
http://kmoving.blog.163.com/blog/static/20504919720123151533819/

it should be a linaro gcc bug
https://github.com/gcc-mirror/gcc/commits/linaro/gcc-4_9-branch

@wongsyrone
Copy link
Owner Author

someone says DTB not attached
cuz ARM uses Device Tree while MIPS uses loaders to boot
do some search, gcc 4.9 issue, find some upstream patches

@wongsyrone wongsyrone changed the title wrt1900ac works when building with gcc 4.8 gcc 4.9: No more output is seen on the console after "Starting Kernel..." Jun 14, 2015
@wongsyrone
Copy link
Owner Author

based on link: https://developer.ridgerun.com/wiki/index.php/Common_Problems_-_Linux_kernel_doesnt_boot

The last data sent to the console by u-boot is the string Starting kernel .... The next output is generated by Linux. If you are not seeing any output after Starting kernel ..., then something has gone wrong with either Linux sending the output to the right UART, a mismatch in u-boot and kernel images, or the kernel image is corrupt.

we need kernel console configuration, machine ID and well-built kernel image to boot, and kernel console information was coded in DTS file.

look for:
[ ] compile DTB correctly
[ ] compile kernel and make image correctly

@wongsyrone
Copy link
Owner Author

https://github.com/wongsyrone/openwrt-1/blob/master/target/linux/mvebu/patches-3.18/001-add_mamba_support.patch#L101 console info here, but this info not passed to linux kernel, maybe DTB corrupted or kernel image corrupted

try with

  • gcc 4.9 official + linux 4.x + uclibc snapshot
  • gcc 4.9 self + linux 4.x

@wongsyrone
Copy link
Owner Author

@wongsyrone
Copy link
Owner Author

try to add buildroot's gcc 4.9.x patches

@wongsyrone
Copy link
Owner Author

@wongsyrone
Copy link
Owner Author

Reported: https://dev.openwrt.org/ticket/19916

@wongsyrone
Copy link
Owner Author

Giving up, and waiting upstream fix
EDIT: try to enable early_printk() in kernel and see logs

@wongsyrone
Copy link
Owner Author

bootargs = "console=ttyS0,115200";

@wongsyrone
Copy link
Owner Author

finally openwrt-mirror@53a77a9 , waiting......

@wongsyrone
Copy link
Owner Author

switching to self-added gcc 5.1 and need test

@wongsyrone
Copy link
Owner Author

failed on gcc 4.9, 5.1 and 5.2

@wongsyrone
Copy link
Owner Author

Still broken on official GCC 5.2.0

@plntyk
Copy link

plntyk commented Aug 18, 2015

can you try to insert / add to KCFLAGS (i dont know where - probably somewhere in kernel make templates)

-fno-ipa-sra

source: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65932

also from there:

The issue is also present when compiling kernels for OMAP1/2 platforms. Also
looks like -Os is needed to trigger this. Kernels compiled with -O2 seem to
work.

so changing default flags might be worth a try

@wongsyrone
Copy link
Owner Author

@wongsyrone
Copy link
Owner Author

@plntyk
Please refer to 35308f2 and 93c0a51
If you want to send these changes to OpenWrt's mailing list, feel free to do it.

@wongsyrone
Copy link
Owner Author

nbd pushed a better solution from gcc guys, I will revert my changes.

Repository owner locked and limited conversation to collaborators Sep 3, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants