Skip to content

Commit abb0bb4

Browse files
committed
start: Fix ++ usage in inline asm string construction.
1 parent 9ef16b3 commit abb0bb4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/std/start.zig

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,15 +277,16 @@ fn _start() callconv(.Naked) noreturn {
277277
,
278278
// zig fmt: off
279279
.csky =>
280-
if (builtin.position_independent_code)
280+
(if (builtin.position_independent_code)
281281
// The CSKY ABI assumes that `gb` is set to the address of the GOT in order for
282282
// position-independent code to work. We depend on this in `std.os.linux.start_pie`
283283
// to locate `_DYNAMIC` as well.
284284
\\ grs t0, 1f
285285
\\ 1:
286286
\\ lrw gb, 1b@GOTPC
287287
\\ addu gb, t0
288-
else ""
288+
\\
289+
else "")
289290
++
290291
\\ movi lr, 0
291292
\\ mov a0, sp
@@ -311,7 +312,7 @@ fn _start() callconv(.Naked) noreturn {
311312
// zig fmt: off
312313
.riscv32, .riscv64 =>
313314
// The self-hosted riscv64 backend is not able to assemble this yet.
314-
if (builtin.zig_backend != .stage2_riscv64)
315+
(if (builtin.zig_backend != .stage2_riscv64)
315316
// The RISC-V ELF ABI assumes that `gp` is set to the value of `__global_pointer$` at
316317
// startup in order for GP relaxation to work, even in static builds.
317318
\\ .weak __global_pointer$
@@ -320,7 +321,8 @@ fn _start() callconv(.Naked) noreturn {
320321
\\ .option norelax
321322
\\ lla gp, __global_pointer$
322323
\\ .option pop
323-
else ""
324+
\\
325+
else "")
324326
++
325327
\\ li s0, 0
326328
\\ li ra, 0

0 commit comments

Comments
 (0)