Skip to content

Commit bcaea0e

Browse files
[libsanitizer] configure+make: install include/sanitizer into Clang
When building Clang with compiler-rt, copy the contents of compiler-rt/include/sanitizer into lib/clang/3.4/include/sanitizer llvm-svn: 193515
1 parent 6094f30 commit bcaea0e

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

clang/runtime/compiler-rt/Makefile

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ ResourceDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib/clang/$(CLANG_VERSION)
2323
PROJ_resources := $(DESTDIR)$(PROJ_prefix)/lib/clang/$(CLANG_VERSION)
2424

2525
ResourceLibDir := $(ResourceDir)/lib
26+
ResourceIncludeDir := $(ResourceDir)/include
2627
PROJ_resources_lib := $(PROJ_resources)/lib
28+
PROJ_resources_include := $(PROJ_resources)/include
2729

2830
# Expect compiler-rt to be in llvm/projects/compiler-rt
2931
COMPILERRT_SRC_ROOT := $(LLVM_SRC_ROOT)/projects/compiler-rt
@@ -150,10 +152,18 @@ CleanRuntimeLibraries:
150152
ProjObjRoot=$(PROJ_OBJ_DIR) \
151153
clean
152154
.PHONY: CleanRuntimeLibraries
155+
RuntimeHeader: $(ResourceIncludeDir)/sanitizer
153156

154157
$(PROJ_resources_lib):
155158
$(Verb) $(MKDIR) $@
156159

160+
$(ResourceIncludeDir):
161+
$(Verb) $(MKDIR) $@
162+
163+
$(ResourceIncludeDir)/sanitizer: $(ResourceIncludeDir)
164+
$(Verb) $(MKDIR) $@
165+
$(Verb) cp $(COMPILERRT_SRC_ROOT)/include/sanitizer/*.h $@
166+
157167
# Expand rules for copying/installing each individual library. We can't use
158168
# implicit rules here because we need to match against multiple things.
159169
define RuntimeLibraryTemplate
@@ -210,9 +220,21 @@ RuntimeLibraryInstall.$1: \
210220
endef
211221
$(foreach lib,$(RuntimeDirs), $(eval $(call RuntimeLibraryTemplate,$(lib))))
212222

223+
$(PROJ_resources_include):
224+
$(Verb) $(MKDIR) $@
225+
226+
$(PROJ_resources_include)/sanitizer: $(ResourceIncludeDir)/sanitizer $(PROJ_resources_include)
227+
$(Verb) $(MKDIR) $@
228+
$(Echo) Installing compiler runtime headers
229+
$(Verb) $(DataInstall) $(ResourceIncludeDir)/sanitizer/* \
230+
$(PROJ_resources_include)/sanitizer
231+
232+
RuntimeHeaderInstall: $(PROJ_resources_include)/sanitizer
233+
.PHONY: RuntimeHeaderInstall
234+
213235
# Hook into the standard Makefile rules.
214-
all-local:: $(RuntimeDirs:%=RuntimeLibrary.%)
215-
install-local:: $(RuntimeDirs:%=RuntimeLibraryInstall.%)
236+
all-local:: $(RuntimeDirs:%=RuntimeLibrary.%) RuntimeHeader
237+
install-local:: $(RuntimeDirs:%=RuntimeLibraryInstall.%) RuntimeHeaderInstall
216238
clean-local:: CleanRuntimeLibraries
217239

218240
endif

0 commit comments

Comments
 (0)