From b795d6fa4b2a5721df5499c7d30e66e4b62c94ed Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 14 Sep 2022 20:15:19 +0000 Subject: [PATCH] Fix the build with a newer LLVM. Unify all our "noinline" variants to the current most common one, not least because the new [[noinline]] syntax is fussier about where it goes. Test: treehugger Change-Id: Icfcb75c9d687f0f05c19f66ee778fd8962519436 --- debuggerd/debuggerd_test.cpp | 2 +- libutils/CallStack_test.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/debuggerd/debuggerd_test.cpp b/debuggerd/debuggerd_test.cpp index ed90ab468..aca476f68 100644 --- a/debuggerd/debuggerd_test.cpp +++ b/debuggerd/debuggerd_test.cpp @@ -1403,7 +1403,7 @@ TEST_F(CrasherTest, seccomp_crash_oom) { // We can't actually generate a backtrace, just make sure that the process terminates. } -__attribute__((noinline)) extern "C" bool raise_debugger_signal(DebuggerdDumpType dump_type) { +__attribute__((__noinline__)) extern "C" bool raise_debugger_signal(DebuggerdDumpType dump_type) { siginfo_t siginfo; siginfo.si_code = SI_QUEUE; siginfo.si_pid = getpid(); diff --git a/libutils/CallStack_test.cpp b/libutils/CallStack_test.cpp index 2ea191168..2cfaf6127 100644 --- a/libutils/CallStack_test.cpp +++ b/libutils/CallStack_test.cpp @@ -22,7 +22,7 @@ #include #include -[[clang::noinline]] extern "C" void CurrentCaller(android::String8& backtrace) { +__attribute__((__noinline__)) extern "C" void CurrentCaller(android::String8& backtrace) { android::CallStack cs; cs.update(); backtrace = cs.toString(); @@ -35,7 +35,8 @@ TEST(CallStackTest, current_backtrace) { ASSERT_NE(-1, backtrace.find("(CurrentCaller")) << "Full backtrace:\n" << backtrace; } -[[clang::noinline]] extern "C" void ThreadBusyWait(std::atomic* tid, volatile bool* done) { +__attribute__((__noinline__)) extern "C" void ThreadBusyWait(std::atomic* tid, + volatile bool* done) { *tid = android::base::GetThreadId(); while (!*done) { }