Commit graph

72 commits

Author SHA1 Message Date
Martin Kinkelin
48dc005c88 CMake: Fix hacky way of determining LLVM libs for jit-rt
Fixing issues like #3079 and the recent regression with Ubuntu 19.10 and
its LLVM 9 (CircleCI).
2019-10-21 00:46:47 +02:00
Johan Engelen
a5c453f766 Fix CMake configuring with LLVM 10 (current trunk) 2019-10-16 22:53:46 +02:00
Martin Kinkelin
8bd540e114 CMake: Find LLVMSPIRVLib library if built in-tree 2019-03-02 19:54:36 +01:00
Martin Kinkelin
0e00487efe FindLLVM.cmake: Add llvm-config for v7.0 and v8.0 2018-11-02 02:53:39 +01:00
Martin Kinkelin
c0d269d5d9 Support clang on Windows
E.g., via:

cmake -G Ninja -DCMAKE_C_COMPILER:PATH=clang-cl.exe
               -DCMAKE_CXX_COMPILER:PATH=clang-cl.exe
2018-10-26 23:57:03 +02:00
Martin
2d3deda639 CMake: Try to fix linking with the LLVMWindowsManifest library 2018-03-25 18:22:08 +02:00
Johan Engelen
6ff5433cc8
Make base LLVM version available in LDC code. (#2522) 2018-01-21 14:12:19 +01:00
Johan Engelen
f338b559ff CMake: use llvm-config to determine LLVM's cmake directory, if possible.
This should fix https://github.com/NixOS/nixpkgs/issues/33127
2018-01-05 17:30:32 +01:00
kinke
f4038aab7c Merge pull request #2279 from kinke/cmake2
[MSVC] CMake: Prepare for LLVM 5.0
2017-08-19 21:58:13 +02:00
Nicholas Wilson
f27109c8e8 New spirv and 6.0 compilation fixes (#2276)
Update to a new SPIRV-LLVM and fix compilation issues for LLVM6.0
2017-08-18 15:23:56 +08:00
Martin
acfa2dfb1c [MSVC] CMake: Prepare for LLVM 5.0
Some LLVM libs were missing from the linker flags for current LLVM 5.0.
It was only during troubleshooting that I noticed the MSVC special case in
FindLLVM.cmake. Getting rid of it entirely made the issues disappear. I
checked llvm-config.exe, and it's returning appropriate switches for the
MS toolchain, no need for special processing.

This apparently also leads to LLVM_CXXFLAGS being used for the first time
when building with MSVC. These include /W4, a level further up from
CMake's default /W3, so I disabled a few more frequent warnings.

I also had to link in a lib from Microsoft's Debug Info Access SDK
manually. As the VS command prompt unfortunately doesn't even include the
DIA SDK dir in the LIBPATH environment variable, I even had to specify a
full path, relying on the `VSINSTALLDIR` environment variable.
2017-08-17 23:49:37 +02:00
Martin
1fb269f940 Drop support for LLVM < 3.7 2017-07-16 02:18:00 +02:00
kinke
1dfe11c961 Merge pull request #2030 from kinke/crossLib
Enable cross-static-lib generation for LLVM 3.9+
2017-04-08 20:25:13 +02:00
Johan Engelen
fd84666def Travis LLVM 4.0 + CircleCI LLVM trunk (#2031)
* Travis: add LLVM 4.0 testing

* CMake: remove the `-Wstring-conversion` cxxflag, added in LLVM 4.0, that is not recognized by gcc-4.9 on Travis.

* CircleCI: With Travis testing 4.0, move CircleCI back to testing LLVM trunk
2017-03-19 13:12:17 +01:00
Martin
ad3294b3ae Enable cross-static-lib generation for LLVM 3.9+
By directly integrating LLVM's `llvm-lib.exe` driver to generate static
libs for MSVC targets and a stripped-down version of the `llvm-ar` tool
for the other targets.

Introduce command-line option `-archiver=<file>` to allow the user to
specify an external archiver to be invoked.
2017-03-12 03:56:46 +01:00
Martin
c5565d7955 Clean up FindLLVM.cmake a bit 2017-03-11 21:25:38 +01:00
Johan Engelen
4e671e1ca3 Add support for LLVM 5.0 (current LLVM trunk) (#1985) 2017-01-25 20:36:20 +01:00
Johan Engelen
0e34826757 CMake: add version check to findLLVM (#1940) 2016-12-22 18:09:56 +01:00
Rainer Schuetze
cd4bc7cc02 fix build with LLVM 4.0: debuginfomsf needed by debuginfocodeview 2016-09-20 08:36:32 +02:00
Johan Engelen
d63d3794db [CMake] Add new LLVM versions to FindLLVM.cmake. 2016-09-04 12:47:34 +02:00
David Nadlinger
dea2bfbfe0 cmake: Print useful message instead of regex error on invalid llvm-config 2016-07-26 18:49:05 +01:00
Johan Engelen
cc2f7c8121 Fix FindLLVM for LLVM 4.0 2016-07-19 17:47:59 +02:00
Kai Nacke
ed79298915 Merge pull request #1507 from redstar/cmakellvm
LLVM/MSVC: Use library path to search for LLVM libraries.
2016-05-20 23:04:43 +02:00
Kai Nacke
22e2928005 LLVM/MSVC: Use library path to search for LLVM libraries.
For MSVC each LLVM library was prefixed with the absolute path of the
library location. This leads to problems with the command line length.

This PR uses "-LIBPATH:" as link flag for the LLVM libraries and
only appends the suffix .lib to the library names.

It is important to handle the command line options in the right way.
Otherwise spaces in paths may be lost.

A special problem is the automatic conversion of linker options starting
with "-" to "/". If the linker argument does not start with "-" then the
argument is not considered as a link flag. On the other hand if "-" is
used then the prepending of "-L" for LDC does not generate a valid option.
2016-05-20 22:22:38 +02:00
Kai Nacke
41a9dcecea LLVM: Prevent linking error if linking against AMDGPU target.
As usual the AMDGPUUtils library is missing in the list of libraries.
2016-05-20 21:34:22 +02:00
Kai Nacke
4bc9610611 Revert "LLVM: Use /LIBPATH for MSVC"
This reverts commit f35b45b823.
2016-05-20 20:25:33 +02:00
Kai Nacke
f35b45b823 LLVM: Use /LIBPATH for MSVC
For MSVC each LLVM library was prefixed with the absolute path of the
library location. This leads to problems with the command line length.

This PR uses "/LIBPATH:..." as link flag for the LLVM libraries and
only appends the suffix .lib to the library names.
2016-05-19 22:46:27 +02:00
Kai Nacke
cb0f2e7e6a Fix space handling for different paths.
E.g. on my machine LLVM is installed in folder C:\My Program Files\LLVM.

Fixes part of issue #1465. (PR 1466 is required for complete fix.)
2016-05-16 00:12:27 +02:00
Johan Engelen
b025e37bbd Also match LLVMTableGen when full paths are used. Fixes build. 2016-03-21 19:36:47 +01:00
Kai Nacke
c987863b60 LLVM: Add -lLLVMTableGen if linking against shared LLVM library
The problem is that `llvm-config --libs tablegen` returns `-lLLVM-3.8.0` but the
code of the tablegen component is not included in this library.
Current solution is to add `-lLLVMTableGen` to the list of libraries.
2016-03-18 18:11:13 +01:00
Kai Nacke
1af1d07cde LLVM 3.9: Add new library globalisel 2016-03-12 15:23:53 +01:00
Kai Nacke
e9b2b46540 FindLLVM: Add new search path for LLVM 3.9 2016-02-20 20:45:45 +01:00
Kai Nacke
1672216cc2 Add gccbuiltins_*.di for more supported targets.
These are: AArch64, ARM, Mips, PowerPC, SystemZ and X86.
2016-02-07 21:17:53 +01:00
Kai Nacke
998510424c cmake: Remove old dependencies from FindLLVM and ...
add support for new component debuginfocodeview.
2016-01-30 00:53:36 +01:00
Dan Olson
0b63c58a8b cmake: Detect if llvm assertions enabled
Set cmake var LLVM_ENABLE_ASSERTIONS based on llvm-config
--assertion-mode.
2016-01-20 22:22:47 -08:00
Kai Nacke
4d906ec336 Add support for LLVM 3.9 in FindLLVM.cmake 2016-01-17 09:55:37 +01:00
Kai Nacke
4d44c3e961 Fix linking with LLVM shared libraries.
Uses llvm-config --libs and special treatment for TableGen library.
2015-10-09 23:03:38 +02:00
Kai Nacke
992fc7b318 Autodetect LLVM 3.8. 2015-10-09 22:58:48 +02:00
Kai Nacke
5bdfce69ec Remove component ipa if building LDC with LLVM 3.8.
This fixes issue #1125.
2015-09-26 18:14:42 +02:00
Kai Nacke
f104af4462 Revert "LLVM 3.7: Add new component mir"
This reverts commit f1c3c3a81f.

The LLVM commit was reverted.
2015-05-23 02:10:15 +02:00
Kai Nacke
f1c3c3a81f LLVM 3.7: Add new component mir 2015-05-22 21:42:41 +02:00
kai
e4b0afb3c2 Add llvm-config-3.7 to list of names 2015-02-17 23:32:18 +01:00
kai
c04537903e LLVM 3.7: Component DebugInfo is now named DebugInfoDWARF.
It's only a change in the build system. This is in preparation for PDB debug info.
2015-02-03 07:11:16 +01:00
Kai Nacke
10be3b836c Fix mingw build script.
LLVM 3.5 requires use of C++11. The gcc compiler requires a flag to use C++11.
The easiest way to pass this flags is to uses the flags returend by llvm-config.
Using llvm-config with mingw requires some path fiddeling because of the mixed
Windows and Unix conventions.
2014-11-04 06:36:39 +01:00
Toby Chen
0840bccfab Work around for LLVM not including AArch64Utils
Similar to LLVM bug 21016, the LLVMAArch64Utils.lib is also missing form
the llvm cmake config script when building on MSVC.
2014-10-12 15:30:55 -04:00
Andreas Hollandt
a2e53feaec fix CMP0054 policy warnings 2014-10-02 14:36:51 +02:00
kai
c27f5a5c9f Work around for LLVM bug 21016.
LLVMX86Utils is missing from target library list for target X86.
Affects only MSVC build.
2014-09-27 02:05:20 +02:00
Kai Nacke
813d514243 Fix deprecation warning 2014-09-21 00:12:34 +02:00
Kai Nacke
76281458db Several changes to CMakeLists.txt and FindLLVM.cmake
- Fix typo in comment
- Removes traces from LLVM 3.0 support
- Fix the regular expression used to match LLVM version
- Add support for LLVM 3.6 config tool
2014-09-21 00:10:59 +02:00
Guillaume Ballet
eb32c672a4 Make sure LLVM_LDFLAGS doesn't contain any new line as this breaks the build 2014-07-28 16:09:28 +02:00