Julia Vassiliki c406015c38 cmake: remove default flags added to the compiler
Previously, CMake defaults to adding various flags to the compile
options, such as `-O3`, `-DNDEBUG`, and `-g`. Here is an excerpt from
CMakeCache.txt:

    //Flags used by the C compiler during RELEASE builds.
    CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG

    //Flags used by the C compiler during RELWITHDEBINFO builds.
    CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG

We instead change the CMAKE_BUILD_TYPE to 'None' so that CMake
doesn't try to be clever and append extra compile flags. Anything
that depends on seL4 will be unaffected as CMake variables are scoped.

This should have no meaningful change to the kernel's generated code,
as the compile flags were being overridden anyway.

Relevant parts of the build.ninja file for comparison:

- Now, `-DRELEASE=ON`:

    FLAGS = -march=armv8-a  -D__KERNEL_64__ -std=c99 -Wall -Werror
            -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs
            -Wmissing-declarations -Wundef -Wpointer-arith -Wno-nonnull
            -nostdinc -ffreestanding -fno-stack-protector
            -fno-asynchronous-unwind-tables -fno-common -O2 -nostdlib
            -fno-pic -fno-pie -mgeneral-regs-only -mno-outline-atomics
            -E -CC -I/sel4test-manifest/build/kernel/generated_prune

- Before, `-DRELEASE=ON`:

    FLAGS = -march=armv8-a  -D__KERNEL_64__ -O3 -DNDEBUG -std=c99 -Wall
             -Werror -Wstrict-prototypes -Wmissing-prototypes
             -Wnested-externs -Wmissing-declarations -Wundef
             -Wpointer-arith -Wno-nonnull -nostdinc -ffreestanding
             -fno-stack-protector -fno-asynchronous-unwind-tables
             -fno-common -O2 -nostdlib -fno-pic -fno-pie
             -mgeneral-regs-only -mno-outline-atomics -E -CC
             -I/sel4test-manifest/build/kernel/generated_prune

Note the lack of -O3 -DNDEBUG options.

Signed-off-by: Julia Vassiliki <julia.vassiliki@unsw.edu.au>
2026-03-12 12:30:37 +11:00
2026-03-12 11:28:26 +11:00
2026-03-12 11:28:26 +11:00
2025-11-25 09:33:58 +11:00
2020-04-01 17:23:36 +08:00
2026-03-12 11:28:26 +11:00
2026-03-12 11:28:26 +11:00
2025-05-26 06:01:48 +02:00
2022-05-18 13:40:55 +10:00
2025-02-26 17:11:57 +11:00
2025-11-25 09:35:53 +11:00

The seL4 microkernel

CII Best Practices CI seL4Test C Parser Compile Proof Sync RefMan XML

This project contains the source code of seL4 microkernel.

For details about the seL4 microkernel, including details about its formal correctness proof, please see the sel4.systems website and associated FAQ.

DOIs for citing recent releases of this repository:

  • DOI

We welcome contributions to seL4. Please see the website for information on how to contribute.

This repository is usually not used in isolation, but as part of the build system in a larger project.

seL4 Basics

Community

See also the contact links on the seL4 website.

Reporting security vulnerabilities

If you believe you have found a security vulnerability in seL4 or related software, we ask you to follow our vulnerability disclosure policy.

Manual

A hosted PDF version of the manual for the most recent release can be found here.

A web version of the API documentation is available as well.

Repository Overview

  • include and src: C and ASM source code of seL4
  • tools: build tools
  • libsel4: C bindings for the seL4 ABI
  • manual: LaTeX sources of the seL4 reference manual

Build Instructions

See the seL4 website for build instructions.

Status

License

See the file LICENSE.md.

Description
The seL4 microkernel
Readme 25 MiB
Languages
C 72.7%
Python 9.5%
CMake 6.2%
TeX 5.8%
Assembly 2.7%
Other 3.1%