This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/58638] libstdc++ builds as non-PIC when --with-pic is specified
- From: "fredrik at lysator dot liu.se" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 03 Mar 2014 19:30:26 +0000
- Subject: [Bug libstdc++/58638] libstdc++ builds as non-PIC when --with-pic is specified
- Auto-submitted: auto-generated
- References: <bug-58638-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58638
Fredrik NystrÃm <fredrik at lysator dot liu.se> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fredrik at lysator dot liu.se
--- Comment #3 from Fredrik NystrÃm <fredrik at lysator dot liu.se> ---
Seems to be a bug in libstdc++-v3/configure, same in both gcc-4.8 and gcc-4.9.
Suggested fix:
--- libstdc++-v3/configure~ 2013-11-22 14:17:55.000000000 +0100
+++ libstdc++-v3/configure 2014-03-03 20:01:32.000000000 +0100
@@ -14909,25 +14909,25 @@
# libtool variables for C++ shared and position-independent compiles.
#
# Use glibcxx_lt_pic_flag to designate the automake variable
# used to encapsulate the default libtool approach to creating objects
# with position-independent code. Default: -prefer-pic.
#
# Use glibcxx_compiler_shared_flag to designate a compile-time flags for
# creating shared objects. Default: -D_GLIBCXX_SHARED.
#
# Use glibcxx_compiler_pic_flag to designate a compile-time flags for
# creating position-independent objects. This varies with the target
# hardware and operating system, but is often: -DPIC -fPIC.
-if test "$enable_shared" = yes; then
+if test "$enable_shared" = yes || test "${with_pic+set}" = set; then
glibcxx_lt_pic_flag="-prefer-pic"
glibcxx_compiler_pic_flag="$lt_prog_compiler_pic_CXX"
glibcxx_compiler_shared_flag="-D_GLIBCXX_SHARED"
else
glibcxx_lt_pic_flag=
glibcxx_compiler_pic_flag=
glibcxx_compiler_shared_flag=
fi