Skip to content

Commit

Permalink
Add stack protection flag to compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgecrw committed Jun 20, 2023
1 parent 803e741 commit 628fea3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/c/Posix/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ COMPILE_FREEBSD_X86_64 := clang -target x86_64-unknown-freebsd11.2 --sysroo
COMPILE_FREEBSD_ARM64 := clang -target arm64-unknown-freebsd11.2 --sysroot=$(HOME)/x-tools/arm64-unknown-freebsd11.2
COMPILE_OPENBSD_X86 := clang -target i386-unknown-openbsd6.2 --sysroot=$(HOME)/x-tools/i386-unknown-openbsd6.2
COMPILE_OPENBSD_X86_64 := clang -target amd64-unknown-openbsd6.2 --sysroot=$(HOME)/x-tools/amd64-unknown-openbsd6.2
CFLAGS_POSIX := -fPIC -Os -flto -static-libgcc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -fuse-linker-plugin
CFLAGS_POSIX := -fPIC -Os -flto -static-libgcc -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -fuse-linker-plugin
CFLAGS_APPLE := -fPIC -Os -flto -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
LDFLAGS_POSIX := -Os -flto -static-libgcc -shared -fuse-linker-plugin -s
LDFLAGS_FREEBSD := -fuse-ld=lld -O3 -flto -shared -s -fuse-linker-plugin
Expand Down
5 changes: 5 additions & 0 deletions src/main/c/Posix/PosixHelperFunctions.c
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,11 @@ void searchForComPorts(serialPortVector* comPorts)
}
}

uint32_t __stack_chk_fail_local()
{
return 0;
}

int flock(int fd, int op)
{
int rc = 0;
Expand Down

0 comments on commit 628fea3

Please sign in to comment.