wongsyrone / openwrt-1

已废弃DEPRECATED-see https://github.com/wongsyrone/lede-1 | modifications on OpenWrt official repository
https://www.lede-project.org/
GNU General Public License v2.0
37 stars 19 forks source link

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

Closed wongsyrone closed 9 years ago

wongsyrone commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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

wongsyrone commented 9 years ago

DT warning https://lists.ozlabs.org/pipermail/linuxppc-dev/2009-February/068170.html

wongsyrone commented 9 years ago

try to add buildroot's gcc 4.9.x patches

wongsyrone commented 9 years ago

check openembedded patches https://github.com/openembedded/oe-core/tree/master/meta/recipes-devtools/gcc/gcc-4.9

wongsyrone commented 9 years ago

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

wongsyrone commented 9 years ago

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

wongsyrone commented 9 years ago

bootargs = "console=ttyS0,115200";

wongsyrone commented 9 years ago

finally https://github.com/openwrt-mirror/openwrt/commit/53a77a939215c571f27c44c436cf5f715ffc6235 , waiting......

wongsyrone commented 9 years ago

switching to self-added gcc 5.1 and need test

wongsyrone commented 9 years ago

failed on gcc 4.9, 5.1 and 5.2

wongsyrone commented 9 years ago

Still broken on official GCC 5.2.0

plntyk commented 9 years ago

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 commented 9 years ago

Thanks, I will try. https://github.com/wongsyrone/openwrt-1/blob/master/include/target.mk

wongsyrone commented 9 years ago

@plntyk Please refer to https://github.com/wongsyrone/openwrt-1/commit/35308f2435ec75192324d68817e7702e3b257e71 and https://github.com/wongsyrone/openwrt-1/commit/93c0a5173414cfa7684547de3c3a1f3dc4240383 If you want to send these changes to OpenWrt's mailing list, feel free to do it.

wongsyrone commented 9 years ago

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