diff --git a/tools/llvm-shlib/Makefile b/tools/llvm-shlib/Makefile index 19077a3858a..4e656b438c3 100644 --- a/tools/llvm-shlib/Makefile +++ b/tools/llvm-shlib/Makefile @@ -69,6 +69,11 @@ ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux GNU GNU/kFreeBSD)) LLVMLibsOptions += -Wl,--no-undefined endif +ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux GNU GNU/kFreeBSD)) + # Define a default symbol version + LLVMLibsOptions += -Wl,--default-symver +endif + ifeq ($(HOST_OS),SunOS) # add -z allextract ahead of other libraries on Solaris LLVMLibsOptions := -Wl,-z -Wl,allextract $(LLVMLibsOptions)