[PATCH] D104058: ThinLTO: Fix inline assembly references to static functions with CFI

Peter Collingbourne via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 17 09:16:59 PDT 2021


pcc accepted this revision.
pcc added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: clang/test/CodeGen/thinlto-cfi-icall-static-inline-asm.c:3
+
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -flto=thin -fsanitize=cfi-icall -fsplit-lto-unit -o - %s | llvm-dis - | FileCheck %s
+
----------------
Can the test be moved to `llvm/test/Transforms/ThinLTOBitcodeWriter` and made to use `opt -thinlto-bc`?


================
Comment at: llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp:79
+                              GlobalValue::InternalLinkage, Name, F, &ExportM);
+      appendToCompilerUsed(ExportM, A);
+    }
----------------
samitolvanen wrote:
> Note that I'm adding the alias to llvm.compiler.used because it's otherwise removed during optimization. Is there are better way to accomplish this?
Not as far as I know, that's what I'd recommend.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104058/new/

https://reviews.llvm.org/D104058



More information about the cfe-commits mailing list