Skip to content

Commit

Permalink
Workaround for stack-protector nonsense
Browse files Browse the repository at this point in the history
  • Loading branch information
zeldin committed Aug 12, 2023
1 parent 739c1c3 commit c70ffb3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ INCLUDE = -I.
GENDEP = -MMD -MP
DEFS = -DPLL_FBDIV=20

CFLAGS = -std=c11 $(CGENFLAGS) $(WARN) $(OPTIMIZE) $(INCLUDE) $(GENDEP) $(DEFS)
CFLAGS = -std=c11 $(CGENFLAGS) $(WARN) $(OPTIMIZE) $(INCLUDE) $(GENDEP) $(DEFS) -fno-stack-protector
LDFLAGS = -static -nostartfiles -T bsp/fx3.ld -Wl,-z,max-page-size=4096,-Map,$(basename $@).map

VPATH = bsp
Expand Down
6 changes: 6 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ int main(void)
}
}

/* Workaround for handling newlib being compiled with ssp */
uintptr_t __stack_chk_guard = 0x00000aff;
void __stack_chk_fail(void)
{
}

/* Newlib's assert() calls this function if the assertion fails */
void
__assert_func (const char *file,
Expand Down

0 comments on commit c70ffb3

Please sign in to comment.