diff --git a/.bazelversion b/.bazelversion index 09b254e9..815da58b 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -6.0.0 +7.4.1 diff --git a/WORKSPACE b/WORKSPACE index e03547e9..2f3c4e4b 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -8,18 +8,6 @@ zirgen_dependencies() load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") bazel_skylib_workspace() -LLVM_COMMIT = "fea7b65f23632b42ff8f7e2595ac0641e2c1d214" - -LLVM_SHA256 = "7f8da8de897f20824e7d11204768ccb29a47419385bb6c9b3f5eccfd738d7510" - -http_archive( - name = "llvm-raw", - build_file_content = "# empty", - sha256 = LLVM_SHA256, - strip_prefix = "llvm-project-" + LLVM_COMMIT, - urls = ["https://github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT)], -) - load("@llvm-raw//utils/bazel:configure.bzl", "llvm_configure") llvm_configure(name = "llvm-project") diff --git a/bazel/rules/zirgen/deps.bzl b/bazel/rules/zirgen/deps.bzl index 4ab54de3..fa22f402 100644 --- a/bazel/rules/zirgen/deps.bzl +++ b/bazel/rules/zirgen/deps.bzl @@ -23,15 +23,15 @@ def zirgen_dependencies(): """ http_archive( name = "bazel_skylib", - sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506", + sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.3.0.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", ], ) - LLVM_COMMIT = "0d72fe9777e7c131dfb50c172b944d64437e2ece" - LLVM_SHA256 = "41f69c116fd1e25d290031c408f6ea0246cafb993b1fdab6f781c87fc0b903cf" + LLVM_COMMIT = "fea7b65f23632b42ff8f7e2595ac0641e2c1d214" + LLVM_SHA256 = "7f8da8de897f20824e7d11204768ccb29a47419385bb6c9b3f5eccfd738d7510" http_archive( name = "llvm-raw", build_file_content = "# empty", diff --git a/bazel/toolchain/risc0/gcc_toolchain.bzl b/bazel/toolchain/risc0/gcc_toolchain.bzl index 1dc04c8a..7135d36a 100644 --- a/bazel/toolchain/risc0/gcc_toolchain.bzl +++ b/bazel/toolchain/risc0/gcc_toolchain.bzl @@ -19,6 +19,7 @@ def gcc_toolchain_config(name, sysroot): "gcov", "ld", "nm", + "objcopy", "objdump", "strip", ]} diff --git a/bazel/toolchain/rv32im-linux/gcc_toolchain.bzl b/bazel/toolchain/rv32im-linux/gcc_toolchain.bzl index 8063f359..15bf4f99 100644 --- a/bazel/toolchain/rv32im-linux/gcc_toolchain.bzl +++ b/bazel/toolchain/rv32im-linux/gcc_toolchain.bzl @@ -19,6 +19,7 @@ def gcc_toolchain_config(name, sysroot): "gcov", "ld", "nm", + "objcopy", "objdump", "strip", ]} diff --git a/zirgen/Dialect/BigInt/Precompiles.md b/zirgen/Dialect/BigInt/Precompiles.md index f8464002..8b8a6c1c 100644 --- a/zirgen/Dialect/BigInt/Precompiles.md +++ b/zirgen/Dialect/BigInt/Precompiles.md @@ -12,7 +12,7 @@ First, create files under [`zirgen/circuit/bigint/`] which will hold the acceler void genAdd128(mlir::OpBuilder& builder, mlir::Location loc) { auto lhs = builder.create(loc, 128, 11, 0); auto rhs = builder.create(loc, 128, 12, 0); - auto sum = builder.create(loc, lhs, rhs); + auto sum = builder.create(loc, lhs, rhs); builder.create(loc, sum, 13, 0); } ``` @@ -33,7 +33,7 @@ enum class Program { Make this option available by extending the arg parser's declaration: ``` - + clEnumValN(Program::Add128, "add128", "Add128")), ``` @@ -53,7 +53,7 @@ The `bigint2c` program can now compile our addition function into a "bibc" forma genrule( name = "add128", outs = ["add128.blob"], - exec_tools = [":bigint2c"], + tools = [":bigint2c"], cmd = "$(location //zirgen/circuit/bigint:bigint2c) --program=add128 --bitwidth 128 > $(OUTS)" ) ``` diff --git a/zirgen/circuit/bigint/BUILD.bazel b/zirgen/circuit/bigint/BUILD.bazel index e21c5be4..e2d8a41b 100644 --- a/zirgen/circuit/bigint/BUILD.bazel +++ b/zirgen/circuit/bigint/BUILD.bazel @@ -66,49 +66,49 @@ BLOBS = [ genrule( name = "modpow65537_4096", outs = ["modpow65537_4096.blob"], - exec_tools = [":bigint2c"], + tools = [":bigint2c"], cmd = "$(location //zirgen/circuit/bigint:bigint2c) --program=modpow65537 --bitwidth 4096 > $(OUTS)" ) genrule( name = "ec_double_256", outs = ["ec_double_256.blob"], - exec_tools = [":bigint2c"], + tools = [":bigint2c"], cmd = "$(location //zirgen/circuit/bigint:bigint2c) --program=ec_double --bitwidth 256 > $(OUTS)" ) genrule( name = "ec_add_256", outs = ["ec_add_256.blob"], - exec_tools = [":bigint2c"], + tools = [":bigint2c"], cmd = "$(location //zirgen/circuit/bigint:bigint2c) --program=ec_add --bitwidth 256 > $(OUTS)" ) genrule( name = "modadd_256", outs = ["modadd_256.blob"], - exec_tools = [":bigint2c"], + tools = [":bigint2c"], cmd = "$(location //zirgen/circuit/bigint:bigint2c) --program=modadd --bitwidth 256 > $(OUTS)" ) genrule( name = "modinv_256", outs = ["modinv_256.blob"], - exec_tools = [":bigint2c"], + tools = [":bigint2c"], cmd = "$(location //zirgen/circuit/bigint:bigint2c) --program=modinv --bitwidth 256 > $(OUTS)" ) genrule( name = "modmul_256", outs = ["modmul_256.blob"], - exec_tools = [":bigint2c"], + tools = [":bigint2c"], cmd = "$(location //zirgen/circuit/bigint:bigint2c) --program=modmul --bitwidth 256 > $(OUTS)" ) genrule( name = "modsub_256", outs = ["modsub_256.blob"], - exec_tools = [":bigint2c"], + tools = [":bigint2c"], cmd = "$(location //zirgen/circuit/bigint:bigint2c) --program=modsub --bitwidth 256 > $(OUTS)" ) diff --git a/zirgen/compiler/codegen/test/lit.site.cfg b/zirgen/compiler/codegen/test/lit.site.cfg index a10e5dec..58462f39 100644 --- a/zirgen/compiler/codegen/test/lit.site.cfg +++ b/zirgen/compiler/codegen/test/lit.site.cfg @@ -15,7 +15,7 @@ config.suffixes = [".mlir"] # This is different from the root configuration. Modify the exec root so that # the relative path of the template files used for codegen are resolved # correctly at test execution time. -config.test_exec_root = os.environ["RUNFILES_DIR"] + "/zirgen/zirgen" +config.test_exec_root = os.environ["RUNFILES_DIR"] + "/_main" tool_names = [ ToolSubst("FileCheck", unresolved="fatal"), diff --git a/zirgen/lit.cfg b/zirgen/lit.cfg index 5f04809d..ebde1c8d 100644 --- a/zirgen/lit.cfg +++ b/zirgen/lit.cfg @@ -12,8 +12,6 @@ config.test_format = formats.ShTest(True) # by individual lit.local.cfg files in the test subdirectories. config.suffixes = [".mlir", ".zir"] -config.test_exec_root = os.environ["RUNFILES_DIR"] - tool_names = [ ToolSubst("FileCheck", unresolved="fatal"), ToolSubst("not", unresolved="fatal"),