- Added support for building with Clang and LLD
- Switched to use csc.exe Roslyn compiler under Mono
- Disable most of the support for explicit pre-C++11 ABI since we do not
need it anymore
Compiler kind (always gcc for now) and version (4.8/4.9/5/6/7) is now always included in llvm package name. Additionally if `--no-cxx11-abi` flag is passed to premake then package name will end wiht "-no-cxx11".
Prebuilt LLVM binaries package for CI needs renaming to `llvm-9bde5f-linux-x64-gcc-4.8-Release.tar.xz`.
This change prevents premake from inserting /usr/lib64 search path on linux. GCC does not need this path specified compiler automatically knows where to look for system libs. Insertion of this path causes issues system has clang/llvm libs installed. Build would link to system libraries instead of custom required by CppSharp.
Also this patch revealed that linking to `pthread`, `z` and `tinfo` libraries on linux is not necessary and disabling them in LLVM build config works. Linking to these libs was removed. As you probably have guessed in the past CppSharp would throw `DllNotFoundException` due to missing symbols because it linked to system LLVM libs, not custom in-tree LLVM build.
GCC version is checked, if version is 4.8 or lower then cxx11 ABI is disabled. Added new `--no-cxx11-abi` option. It explicitly disables cxx11 ABI even on new compilers. This option is also taken into account when building LLVM.
Link `pthread` and `z` on linux as well. Link `tinfo` if `/usr/lib/libtinfo.so` file exists. This is required because despite explicitly disabling these libs in LLVM build config they still somehow get pulled in on some systems. `pthread` and `z` are standard components of every linux distribution therefore linking them unconditionally is OK. `tinfo` may not exist on some systems therefore it's existence is checked first. With this patch finally builds produced on Archlinux no longer result in `DllNotFoundException`.
`get_llvm_build_dir()` returns directory `<llvm_dir>/build`. It is incorrect when using non-packaged LLVM build, because LLVM is built into `'deps/llvm/'..get_llvm_package_name()`. This change fixes issue where using unpackaged LLVM build resulted in `error: ‘StrictFP’ is not a member of ‘llvm::Attribute’`.
These libs are not used by current official CppSharp binary distributions of LLVM, however building LLVM locally will pick these libs up and link to them if they are installed on local system. Since premake does not link to any of those libs linking to local LLVM build will cause `DllNotFoundException` due to missing symbols.
In some environments mono defaults building managed targets in architecture different from the host (like AnyCPU or x86 on x64 host). For example on x64 host (linux) build system would produce i686 architecture managed executables while native libraries are built as amd64. In such case managed executables are unable to load native libraries because they target different native architectures. This change ensures architecture consistency between all built binaries.