[llvm-bugs] [Bug 42542] New: ThinLTO on Aarch64 fails to handle aliases to overridden weak functions

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jul 8 12:15:41 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42542

            Bug ID: 42542
           Summary: ThinLTO on Aarch64 fails to handle aliases to
                    overridden weak functions
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: samitolvanen at google.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

C code that defines an alias to a weak function, which is then referred to in
assembly code that also overrides the same weak function, fails to compile with
-flto=thin on Aarch64:

$ cat alias.c
__attribute__((__weak__)) int __a(int n)
{
        return n;
}
int a(int n)  __attribute__((__alias__("__a")));

int main()
{
        return __a(0);
}

$ cat alias.s
.arch armv8-a

__a:
        b a
.globl __a

$ clang -flto=thin -fvisibility=hidden -fuse-ld=lld --target=aarch64-linux-gnu-
alias.s alias.c
Alias must point to a definition
i32 (i32)* @a
LLVM ERROR: Broken module found, compilation aborted!
clang-9: error: linker command failed with exit code 1 (use -v to see
invocation)

Using -flto instead of -flto=thin works.

This bug prevents us from compiling the Linux kernel with ThinLTO, as explained
here:
https://github.com/ClangBuiltLinux/linux/issues/509

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190708/dfcb7a04/attachment.html>


More information about the llvm-bugs mailing list