| author | |
| committer | |
| log | cd91e17b7384fe857c5cf847b106cd0f98cb4d6a |
| tree | 191f674ebfbf15cc4ec221cc2700ee6c618f7f24 |
| parent | 995fd7314cd230ca7c829bb478f88b1ab7efd7b4 |
4 files changed, 51 insertions(+), 59 deletions(-)
README.md+2-10| ... | @@ -27,7 +27,7 @@ Note that you can | ... | @@ -27,7 +27,7 @@ Note that you can |
| 27 | 27 | ||
| 28 | * cmake >= 2.8.5 | 28 | * cmake >= 2.8.5 |
| 29 | * gcc >= 5.0.0 or clang >= 3.6.0 | 29 | * gcc >= 5.0.0 or clang >= 3.6.0 |
| 30 | * LLVM, Clang, LLD development libraries == 10.x, compiled with the same gcc or clang version above | 30 | * LLVM, Clang, LLD development libraries == 11.x, compiled with the same gcc or clang version above |
| 31 | - Use the system package manager, or [build from source](https://github.com/ziglang/zig/wiki/How-to-build-LLVM,-libclang,-and-liblld-from-source#posix). | 31 | - Use the system package manager, or [build from source](https://github.com/ziglang/zig/wiki/How-to-build-LLVM,-libclang,-and-liblld-from-source#posix). |
| 32 | 32 | ||
| 33 | ##### Windows | 33 | ##### Windows |
| ... | @@ -37,7 +37,7 @@ Note that you can | ... | @@ -37,7 +37,7 @@ Note that you can |
| 37 | - 2015 (version 14) | 37 | - 2015 (version 14) |
| 38 | - 2017 (version 15.8) | 38 | - 2017 (version 15.8) |
| 39 | - 2019 (version 16) | 39 | - 2019 (version 16) |
| 40 | * LLVM, Clang, LLD development libraries == 10.x | 40 | * LLVM, Clang, LLD development libraries == 11.x |
| 41 | - Use the [pre-built binaries](https://github.com/ziglang/zig/wiki/Building-Zig-on-Windows) or [build from source](https://github.com/ziglang/zig/wiki/How-to-build-LLVM,-libclang,-and-liblld-from-source#windows). | 41 | - Use the [pre-built binaries](https://github.com/ziglang/zig/wiki/Building-Zig-on-Windows) or [build from source](https://github.com/ziglang/zig/wiki/How-to-build-LLVM,-libclang,-and-liblld-from-source#windows). |
| 42 | 42 | ||
| 43 | #### Instructions | 43 | #### Instructions |
| ... | @@ -64,14 +64,6 @@ cmake .. -DCMAKE_PREFIX_PATH=$(brew --prefix llvm) | ... | @@ -64,14 +64,6 @@ cmake .. -DCMAKE_PREFIX_PATH=$(brew --prefix llvm) |
| 64 | make install | 64 | make install |
| 65 | ``` | 65 | ``` |
| 66 | 66 | ||
| 67 | You will now run into this issue: | ||
| 68 | [homebrew and llvm 10 packages in apt.llvm.org are broken with undefined reference to getPollyPluginInfo](https://github.com/ziglang/zig/issues/4799) | ||
| 69 | or | ||
| 70 | [error: unable to create target: 'Unable to find target for this triple (no targets are registered)'](https://github.com/ziglang/zig/issues/5055), | ||
| 71 | in which case try `-DZIG_WORKAROUND_4799=ON` | ||
| 72 | |||
| 73 | Hopefully this will be fixed upstream with LLVM 10.0.1. | ||
| 74 | |||
| 75 | ##### Windows | 67 | ##### Windows |
| 76 | 68 | ||
| 77 | See https://github.com/ziglang/zig/wiki/Building-Zig-on-Windows | 69 | See https://github.com/ziglang/zig/wiki/Building-Zig-on-Windows |
cmake/Findclang.cmake+15-15| ... | @@ -9,25 +9,25 @@ | ... | @@ -9,25 +9,25 @@ |
| 9 | 9 | ||
| 10 | find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h | 10 | find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h |
| 11 | PATHS | 11 | PATHS |
| 12 | /usr/lib/llvm/10/include | 12 | /usr/lib/llvm/11/include |
| 13 | /usr/lib/llvm-10/include | 13 | /usr/lib/llvm-11/include |
| 14 | /usr/lib/llvm-10.0/include | 14 | /usr/lib/llvm-11.0/include |
| 15 | /usr/local/llvm100/include | 15 | /usr/local/llvm110/include |
| 16 | /usr/local/llvm10/include | 16 | /usr/local/llvm11/include |
| 17 | /mingw64/include | 17 | /mingw64/include |
| 18 | ) | 18 | ) |
| 19 | 19 | ||
| 20 | if(ZIG_PREFER_CLANG_CPP_DYLIB) | 20 | if(ZIG_PREFER_CLANG_CPP_DYLIB) |
| 21 | find_library(CLANG_LIBRARIES | 21 | find_library(CLANG_LIBRARIES |
| 22 | NAMES | 22 | NAMES |
| 23 | clang-cpp-10.0 | 23 | clang-cpp-11.0 |
| 24 | clang-cpp100 | 24 | clang-cpp110 |
| 25 | clang-cpp | 25 | clang-cpp |
| 26 | PATHS | 26 | PATHS |
| 27 | ${CLANG_LIBDIRS} | 27 | ${CLANG_LIBDIRS} |
| 28 | /usr/lib/llvm-10/lib | 28 | /usr/lib/llvm-11/lib |
| 29 | /usr/local/llvm100/lib | 29 | /usr/local/llvm110/lib |
| 30 | /usr/local/llvm10/lib | 30 | /usr/local/llvm11/lib |
| 31 | ) | 31 | ) |
| 32 | endif() | 32 | endif() |
| 33 | 33 | ||
| ... | @@ -37,11 +37,11 @@ if(NOT CLANG_LIBRARIES) | ... | @@ -37,11 +37,11 @@ if(NOT CLANG_LIBRARIES) |
| 37 | find_library(CLANG_${_prettylibname_}_LIB NAMES ${_libname_} | 37 | find_library(CLANG_${_prettylibname_}_LIB NAMES ${_libname_} |
| 38 | PATHS | 38 | PATHS |
| 39 | ${CLANG_LIBDIRS} | 39 | ${CLANG_LIBDIRS} |
| 40 | /usr/lib/llvm/10/lib | 40 | /usr/lib/llvm/11/lib |
| 41 | /usr/lib/llvm-10/lib | 41 | /usr/lib/llvm-11/lib |
| 42 | /usr/lib/llvm-10.0/lib | 42 | /usr/lib/llvm-11.0/lib |
| 43 | /usr/local/llvm100/lib | 43 | /usr/local/llvm110/lib |
| 44 | /usr/local/llvm10/lib | 44 | /usr/local/llvm11/lib |
| 45 | /mingw64/lib | 45 | /mingw64/lib |
| 46 | /c/msys64/mingw64/lib | 46 | /c/msys64/mingw64/lib |
| 47 | c:\\msys64\\mingw64\\lib | 47 | c:\\msys64\\mingw64\\lib |
cmake/Findlld.cmake+10-10| ... | @@ -8,16 +8,16 @@ | ... | @@ -8,16 +8,16 @@ |
| 8 | 8 | ||
| 9 | find_path(LLD_INCLUDE_DIRS NAMES lld/Common/Driver.h | 9 | find_path(LLD_INCLUDE_DIRS NAMES lld/Common/Driver.h |
| 10 | PATHS | 10 | PATHS |
| 11 | /usr/lib/llvm-10/include | 11 | /usr/lib/llvm-11/include |
| 12 | /usr/local/llvm100/include | 12 | /usr/local/llvm110/include |
| 13 | /usr/local/llvm10/include | 13 | /usr/local/llvm11/include |
| 14 | /mingw64/include) | 14 | /mingw64/include) |
| 15 | 15 | ||
| 16 | find_library(LLD_LIBRARY NAMES lld-10.0 lld100 lld | 16 | find_library(LLD_LIBRARY NAMES lld-11.0 lld110 lld |
| 17 | PATHS | 17 | PATHS |
| 18 | /usr/lib/llvm-10/lib | 18 | /usr/lib/llvm-11/lib |
| 19 | /usr/local/llvm100/lib | 19 | /usr/local/llvm110/lib |
| 20 | /usr/local/llvm10/lib | 20 | /usr/local/llvm11/lib |
| 21 | ) | 21 | ) |
| 22 | if(EXISTS ${LLD_LIBRARY}) | 22 | if(EXISTS ${LLD_LIBRARY}) |
| 23 | set(LLD_LIBRARIES ${LLD_LIBRARY}) | 23 | set(LLD_LIBRARIES ${LLD_LIBRARY}) |
| ... | @@ -27,9 +27,9 @@ else() | ... | @@ -27,9 +27,9 @@ else() |
| 27 | find_library(LLD_${_prettylibname_}_LIB NAMES ${_libname_} | 27 | find_library(LLD_${_prettylibname_}_LIB NAMES ${_libname_} |
| 28 | PATHS | 28 | PATHS |
| 29 | ${LLD_LIBDIRS} | 29 | ${LLD_LIBDIRS} |
| 30 | /usr/lib/llvm-10/lib | 30 | /usr/lib/llvm-11/lib |
| 31 | /usr/local/llvm100/lib | 31 | /usr/local/llvm110/lib |
| 32 | /usr/local/llvm10/lib | 32 | /usr/local/llvm11/lib |
| 33 | /mingw64/lib | 33 | /mingw64/lib |
| 34 | /c/msys64/mingw64/lib | 34 | /c/msys64/mingw64/lib |
| 35 | c:/msys64/mingw64/lib) | 35 | c:/msys64/mingw64/lib) |
cmake/Findllvm.cmake+24-24| ... | @@ -9,35 +9,35 @@ | ... | @@ -9,35 +9,35 @@ |
| 9 | 9 | ||
| 10 | find_path(LLVM_INCLUDE_DIRS NAMES llvm/IR/IRBuilder.h | 10 | find_path(LLVM_INCLUDE_DIRS NAMES llvm/IR/IRBuilder.h |
| 11 | PATHS | 11 | PATHS |
| 12 | /usr/lib/llvm/10/include | 12 | /usr/lib/llvm/11/include |
| 13 | /usr/lib/llvm-10/include | 13 | /usr/lib/llvm-11/include |
| 14 | /usr/lib/llvm-10.0/include | 14 | /usr/lib/llvm-11.0/include |
| 15 | /usr/local/llvm10/include | 15 | /usr/local/llvm11/include |
| 16 | /usr/local/llvm100/include | 16 | /usr/local/llvm110/include |
| 17 | /mingw64/include | 17 | /mingw64/include |
| 18 | ) | 18 | ) |
| 19 | 19 | ||
| 20 | if(ZIG_PREFER_CLANG_CPP_DYLIB) | 20 | if(ZIG_PREFER_CLANG_CPP_DYLIB) |
| 21 | find_library(LLVM_LIBRARIES | 21 | find_library(LLVM_LIBRARIES |
| 22 | NAMES | 22 | NAMES |
| 23 | LLVM-10.0 | 23 | LLVM-11.0 |
| 24 | LLVM-10 | 24 | LLVM-11 |
| 25 | LLVM-100 | 25 | LLVM-110 |
| 26 | LLVM | 26 | LLVM |
| 27 | PATHS | 27 | PATHS |
| 28 | ${LLVM_LIBDIRS} | 28 | ${LLVM_LIBDIRS} |
| 29 | /usr/lib/llvm-10/lib | 29 | /usr/lib/llvm-11/lib |
| 30 | /usr/local/llvm10/lib | 30 | /usr/local/llvm11/lib |
| 31 | /usr/local/llvm100/lib | 31 | /usr/local/llvm110/lib |
| 32 | ) | 32 | ) |
| 33 | elseif("${ZIG_TARGET_TRIPLE}" STREQUAL "native") | 33 | elseif("${ZIG_TARGET_TRIPLE}" STREQUAL "native") |
| 34 | find_program(LLVM_CONFIG_EXE | 34 | find_program(LLVM_CONFIG_EXE |
| 35 | NAMES llvm-config-10 llvm-config-10.0 llvm-config100 llvm-config10 llvm-config | 35 | NAMES llvm-config-11 llvm-config-11.0 llvm-config110 llvm-config11 llvm-config |
| 36 | PATHS | 36 | PATHS |
| 37 | "/mingw64/bin" | 37 | "/mingw64/bin" |
| 38 | "/c/msys64/mingw64/bin" | 38 | "/c/msys64/mingw64/bin" |
| 39 | "c:/msys64/mingw64/bin" | 39 | "c:/msys64/mingw64/bin" |
| 40 | "C:/Libraries/llvm-10.0.0/bin") | 40 | "C:/Libraries/llvm-11.0.0/bin") |
| 41 | 41 | ||
| 42 | if ("${LLVM_CONFIG_EXE}" STREQUAL "LLVM_CONFIG_EXE-NOTFOUND") | 42 | if ("${LLVM_CONFIG_EXE}" STREQUAL "LLVM_CONFIG_EXE-NOTFOUND") |
| 43 | message(FATAL_ERROR "unable to find llvm-config") | 43 | message(FATAL_ERROR "unable to find llvm-config") |
| ... | @@ -52,14 +52,14 @@ elseif("${ZIG_TARGET_TRIPLE}" STREQUAL "native") | ... | @@ -52,14 +52,14 @@ elseif("${ZIG_TARGET_TRIPLE}" STREQUAL "native") |
| 52 | OUTPUT_VARIABLE LLVM_CONFIG_VERSION | 52 | OUTPUT_VARIABLE LLVM_CONFIG_VERSION |
| 53 | OUTPUT_STRIP_TRAILING_WHITESPACE) | 53 | OUTPUT_STRIP_TRAILING_WHITESPACE) |
| 54 | 54 | ||
| 55 | if("${LLVM_CONFIG_VERSION}" VERSION_LESS 10) | 55 | if("${LLVM_CONFIG_VERSION}" VERSION_LESS 11) |
| 56 | message(FATAL_ERROR "expected LLVM 10.x but found ${LLVM_CONFIG_VERSION}") | 56 | message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION}") |
| 57 | endif() | 57 | endif() |
| 58 | if("${LLVM_CONFIG_VERSION}" VERSION_EQUAL 11) | 58 | if("${LLVM_CONFIG_VERSION}" VERSION_EQUAL 12) |
| 59 | message(FATAL_ERROR "expected LLVM 10.x but found ${LLVM_CONFIG_VERSION}") | 59 | message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION}") |
| 60 | endif() | 60 | endif() |
| 61 | if("${LLVM_CONFIG_VERSION}" VERSION_GREATER 11) | 61 | if("${LLVM_CONFIG_VERSION}" VERSION_GREATER 11) |
| 62 | message(FATAL_ERROR "expected LLVM 10.x but found ${LLVM_CONFIG_VERSION}") | 62 | message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION}") |
| 63 | endif() | 63 | endif() |
| 64 | 64 | ||
| 65 | execute_process( | 65 | execute_process( |
| ... | @@ -132,7 +132,7 @@ elseif("${ZIG_TARGET_TRIPLE}" STREQUAL "native") | ... | @@ -132,7 +132,7 @@ elseif("${ZIG_TARGET_TRIPLE}" STREQUAL "native") |
| 132 | set(LLVM_LIBRARIES ${LLVM_LIBRARIES} ${LLVM_SYSTEM_LIBS}) | 132 | set(LLVM_LIBRARIES ${LLVM_LIBRARIES} ${LLVM_SYSTEM_LIBS}) |
| 133 | 133 | ||
| 134 | if(NOT LLVM_LIBRARIES) | 134 | if(NOT LLVM_LIBRARIES) |
| 135 | find_library(LLVM_LIBRARIES NAMES LLVM LLVM-10 LLVM-10.0) | 135 | find_library(LLVM_LIBRARIES NAMES LLVM LLVM-11 LLVM-11.0) |
| 136 | endif() | 136 | endif() |
| 137 | 137 | ||
| 138 | link_directories("${CMAKE_PREFIX_PATH}/lib") | 138 | link_directories("${CMAKE_PREFIX_PATH}/lib") |
| ... | @@ -147,11 +147,11 @@ else() | ... | @@ -147,11 +147,11 @@ else() |
| 147 | find_library(LLVM_${_prettylibname_}_LIB NAMES ${_libname_} | 147 | find_library(LLVM_${_prettylibname_}_LIB NAMES ${_libname_} |
| 148 | PATHS | 148 | PATHS |
| 149 | ${LLVM_LIBDIRS} | 149 | ${LLVM_LIBDIRS} |
| 150 | /usr/lib/llvm/10/lib | 150 | /usr/lib/llvm/11/lib |
| 151 | /usr/lib/llvm-10/lib | 151 | /usr/lib/llvm-11/lib |
| 152 | /usr/lib/llvm-10.0/lib | 152 | /usr/lib/llvm-11.0/lib |
| 153 | /usr/local/llvm100/lib | 153 | /usr/local/llvm110/lib |
| 154 | /usr/local/llvm10/lib | 154 | /usr/local/llvm11/lib |
| 155 | /mingw64/lib | 155 | /mingw64/lib |
| 156 | /c/msys64/mingw64/lib | 156 | /c/msys64/mingw64/lib |
| 157 | c:\\msys64\\mingw64\\lib) | 157 | c:\\msys64\\mingw64\\lib) |