]> granicus.if.org Git - clang/commit
[Clang][CodeGen] set alias linkage on QualType
authorNick Desaulniers <ndesaulniers@google.com>
Thu, 22 Aug 2019 20:47:12 +0000 (20:47 +0000)
committerNick Desaulniers <ndesaulniers@google.com>
Thu, 22 Aug 2019 20:47:12 +0000 (20:47 +0000)
commita6a0ae608be83c9c286fc9f11d0a380301922535
tree9af84bf6c17407a141057644e5f40edf70fa67ed
parent2763806de6044c451fa4511bb4d68cd2cd2cff27
[Clang][CodeGen] set alias linkage on QualType

Summary:
It seems that CodeGen was always using ExternalLinkage when emitting a
GlobalDecl with __attribute__((alias)). This leads to symbol
redefinitions (ODR) that cause failures at link time for static aliases.
This is readily attempting to link an ARM (32b) allyesconfig Linux
kernel built with Clang.

Reported-by: nathanchance
Suggested-by: ihalip
Link: https://bugs.llvm.org/show_bug.cgi?id=42377
Link: https://github.com/ClangBuiltLinux/linux/issues/631
Reviewers: rsmith, aaron.ballman, erichkeane

Reviewed By: aaron.ballman

Subscribers: javed.absar, kristof.beyls, cfe-commits, srhines, ihalip, nathanchance

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66492

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@369705 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CodeGenModule.cpp
test/CodeGen/alias.c