liblinux++

A hosted C++ runtime without any libc.
git clone git://henryandlizzy.uk/liblinux++
Log | Files | Refs

commit 5e873cd7c3214b4ed864d9b401c90ada53dfa7a8
parent 8f03e8f444bc682ee4c7ef819c0662783229bd1a
Author: Henry Wilson <henry@henryandlizzy.uk>
Date:   Sat,  3 Jan 2026 14:02:49 +0000

C++23 and support functions

Diffstat:
MTupfile | 2+-
Mlinux.hpp | 17+++++++++++++++++
2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/Tupfile b/Tupfile @@ -1,4 +1,4 @@ -CXXFLAGS = -Werror -g -Os -fno-exceptions -fno-rtti -fno-asynchronous-unwind-tables -fno-builtin -fno-pic -fno-pie -fno-stack-protector -fdiagnostics-color=always +CXXFLAGS = -std=c++23 -Werror -g -fno-exceptions -fno-rtti -fno-asynchronous-unwind-tables -fno-builtin -fno-pic -fno-pie -fno-stack-protector -fdiagnostics-color=always LDFLAGS = --gc-sections : foreach *.cpp |> clang++ --target=aarch64 $(CXXFLAGS) -c -o %o %f |> obj/%B.aarch64.o {objs-aarch64} diff --git a/linux.hpp b/linux.hpp @@ -196,3 +196,20 @@ enum class unlink_flags : int }; extern syscall_result<void> unlinkat(file dir, c_str path, unlink_flags flags); + +extern "C" +{ + +void memset(char* p, size_t n, char c) +{ + char* const end = p + n; + while (p != end) + *p++ = c; +} + +void __cxa_pure_virtual() +{ + __builtin_trap(); +} + +}