feat: use PIC code model for shared libraries, fix shared library bugs
This commit is contained in:
@@ -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 \
|
||||
|
||||
Reference in New Issue
Block a user