Skip to content

Commit

Permalink
update LLVM 10 version numbers to 11
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrk committed Jul 24, 2020
1 parent 995fd73 commit cd91e17
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 59 deletions.
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Note that you can

* cmake >= 2.8.5
* gcc >= 5.0.0 or clang >= 3.6.0
* LLVM, Clang, LLD development libraries == 10.x, compiled with the same gcc or clang version above
* LLVM, Clang, LLD development libraries == 11.x, compiled with the same gcc or clang version above
- 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).

##### Windows
Expand All @@ -37,7 +37,7 @@ Note that you can
- 2015 (version 14)
- 2017 (version 15.8)
- 2019 (version 16)
* LLVM, Clang, LLD development libraries == 10.x
* LLVM, Clang, LLD development libraries == 11.x
- 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).

#### Instructions
Expand All @@ -64,14 +64,6 @@ cmake .. -DCMAKE_PREFIX_PATH=$(brew --prefix llvm)
make install
```

You will now run into this issue:
[homebrew and llvm 10 packages in apt.llvm.org are broken with undefined reference to getPollyPluginInfo](https://github.com/ziglang/zig/issues/4799)
or
[error: unable to create target: 'Unable to find target for this triple (no targets are registered)'](https://github.com/ziglang/zig/issues/5055),
in which case try `-DZIG_WORKAROUND_4799=ON`

Hopefully this will be fixed upstream with LLVM 10.0.1.

##### Windows

See https://github.com/ziglang/zig/wiki/Building-Zig-on-Windows
30 changes: 15 additions & 15 deletions cmake/Findclang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@

find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h
PATHS
/usr/lib/llvm/10/include
/usr/lib/llvm-10/include
/usr/lib/llvm-10.0/include
/usr/local/llvm100/include
/usr/local/llvm10/include
/usr/lib/llvm/11/include
/usr/lib/llvm-11/include
/usr/lib/llvm-11.0/include
/usr/local/llvm110/include
/usr/local/llvm11/include
/mingw64/include
)

if(ZIG_PREFER_CLANG_CPP_DYLIB)
find_library(CLANG_LIBRARIES
NAMES
clang-cpp-10.0
clang-cpp100
clang-cpp-11.0
clang-cpp110
clang-cpp
PATHS
${CLANG_LIBDIRS}
/usr/lib/llvm-10/lib
/usr/local/llvm100/lib
/usr/local/llvm10/lib
/usr/lib/llvm-11/lib
/usr/local/llvm110/lib
/usr/local/llvm11/lib
)
endif()

Expand All @@ -37,11 +37,11 @@ if(NOT CLANG_LIBRARIES)
find_library(CLANG_${_prettylibname_}_LIB NAMES ${_libname_}
PATHS
${CLANG_LIBDIRS}
/usr/lib/llvm/10/lib
/usr/lib/llvm-10/lib
/usr/lib/llvm-10.0/lib
/usr/local/llvm100/lib
/usr/local/llvm10/lib
/usr/lib/llvm/11/lib
/usr/lib/llvm-11/lib
/usr/lib/llvm-11.0/lib
/usr/local/llvm110/lib
/usr/local/llvm11/lib
/mingw64/lib
/c/msys64/mingw64/lib
c:\\msys64\\mingw64\\lib
Expand Down
20 changes: 10 additions & 10 deletions cmake/Findlld.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@

find_path(LLD_INCLUDE_DIRS NAMES lld/Common/Driver.h
PATHS
/usr/lib/llvm-10/include
/usr/local/llvm100/include
/usr/local/llvm10/include
/usr/lib/llvm-11/include
/usr/local/llvm110/include
/usr/local/llvm11/include
/mingw64/include)

find_library(LLD_LIBRARY NAMES lld-10.0 lld100 lld
find_library(LLD_LIBRARY NAMES lld-11.0 lld110 lld
PATHS
/usr/lib/llvm-10/lib
/usr/local/llvm100/lib
/usr/local/llvm10/lib
/usr/lib/llvm-11/lib
/usr/local/llvm110/lib
/usr/local/llvm11/lib
)
if(EXISTS ${LLD_LIBRARY})
set(LLD_LIBRARIES ${LLD_LIBRARY})
Expand All @@ -27,9 +27,9 @@ else()
find_library(LLD_${_prettylibname_}_LIB NAMES ${_libname_}
PATHS
${LLD_LIBDIRS}
/usr/lib/llvm-10/lib
/usr/local/llvm100/lib
/usr/local/llvm10/lib
/usr/lib/llvm-11/lib
/usr/local/llvm110/lib
/usr/local/llvm11/lib
/mingw64/lib
/c/msys64/mingw64/lib
c:/msys64/mingw64/lib)
Expand Down
48 changes: 24 additions & 24 deletions cmake/Findllvm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,35 @@

find_path(LLVM_INCLUDE_DIRS NAMES llvm/IR/IRBuilder.h
PATHS
/usr/lib/llvm/10/include
/usr/lib/llvm-10/include
/usr/lib/llvm-10.0/include
/usr/local/llvm10/include
/usr/local/llvm100/include
/usr/lib/llvm/11/include
/usr/lib/llvm-11/include
/usr/lib/llvm-11.0/include
/usr/local/llvm11/include
/usr/local/llvm110/include
/mingw64/include
)

if(ZIG_PREFER_CLANG_CPP_DYLIB)
find_library(LLVM_LIBRARIES
NAMES
LLVM-10.0
LLVM-10
LLVM-100
LLVM-11.0
LLVM-11
LLVM-110
LLVM
PATHS
${LLVM_LIBDIRS}
/usr/lib/llvm-10/lib
/usr/local/llvm10/lib
/usr/local/llvm100/lib
/usr/lib/llvm-11/lib
/usr/local/llvm11/lib
/usr/local/llvm110/lib
)
elseif("${ZIG_TARGET_TRIPLE}" STREQUAL "native")
find_program(LLVM_CONFIG_EXE
NAMES llvm-config-10 llvm-config-10.0 llvm-config100 llvm-config10 llvm-config
NAMES llvm-config-11 llvm-config-11.0 llvm-config110 llvm-config11 llvm-config
PATHS
"/mingw64/bin"
"/c/msys64/mingw64/bin"
"c:/msys64/mingw64/bin"
"C:/Libraries/llvm-10.0.0/bin")
"C:/Libraries/llvm-11.0.0/bin")

if ("${LLVM_CONFIG_EXE}" STREQUAL "LLVM_CONFIG_EXE-NOTFOUND")
message(FATAL_ERROR "unable to find llvm-config")
Expand All @@ -52,14 +52,14 @@ elseif("${ZIG_TARGET_TRIPLE}" STREQUAL "native")
OUTPUT_VARIABLE LLVM_CONFIG_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)

if("${LLVM_CONFIG_VERSION}" VERSION_LESS 10)
message(FATAL_ERROR "expected LLVM 10.x but found ${LLVM_CONFIG_VERSION}")
if("${LLVM_CONFIG_VERSION}" VERSION_LESS 11)
message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION}")
endif()
if("${LLVM_CONFIG_VERSION}" VERSION_EQUAL 11)
message(FATAL_ERROR "expected LLVM 10.x but found ${LLVM_CONFIG_VERSION}")
if("${LLVM_CONFIG_VERSION}" VERSION_EQUAL 12)
message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION}")
endif()
if("${LLVM_CONFIG_VERSION}" VERSION_GREATER 11)
message(FATAL_ERROR "expected LLVM 10.x but found ${LLVM_CONFIG_VERSION}")
message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION}")
endif()

execute_process(
Expand Down Expand Up @@ -132,7 +132,7 @@ elseif("${ZIG_TARGET_TRIPLE}" STREQUAL "native")
set(LLVM_LIBRARIES ${LLVM_LIBRARIES} ${LLVM_SYSTEM_LIBS})

if(NOT LLVM_LIBRARIES)
find_library(LLVM_LIBRARIES NAMES LLVM LLVM-10 LLVM-10.0)
find_library(LLVM_LIBRARIES NAMES LLVM LLVM-11 LLVM-11.0)
endif()

link_directories("${CMAKE_PREFIX_PATH}/lib")
Expand All @@ -147,11 +147,11 @@ else()
find_library(LLVM_${_prettylibname_}_LIB NAMES ${_libname_}
PATHS
${LLVM_LIBDIRS}
/usr/lib/llvm/10/lib
/usr/lib/llvm-10/lib
/usr/lib/llvm-10.0/lib
/usr/local/llvm100/lib
/usr/local/llvm10/lib
/usr/lib/llvm/11/lib
/usr/lib/llvm-11/lib
/usr/lib/llvm-11.0/lib
/usr/local/llvm110/lib
/usr/local/llvm11/lib
/mingw64/lib
/c/msys64/mingw64/lib
c:\\msys64\\mingw64\\lib)
Expand Down

0 comments on commit cd91e17

Please sign in to comment.