From 646981459df7ba075069320bcaba4dd983777f4f Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 9 Oct 2023 16:30:10 +0200 Subject: [PATCH] Add -rpath when building analyzer executable on macOS ...as at least with LLVM 18 trunk, the generated executable references @rpath/libclang-cpp.dylib but didn't actually contain an LC_RPATH Change-Id: Ida643903aa4566853ea9541553f0dfc9c3243d4b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157706 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- compilerplugins/Makefile-clang.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compilerplugins/Makefile-clang.mk b/compilerplugins/Makefile-clang.mk index 7d993433c030..16a75e44b403 100644 --- a/compilerplugins/Makefile-clang.mk +++ b/compilerplugins/Makefile-clang.mk @@ -260,7 +260,9 @@ $(CLANGOUTDIR)/sharedvisitor/sharedvisitor.cxx: $(SHARED_SOURCE_INFOS) $(CLANGOU # and it can also cause trouble with finding the proper headers. CLANGTOOLDEFS = $(filter-out -stdlib=%,$(CLANGDEFS) -I$(CLANGSYSINCLUDE)) CLANGTOOLDEFS += -w -ifneq ($(filter-out MACOSX WNT,$(OS)),) +ifneq ($(filter MACOSX,$(OS)),) +CLANGTOOLLIBS += -Wl,-rpath,$(CLANGLIBDIR) +else ifneq ($(filter-out WNT,$(OS)),) ifneq ($(CLANGDIR),/usr) # Help the generator find Clang shared libs, if Clang is built so and installed in a non-standard prefix. CLANGTOOLLIBS += -Wl,--rpath,$(CLANGLIBDIR)