mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-10-20 18:56:17 +00:00
Update LLVM from 21 to 22 (#505)
This commit is contained in:
1 parent
72d47e4d26
commit
8326aa3aed
49 files changed
+182
-181
No files matched your search
@@ -60,7 +60,7 @@ jobs:
|
||||
|
||||
- name: Set LLVM Environment Variables
|
||||
run: |
|
||||
echo "LLVM_SYS_211_PREFIX=$(pwd)/llvm-x86_64-unknown-linux-gnu" >> $GITHUB_ENV
|
||||
echo "LLVM_SYS_221_PREFIX=$(pwd)/llvm-x86_64-unknown-linux-gnu" >> $GITHUB_ENV
|
||||
|
||||
- name: Build resolc
|
||||
run: |
|
||||
|
||||
@@ -132,7 +132,7 @@ jobs:
|
||||
if: ${{ steps.cache.outputs.cache-hit != 'true' && matrix.type == 'native' }}
|
||||
shell: bash
|
||||
run: |
|
||||
export LLVM_SYS_211_PREFIX=$PWD/llvm-${{ matrix.target }}
|
||||
export LLVM_SYS_221_PREFIX=$PWD/llvm-${{ matrix.target }}
|
||||
make install-bin
|
||||
mv target/release/resolc resolc-${{ matrix.target }} || mv target/release/resolc.exe resolc-${{ matrix.target }}.exe
|
||||
|
||||
@@ -143,7 +143,7 @@ jobs:
|
||||
cd /opt/revive
|
||||
chown -R root:root .
|
||||
apt update && apt upgrade -y && apt install -y pkg-config
|
||||
export LLVM_SYS_211_PREFIX=/opt/revive/llvm-${{ matrix.target }}
|
||||
export LLVM_SYS_221_PREFIX=/opt/revive/llvm-${{ matrix.target }}
|
||||
make install-bin
|
||||
mv target/${{ matrix.target }}/release/resolc resolc-${{ matrix.target }}
|
||||
"
|
||||
@@ -275,7 +275,7 @@ jobs:
|
||||
- name: Build
|
||||
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
|
||||
run: |
|
||||
export LLVM_SYS_211_PREFIX=$PWD/llvm-x86_64-unknown-linux-gnu
|
||||
export LLVM_SYS_221_PREFIX=$PWD/llvm-x86_64-unknown-linux-gnu
|
||||
export REVIVE_LLVM_TARGET_PREFIX=$PWD/llvm-wasm32-unknown-emscripten
|
||||
source emsdk/emsdk_env.sh
|
||||
make install-wasm
|
||||
|
||||
@@ -50,7 +50,7 @@ jobs:
|
||||
|
||||
- name: Set LLVM Environment Variables
|
||||
run: |
|
||||
echo "LLVM_SYS_211_PREFIX=$(pwd)/llvm-x86_64-unknown-linux-gnu" >> $GITHUB_ENV
|
||||
echo "LLVM_SYS_221_PREFIX=$(pwd)/llvm-x86_64-unknown-linux-gnu" >> $GITHUB_ENV
|
||||
echo "REVIVE_LLVM_TARGET_PREFIX=$(pwd)/llvm-wasm32-unknown-emscripten" >> $GITHUB_ENV
|
||||
|
||||
- name: Build Revive
|
||||
|
||||
@@ -38,7 +38,7 @@ jobs:
|
||||
|
||||
- name: Set LLVM Environment Variables
|
||||
run: |
|
||||
echo "LLVM_SYS_211_PREFIX=$(pwd)/llvm-x86_64-unknown-linux-gnu" >> $GITHUB_ENV
|
||||
echo "LLVM_SYS_221_PREFIX=$(pwd)/llvm-x86_64-unknown-linux-gnu" >> $GITHUB_ENV
|
||||
|
||||
- name: Install Geth
|
||||
run: |
|
||||
|
||||
+2
-1
@@ -2,7 +2,8 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
Supported `polkadot-sdk` rev: `2603`
|
||||
- Supported `polkadot-sdk` rev: `2603`
|
||||
- Updated `LLVM` from `21.1.8` to LLVM `22.1.3`
|
||||
|
||||
## v1.1.0
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ Revive is a Solidity compiler targeting RISC-V on PolkaVM. It uses `solc` (Ether
|
||||
|
||||
## Build Commands
|
||||
|
||||
**Prerequisites:** Requires `LLVM_SYS_211_PREFIX` environment variable pointing to a compatible LLVM 18.1.8 build. Download from releases or build with `make install-llvm`.
|
||||
**Prerequisites:** Requires `LLVM_SYS_221_PREFIX` environment variable pointing to a compatible LLVM 18.1.8 build. Download from releases or build with `make install-llvm`.
|
||||
|
||||
```bash
|
||||
# Install resolc binary
|
||||
|
||||
Generated
+2
-2
@@ -5100,9 +5100,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "llvm-sys"
|
||||
version = "211.0.1"
|
||||
version = "221.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "44007a7a44b73bdd877fa9c9ccef256036511220e90f65b4d50e7a15773c0ee3"
|
||||
checksum = "eb985e19ce5d9d75d8a7aa741fde1a7381c092cf9e38896f57ae72bfa0a5dbe2"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"cc",
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ polkadot-sdk = { version = "=2603.0.0" }
|
||||
[workspace.dependencies.inkwell]
|
||||
version = "0.9.0"
|
||||
default-features = false
|
||||
features = ["serde", "llvm21-1", "no-libffi-linking", "target-riscv"]
|
||||
features = ["serde", "llvm22-1", "no-libffi-linking", "target-riscv"]
|
||||
|
||||
[profile.bench]
|
||||
inherits = "release"
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ RUN apt update && \
|
||||
COPY . .
|
||||
COPY --from=llvm-builder /opt/revive/target-llvm /opt/revive/target-llvm
|
||||
|
||||
ENV LLVM_SYS_211_PREFIX=/opt/revive/target-llvm/musl/target-final
|
||||
ENV LLVM_SYS_221_PREFIX=/opt/revive/target-llvm/musl/target-final
|
||||
RUN make install-bin
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
@@ -76,9 +76,9 @@ Download the [latest LLVM build](https://github.com/paritytech/revive/releases?q
|
||||
> xattr -rc </path/to/the/extracted/archive>/target-llvm/gnu/target-final/bin/*
|
||||
> ```
|
||||
|
||||
After extracting the archive, point `$LLVM_SYS_211_PREFIX` to it:
|
||||
After extracting the archive, point `$LLVM_SYS_221_PREFIX` to it:
|
||||
```sh
|
||||
export LLVM_SYS_211_PREFIX=</path/to/the/extracted/archive>/target-llvm/gnu/target-final
|
||||
export LLVM_SYS_221_PREFIX=</path/to/the/extracted/archive>/target-llvm/gnu/target-final
|
||||
```
|
||||
|
||||
</details>
|
||||
@@ -86,18 +86,18 @@ export LLVM_SYS_211_PREFIX=</path/to/the/extracted/archive>/target-llvm/gnu/targ
|
||||
<details>
|
||||
<summary>Building from source</summary>
|
||||
|
||||
The `Makefile` provides a shortcut target to obtain a compatible LLVM build, using the provided [revive-llvm](crates/llvm-builder/README.md) utility. Once installed, point `$LLVM_SYS_211_PREFIX` to the installation afterwards:
|
||||
The `Makefile` provides a shortcut target to obtain a compatible LLVM build, using the provided [revive-llvm](crates/llvm-builder/README.md) utility. Once installed, point `$LLVM_SYS_221_PREFIX` to the installation afterwards:
|
||||
|
||||
```sh
|
||||
make install-llvm
|
||||
export LLVM_SYS_211_PREFIX=${PWD}/target-llvm/gnu/target-final
|
||||
export LLVM_SYS_221_PREFIX=${PWD}/target-llvm/gnu/target-final
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### The `resolc` Solidity frontend
|
||||
|
||||
To build the `resolc` Solidity frontend executable, make sure you have obtained a compatible LLVM build and did export the `LLVM_SYS_211_PREFIX` environment variable pointing to it (see [above](#LLVM)).
|
||||
To build the `resolc` Solidity frontend executable, make sure you have obtained a compatible LLVM build and did export the `LLVM_SYS_221_PREFIX` environment variable pointing to it (see [above](#LLVM)).
|
||||
|
||||
To install the `resolc` Solidity frontend executable:
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ The `REVIVE_LLVM_TARGET_PREFIX` environment variable is used to control the targ
|
||||
```sh
|
||||
# Build the host LLVM dependency with PolkaVM target support
|
||||
make install-llvm
|
||||
export LLVM_SYS_211_PREFIX=${PWD}/target-llvm/gnu/target-final
|
||||
export LLVM_SYS_221_PREFIX=${PWD}/target-llvm/gnu/target-final
|
||||
|
||||
# Build the target LLVM dependency with PolkaVM target support
|
||||
revive-llvm emsdk
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! The compiler build utilities library.
|
||||
|
||||
/// The revive LLVM host dependency directory prefix environment variable.
|
||||
pub const REVIVE_LLVM_HOST_PREFIX: &str = "LLVM_SYS_211_PREFIX";
|
||||
pub const REVIVE_LLVM_HOST_PREFIX: &str = "LLVM_SYS_221_PREFIX";
|
||||
|
||||
/// The revive LLVM target dependency directory prefix environment variable.
|
||||
pub const REVIVE_LLVM_TARGET_PREFIX: &str = "REVIVE_LLVM_TARGET_PREFIX";
|
||||
|
||||
+16
-20
@@ -1,4 +1,7 @@
|
||||
use std::{env, fs, io::Read, path::Path, process::Command};
|
||||
use std::{
|
||||
env, fs,
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
pub const BUILTINS_ARCHIVE_FILE: &str = "libclang_rt.builtins-riscv64.a";
|
||||
|
||||
@@ -7,28 +10,21 @@ fn main() {
|
||||
"cargo:rerun-if-env-changed={}",
|
||||
revive_build_utils::REVIVE_LLVM_HOST_PREFIX
|
||||
);
|
||||
println!(
|
||||
"cargo:rerun-if-env-changed={}",
|
||||
revive_build_utils::REVIVE_LLVM_TARGET_PREFIX
|
||||
);
|
||||
|
||||
let llvm_config = revive_build_utils::llvm_host_tool("llvm-config");
|
||||
let mut llvm_lib_dir = String::new();
|
||||
Command::new(&llvm_config)
|
||||
.arg("--libdir")
|
||||
.output()
|
||||
.unwrap_or_else(|_| {
|
||||
panic!(
|
||||
"{} should be able to provide LD path",
|
||||
llvm_config.display()
|
||||
)
|
||||
})
|
||||
.stdout
|
||||
.as_slice()
|
||||
.read_to_string(&mut llvm_lib_dir)
|
||||
.expect("llvm-config output should be utf8");
|
||||
// When cross-compiling, the riscv64 builtins live in the target LLVM,
|
||||
// not the host LLVM that `LLVM_SYS_221_PREFIX` points at.
|
||||
let llvm_lib_dir = match env::var_os(revive_build_utils::REVIVE_LLVM_TARGET_PREFIX) {
|
||||
Some(prefix) => PathBuf::from(prefix).join("lib"),
|
||||
None => revive_build_utils::llvm_lib_dir(),
|
||||
};
|
||||
|
||||
let lib_path = revive_build_utils::llvm_lib_dir()
|
||||
.join("unknown")
|
||||
.join(BUILTINS_ARCHIVE_FILE);
|
||||
let lib_path = llvm_lib_dir.join("unknown").join(BUILTINS_ARCHIVE_FILE);
|
||||
let archive = fs::read(&lib_path).expect("clang builtins not found");
|
||||
println!("cargo:rerun-if-env-changed={}", lib_path.display());
|
||||
println!("cargo:rerun-if-changed={}", lib_path.display());
|
||||
|
||||
let out_dir = env::var_os("OUT_DIR").expect("has OUT_DIR");
|
||||
let archive_path = Path::new(&out_dir).join(BUILTINS_ARCHIVE_FILE);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"Baseline": 870,
|
||||
"Computation": 2418,
|
||||
"DivisionArithmetics": 9404,
|
||||
"ERC20": 17160,
|
||||
"DivisionArithmetics": 9274,
|
||||
"ERC20": 17090,
|
||||
"Events": 1662,
|
||||
"FibonacciIterative": 1427,
|
||||
"Flipper": 2240,
|
||||
"SHA1": 8009
|
||||
"SHA1": 8056
|
||||
}
|
||||
+11
-2
@@ -9,6 +9,8 @@ fn set_rustc_link_flags() {
|
||||
llvm_lib_path.to_string_lossy()
|
||||
);
|
||||
|
||||
let llvm_built_with_libcxx = llvm_lib_path.join("libc++.a").exists();
|
||||
|
||||
for lib in [
|
||||
// These are required by ld.lld
|
||||
"lldELF",
|
||||
@@ -96,15 +98,22 @@ fn set_rustc_link_flags() {
|
||||
"LLVMVectorize",
|
||||
"LLVMSandboxIR",
|
||||
"LLVMExtensions",
|
||||
"LLVMDTLTO",
|
||||
"LLVMPlugins",
|
||||
"LLVMFrontendHLSL",
|
||||
] {
|
||||
println!("cargo:rustc-link-lib=static={lib}");
|
||||
}
|
||||
|
||||
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
|
||||
let target_env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap_or_default();
|
||||
if target_os == "linux" {
|
||||
if target_env == "musl" {
|
||||
if llvm_built_with_libcxx {
|
||||
// LLVM archives reference `std::__1::…` and unwinder symbols that
|
||||
// `libstdc++` does not provide; pull them from the LLVM prefix.
|
||||
println!("cargo:rustc-link-lib=static=c++");
|
||||
if llvm_lib_path.join("libunwind.a").exists() {
|
||||
println!("cargo:rustc-link-lib=static=unwind");
|
||||
}
|
||||
} else {
|
||||
println!("cargo:rustc-link-lib=dylib=stdc++");
|
||||
}
|
||||
|
||||
@@ -82,10 +82,10 @@ Obtain a compatible build for your host platform from the release section of thi
|
||||
|
||||
Build artifacts end up in the `./target-llvm/gnu/target-final/` directory by default.
|
||||
The `gnu` directory depends on the supported archticture and will either be `gnu`, `musl` or `emscripten`.
|
||||
You now need to export the final target directory `$LLVM_SYS_211_PREFIX`:
|
||||
You now need to export the final target directory `$LLVM_SYS_221_PREFIX`:
|
||||
|
||||
```shell
|
||||
export LLVM_SYS_211_PREFIX=${PWD}/target-llvm/gnu/target-final
|
||||
export LLVM_SYS_221_PREFIX=${PWD}/target-llvm/gnu/target-final
|
||||
```
|
||||
|
||||
If built with the `--enable-tests` option, test tools will be in the `./target-llvm/gnu/build-final/` directory, along with copies of the build artifacts. For all supported build options, run `revive-llvm build --help`.
|
||||
|
||||
@@ -77,7 +77,6 @@ pub fn build(
|
||||
llvm_module_llvm.as_path(),
|
||||
llvm_build_final.as_path(),
|
||||
llvm_target_final.as_path(),
|
||||
musl_target.as_path(),
|
||||
llvm_target_host.as_path(),
|
||||
enable_tests,
|
||||
enable_coverage,
|
||||
@@ -269,7 +268,6 @@ fn build_target(
|
||||
source_directory: &Path,
|
||||
build_directory: &Path,
|
||||
target_directory: &Path,
|
||||
musl_target_directory: &Path,
|
||||
host_target_directory: &Path,
|
||||
enable_tests: bool,
|
||||
enable_coverage: bool,
|
||||
@@ -366,26 +364,21 @@ fn build_target(
|
||||
|
||||
crate::utils::ninja(build_directory)?;
|
||||
|
||||
let mut musl_lib_directory = musl_target_directory.to_path_buf();
|
||||
musl_lib_directory.push("lib/");
|
||||
|
||||
let mut host_lib_directory = host_target_directory.to_path_buf();
|
||||
host_lib_directory.push("lib/aarch64-unknown-linux-musl/");
|
||||
|
||||
let mut target_lib_directory = target_directory.to_path_buf();
|
||||
target_lib_directory.push("lib/");
|
||||
|
||||
// Stage libc++/libunwind alongside the LLVM archives so `LLVM_SYS_221_PREFIX`
|
||||
// consumers can resolve the libc++ symbols they reference. The musl sysroot
|
||||
// is not copied: it would shadow the host libc on the link search path.
|
||||
let copy_options = fs_extra::dir::CopyOptions {
|
||||
overwrite: true,
|
||||
copy_inside: true,
|
||||
content_only: true,
|
||||
..Default::default()
|
||||
};
|
||||
fs_extra::dir::copy(
|
||||
musl_lib_directory,
|
||||
target_lib_directory.as_path(),
|
||||
©_options,
|
||||
)?;
|
||||
fs_extra::dir::copy(
|
||||
host_lib_directory,
|
||||
target_lib_directory.as_path(),
|
||||
|
||||
@@ -80,7 +80,6 @@ pub fn build(
|
||||
llvm_module_llvm.as_path(),
|
||||
llvm_build_final.as_path(),
|
||||
llvm_target_final.as_path(),
|
||||
musl_target.as_path(),
|
||||
llvm_target_host.as_path(),
|
||||
enable_tests,
|
||||
enable_coverage,
|
||||
@@ -267,7 +266,6 @@ fn build_target(
|
||||
source_directory: &Path,
|
||||
build_directory: &Path,
|
||||
target_directory: &Path,
|
||||
musl_target_directory: &Path,
|
||||
host_target_directory: &Path,
|
||||
enable_tests: bool,
|
||||
enable_coverage: bool,
|
||||
@@ -366,26 +364,21 @@ fn build_target(
|
||||
|
||||
crate::utils::ninja(build_directory)?;
|
||||
|
||||
let mut musl_lib_directory = musl_target_directory.to_path_buf();
|
||||
musl_lib_directory.push("lib/");
|
||||
|
||||
let mut host_lib_directory = host_target_directory.to_path_buf();
|
||||
host_lib_directory.push("lib/x86_64-pc-linux-musl/");
|
||||
|
||||
let mut target_lib_directory = target_directory.to_path_buf();
|
||||
target_lib_directory.push("lib/");
|
||||
|
||||
// Stage libc++/libunwind alongside the LLVM archives so `LLVM_SYS_221_PREFIX`
|
||||
// consumers can resolve the libc++ symbols they reference. The musl sysroot
|
||||
// is not copied: it would shadow the host libc on the link search path.
|
||||
let copy_options = fs_extra::dir::CopyOptions {
|
||||
overwrite: true,
|
||||
copy_inside: true,
|
||||
content_only: true,
|
||||
..Default::default()
|
||||
};
|
||||
fs_extra::dir::copy(
|
||||
musl_lib_directory,
|
||||
target_lib_directory.as_path(),
|
||||
©_options,
|
||||
)?;
|
||||
fs_extra::dir::copy(
|
||||
host_lib_directory,
|
||||
target_lib_directory.as_path(),
|
||||
|
||||
@@ -7,9 +7,14 @@ use std::str::FromStr;
|
||||
|
||||
use anyhow::Context;
|
||||
use clap::Parser;
|
||||
use revive_llvm_builder::target_env::TargetEnv;
|
||||
|
||||
use self::arguments::{Arguments, Subcommand};
|
||||
|
||||
/// RUSTFLAGS required when operating in a musl target environment so that the
|
||||
/// C runtime is linked dynamically rather than statically.
|
||||
const MUSL_RUSTFLAGS: &str = "-Ctarget-feature=-crt-static";
|
||||
|
||||
fn main() {
|
||||
env_logger::init();
|
||||
|
||||
@@ -25,6 +30,10 @@ fn main() {
|
||||
fn main_inner() -> anyhow::Result<()> {
|
||||
let arguments = Arguments::parse();
|
||||
|
||||
if arguments.target_env == TargetEnv::MUSL {
|
||||
std::env::set_var("RUSTFLAGS", MUSL_RUSTFLAGS);
|
||||
}
|
||||
|
||||
revive_llvm_builder::utils::directory_target_llvm(arguments.target_env);
|
||||
|
||||
match arguments.subcommand {
|
||||
|
||||
@@ -35,88 +35,90 @@ pub enum Attribute {
|
||||
NoBuiltin = 24,
|
||||
NoCallback = 25,
|
||||
NoCfCheck = 26,
|
||||
NoDivergenceSource = 27,
|
||||
NoDuplicate = 28,
|
||||
NoExt = 29,
|
||||
NoFree = 30,
|
||||
NoImplicitFloat = 31,
|
||||
NoInline = 32,
|
||||
NoMerge = 33,
|
||||
NoProfile = 34,
|
||||
NoRecurse = 35,
|
||||
NoRedZone = 36,
|
||||
NoReturn = 37,
|
||||
NoSanitizeBounds = 38,
|
||||
NoSanitizeCoverage = 39,
|
||||
NoSync = 40,
|
||||
NoUndef = 41,
|
||||
NoUnwind = 42,
|
||||
NonLazyBind = 43,
|
||||
NonNull = 44,
|
||||
NullPointerIsValid = 45,
|
||||
OptForFuzzing = 46,
|
||||
OptimizeForDebugging = 47,
|
||||
OptimizeForSize = 48,
|
||||
OptimizeNone = 49,
|
||||
PresplitCoroutine = 50,
|
||||
ReadNone = 51,
|
||||
ReadOnly = 52,
|
||||
Returned = 53,
|
||||
ReturnsTwice = 54,
|
||||
SExt = 55,
|
||||
SafeStack = 56,
|
||||
SanitizeAddress = 57,
|
||||
SanitizeHWAddress = 58,
|
||||
SanitizeMemTag = 59,
|
||||
SanitizeMemory = 60,
|
||||
SanitizeNumericalStability = 61,
|
||||
SanitizeRealtime = 62,
|
||||
SanitizeRealtimeBlocking = 63,
|
||||
SanitizeThread = 64,
|
||||
SanitizeType = 65,
|
||||
ShadowCallStack = 66,
|
||||
SkipProfile = 67,
|
||||
Speculatable = 68,
|
||||
SpeculativeLoadHardening = 69,
|
||||
StackProtect = 70,
|
||||
StackProtectReq = 71,
|
||||
StackProtectStrong = 72,
|
||||
StrictFP = 73,
|
||||
SwiftAsync = 74,
|
||||
SwiftError = 75,
|
||||
SwiftSelf = 76,
|
||||
WillReturn = 77,
|
||||
Writable = 78,
|
||||
WriteOnly = 79,
|
||||
ZExt = 80,
|
||||
//LastEnumAttr = 80,
|
||||
//FirstTypeAttr = 81,
|
||||
ByRef = 81,
|
||||
ByVal = 82,
|
||||
ElementType = 83,
|
||||
InAlloca = 84,
|
||||
Preallocated = 85,
|
||||
StructRet = 86,
|
||||
//LastTypeAttr = 86,
|
||||
//FirstIntAttr = 87,
|
||||
Alignment = 87,
|
||||
AllocKind = 88,
|
||||
AllocSize = 89,
|
||||
Captures = 90,
|
||||
Dereferenceable = 91,
|
||||
DereferenceableOrNull = 92,
|
||||
Memory = 93,
|
||||
NoFPClass = 94,
|
||||
StackAlignment = 95,
|
||||
UWTable = 96,
|
||||
VScaleRange = 97,
|
||||
//LastIntAttr = 97,
|
||||
//FirstConstantRangeAttr = 98,
|
||||
Range = 98,
|
||||
//LastConstantRangeAttr = 98,
|
||||
//FirstConstantRangeListAttr = 99,
|
||||
Initializes = 99,
|
||||
//LastConstantRangeListAttr = 99,
|
||||
NoCreateUndefOrPoison = 27,
|
||||
NoDivergenceSource = 28,
|
||||
NoDuplicate = 29,
|
||||
NoExt = 30,
|
||||
NoFree = 31,
|
||||
NoImplicitFloat = 32,
|
||||
NoInline = 33,
|
||||
NoMerge = 34,
|
||||
NoProfile = 35,
|
||||
NoRecurse = 36,
|
||||
NoRedZone = 37,
|
||||
NoReturn = 38,
|
||||
NoSanitizeBounds = 39,
|
||||
NoSanitizeCoverage = 40,
|
||||
NoSync = 41,
|
||||
NoUndef = 42,
|
||||
NoUnwind = 43,
|
||||
NonLazyBind = 44,
|
||||
NonNull = 45,
|
||||
NullPointerIsValid = 46,
|
||||
OptForFuzzing = 47,
|
||||
OptimizeForDebugging = 48,
|
||||
OptimizeForSize = 49,
|
||||
OptimizeNone = 50,
|
||||
PresplitCoroutine = 51,
|
||||
ReadNone = 52,
|
||||
ReadOnly = 53,
|
||||
Returned = 54,
|
||||
ReturnsTwice = 55,
|
||||
SExt = 56,
|
||||
SafeStack = 57,
|
||||
SanitizeAddress = 58,
|
||||
SanitizeAllocToken = 59,
|
||||
SanitizeHWAddress = 60,
|
||||
SanitizeMemTag = 61,
|
||||
SanitizeMemory = 62,
|
||||
SanitizeNumericalStability = 63,
|
||||
SanitizeRealtime = 64,
|
||||
SanitizeRealtimeBlocking = 65,
|
||||
SanitizeThread = 66,
|
||||
SanitizeType = 67,
|
||||
ShadowCallStack = 68,
|
||||
SkipProfile = 69,
|
||||
Speculatable = 70,
|
||||
SpeculativeLoadHardening = 71,
|
||||
StackProtect = 72,
|
||||
StackProtectReq = 73,
|
||||
StackProtectStrong = 74,
|
||||
StrictFP = 75,
|
||||
SwiftAsync = 76,
|
||||
SwiftError = 77,
|
||||
SwiftSelf = 78,
|
||||
WillReturn = 79,
|
||||
Writable = 80,
|
||||
WriteOnly = 81,
|
||||
ZExt = 82,
|
||||
//LastEnumAttr = 82,
|
||||
//FirstTypeAttr = 83,
|
||||
ByRef = 83,
|
||||
ByVal = 84,
|
||||
ElementType = 85,
|
||||
InAlloca = 86,
|
||||
Preallocated = 87,
|
||||
StructRet = 88,
|
||||
//LastTypeAttr = 88,
|
||||
//FirstIntAttr = 89,
|
||||
Alignment = 89,
|
||||
AllocKind = 90,
|
||||
AllocSize = 91,
|
||||
Captures = 92,
|
||||
Dereferenceable = 93,
|
||||
DereferenceableOrNull = 94,
|
||||
Memory = 95,
|
||||
NoFPClass = 96,
|
||||
StackAlignment = 97,
|
||||
UWTable = 98,
|
||||
VScaleRange = 99,
|
||||
//LastIntAttr = 99,
|
||||
//FirstConstantRangeAttr = 100,
|
||||
Range = 100,
|
||||
//LastConstantRangeAttr = 100,
|
||||
//FirstConstantRangeListAttr = 101,
|
||||
Initializes = 101,
|
||||
//LastConstantRangeListAttr = 101,
|
||||
}
|
||||
|
||||
impl TryFrom<&str> for Attribute {
|
||||
|
||||
@@ -287,7 +287,6 @@ impl<'ctx> Context<'ctx> {
|
||||
) -> anyhow::Result<Build> {
|
||||
self.link_polkavm_exports(contract_path)?;
|
||||
self.link_immutable_data(contract_path)?;
|
||||
|
||||
let target_machine = TargetMachine::new(Target::PVM, self.optimizer.settings())?;
|
||||
self.module().set_triple(&target_machine.get_triple());
|
||||
|
||||
|
||||
@@ -59,10 +59,10 @@ impl TargetMachine {
|
||||
}
|
||||
|
||||
/// Writes the LLVM module to a memory buffer.
|
||||
pub fn write_to_memory_buffer<'ctx>(
|
||||
pub fn write_to_memory_buffer(
|
||||
&self,
|
||||
module: &inkwell::module::Module<'ctx>,
|
||||
) -> Result<inkwell::memory_buffer::MemoryBuffer<'ctx>, inkwell::support::LLVMString> {
|
||||
module: &inkwell::module::Module,
|
||||
) -> Result<inkwell::memory_buffer::MemoryBuffer<'static>, inkwell::support::LLVMString> {
|
||||
match self.target {
|
||||
Target::PVM => self
|
||||
.target_machine
|
||||
|
||||
@@ -41,7 +41,7 @@ mimalloc = { version = "0.1.46", default-features = false }
|
||||
|
||||
[target.'cfg(target_os = "emscripten")'.dependencies]
|
||||
libc = { workspace = true }
|
||||
inkwell = { workspace = true, features = ["target-riscv", "llvm21-1-no-llvm-linking"]}
|
||||
inkwell = { workspace = true, features = ["target-riscv", "llvm22-1-no-llvm-linking"]}
|
||||
|
||||
[build-dependencies]
|
||||
git2 = { workspace = true, default-features = false }
|
||||
|
||||
@@ -9,7 +9,7 @@ description = "Implements the low level runtime API bindings with pallet contrac
|
||||
|
||||
[dependencies]
|
||||
anyhow = { workspace = true }
|
||||
inkwell = { workspace = true, features = ["target-riscv", "no-libffi-linking", "llvm21-1"] }
|
||||
inkwell = { workspace = true, features = ["target-riscv", "no-libffi-linking", "llvm22-1"] }
|
||||
|
||||
revive-common = { workspace = true }
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ repository.workspace = true
|
||||
description = "revive compiler stdlib components"
|
||||
|
||||
[dependencies]
|
||||
inkwell = { workspace = true, features = ["target-riscv", "no-libffi-linking", "llvm21-1"] }
|
||||
inkwell = { workspace = true, features = ["target-riscv", "no-libffi-linking", "llvm22-1"] }
|
||||
|
||||
[build-dependencies]
|
||||
revive-build-utils = { workspace = true }
|
||||
+1
-1
@@ -36,7 +36,7 @@
|
||||
const path_to_root = "";
|
||||
const default_light_theme = "light";
|
||||
const default_dark_theme = "navy";
|
||||
window.path_to_searchindex_js = "searchindex-575cfd18.js";
|
||||
window.path_to_searchindex_js = "searchindex-79c091ca.js";
|
||||
</script>
|
||||
<!-- Start loading toc.js asap -->
|
||||
<script src="toc-6f3f265e.js"></script>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
const path_to_root = "";
|
||||
const default_light_theme = "light";
|
||||
const default_dark_theme = "navy";
|
||||
window.path_to_searchindex_js = "searchindex-575cfd18.js";
|
||||
window.path_to_searchindex_js = "searchindex-79c091ca.js";
|
||||
</script>
|
||||
<!-- Start loading toc.js asap -->
|
||||
<script src="toc-6f3f265e.js"></script>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
const path_to_root = "../";
|
||||
const default_light_theme = "light";
|
||||
const default_dark_theme = "navy";
|
||||
window.path_to_searchindex_js = "../searchindex-575cfd18.js";
|
||||
window.path_to_searchindex_js = "../searchindex-79c091ca.js";
|
||||
</script>
|
||||
<!-- Start loading toc.js asap -->
|
||||
<script src="../toc-6f3f265e.js"></script>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
const path_to_root = "../";
|
||||
const default_light_theme = "light";
|
||||
const default_dark_theme = "navy";
|
||||
window.path_to_searchindex_js = "../searchindex-575cfd18.js";
|
||||
window.path_to_searchindex_js = "../searchindex-79c091ca.js";
|
||||
</script>
|
||||
<!-- Start loading toc.js asap -->
|
||||
<script src="../toc-6f3f265e.js"></script>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
const path_to_root = "../";
|
||||
const default_light_theme = "light";
|
||||
const default_dark_theme = "navy";
|
||||
window.path_to_searchindex_js = "../searchindex-575cfd18.js";
|
||||
window.path_to_searchindex_js = "../searchindex-79c091ca.js";
|
||||
</script>
|
||||
<!-- Start loading toc.js asap -->
|
||||
<script src="../toc-6f3f265e.js"></script>
|
||||
@@ -181,7 +181,7 @@
|
||||
<p>The <code>REVIVE_LLVM_TARGET_PREFIX</code> environment variable is used to control the target environment LLVM dependency. This requires a compatible LLVM build, obtainable via the <code>revive-llvm</code> build script. Example:</p>
|
||||
<pre><code class="language-sh"># Build the host LLVM dependency with PolkaVM target support
|
||||
make install-llvm
|
||||
export LLVM_SYS_211_PREFIX=${PWD}/target-llvm/gnu/target-final
|
||||
export LLVM_SYS_221_PREFIX=${PWD}/target-llvm/gnu/target-final
|
||||
|
||||
# Build the target LLVM dependency with PolkaVM target support
|
||||
revive-llvm emsdk
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
const path_to_root = "../";
|
||||
const default_light_theme = "light";
|
||||
const default_dark_theme = "navy";
|
||||
window.path_to_searchindex_js = "../searchindex-575cfd18.js";
|
||||
window.path_to_searchindex_js = "../searchindex-79c091ca.js";
|
||||
</script>
|
||||
<!-- Start loading toc.js asap -->
|
||||
<script src="../toc-6f3f265e.js"></script>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
const path_to_root = "../";
|
||||
const default_light_theme = "light";
|
||||
const default_dark_theme = "navy";
|
||||
window.path_to_searchindex_js = "../searchindex-575cfd18.js";
|
||||
window.path_to_searchindex_js = "../searchindex-79c091ca.js";
|
||||
</script>
|
||||
<!-- Start loading toc.js asap -->
|
||||
<script src="../toc-6f3f265e.js"></script>
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
const path_to_root = "";
|
||||
const default_light_theme = "light";
|
||||
const default_dark_theme = "navy";
|
||||
window.path_to_searchindex_js = "searchindex-575cfd18.js";
|
||||
window.path_to_searchindex_js = "searchindex-79c091ca.js";
|
||||
</script>
|
||||
<!-- Start loading toc.js asap -->
|
||||
<script src="toc-6f3f265e.js"></script>
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
const path_to_root = "";
|
||||
const default_light_theme = "light";
|
||||
const default_dark_theme = "navy";
|
||||
window.path_to_searchindex_js = "searchindex-575cfd18.js";
|
||||
window.path_to_searchindex_js = "searchindex-79c091ca.js";
|
||||
</script>
|
||||
<!-- Start loading toc.js asap -->
|
||||
<script src="toc-6f3f265e.js"></script>
|
||||
|
||||
+2
-2
@@ -36,7 +36,7 @@
|
||||
const path_to_root = "";
|
||||
const default_light_theme = "light";
|
||||
const default_dark_theme = "navy";
|
||||
window.path_to_searchindex_js = "searchindex-575cfd18.js";
|
||||
window.path_to_searchindex_js = "searchindex-79c091ca.js";
|
||||
</script>
|
||||
<!-- Start loading toc.js asap -->
|
||||
<script src="toc-6f3f265e.js"></script>
|
||||
@@ -724,7 +724,7 @@ export PATH=/path/to/go-ethereum/build/bin/:$PATH
|
||||
<p>The <code>REVIVE_LLVM_TARGET_PREFIX</code> environment variable is used to control the target environment LLVM dependency. This requires a compatible LLVM build, obtainable via the <code>revive-llvm</code> build script. Example:</p>
|
||||
<pre><code class="language-sh"># Build the host LLVM dependency with PolkaVM target support
|
||||
make install-llvm
|
||||
export LLVM_SYS_211_PREFIX=${PWD}/target-llvm/gnu/target-final
|
||||
export LLVM_SYS_221_PREFIX=${PWD}/target-llvm/gnu/target-final
|
||||
|
||||
# Build the target LLVM dependency with PolkaVM target support
|
||||
revive-llvm emsdk
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
const path_to_root = "";
|
||||
const default_light_theme = "light";
|
||||
const default_dark_theme = "navy";
|
||||
window.path_to_searchindex_js = "searchindex-575cfd18.js";
|
||||
window.path_to_searchindex_js = "searchindex-79c091ca.js";
|
||||
</script>
|
||||
<!-- Start loading toc.js asap -->
|
||||
<script src="toc-6f3f265e.js"></script>
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
const path_to_root = "";
|
||||
const default_light_theme = "light";
|
||||
const default_dark_theme = "navy";
|
||||
window.path_to_searchindex_js = "searchindex-575cfd18.js";
|
||||
window.path_to_searchindex_js = "searchindex-79c091ca.js";
|
||||
</script>
|
||||
<!-- Start loading toc.js asap -->
|
||||
<script src="toc-6f3f265e.js"></script>
|
||||
|
||||
@@ -437,7 +437,7 @@ window.search = window.search || {};
|
||||
if (yes) {
|
||||
loadSearchScript(
|
||||
window.path_to_searchindex_js ||
|
||||
path_to_root + 'searchindex-575cfd18.js',
|
||||
path_to_root + 'searchindex-79c091ca.js',
|
||||
'mdbook-search-index');
|
||||
search_wrap.classList.remove('hidden');
|
||||
searchicon.setAttribute('aria-expanded', 'true');
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
window.search = Object.assign(window.search, JSON.parse('{"doc_urls":["welcome.html#welcome","welcome.html#target-audience","welcome.html#other-polkadot-contracts-resources","welcome.html#about","user_guide.html#resolc-user-guide","user_guide.html#revive-vs-resolc-nomenclature","user_guide/installation.html#installation","user_guide/installation.html#resolc-binary-releases","user_guide/installation.html#installing-the-solc-dependency","user_guide/installation.html#revive-npm-package","user_guide/installation.html#buidling-resolc-from-source","user_guide/cli.html#cli-usage","user_guide/cli.html#llvm-optimization-levels","user_guide/cli.html#stack-size","user_guide/cli.html#heap-size","user_guide/cli.html#solc","user_guide/cli.html#debug-artifacts","user_guide/cli.html#debug-info","user_guide/cli.html#deploy-time-linking","user_guide/js.html#js-npm-package","user_guide/tooling.html#tooling-integration","user_guide/tooling.html#solidity-toolkits","user_guide/tooling.html#compiler-explorer","user_guide/tooling.html#remix-ide","user_guide/std_json.html#standard-json-interface","user_guide/std_json.html#the-settingspolkavm-object","user_guide/std_json.html#settingspolkavmdebuginformation","user_guide/std_json.html#the-settingspolkavmmemoryconfig-object","user_guide/std_json.html#the-settingsoptimizer-object","user_guide/std_json.html#settingsoptimizermode","user_guide/std_json.html#settingsllvmarguments","user_guide/std_json.html#the-settingsoutputselection-object","user_guide/std_json.html#the-all--wildcard","user_guide/std_json.html#the-contract-level-evm-output-selection","user_guide/differences.html#differences-to-evm","user_guide/differences.html#deploy-code-vs-runtime-code","user_guide/differences.html#solidity","user_guide/differences.html#the-6364-gas-rule","user_guide/differences.html#addresscreationcode","user_guide/differences.html#yul-functions","user_guide/differences.html#mload-mstore-msize-mcopy-memory-related-functions","user_guide/differences.html#calldataload-calldatacopy","user_guide/differences.html#codecopy","user_guide/differences.html#create-create2","user_guide/differences.html#dataoffset","user_guide/differences.html#datasize","user_guide/differences.html#revert-return","user_guide/differences.html#prevrandao-difficulty","user_guide/differences.html#pc-extcodecopy","user_guide/differences.html#blobhash-blobbasefee","user_guide/differences.html#difference-regarding-the-solc-via-ir-mode","user_guide/differences.html#example-state-variable-initialization-order-in-inheritance","user_guide/rust_libraries.html#rust-contract-libraries","revive_runner.html#revive-runner-sandbox","revive_runner.html#installation-and-usage","revive_runner.html#trace-logs","revive_runner.html#automatic-contract-instantiation","revive_runner.html#example","developer_guide.html#developer-guide","developer_guide/contributing.html#contributor-guide","developer_guide/contributing.html#getting-started","developer_guide/contributing.html#using-the-makefile","developer_guide/contributing.html#codebase-organization","developer_guide/contributing.html#contribution-rules","developer_guide/contributing.html#style-guide","developer_guide/contributing.html#ai-policy","developer_guide/architecture.html#compiler-architecture-and-internals","developer_guide/architecture.html#resolc","developer_guide/architecture.html#reproducible-contract-builds","developer_guide/architecture.html#the-revive-compiler-libraries","developer_guide/architecture.html#evm-heap-memory","developer_guide/architecture.html#the-llvm-dependency","developer_guide/architecture.html#custom-optimizations","developer_guide/target.html#pvm-and-the-pallet-revive-runtime-target","developer_guide/target.html#target-cpu-configuration","developer_guide/target.html#why-pvm","developer_guide/target.html#host-environment-pallet-revive","developer_guide/testing.html#testing-strategy","developer_guide/testing.html#bug-compatibility-with-ethereum-solidity","developer_guide/testing.html#differential-integration-tests","developer_guide/testing.html#the-differential-testing-utility","developer_guide/cross_compilation.html#cross-compilation","developer_guide/cross_compilation.html#wasm-via-emscripten","developer_guide/cross_compilation.html#musl-libc","faq.html#faq","faq.html#what-evm-version-do-you-support","faq.html#is-inline-assembly-supported","faq.html#do-you-support-opcode-xy","faq.html#in-what-solidity-version-should-i-write-my-dapp","faq.html#tool-xy-says-the-contract-size-is-larger-than-24kb-and-will-fail-to-deploy","faq.html#is-resolc-a-drop-in-replacement-for-solc","roadmap.html#vision-and-roadmap","roadmap.html#roadmap"],"index":{"documentStore":{"docInfo":{"0":{"body":74,"breadcrumbs":2,"title":1},"1":{"body":22,"breadcrumbs":3,"title":2},"10":{"body":6,"breadcrumbs":7,"title":3},"11":{"body":33,"breadcrumbs":8,"title":2},"12":{"body":53,"breadcrumbs":9,"title":3},"13":{"body":62,"breadcrumbs":8,"title":2},"14":{"body":75,"breadcrumbs":8,"title":2},"15":{"body":10,"brLine truncated
|
||||
@@ -35,7 +35,7 @@
|
||||
const path_to_root = "";
|
||||
const default_light_theme = "light";
|
||||
const default_dark_theme = "navy";
|
||||
window.path_to_searchindex_js = "searchindex-575cfd18.js";
|
||||
window.path_to_searchindex_js = "searchindex-79c091ca.js";
|
||||
</script>
|
||||
<!-- Start loading toc.js asap -->
|
||||
<script src="toc-6f3f265e.js"></script>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
const path_to_root = "../";
|
||||
const default_light_theme = "light";
|
||||
const default_dark_theme = "navy";
|
||||
window.path_to_searchindex_js = "../searchindex-575cfd18.js";
|
||||
window.path_to_searchindex_js = "../searchindex-79c091ca.js";
|
||||
</script>
|
||||
<!-- Start loading toc.js asap -->
|
||||
<script src="../toc-6f3f265e.js"></script>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
const path_to_root = "../";
|
||||
const default_light_theme = "light";
|
||||
const default_dark_theme = "navy";
|
||||
window.path_to_searchindex_js = "../searchindex-575cfd18.js";
|
||||
window.path_to_searchindex_js = "../searchindex-79c091ca.js";
|
||||
</script>
|
||||
<!-- Start loading toc.js asap -->
|
||||
<script src="../toc-6f3f265e.js"></script>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
const path_to_root = "../";
|
||||
const default_light_theme = "light";
|
||||
const default_dark_theme = "navy";
|
||||
window.path_to_searchindex_js = "../searchindex-575cfd18.js";
|
||||
window.path_to_searchindex_js = "../searchindex-79c091ca.js";
|
||||
</script>
|
||||
<!-- Start loading toc.js asap -->
|
||||
<script src="../toc-6f3f265e.js"></script>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
const path_to_root = "../";
|
||||
const default_light_theme = "light";
|
||||
const default_dark_theme = "navy";
|
||||
window.path_to_searchindex_js = "../searchindex-575cfd18.js";
|
||||
window.path_to_searchindex_js = "../searchindex-79c091ca.js";
|
||||
</script>
|
||||
<!-- Start loading toc.js asap -->
|
||||
<script src="../toc-6f3f265e.js"></script>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
const path_to_root = "../";
|
||||
const default_light_theme = "light";
|
||||
const default_dark_theme = "navy";
|
||||
window.path_to_searchindex_js = "../searchindex-575cfd18.js";
|
||||
window.path_to_searchindex_js = "../searchindex-79c091ca.js";
|
||||
</script>
|
||||
<!-- Start loading toc.js asap -->
|
||||
<script src="../toc-6f3f265e.js"></script>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
const path_to_root = "../";
|
||||
const default_light_theme = "light";
|
||||
const default_dark_theme = "navy";
|
||||
window.path_to_searchindex_js = "../searchindex-575cfd18.js";
|
||||
window.path_to_searchindex_js = "../searchindex-79c091ca.js";
|
||||
</script>
|
||||
<!-- Start loading toc.js asap -->
|
||||
<script src="../toc-6f3f265e.js"></script>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
const path_to_root = "../";
|
||||
const default_light_theme = "light";
|
||||
const default_dark_theme = "navy";
|
||||
window.path_to_searchindex_js = "../searchindex-575cfd18.js";
|
||||
window.path_to_searchindex_js = "../searchindex-79c091ca.js";
|
||||
</script>
|
||||
<!-- Start loading toc.js asap -->
|
||||
<script src="../toc-6f3f265e.js"></script>
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
const path_to_root = "";
|
||||
const default_light_theme = "light";
|
||||
const default_dark_theme = "navy";
|
||||
window.path_to_searchindex_js = "searchindex-575cfd18.js";
|
||||
window.path_to_searchindex_js = "searchindex-79c091ca.js";
|
||||
</script>
|
||||
<!-- Start loading toc.js asap -->
|
||||
<script src="toc-6f3f265e.js"></script>
|
||||
|
||||
+1
-1
Submodule llvm updated: 2078da43e2...99031a474b.
Reference in new issue
Block a user