title: Hiding symbols from static library when building an Android project with Clang as compiler
body: <p>Hiding symbols when gcc is used as compiler can be done using the --exclude-libs option.</p>
  
  <p>A working example:</p>
  
  <p>My Application.mk file looks like this:</p>
  
  <pre><code>APP_ABI := all
  APP_STL=c++_static
  APP_PLATFORM := android-21
  TARGET_PLATFORM := android-21
  NDK_TOOLCHAIN_VERSION := 4.9
  </code></pre>
  
  <p>The following line in the Android.mk file does the job:</p>
  
  <pre><code>LOCAL_LDFLAGS += -Wl,--exclude-libs=library.a
  </code></pre>
  
  <p>If I remove the following line from the Application.mk file</p>
  
  <pre><code>NDK_TOOLCHAIN_VERSION := 4.9
  </code></pre>
  
  <p>I believe Clang is used as the default compiler, which doesn't seem to have an --exclude-libs option, so symbols from library.a are not hidden anymore.</p>
  
  <p>Is there a Clang equivalent to the gcc --exclude-libs option?</p>
  
  <p>I have already tried the suggestion at the following link</p>
  
  <p><a href="http://lists.llvm.org/pipermail/cfe-dev/2013-June/030376.html" rel="nofollow noreferrer">http://lists.llvm.org/pipermail/cfe-dev/2013-June/030376.html</a></p>
  
  <p>but this doesn't seem to have any effect.</p>
  
  <p>Modifying the source code and making use of Clang's LTO Visibility property is not an option. </p>