Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .gitmodules

This file was deleted.

86 changes: 2 additions & 84 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -75,64 +75,7 @@ pub fn build(b: *std.Build) !void {
.optimize = optimize,
});
const mod_httpz = httpz.module("httpz");

const ethash = b.addStaticLibrary(.{
.name = "ethash",
.optimize = optimize,
.target = target,
});
const cflags = [_][]const u8{
"-Wall", "-O3", "-fvisibility=hidden",
"-fvisibility-inlines-hidden", "-Wpedantic", "-Werror",
"-Wextra", "-Wshadow", "-Wconversion",
"-Wsign-conversion", "-Wno-unknown-pragmas", "-fno-stack-protector",
"-Wimplicit-fallthrough", "-Wmissing-declarations", "-Wno-attributes",
"-Wextra-semi", "-fno-exceptions", "-fno-rtti",
"-Wno-deprecated", // this one is used to remove a warning about char_trait deprecation
"-Wno-strict-prototypes", // this one is used by glue.c to avoid a warning that does not disappear when the prototype is added.
};
ethash.addCSourceFiles(.{ .root = b.path(""), .files = &[_][]const u8{"ethash/lib/keccak/keccak.c"}, .flags = &cflags });
ethash.addIncludePath(b.path("ethash/include"));
ethash.linkLibC();
ethash.linkLibCpp();
b.installArtifact(ethash);

const evmone = b.addStaticLibrary(.{
.name = "evmone",
.optimize = optimize,
.target = target,
});
const cppflags = [_][]const u8{
"-Wall", "-std=c++20", "-O3",
"-fvisibility=hidden", "-fvisibility-inlines-hidden", "-Wpedantic",
"-Werror", "-Wextra", "-Wshadow",
"-Wconversion", "-Wsign-conversion", "-Wno-unknown-pragmas",
"-fno-stack-protector", "-Wimplicit-fallthrough", "-Wmissing-declarations",
"-Wno-attributes", "-Wextra-semi", "-fno-exceptions",
"-fno-rtti",
"-Wno-deprecated", // this one is used to remove a warning about char_trait deprecation
"-DPROJECT_VERSION=\"0.14.0-dev\"",
};
evmone.addCSourceFiles(.{ .root = b.path(""), .files = &[_][]const u8{
"evmone/lib/evmone/advanced_analysis.cpp",
"evmone/lib/evmone/eof.cpp",
"evmone/lib/evmone/advanced_execution.cpp",
"evmone/lib/evmone/instructions_calls.cpp",
"evmone/lib/evmone/advanced_instructions.cpp",
"evmone/lib/evmone/instructions_storage.cpp",
"evmone/lib/evmone/baseline.cpp",
"evmone/lib/evmone/tracing.cpp",
"evmone/lib/evmone/baseline_instruction_table.cpp",
"evmone/lib/evmone/vm.cpp",
}, .flags = &cppflags });

evmone.addIncludePath(b.path("evmone/evmc/include"));
evmone.addIncludePath(b.path("evmone/include"));
evmone.addIncludePath(b.path("intx/include"));
evmone.addIncludePath(b.path("ethash/include"));
evmone.linkLibC();
evmone.linkLibCpp();
b.installArtifact(evmone);
const zevem = b.dependency("zevem", .{ .target = target, .optimize = optimize });

const zigcli = b.dependency("zigcli", .{});

Expand All @@ -144,19 +87,7 @@ pub fn build(b: *std.Build) !void {
.target = target,
.optimize = optimize,
});
exe.addIncludePath(b.path("evmone/include/evmone"));
exe.addIncludePath(b.path("evmone/evmc/include"));
if (target.result.cpu.arch == .x86_64) {
// On x86_64, some functions are missing from the static library,
// so we define dummy functions to make sure that it compiles.
exe.addCSourceFile(.{
.file = b.path("src/glue.c"),
.flags = &cflags,
});
}
exe.linkLibrary(ethash);
exe.linkLibrary(evmone);
exe.linkLibC();
exe.root_module.addImport("zevem", zevem.module("zevem"));
exe.root_module.addImport("zig-rlp", dep_rlp.module("zig-rlp"));
exe.linkLibrary(depSecp256k1.artifact("secp256k1"));
exe.root_module.addImport("zig-eth-secp256k1", mod_secp256k1);
Expand Down Expand Up @@ -199,19 +130,6 @@ pub fn build(b: *std.Build) !void {
.target = target,
.optimize = optimize,
});
unit_tests.addIncludePath(b.path("evmone/include/evmone"));
unit_tests.addIncludePath(b.path("evmone/evmc/include"));
if (target.result.cpu.arch == .x86_64) {
// On x86_64, some functions are missing from the static library,
// so we define dummy functions to make sure that it compiles.
unit_tests.addCSourceFile(.{
.file = b.path("src/glue.c"),
.flags = &cflags,
});
}
unit_tests.linkLibrary(ethash);
unit_tests.linkLibrary(evmone);
unit_tests.linkLibC();
unit_tests.root_module.addImport("zig-rlp", dep_rlp.module("zig-rlp"));
unit_tests.linkLibrary(depSecp256k1.artifact("secp256k1"));
unit_tests.root_module.addImport("zig-eth-secp256k1", mod_secp256k1);
Expand Down
12 changes: 8 additions & 4 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@
.hash = "12201b3645a414dffc2bca872a1467b549d0029b9e36c80fcaeb22a06ec27fab9aee",
},
.@"zig-eth-secp256k1" = .{
.url = "https://github.com/jsign/zig-eth-secp256k1/archive/95b7f93.tar.gz",
.hash = "1220c0cf921a5311489bdd6eaf2f2b82bc9245ba39c2da346039aa311e28db633828",
.url = "https://github.com/jsign/zig-eth-secp256k1/archive/6cf0d1f.tar.gz",
.hash = "1220e3c49d0a2e0e7e84dcc3f8ca00b357af526a8ea28d3c848001d72bda4ddc1e66",
},
.httpz = .{
.url = "https://github.com/karlseguin/http.zig/archive/c224ebb.tar.gz",
.hash = "12206297df84406cd4eed306acef30eb2a1a6a18b6771ebb4920391a3a7299b2e6a7",
.url = "https://github.com/karlseguin/http.zig/archive/46753ab.tar.gz",
.hash = "12207dbe64a04fb960156cbc990153cb3637a08e3fe23077c7199621b5c6377f5d20",
},
.zigcli = .{
.url = "https://github.com/jiacai2050/zigcli/archive/54d095c.tar.gz",
.hash = "1220e8fb37224ab6ee9c575129594a808643b548596d63dd8b87cb42e22a7eed9f51",
},
.zevem = .{
.url = "https://github.com/gballet/zevem/archive/3ce1930.tar.gz",
.hash = "1220be22307447ddcb715ab71e14cd58e00215408bc235fb143a58fa8a4b51fd72ae",
},
},
.paths = .{""},
}
1 change: 0 additions & 1 deletion ethash
Submodule ethash deleted from 8e18c3
1 change: 0 additions & 1 deletion evmone
Submodule evmone deleted from 095f83
1 change: 0 additions & 1 deletion intx
Submodule intx deleted from 2ab1e8
Loading
Loading