feat: use PIC code model for shared libraries, fix shared library bugs

This commit is contained in:
2026-04-08 17:07:55 +02:00
parent d87c14da25
commit 28d0614511
10 changed files with 85 additions and 25 deletions
+3 -1
View File
@@ -11,6 +11,8 @@ NM := $(TOOLCHAIN_PREFIX)nm
STRIP := $(TOOLCHAIN_PREFIX)strip
# Compiler flags: freestanding, no stdlib
# Build as PIE so library-internal data references remain valid after the
# kernel maps the image into a per-process library slot.
override CXXFLAGS := \
-std=gnu++20 \
-g -O2 -pipe \
@@ -20,7 +22,7 @@ override CXXFLAGS := \
-ffreestanding \
-fno-stack-protector \
-fno-stack-check \
-fno-PIC \
-fPIE \
-fno-rtti \
-fno-exceptions \
-ffunction-sections \