aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llvm-config
diff options
context:
space:
mode:
authorChris Wailes <chriswailes@google.com>2014-06-02 11:53:16 -0700
committerChris Wailes <chriswailes@google.com>2014-06-06 18:19:16 -0700
commit075c621d834af7ffc32d2067fadb147cc1758b99 (patch)
treef4f29ff2e71102ee86111bc695830ae5850ec50c /tools/llvm-config
parenta637ea99e253d9d3bd16ebb9e33f5828d38d94de (diff)
downloadexternal_llvm-075c621d834af7ffc32d2067fadb147cc1758b99.zip
external_llvm-075c621d834af7ffc32d2067fadb147cc1758b99.tar.gz
external_llvm-075c621d834af7ffc32d2067fadb147cc1758b99.tar.bz2
Adds the ability to run the llvm test suite in-tree.
This was accomplished by building additional tools and hand-generating several files that are auto-generated by the configuration system when LLVM is built out-of-tree. The LTO, Interpreter, and DebugInfo libraries are now being compiled, and several source files were added to existing compilation targets. To run these tests you must first run build/envsetup.sh and have used lunch to select a target. You can then launch the test script by running: cd $ANDROID_BUILD_TOP/external/llvm && ./android_test.sh Bug: 15433215 Change-Id: I43d87de0a4620cdd46c8d0f825dd4428e8409702
Diffstat (limited to 'tools/llvm-config')
-rw-r--r--tools/llvm-config/Android.mk46
-rw-r--r--tools/llvm-config/BuildVariables.inc.in18
-rw-r--r--tools/llvm-config/LibraryDependencies.inc94
3 files changed, 149 insertions, 9 deletions
diff --git a/tools/llvm-config/Android.mk b/tools/llvm-config/Android.mk
new file mode 100644
index 0000000..628a62c
--- /dev/null
+++ b/tools/llvm-config/Android.mk
@@ -0,0 +1,46 @@
+LOCAL_PATH := $(call my-dir)
+
+LLVM_ROOT_PATH := $(LOCAL_PATH)/../..
+
+
+#===---------------------------------------------------------------===
+# llvm-config command line tool
+#===---------------------------------------------------------------===
+
+llvm_config_SRC_FILES := \
+ llvm-config.cpp \
+
+llvm_config_STATIC_LIBRARIES := \
+ libLLVMCore \
+ libLLVMSupport \
+
+llvm_config_LOCAL_INCLUDES := \
+ BuildVariables.inc \
+ LibraryDependencies.inc
+
+llvm_config_DEPENDENCIES := \
+ BuildVariables.inc
+
+include $(CLEAR_VARS)
+
+BUILD_VARIABLES_IN := $(LOCAL_PATH)/BuildVariables.inc.in
+BUILD_VARIABLES_OUT := $(LOCAL_PATH)/BuildVariables.inc
+
+BuildVariables.inc:
+ sed -e 's/@ANDROID_BUILD_TOP@/$(subst /,\/,$(ANDROID_BUILD_TOP))/' < $(BUILD_VARIABLES_IN) > $(BUILD_VARIABLES_OUT)
+
+LOCAL_MODULE := llvm-config
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_CLASS := EXECUTABLES
+LOCAL_IS_HOST_MODULE := true
+
+LOCAL_SRC_FILES := $(llvm_config_SRC_FILES)
+LOCAL_STATIC_LIBRARIES := $(llvm_config_STATIC_LIBRARIES)
+LOCAL_INCLUDES := $(llvm_config_LOCAL_INCLUDES)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(llvm_config_DEPENDENCIES)
+
+LOCAL_LDLIBS += -lpthread -lm -ldl
+
+include $(LLVM_ROOT_PATH)/llvm.mk
+include $(LLVM_HOST_BUILD_MK)
+include $(BUILD_HOST_EXECUTABLE)
diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
index 2ec019b..59b5835 100644
--- a/tools/llvm-config/BuildVariables.inc.in
+++ b/tools/llvm-config/BuildVariables.inc.in
@@ -16,12 +16,12 @@
//
//===----------------------------------------------------------------------===//
-#define LLVM_SRC_ROOT "@LLVM_SRC_ROOT@"
-#define LLVM_OBJ_ROOT "@LLVM_OBJ_ROOT@"
-#define LLVM_CPPFLAGS "@LLVM_CPPFLAGS@"
-#define LLVM_CFLAGS "@LLVM_CFLAGS@"
-#define LLVM_LDFLAGS "@LLVM_LDFLAGS@"
-#define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@"
-#define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
-#define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
-#define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
+#define LLVM_SRC_ROOT "@ANDROID_BUILD_TOP@/external/llvm"
+#define LLVM_OBJ_ROOT ""
+#define LLVM_CPPFLAGS " -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
+#define LLVM_CFLAGS " -fPIC -Wall -W -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -fcolor-diagnostics -ffunction-sections -fdata-sections -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
+#define LLVM_LDFLAGS ""
+#define LLVM_CXXFLAGS " -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -std=c++11 -fcolor-diagnostics -ffunction-sections -fdata-sections -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
+#define LLVM_BUILDMODE ""
+#define LLVM_TARGETS_BUILT "X86 AArch64 ARM Mips"
+#define LLVM_SYSTEM_LIBS "-lrt -ldl -ltinfo -lpthread"
diff --git a/tools/llvm-config/LibraryDependencies.inc b/tools/llvm-config/LibraryDependencies.inc
new file mode 100644
index 0000000..47a51e6
--- /dev/null
+++ b/tools/llvm-config/LibraryDependencies.inc
@@ -0,0 +1,94 @@
+//===- llvm-build generated file --------------------------------*- C++ -*-===//
+//
+// Component Library Depenedency Table
+//
+// Automatically generated file, do not edit!
+//
+//===----------------------------------------------------------------------===//
+
+struct AvailableComponent {
+ /// The name of the component.
+ const char *Name;
+
+ /// The name of the library for this component (or NULL).
+ const char *Library;
+
+ /// Whether the component is installed.
+ bool IsInstalled;
+
+ /// The list of libraries required when linking this component.
+ const char *RequiredLibraries[16];
+} AvailableComponents[72] = {
+ { "aarch64", 0, 1, { "aarch64utils", "aarch64asmprinter", "aarch64info", "aarch64desc", "aarch64asmparser", "aarch64codegen", "aarch64disassembler" } },
+ { "aarch64asmparser", "libLLVMAArch64AsmParser.a", 1, { "aarch64desc", "aarch64info", "aarch64utils", "mc", "mcparser", "support" } },
+ { "aarch64asmprinter", "libLLVMAArch64AsmPrinter.a", 1, { "aarch64utils", "mc", "support" } },
+ { "aarch64codegen", "libLLVMAArch64CodeGen.a", 1, { "aarch64asmprinter", "aarch64desc", "aarch64info", "aarch64utils", "analysis", "asmprinter", "codegen", "core", "mc", "scalaropts", "selectiondag", "support", "target" } },
+ { "aarch64desc", "libLLVMAArch64Desc.a", 1, { "aarch64asmprinter", "aarch64info", "mc", "support" } },
+ { "aarch64disassembler", "libLLVMAArch64Disassembler.a", 1, { "aarch64info", "aarch64utils", "mc", "support" } },
+ { "aarch64info", "libLLVMAArch64Info.a", 1, { "support" } },
+ { "aarch64utils", "libLLVMAArch64Utils.a", 1, { "support" } },
+ { "all", 0, 1, { "mcjit", "interpreter", "mcdisassembler", "engine", "option", "debuginfo", "gtest_main", "all-targets", "irreader", "profiledata", "instrumentation", "lineeditor", "nativecodegen", "tablegen", "lto" } },
+ { "all-targets", 0, 1, { "x86", "aarch64", "arm", "mips" } },
+ { "analysis", "libLLVMAnalysis.a", 1, { "core", "support", "target" } },
+ { "arm", 0, 1, { "armasmprinter", "arminfo", "armdesc", "armasmparser", "armcodegen", "armdisassembler" } },
+ { "armasmparser", "libLLVMARMAsmParser.a", 1, { "armdesc", "arminfo", "mc", "mcparser", "support" } },
+ { "armasmprinter", "libLLVMARMAsmPrinter.a", 1, { "mc", "support" } },
+ { "armcodegen", "libLLVMARMCodeGen.a", 1, { "armasmprinter", "armdesc", "arminfo", "analysis", "asmprinter", "codegen", "core", "mc", "scalaropts", "selectiondag", "support", "target" } },
+ { "armdesc", "libLLVMARMDesc.a", 1, { "armasmprinter", "arminfo", "mc", "support" } },
+ { "armdisassembler", "libLLVMARMDisassembler.a", 1, { "armdesc", "arminfo", "mc", "support" } },
+ { "arminfo", "libLLVMARMInfo.a", 1, { "support" } },
+ { "asmparser", "libLLVMAsmParser.a", 1, { "core", "support" } },
+ { "asmprinter", "libLLVMAsmPrinter.a", 1, { "analysis", "codegen", "core", "mc", "mcparser", "support", "target", "transformutils" } },
+ { "bitreader", "libLLVMBitReader.a", 1, { "core", "support" } },
+ { "bitwriter", "libLLVMBitWriter.a", 1, { "core", "support" } },
+ { "codegen", "libLLVMCodeGen.a", 1, { "analysis", "core", "mc", "scalaropts", "support", "target", "transformutils" } },
+ { "core", "libLLVMCore.a", 1, { "support" } },
+ { "debuginfo", "libLLVMDebugInfo.a", 1, { "object", "support" } },
+ { "engine", 0, 1, { "jit", "native" } },
+ { "executionengine", "libLLVMExecutionEngine.a", 1, { "core", "mc", "support" } },
+ { "gtest", "libgtest.a", 0, { "support" } },
+ { "gtest_main", "libgtest_main.a", 0, { "gtest" } },
+ { "instcombine", "libLLVMInstCombine.a", 1, { "analysis", "core", "support", "target", "transformutils" } },
+ { "instrumentation", "libLLVMInstrumentation.a", 1, { "analysis", "core", "support", "target", "transformutils" } },
+ { "interpreter", "libLLVMInterpreter.a", 1, { "codegen", "core", "executionengine", "support" } },
+ { "ipa", "libLLVMipa.a", 1, { "analysis", "core", "support" } },
+ { "ipo", "libLLVMipo.a", 1, { "analysis", "core", "ipa", "instcombine", "scalaropts", "support", "target", "transformutils", "vectorize" } },
+ { "irreader", "libLLVMIRReader.a", 1, { "asmparser", "bitreader", "core", "support" } },
+ { "jit", "libLLVMJIT.a", 1, { "codegen", "core", "executionengine", "support" } },
+ { "lineeditor", "libLLVMLineEditor.a", 1, { "support" } },
+ { "linker", "libLLVMLinker.a", 1, { "core", "support", "transformutils" } },
+ { "lto", "libLLVMLTO.a", 1, { "bitreader", "bitwriter", "core", "ipa", "ipo", "instcombine", "linker", "mc", "mcparser", "objcarcopts", "scalaropts", "support", "target", "transformutils" } },
+ { "mc", "libLLVMMC.a", 1, { "object", "support" } },
+ { "mcdisassembler", "libLLVMMCDisassembler.a", 1, { "mc", "support" } },
+ { "mcjit", "libLLVMMCJIT.a", 1, { "core", "executionengine", "object", "runtimedyld", "support", "target" } },
+ { "mcparser", "libLLVMMCParser.a", 1, { "mc", "support" } },
+ { "mips", 0, 1, { "mipsasmprinter", "mipsinfo", "mipsdesc", "mipsasmparser", "mipscodegen", "mipsdisassembler" } },
+ { "mipsasmparser", "libLLVMMipsAsmParser.a", 1, { "mc", "mcparser", "mipsdesc", "mipsinfo", "support" } },
+ { "mipsasmprinter", "libLLVMMipsAsmPrinter.a", 1, { "mc", "support" } },
+ { "mipscodegen", "libLLVMMipsCodeGen.a", 1, { "analysis", "asmprinter", "codegen", "core", "mc", "mipsasmprinter", "mipsdesc", "mipsinfo", "scalaropts", "selectiondag", "support", "target" } },
+ { "mipsdesc", "libLLVMMipsDesc.a", 1, { "mc", "mipsasmprinter", "mipsinfo", "support" } },
+ { "mipsdisassembler", "libLLVMMipsDisassembler.a", 1, { "mc", "mipsinfo", "support" } },
+ { "mipsinfo", "libLLVMMipsInfo.a", 1, { "support" } },
+ { "native", 0, 1, { "x86" } },
+ { "nativecodegen", 0, 1, { "x86codegen" } },
+ { "objcarcopts", "libLLVMObjCARCOpts.a", 1, { "analysis", "core", "support", "transformutils" } },
+ { "object", "libLLVMObject.a", 1, { "bitreader", "core", "support" } },
+ { "option", "libLLVMOption.a", 1, { "support" } },
+ { "profiledata", "libLLVMProfileData.a", 1, { "support" } },
+ { "runtimedyld", "libLLVMRuntimeDyld.a", 1, { "object", "support" } },
+ { "scalaropts", "libLLVMScalarOpts.a", 1, { "analysis", "core", "ipa", "instcombine", "support", "target", "transformutils" } },
+ { "selectiondag", "libLLVMSelectionDAG.a", 1, { "analysis", "codegen", "core", "mc", "support", "target", "transformutils" } },
+ { "support", "libLLVMSupport.a", 1, { } },
+ { "tablegen", "libLLVMTableGen.a", 1, { "support" } },
+ { "target", "libLLVMTarget.a", 1, { "core", "mc", "support" } },
+ { "transformutils", "libLLVMTransformUtils.a", 1, { "analysis", "core", "ipa", "support", "target" } },
+ { "vectorize", "libLLVMVectorize.a", 1, { "analysis", "core", "support", "target", "transformutils" } },
+ { "x86", 0, 1, { "x86utils", "x86asmprinter", "x86info", "x86desc", "x86codegen", "x86asmparser", "x86disassembler" } },
+ { "x86asmparser", "libLLVMX86AsmParser.a", 1, { "mc", "mcparser", "support", "x86desc", "x86info" } },
+ { "x86asmprinter", "libLLVMX86AsmPrinter.a", 1, { "mc", "support", "x86utils" } },
+ { "x86codegen", "libLLVMX86CodeGen.a", 1, { "analysis", "asmprinter", "codegen", "core", "mc", "selectiondag", "support", "target", "x86asmprinter", "x86desc", "x86info", "x86utils" } },
+ { "x86desc", "libLLVMX86Desc.a", 1, { "mc", "object", "support", "x86asmprinter", "x86info" } },
+ { "x86disassembler", "libLLVMX86Disassembler.a", 1, { "mc", "support", "x86info" } },
+ { "x86info", "libLLVMX86Info.a", 1, { "support" } },
+ { "x86utils", "libLLVMX86Utils.a", 1, { "support" } },
+};