Skip to content

Commit 04dbc2d

Browse files
committed
Pass LLVM_ANDROID_TOOLCHAIN_DIR if set.
This lets one build ASan runtime for ARM/Android by running make -C tools/clang/runtime/ \ LLVM_ANDROID_TOOLCHAIN_DIR=/path/to/ndk/toolchain in an existing build tree. llvm-svn: 166560
1 parent 64579da commit 04dbc2d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

clang/runtime/compiler-rt/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ test_source = $(LLVM_SRC_ROOT)/tools/clang/runtime/compiler-rt/clang_linux_test_
112112
ifeq ($(call TryCompile,$(ToolDir)/clang,$(test_source),-m32),0)
113113
RuntimeLibrary.linux.Configs += asan-i386.a
114114
endif
115+
ifneq ($(LLVM_ANDROID_TOOLCHAIN_DIR),)
116+
RuntimeLibrary.linux.Configs += asan-arm-android.so
117+
endif
115118
endif
116119

117120
endif
@@ -130,6 +133,7 @@ BuildRuntimeLibraries:
130133
ProjSrcRoot=$(COMPILERRT_SRC_ROOT) \
131134
ProjObjRoot=$(PROJ_OBJ_DIR) \
132135
CC="$(ToolDir)/clang" \
136+
LLVM_ANDROID_TOOLCHAIN_DIR="$(LLVM_ANDROID_TOOLCHAIN_DIR)" \
133137
$(RuntimeDirs:%=clang_%)
134138
.PHONY: BuildRuntimeLibraries
135139
CleanRuntimeLibraries:

0 commit comments

Comments
 (0)