aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorKenta Iwasaki <kenta@lithdew.net>2022-01-01 06:32:37 +0900
committerAndrew Kelley <andrew@ziglang.org>2022-01-19 11:22:10 -0700
commit5ae3e4e9bd5216c7cc2305c8996ed413c89c59e7 (patch)
treefc0a9852022f89d33d249540527296e7477e7f19 /lib/std
parentbeb7495e19d23b4814e16772888e80688ad10e47 (diff)
downloadzig-5ae3e4e9bd5216c7cc2305c8996ed413c89c59e7.tar.gz
zig-5ae3e4e9bd5216c7cc2305c8996ed413c89c59e7.zip
lld: allow for entrypoint symbol name to be set
This commit enables for the entrypoint symbol to be set when linking ELF or WebAssembly modules with lld using the Zig compiler.
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/build.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/std/build.zig b/lib/std/build.zig
index 09f57a8cfa..47f721c2ba 100644
--- a/lib/std/build.zig
+++ b/lib/std/build.zig
@@ -1554,6 +1554,9 @@ pub const LibExeObjStep = struct {
subsystem: ?std.Target.SubSystem = null,
+ /// Entrypoint symbol name
+ entry: ?[]const u8 = null,
+
/// Overrides the default stack size
stack_size: ?u64 = null,
@@ -2255,6 +2258,11 @@ pub const LibExeObjStep = struct {
try zig_args.append(@tagName(builder.color));
}
+ if (self.entry) |entry| {
+ try zig_args.append("--entry");
+ try zig_args.append(entry);
+ }
+
if (self.stack_size) |stack_size| {
try zig_args.append("--stack");
try zig_args.append(try std.fmt.allocPrint(builder.allocator, "{}", .{stack_size}));