Commit Graph

35 Commits

Author SHA1 Message Date
Andrew Kelley
3ac8d37182 update CMake files to LLVM 18 2024-05-08 19:37:28 -07:00
Andrew Kelley
3882ce4f4b update cmake files to LLVM 17 2023-09-19 09:37:26 -07:00
Andrew Kelley
9c3bd437e6 update cmake files to LLVM 16 2023-01-25 20:26:14 -07:00
Andrew Kelley
adb4a95302 update to LLVM 15
release/15.x 37007475ca1b345b4c5d340e228bcd7a62732d81
2022-07-28 11:53:25 -07:00
Cody Tapscott
4113a790b0 CMake: Search more permissively for LLD
This change relaxes the restriction added in the prior commit that LLD
should be alongside LLVM.

This also leaves unresolved the issue of making sure the link mode
(static or shared) of LLD matches that of LLVM/Clang. That would be an
unfortunate restriction, since LLD seems to be provided only as a static
lib on some distros.
2022-07-23 08:55:56 -07:00
Cody Tapscott
3f640ef3d2 CMake: Improve usage of llvm-config, esp. for consistent linking
This commit reworks the LLVM/Clang/LLD discovery process for CMake. The
biggest changes are that:
  1. We search for LLVM from most preferred directory to least, skipping
     any `llvm-config` that is the wrong version, or that doesn't
     support the requested link mode ("static" or "shared").
  2. `ZIG_PREFER_CLANG_CPP_DYLIB` has been renamed to `ZIG_SHARED_LLVM`,
     to better align with `ZIG_STATIC_LLVM`.
  3. We only search for LLVM in the same directory alongside LLVM.
  4. LLVM's link mode is forwarded to Clang, so that we can look for the
     appropriate shared/static libraries.
  5. We use `--link-static` when querying `--system-libs` from llvm-config,
     so that this will include libz and other dependencies for
     statically linking LLD
2022-07-23 08:52:30 -07:00
Cody Tapscott
dd70336f3a CMake: Use NAMES_PER_DIR in all lookups
CMake has a surprising default behavior where looking up a library by
multiple names gives the name order higher priority than the directory
search order.

For example, if your system provides "llvm-config-14" and
CMAKE_PREFIX_PATH includes "llvm-config", CMake will always end up
choosing the system-provided llvm-config-14.

This change add NAMES_PER_DIR to request the more sensible behavior:
directory search order has higher priority than name order, so
CMAKE_PREFIX_PATH always wins over system-provided tools/libraries.
2022-07-14 22:18:10 -04:00
Andrew Kelley
ae0b0729fc LLD: there are fewer libraries to link against now 2022-07-01 22:13:12 -07:00
Andrew Kelley
c89dd15e1b Merge remote-tracking branch 'origin/master' into llvm14 2022-07-01 15:52:54 -07:00
Kazuki Sakamoto
64f7231f86 stage1: Fix missing LLD library 2022-02-04 01:45:44 -05:00
Andrew Kelley
308f72701a update cmake files to LLVM 14 2022-02-03 13:38:48 -07:00
Andrew Kelley
f3ebfcae38 Merge remote-tracking branch 'origin/master' into llvm13
Conflicts:

 * cmake/Findclang.cmake
 * cmake/Findlld.cmake
 * cmake/Findllvm.cmake

In master branch, more search paths were added to these files with "12"
in the path. In this commit I updated them to "13".

 * src/stage1/codegen.cpp
 * src/zig_llvm.cpp
 * src/zig_llvm.h

In master branch, ZigLLVMBuildCmpXchg is improved to add
`is_single_threaded`. However, the LLVM 13 C API has this already, and
in the llvm13 branch, ZigLLVMBuildCmpXchg is deleted in favor of the C
API. In this commit I updated stage2 to use the LLVM 13 C API rather
than depending on an improved ZigLLVMBuildCmpXchg.

Additionally, src/target.zig largestAtomicBits needed to be updated to
include the new m68k ISA.
2021-09-15 14:51:08 -07:00
FnControlOption
23c25c5eaf cmake: also check Homebrew install paths when looking for LLVM
- On Intel Macs, the path is /usr/local/opt/llvm@12
- On Silicon Macs, the path is /opt/homebrew/opt/llvm@12

This makes specifying CMAKE_PREFIX_PATH optional for Homebrew LLVM.
2021-09-08 13:48:16 -04:00
Andrew Kelley
78ff2a148a cmake: update to LLVM 13 rc1
More precisely, aac4fe380d16a957627af2d6e5110ee35ad7e7e7 which is the
current tip of release/13.x.

Immediately following commits are tracking the same LLVM version.
2021-08-15 17:48:37 -07:00
Jakub Konka
0e15205521 Remove mention of lldMachO from the project
including:
* finding lldMachO in CMake config
* punting `ld64.lld` to LLD linker
* providing bindings to LLD linker
2021-06-29 23:38:19 +02:00
Jakub Konka
9c2d8056ce Update LLVM version numbers in CMake 2020-12-16 09:37:32 +01:00
Andrew Kelley
cd91e17b73 update LLVM 10 version numbers to 11 2020-07-24 16:49:43 -07:00
Michael Neumann
7a829a7015 Fix paths to find llvm/clang on DragonFly 2020-04-07 17:13:33 +02:00
Brian Cain
607892a30d Create an "LLD_LIBDIRS" var to override lld loc 2020-03-30 11:01:36 -04:00
Michael Dusan
9cc593ca78
cmake: address new warnings from cmake-3.17
Match package-name case from CMakeLists.txt .

New warning sample:

    The package name passed to `find_package_handle_standard_args` (LLVM) does
    not match the name of the calling package (llvm).  This can lead to
    problems in calling code that expects `find_package` result variables
    (e.g., `_FOUND`) to follow a certain pattern.
2020-03-25 18:43:28 -04:00
LemonBoy
935cce2414 Fix lld search path 2019-10-12 15:27:42 +02:00
Andrew Kelley
6f10e3fda6
llvm 9.0.0 => llvm 10.0.0 2019-10-02 02:11:46 -04:00
Andrew Kelley
8f92a49dfd
update to llvm9 trunk 2019-07-16 22:23:48 -04:00
Andrew Kelley
c00216701c Merge remote-tracking branch 'origin/master' into llvm8 2018-12-23 17:04:26 -05:00
Andrew Kelley
dd2450b1b2
tier 2 support for freebsd 2018-11-27 20:56:43 -05:00
Greg V
24e54799fd Fix CMake finding LLVM/clang/lld on FreeBSD 2018-10-20 15:15:01 +03:00
Andrew Kelley
a4d61b5d72 update to llvm 8 2018-09-19 17:34:52 -04:00
Andrew Kelley
84a700f972 llvm7: find external liblldWasm and update for newest lld macho API 2018-06-14 18:28:42 -04:00
Andrew Kelley
94ec2190f8 update to llvm master 2017-11-02 21:54:24 -04:00
Andrew Kelley
234030c37a update build to look for llvm 5.0 2017-08-26 00:34:40 -04:00
Andrew Kelley
e64f0971fc add appveyor integration testing 2017-06-03 12:47:23 -04:00
Andrew Kelley
f043e0e85c build: ignore libLLD.so when it is a broken symlink
closes #318
2017-04-13 00:12:44 -04:00
Andrew Kelley
403eb92a62 try harder to find lld 2017-04-11 06:44:45 -04:00
Josh Wolfe
536c35136a fix cmake finding dependencies for ubuntu 2017-03-29 22:18:12 -07:00
Andrew Kelley
d10bbd28e9 use lld instead of system linker 2017-03-13 11:54:56 -04:00