From 4f178dfd7c98d391a2998db4caf74efa838324a0 Mon Sep 17 00:00:00 2001 From: Sylvain Corlay Date: Sat, 29 Oct 2022 22:27:32 +0200 Subject: [PATCH 1/3] Upgrade to cling 0.9 --- .appveyor.yml | 2 +- environment-host.yml | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 918adef3..ba28ec34 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -27,7 +27,7 @@ install: - conda update -q conda - conda info -a # Install dependencies - - conda install cmake dirent xeus-zmq=1.0.0 cling=0.8 clangdev=5 llvmdev=5 nlohmann_json cppzmq xtl=0.7 pugixml cxxopts=2.1.2 doctest>=2.4.6 -c conda-forge + - conda install cmake dirent xeus-zmq=1.0.0 cling=0.9 nlohmann_json cppzmq xtl=0.7 pugixml cxxopts=2.1.2 doctest>=2.4.6 zlib -c conda-forge # Build and install xeus-cling - mkdir build - cd build diff --git a/environment-host.yml b/environment-host.yml index f5b81dea..8ac15ab9 100644 --- a/environment-host.yml +++ b/environment-host.yml @@ -6,9 +6,7 @@ dependencies: - cmake # Host dependencies - xeus-zmq=1.0.0 - - cling=0.8 - - clangdev=5 - - llvmdev=5 + - cling=0.9 - nlohmann_json - cppzmq - xtl=0.7 From 172f10e5ea13c049ba96acf936d644d3dc446e36 Mon Sep 17 00:00:00 2001 From: Sylvain Corlay Date: Sun, 30 Oct 2022 18:34:48 +0100 Subject: [PATCH 2/3] Fixup build --- .azure-pipelines/unix-build.yml | 2 -- src/xmagics/executable.cpp | 10 ++++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.azure-pipelines/unix-build.yml b/.azure-pipelines/unix-build.yml index 35840ff6..7139c0ee 100644 --- a/.azure-pipelines/unix-build.yml +++ b/.azure-pipelines/unix-build.yml @@ -46,8 +46,6 @@ steps: - script: | source activate xeus-cling conda remove libcxx --force # Workaround for https://github.com/conda-forge/clangdev-feedstock/issues/188 impacting conda package for clangdev 5 - export SDKROOT=`xcrun --sdk macosx --show-sdk-path` - echo "SDKROOT = $SDKROOT" py.test . -v; condition: eq('${{ parameters.platform }}', 'OSX') displayName: Test xeus-cling (Python) diff --git a/src/xmagics/executable.cpp b/src/xmagics/executable.cpp index d63a024f..c3da11ae 100644 --- a/src/xmagics/executable.cpp +++ b/src/xmagics/executable.cpp @@ -131,7 +131,7 @@ namespace xcpp // Generate relocations suitable for dynamic linking. auto CodeGenOpts = CI->getCodeGenOpts(); - CodeGenOpts.RelocationModel = "pic"; + CodeGenOpts.RelocationModel = llvm::Reloc::Model::PIC_; // Enable debug information if requested. if (EnableDebugInfo) @@ -187,7 +187,7 @@ namespace xcpp llvm::sys::path::append(Compiler, "bin", "clang++"); // Construct arguments to linker command. - llvm::SmallVector Args; + llvm::SmallVector Args; Args.push_back(Compiler.c_str()); Args.push_back(ObjectFile.c_str()); for (auto& O : LinkerOptions) @@ -196,7 +196,6 @@ namespace xcpp } Args.push_back("-o"); Args.push_back(ExeFile.c_str()); - Args.push_back(NULL); // Redirect output and error streams from linker. llvm::SmallString<64> OutputFile, ErrorFile; @@ -207,11 +206,10 @@ namespace xcpp llvm::StringRef OutputFileStr(OutputFile); llvm::StringRef ErrorFileStr(ErrorFile); - const llvm::StringRef* Redirects[] = {nullptr, &OutputFileStr, - &ErrorFileStr}; + llvm::SmallVector, 16> Redirects = {llvm::NoneType::None, OutputFileStr, ErrorFileStr}; // Finally run the linker. - int ret = llvm::sys::ExecuteAndWait(Compiler, Args.data(), nullptr, + int ret = llvm::sys::ExecuteAndWait(Compiler, Args, llvm::NoneType::None, Redirects); // Read back output and error streams. From 475f9cf48ed07c9a17bdd4436abb5366804be843 Mon Sep 17 00:00:00 2001 From: Sylvain Corlay Date: Sun, 30 Oct 2022 19:32:43 +0100 Subject: [PATCH 3/3] Fix Windows link issue --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bebeac6d..b1a22774 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -270,7 +270,6 @@ if(MSVC) ??1raw_string_ostream@llvm@@UEAA@XZ ?flush_nonempty@raw_ostream@llvm@@AEAAXXZ ?getASTContext@Decl@clang@@QEBAAEAVASTContext@2@XZ - ?handle@raw_ostream@llvm@@EEAAXXZ ?preferred_buffer_size@raw_ostream@llvm@@MEBA_KXZ ?write_impl@raw_string_ostream@llvm@@EEAAXPEBD_K@Z ?castToDeclContext@Decl@clang@@SAPEAVDeclContext@2@PEBV12@@Z