[Bug libstdc++/58638] libstdc++ builds as non-PIC when --with-pic is specified

2014-03-03 Thread fredrik at lysator dot liu.se
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58638

Fredrik Nyström  changed:

   What|Removed |Added

 CC||fredrik at lysator dot liu.se

--- Comment #3 from Fredrik Nyström  ---
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.0 +0100
+++ libstdc++-v3/configure  2014-03-03 20:01:32.0 +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

[Bug bootstrap/65725] Bootstrap errors on Solaris 10 x86-64, including object diffs

2015-09-07 Thread fredrik at lysator dot liu.se
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65725

Fredrik Nyström  changed:

   What|Removed |Added

 CC||fredrik at lysator dot liu.se

--- Comment #3 from Fredrik Nyström  ---
(In reply to Daniel Richard G. from comment #0)
> 1. Missing libgcc-unwind.map file

1. Is caused by LINK_LIBGCC_MAPFILE_SPEC being set in gcc/config/sol2.h even if
configured with --disable-shared. This has been around since PR target/59788.

I've had success on solaris 10, both sparc and x86 with following fix.

--- gcc/config/sol2.h.orig  2014-05-28 13:37:50.0 +0200
+++ gcc/config/sol2.h   2015-09-03 14:23:19.950566000 +0200
@@ -174,7 +174,7 @@
 #define RDYNAMIC_SPEC "--export-dynamic"
 #endif

-#ifndef USE_GLD
+#if !defined(USE_GLD) && defined(ENABLE_SHARED_LIBGCC)
 /* With Sun ld, use mapfile to enforce direct binding to libgcc_s unwinder. 
*/
 #define LINK_LIBGCC_MAPFILE_SPEC \
   "%{shared|shared-libgcc:-M %slibgcc-unwind.map}"

Also "--disable-shared --with-pic" is still broken (since 4.7.?), see PR
libstdc++/58638 for suggested patch.


> 2. stage2 vs. stage3 diffs

Are you sure you want /usr/ccs/bin/as on solaris x86?
Have you tried with gnu as?
--with-gnu-as
--with-as=/usr/sfw/bin/gas