ladybird/Toolchain/Patches/gcc/0007-libstdc-Build-static-library-with-fPIC.patch
Daniel Bertalan ae21002cb5 Toolchain+Ports: Update GCC to 13.2.0
This is a minor bugfix release, which to my knowledge contains nothing
of importance to us. However, there is one QoL change to our patches.

We no longer force `-fpic` in the compiler driver, and instead use the
`--enable-default-pie` configure option to generate position-independent
code suitable for executables. For building shared libraries, the
`-fpic` flag must be specified explicitly.
2023-09-18 10:26:42 +02:00

30 lines
1.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Daniel Bertalan <dani@danielbertalan.dev>
Date: Mon, 11 Sep 2023 16:37:27 +0200
Subject: [PATCH] libstdc++: Build static library with -fPIC
We want the libstdc++.a library to contain -fPIC code in order to link
it statically into LibC/our shared objects. However, the build system
forces no-pic/pie instead.
This hack is from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58638
---
libstdc++-v3/configure | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index bd6c4ed05cb9621f855ed15d8e0825e5fc4d2d8c..de0adb98973432cd6ee8e42adeaf5efa74546484 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -15624,8 +15624,8 @@ if test "$enable_shared" = yes; then
glibcxx_compiler_shared_flag="-D_GLIBCXX_SHARED"
else
- glibcxx_lt_pic_flag=
- glibcxx_compiler_pic_flag=
+ glibcxx_lt_pic_flag="-prefer-pic"
+ glibcxx_compiler_pic_flag="$lt_prog_compiler_pic_CXX"
glibcxx_compiler_shared_flag=
fi