-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
llvm build failure #16215
Comments
Hello @NickStrupat, |
Thank you @yurybura for your kind help and effort! |
So that build worked, but when I compile against it with
Wondering if you've seen that before or know off the top of your head how to address that? My CMakeLists.txt incase that gives any quick hints: cmake_minimum_required (VERSION 3.8)
set(INCLUDE_DIR "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
message(${INCLUDE_DIR})
include_directories(${INCLUDE_DIR})
find_package(LLD CONFIG REQUIRED)
find_package(LLVM CONFIG REQUIRED)
add_executable (main "main.cpp" )
target_link_libraries(main PRIVATE lldELF lldCOFF lldCore lldWasm)
target_link_libraries(main PRIVATE LTO LLVMMC grpc++ LLVMLTO) ...and my main.cpp is... #include "llvm/ADT/APFloat.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Verifier.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Host.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
using namespace llvm;
int main()
{
LLVMContext context;
Module module("Module", context);
IRBuilder<> builder(context);
// Initialize the target registry etc.
InitializeAllTargetInfos();
InitializeAllTargets();
InitializeAllTargetMCs();
InitializeAllAsmParsers();
InitializeAllAsmPrinters();
auto targetTriple = sys::getDefaultTargetTriple();
module.setTargetTriple(targetTriple);
return 0;
} |
I just removed |
@yurybura I know this is off-topic, but do you happen to know where I can find an example or even a tutorial showing how to use LLD programmatically? You seem to have a strong handle on LLVM in general. I'm hoping to put together a basic front-to-back example of using the LLVM builder and then going all the way to linking an executable binary. So many of the examples I've found seem to gloss over at least a few things. I've gotten as far as outputting an object file for a given module, but I can't find anything about integrating the linker without |
@NickStrupat Unfortunately, I don't know better documentation for programmable API than the source code. Later you may try to use LLD as is for linking your binary from the LLVM module (IR). |
* fix issue #16215 * add more projects and fix issue #16222 * add version * exclude libc from default projects * remove libc, add fland to default projects * update to v11.1.0 * fix compiler-rt install path * fix SHA for version 11.1.0 * fix libc++ install * re-fix libc++ install * fix pstl install * fix flang's license file name * install tools in tools/llvm, fix file names * revert bin directory for libraries * don't create clang sub-directory in llvm/tools * overwrite version * copy tool dependencies * overwrite version * remove vcpkg_copy_tools call * overwrite version * restore default features * overwrite version * overwrite version * convert manifest to json * install usage files * overwrite version * remove feature `default-projects` * modernize CMake in usage files * overwrite version * update ordering * override version
Host Environment
To Reproduce
Steps to reproduce the behavior:
.\vcpkg.exe install --triplet x64-windows llvm[core,lld,target-x86]
Failure logs
The text was updated successfully, but these errors were encountered: