Skip to content

libmicrokit,loader,monitor: omit stack protector - #612

Merged
dreamliner787-9 merged 1 commit into
seL4:mainfrom
au-ts:no_stack_proc
Sep 28, 2026
Merged

dreamliner787-9 merged 1 commit into
seL4:mainfrom
au-ts:no_stack_proc

Conversation

@dreamliner787-9

Copy link
Copy Markdown
Collaborator

Some distro-packaged compilers enable Stack Smashing Protection (SSP) by default, even with -ffreestanding.

If you build Microkit with such a compiler for the same architecture as your host (i.e. using the native rather than a cross toolchain), linking fails with:

ld.lld: error: undefined symbol: __stack_chk_fail
>>> referenced by util.c:0 (... /monitor/src/util.c:0)
...

This is fixed this by building libmicrokit, loader and monitor with -fno-stack-protector.

Some distro-packaged compilers enable Stack Smashing Protection (SSP)
by default, even with -ffreestanding.

If you build Microkit with such a compiler for the same architecture as
your host (i.e. using the native rather than a cross toolchain), linking
fails with:

```
ld.lld: error: undefined symbol: __stack_chk_fail
>>> referenced by util.c:0 (... /monitor/src/util.c:0)
...
```

This is fixed this by building libmicrokit, loader and monitor with
-fno-stack-protector.

Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>

@midnightveil midnightveil left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hate how compilers do this...

@dreamliner787-9
dreamliner787-9 merged commit e4c9ddb into seL4:main Sep 28, 2026
12 checks passed
@midnightveil
midnightveil deleted the no_stack_proc branch September 28, 2026 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants