Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

PPC64, compiling kernel: error in backend: Invalid register name global variable #51555

Open Quuxplusone opened 3 years ago

Quuxplusone commented 3 years ago
Bugzilla Link PR52588
Status NEW
Importance P enhancement
Reported by Alexey Kardashevskiy (aik@ozlabs.ru)
Reported on 2021-11-23 00:22:17 -0800
Last modified on 2021-11-24 17:13:38 -0800
Version trunk
Hardware Other Linux
CC htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
Fixed by commit(s)
Attachments ftrace-0066fe.sh (7841 bytes, application/x-shellscript)
ftrace-0066fe.c.bz2 (796774 bytes, application/x-bzip)
ftrace-0066fe.tmux.tmp (14667 bytes, text/plain)
Blocks
Blocked by
See also
Created attachment 25472
shell script with cmdline

Trying to fix the Linux kernel to build with LLVM on PPC64. Among other things,
this came up.
Quuxplusone commented 3 years ago

Attached ftrace-0066fe.sh (7841 bytes, application/x-shellscript): shell script with cmdline

Quuxplusone commented 3 years ago

Attached ftrace-0066fe.c.bz2 (796774 bytes, application/x-bzip): the problem file

Quuxplusone commented 3 years ago

Attached ftrace-0066fe.tmux.tmp (14667 bytes, text/plain): shell tmux snapshot

Quuxplusone commented 2 years ago
"long reladdr = addr - kernel_toc_addr();" is the problem place which (in my
tree) looks like:

register unsigned long toc_ptr asm ("r2");

static inline unsigned long kernel_toc_addr(void)
{
        return toc_ptr;
}
Quuxplusone commented 2 years ago

ah turns out "r2" cannot be used for global variable at all. Wonder why.