From 38685e188787e657f8b1f5962b963210ecca5ffa Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Mon, 30 Oct 2017 12:45:09 -0700 Subject: [PATCH] versioner: follow __asm__ labels. Attribute the versioning information on `void foo() __asm("bar")` to bar, not foo. The various long double functions in run into this. Bug: https://github.com/android-ndk/ndk/issues/440 Test: python run_tests.py Test: m Change-Id: Idd3681ddbd006b4705608449935c9cfacfa3556e --- tools/versioner/src/DeclarationDatabase.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/versioner/src/DeclarationDatabase.cpp b/tools/versioner/src/DeclarationDatabase.cpp index aef4f550f..33bccf372 100644 --- a/tools/versioner/src/DeclarationDatabase.cpp +++ b/tools/versioner/src/DeclarationDatabase.cpp @@ -54,6 +54,11 @@ class Visitor : public RecursiveASTVisitor { } } + // maps fool onto foo on 32-bit, since long double is the same as double. + if (auto asm_attr = decl->getAttr()) { + return asm_attr->getLabel(); + } + // The decl might not have a name (e.g. bitfields). if (auto identifier = decl->getIdentifier()) { if (mangler->shouldMangleDeclName(decl)) {