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

--- Comment #32 from Gopi Kumar Bulusu <gopi at sankhya dot com> ---
Created attachment 64034
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64034&action=edit
This patch adds necessary stack space for outgoing arguments for some system
calls from entry.S; It is not a tested patch and is not a final fix.

PR121432 seems to be a defect in Linux kernel - arch/microblaze/kernel/entry.S
; C functions are invoked with arguments without allocating stack space for
register params (for potential register spills). As a result kernel built using
buildroot; boot hangs at the point of starting init -. 

This patch adds necessary stack space for few C function calls from entry.S
(not all). After this patch, the kernel boots all the way to login prompt and
root login works. Simple commands like ps work and show normal output.

It is not a complete fix as there are additional C function calls in entry.S
that do not allocate space for outgoing args in the caller's stack frame. 

The patch is not tested beyond checking that the kernel boots.

Run /init as init process
  with arguments:
    /init
  with environment:
    HOME=/
    TERM=linux
Saving 256 bits of creditable seed for next boot
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Starting network: udhcpc: started, v1.37.0
udhcpc: broadcasting discover
udhcpc: broadcasting select for 10.0.2.15, server 10.0.2.2
udhcpc: lease of 10.0.2.15 obtained from 10.0.2.2, lease time 86400
deleting routers
adding dns 10.0.2.3
OK
Starting crond: OK

Welcome to Buildroot
buildroot login:

Reply via email to