[Bug libstdc++/58638] libstdc++ builds as non-PIC when --with-pic is specified
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Aug 1 23:07:42 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58638
--- Comment #14 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Alec Ari from comment #11)
> This fix worked for me:
>
> --- a/libstdc++-v3/configure.ac
> +++ b/libstdc++-v3/configure.ac
> @@ -121,8 +121,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
>
> (no elif / no else if)
But this means always PIC, doesn't it? Even if you build with --disable-shared
and --without-pic. Surely that's not right? Why is this better than comment 9?
More information about the Gcc-bugs
mailing list