diff options
author | Petr Bred <bredpetr@gmail.com> | 2017-11-08 20:12:40 +0300 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2017-11-08 20:12:40 +0300 |
commit | 5a681f144f83b12a797d4cdc04d51b3c6c10c9a1 (patch) | |
tree | c552ae16b70331b27c44fcdd2aafc37caee13f23 /Documentation | |
parent | 32f6384de33e4e42c54cbee3509a9da3783f78bb (diff) |
ObjWriter integration (#4891)
- remove CoreCLR dependence
- fix build with the latest LLVM 5 version
- add documentation
Signed-off-by: Petr Bred <bredpetr@gmail.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/how-to-build-ObjectWriter.md | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Documentation/how-to-build-ObjectWriter.md b/Documentation/how-to-build-ObjectWriter.md new file mode 100644 index 000000000..a848a02ce --- /dev/null +++ b/Documentation/how-to-build-ObjectWriter.md @@ -0,0 +1,40 @@ +# Build ObjectWriter library # + +ObjWriter is based on LLVM, so it requires recent CMake and GCC/Clang to build LLVM. +See http://llvm.org/docs/GettingStarted.html#requirements for more details. + +1. Clone LLVM from official LLVM mirror github git repository: + + ``` + $ git clone -b release_50 https://github.com/llvm-mirror/llvm.git + ``` + +2. Copy ObjWriter directory from CoreRT into LLVM tree + + ``` + $ cp -r CoreRT/src/Native/ObjWriter llvm/tools/ + ``` + +3. Apply the patch to LLVM: + + ``` + $ cd llvm + $ git apply tools/ObjWriter/llvm.patch + ``` + +4. Configure and build LLVM with ObjWriter: + + ``` + $ mkdir build + $ cd build + $ cmake ../ -DCMAKE_BUILD_TYPE=Release -DLLVM_OPTIMIZED_TABLEGEN=1 -DHAVE_POSIX_SPAWN=0 -DLLVM_ENABLE_PIC=1 -DLLVM_BUILD_TESTS=0 -DLLVM_ENABLE_DOXYGEN=0 -DLLVM_INCLUDE_DOCS=0 -DLLVM_INCLUDE_TESTS=0 + $ make -j10 objwriter + $ cd .. + ``` + +* You can change the building type(CMAKE_BUILD_TYPE) to the debugging type(Debug), if necessary to debug ObjWriter. +* Also, you can do this under chroot to building ObjWriter for other platforms. + +5. Get ObjWriter: + + If all goes well, the build will complete in the previous step and you will get ObjWriter library as llvm/build/lib/libobjwriter.so |