Remove BUILDING_LIBART macro.

It has been used only to prevent including the libart header
`runtime_asm_entrypoints.h` when compiling other targets.
Instead make symbols in that header hidden so that using
them from other targets shall yield a link time error. (This
is somewhat pointless because the header defines only inline
functions but the actual entrypoint symbols defined in
assembly are already hidden anyway.)

This change adds the symbol visibility macros `HIDDEN` and
`EXPORT` which were originally included in the reverted CL
    https://android-review.googlesource.com/1137699 .

Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 186902856
Change-Id: Ia9fed6b3f49d7356888d702f4ad3bb48e5884793
diff --git a/libartbase/Android.bp b/libartbase/Android.bp
index 84f3418..1b02119 100644
--- a/libartbase/Android.bp
+++ b/libartbase/Android.bp
@@ -120,7 +120,6 @@
         },
     },
     generated_sources: ["art_libartbase_operator_srcs"],
-    cflags: ["-DBUILDING_LIBART=1"],
 
     export_include_dirs: ["."],
 }
diff --git a/libartbase/base/macros.h b/libartbase/base/macros.h
index e6f72ff..eec73cb 100644
--- a/libartbase/base/macros.h
+++ b/libartbase/base/macros.h
@@ -104,4 +104,7 @@
 #define LOCKABLE CAPABILITY("mutex")
 #define SHARED_LOCKABLE SHARED_CAPABILITY("mutex")
 
+#define HIDDEN __attribute__((visibility("hidden")))
+#define EXPORT __attribute__((visibility("default")))
+
 #endif  // ART_LIBARTBASE_BASE_MACROS_H_
diff --git a/libprofile/Android.bp b/libprofile/Android.bp
index 2edf821..fa10dfa 100644
--- a/libprofile/Android.bp
+++ b/libprofile/Android.bp
@@ -68,7 +68,6 @@
         },
     },
     //generated_sources: ["art_libartbase_operator_srcs"],
-    cflags: ["-DBUILDING_LIBART=1"],
     export_include_dirs: ["."],
 }
 
diff --git a/runtime/Android.bp b/runtime/Android.bp
index 8181cd9..95666b9 100644
--- a/runtime/Android.bp
+++ b/runtime/Android.bp
@@ -416,7 +416,6 @@
             ],
         },
     },
-    cflags: ["-DBUILDING_LIBART=1"],
     generated_sources: [
         "art_operator_srcs"
     ],
diff --git a/runtime/entrypoints/runtime_asm_entrypoints.h b/runtime/entrypoints/runtime_asm_entrypoints.h
index 9f47034..d2096ec 100644
--- a/runtime/entrypoints/runtime_asm_entrypoints.h
+++ b/runtime/entrypoints/runtime_asm_entrypoints.h
@@ -19,17 +19,14 @@
 
 #include "deoptimization_kind.h"
 
+#include "base/macros.h"
 #include "jni.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtMethod;
 class Thread;
 
-#ifndef BUILDING_LIBART
-#error "File and symbols only for use within libart."
-#endif
-
 extern "C" void* art_jni_dlsym_lookup_stub(JNIEnv*, jobject);
 static inline const void* GetJniDlsymLookupStub() {
   return reinterpret_cast<const void*>(art_jni_dlsym_lookup_stub);