Skip to content

Commit

Permalink
Add flags when compiling assembly files too.
Browse files Browse the repository at this point in the history
This prevents a miscompilation due to position independent code.
The first instruction sequence, to load stack0 into sp, is incorrect.
  • Loading branch information
ahmedcharles committed Mar 6, 2023
1 parent f5b93ef commit 6871c19
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ CFLAGS += -fno-pie -nopie
endif

LDFLAGS = -z max-page-size=4096
ASFLAGS = $(CFLAGS)

$K/kernel: $(OBJS) $K/kernel.ld $U/initcode
$(LD) $(LDFLAGS) -T $K/kernel.ld -o $K/kernel $(OBJS)
Expand Down

0 comments on commit 6871c19

Please sign in to comment.