Move libc_log code into libasync_safe.

This library is used by a number of different libraries in the system.
Make it easy for platform libraries to use this library and create
an actual exported include file.

Change the names of the functions to reflect the new name of the library.

Run clang_format on the async_safe_log.cpp file since the formatting is
all over the place.

Bug: 31919199

Test: Compiled for angler/bullhead, and booted.
Test: Ran bionic unit tests.
Test: Ran the malloc debug tests.
Change-Id: I8071bf690c17b0ea3bc8dc5749cdd5b6ad58478a
diff --git a/linker/linker_memory.cpp b/linker/linker_memory.cpp
index f8852e1..472c4e8 100644
--- a/linker/linker_memory.cpp
+++ b/linker/linker_memory.cpp
@@ -32,7 +32,7 @@
 #include <sys/cdefs.h>
 #include <unistd.h>
 
-#include "private/libc_logging.h"
+#include <async_safe/log.h>
 
 static LinkerMemoryAllocator g_linker_allocator;
 static pid_t fallback_tid = 0;
@@ -41,7 +41,7 @@
 // case the linker heap is corrupted. Do not use this function.
 extern "C" void __linker_enable_fallback_allocator() {
   if (fallback_tid != 0) {
-    __libc_fatal("attempted to use currently-in-use fallback allocator");
+    async_safe_fatal("attempted to use currently-in-use fallback allocator");
   }
 
   fallback_tid = gettid();
@@ -49,7 +49,7 @@
 
 extern "C" void __linker_disable_fallback_allocator() {
   if (fallback_tid == 0) {
-    __libc_fatal("attempted to disable unused fallback allocator");
+    async_safe_fatal("attempted to disable unused fallback allocator");
   }
 
   fallback_tid = 0;