mirror of
https://github.com/termux/termux-packages
synced 2024-06-19 04:47:06 +00:00
lfortran: Fix build against LLVM 16
This commit is contained in:
parent
3bc2aafa76
commit
97bd023b1a
|
@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="A modern open-source interactive Fortran compiler"
|
||||||
TERMUX_PKG_LICENSE="BSD 3-Clause"
|
TERMUX_PKG_LICENSE="BSD 3-Clause"
|
||||||
TERMUX_PKG_MAINTAINER="@termux"
|
TERMUX_PKG_MAINTAINER="@termux"
|
||||||
TERMUX_PKG_VERSION=0.18.0
|
TERMUX_PKG_VERSION=0.18.0
|
||||||
TERMUX_PKG_REVISION=1
|
TERMUX_PKG_REVISION=2
|
||||||
TERMUX_PKG_SRCURL=git+https://github.com/lfortran/lfortran
|
TERMUX_PKG_SRCURL=git+https://github.com/lfortran/lfortran
|
||||||
TERMUX_PKG_DEPENDS="clang, libandroid-complex-math, libc++, ncurses, zlib, zstd"
|
TERMUX_PKG_DEPENDS="clang, libandroid-complex-math, libc++, ncurses, zlib, zstd"
|
||||||
TERMUX_PKG_BUILD_DEPENDS="libllvm-static"
|
TERMUX_PKG_BUILD_DEPENDS="libllvm-static"
|
||||||
|
|
59
packages/lfortran/llvm16.patch
Normal file
59
packages/lfortran/llvm16.patch
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
--- a/src/libasr/codegen/KaleidoscopeJIT.h
|
||||||
|
+++ b/src/libasr/codegen/KaleidoscopeJIT.h
|
||||||
|
@@ -25,6 +25,7 @@
|
||||||
|
#include "llvm/IR/DataLayout.h"
|
||||||
|
#include "llvm/IR/LLVMContext.h"
|
||||||
|
#include <memory>
|
||||||
|
+#include <optional>
|
||||||
|
|
||||||
|
namespace llvm {
|
||||||
|
namespace orc {
|
||||||
|
@@ -71,7 +72,7 @@
|
||||||
|
auto CPU = "generic";
|
||||||
|
auto Features = "";
|
||||||
|
TargetOptions opt;
|
||||||
|
- auto RM = Optional<Reloc::Model>();
|
||||||
|
+ auto RM = std::optional<Reloc::Model>();
|
||||||
|
TM = Target->createTargetMachine(TargetTriple, CPU, Features, opt, RM);
|
||||||
|
}
|
||||||
|
|
||||||
|
--- a/src/libasr/codegen/asr_to_llvm.cpp
|
||||||
|
+++ b/src/libasr/codegen/asr_to_llvm.cpp
|
||||||
|
@@ -276,7 +276,7 @@
|
||||||
|
// to our new block
|
||||||
|
builder->CreateBr(bb);
|
||||||
|
}
|
||||||
|
- fn->getBasicBlockList().push_back(bb);
|
||||||
|
+ fn->insert(fn->end(), bb);
|
||||||
|
builder->SetInsertPoint(bb);
|
||||||
|
}
|
||||||
|
|
||||||
|
--- a/src/libasr/codegen/evaluator.cpp
|
||||||
|
+++ b/src/libasr/codegen/evaluator.cpp
|
||||||
|
@@ -1,5 +1,6 @@
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
+#include <optional>
|
||||||
|
|
||||||
|
#include <llvm/IR/LLVMContext.h>
|
||||||
|
#include <llvm/ADT/STLExtras.h>
|
||||||
|
@@ -178,7 +179,7 @@
|
||||||
|
std::string CPU = "generic";
|
||||||
|
std::string features = "";
|
||||||
|
llvm::TargetOptions opt;
|
||||||
|
- llvm::Optional<llvm::Reloc::Model> RM = llvm::Reloc::Model::PIC_;
|
||||||
|
+ std::optional<llvm::Reloc::Model> RM = llvm::Reloc::Model::PIC_;
|
||||||
|
TM = target->createTargetMachine(target_triple, CPU, features, opt, RM);
|
||||||
|
|
||||||
|
// For some reason the JIT requires a different TargetMachine
|
||||||
|
--- a/src/libasr/codegen/llvm_utils.cpp
|
||||||
|
+++ b/src/libasr/codegen/llvm_utils.cpp
|
||||||
|
@@ -189,7 +189,7 @@
|
||||||
|
// to our new block
|
||||||
|
builder->CreateBr(bb);
|
||||||
|
}
|
||||||
|
- fn->getBasicBlockList().push_back(bb);
|
||||||
|
+ fn->insert(fn->end(), bb);
|
||||||
|
builder->SetInsertPoint(bb);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user