+++ This bug was initially created as a clone of Bug #6482 +++ Please
see there for more info. I eyeballed my Testsuite logs and found a
number of test were UNSUPPORTED and should be enabled, here is one:

The file: "gcc_trunk/gcc/config/sol2.h" is setting SUPPORTS_INIT_PRIORITY
incorrectly.


Dropping this hack in for a test and to derive the patch:

#undef SUPPORTS_INIT_PRIORITY
#define SUPPORTS_INIT_PRIORITY 0
/* Added - Start - Support OpenSolaris using GNU ld */
/* From file: gcc_trunk/gcc/config/sparc/sol2-gld.h */
/* Definitions of target machine for GCC, for i386 running Solaris 2
   using the GNU linker.  */

/* Undefine this so that attribute((init_priority)) works.  */
#undef CTORS_SECTION_ASM_OP
#undef DTORS_SECTION_ASM_OP

/* From file: gcc_trunk/gcc/config/pa/pa64-hpux.h */
/* The init_priority attribute is not supported with HP ld.  This could be
   supported if collect2 was used with LD_INIT_SWITCH.  Unfortunately, this
   approach doesn't work with GNU ld since HP-UX doesn't support DT_INIT,
   and therefore the -init and -fini GNU ld switches.  */
#undef SUPPORTS_INIT_PRIORITY
#define SUPPORTS_INIT_PRIORITY (TARGET_GNU_LD ? 1 : 0)
/* Added - End - Support OpenSolaris using GNU ld */



# gcc/xgcc -v
Using built-in specs.
Target: i386-pc-solaris2.11
Configured with: ../gcc_trunk/configure
--enable-languages=ada,c,c++,fortran,java,objc,obj-c++ --enable-shared
--disable-static --enable-decimal-float --with-long-double-128 --enable-nls
--with-included-gettext --enable-gather-detailed-mem-stats --with-stabs
--enable-debug --enable-largefile --enable-symvers --without-system-zlib
--enable-gtk-cairo --enable-gconf-peer --enable-xmlj --enable-gtk-peer
--enable-qt-peer --enable-plugin --enable-tool-wrappers --enable-local-sockets
--enable-gjdoc --enable-java-awt=gtk,xlib,qt,x --enable-gc-debug
--enable-libgcj-debug --enable-objc-gc --enable-libstdcxx-debug
--disable-stage1-checking --enable-checking=release --without-system-libunwind
--with-gnu-as --with-as=/usr/local/bin/as --with-gnu-ld
--with-ld=/usr/local/bin/ld
Thread model: posix
gcc version 4.4.0 20090117 (experimental) [trunk revision 143454] (GCC) 

Rob


-- 
           Summary: gcc 4.4.0 20090117 -  init_priority incorrect for GNU ld
                    in "gcc/config/sol2.h"
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rob1weld at aol dot com
 GCC build triplet: *-*-solaris2*
  GCC host triplet: *-*-solaris2*
GCC target triplet: *-*-solaris2*


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38924

Reply via email to