Stop using -fvisibility=hidden.

It breaks backtraces, and backtraces are useful. (The debugger uses
the ELF debug info, so it doesn't care, but backtracing just uses the
symbols.)

(cherry-pick of da2fb9754a9ccfa954c1b554982f06e7cf7d680a.)

Bug: 6447213
Change-Id: I957df0e935b61bcf5fefc0e506ecdaa862bc7d07
diff --git a/NativeCode.mk b/NativeCode.mk
index 2a222b1..fae0fce 100644
--- a/NativeCode.mk
+++ b/NativeCode.mk
@@ -65,9 +65,6 @@
 core_c_includes := $(sort libcore/include $(LOCAL_C_INCLUDES) $(JNI_H_INCLUDE))
 core_shared_libraries := $(sort $(LOCAL_SHARED_LIBRARIES))
 core_static_libraries := $(sort $(LOCAL_STATIC_LIBRARIES))
-core_cflags := -fvisibility=hidden
-core_cflags += '-DGCC_HIDDEN=__attribute__((visibility("hidden")))'
-core_cppflags := -fvisibility-inlines-hidden
 
 
 #
diff --git a/luni/src/main/native/libcore_io_Posix.cpp b/luni/src/main/native/libcore_io_Posix.cpp
index 30ca145..5a3382a 100644
--- a/luni/src/main/native/libcore_io_Posix.cpp
+++ b/luni/src/main/native/libcore_io_Posix.cpp
@@ -1102,7 +1102,7 @@
     if (rc == -1 && errno == EINVAL) {
         // Maybe we're a 32-bit binary talking to a 64-bit kernel?
         // glibc doesn't automatically handle this.
-        struct GCC_HIDDEN group_req64 {
+        struct group_req64 {
             uint32_t gr_interface;
             uint32_t my_padding;
             sockaddr_storage gr_group;
diff --git a/luni/src/main/native/libcore_net_RawSocket.cpp b/luni/src/main/native/libcore_net_RawSocket.cpp
index 4e5059f..2e493ac 100644
--- a/luni/src/main/native/libcore_net_RawSocket.cpp
+++ b/luni/src/main/native/libcore_net_RawSocket.cpp
@@ -38,10 +38,10 @@
 #include <netinet/ip.h>
 #include <linux/udp.h>
 
-union GCC_HIDDEN sockunion {
+union sockunion {
     sockaddr sa;
     sockaddr_ll sll;
-} su;
+};
 
 /*
  * Creates a socket suitable for raw socket operations.  The socket is
@@ -61,6 +61,7 @@
     return;
   }
 
+  sockunion su;
   memset(&su, 0, sizeof(su));
   su.sll.sll_family = PF_PACKET;
   su.sll.sll_protocol = htons(protocolType);
@@ -119,6 +120,7 @@
     return 0;
   }
 
+  sockunion su;
   memset(&su, 0, sizeof(su));
   su.sll.sll_hatype = htons(1); // ARPHRD_ETHER
   su.sll.sll_halen = mac.size();