Like for LLVM / shlib, we also provide a SONAME to libclang.so



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154779 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/libclang/Makefile b/tools/libclang/Makefile
index 1fff166..f2d29ee 100644
--- a/tools/libclang/Makefile
+++ b/tools/libclang/Makefile
@@ -23,6 +23,11 @@
 
 include $(CLANG_LEVEL)/Makefile
 
+# Add soname to the library.
+ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD OpenBSD GNU))
+        LDFLAGS += -Wl,-soname,lib$(LIBRARYNAME)$(SHLIBEXT)
+endif
+
 ##===----------------------------------------------------------------------===##
 # FIXME: This is copied from the 'lto' makefile.  Should we share this?
 ##===----------------------------------------------------------------------===##