summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2023-10-09 16:30:10 +0200
committerStephan Bergmann <sbergman@redhat.com>2023-10-09 23:25:10 +0200
commit646981459df7ba075069320bcaba4dd983777f4f (patch)
tree442e2b8671d3386d1185f6a29ae528ec80a0674a /compilerplugins
parent969990becc001d5fe5a34ff976cb022786c10c76 (diff)
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 <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/Makefile-clang.mk4
1 files changed, 3 insertions, 1 deletions
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)