From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan 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