This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/14391] New: -fno-weak vs. __GXX_WEAK__


I'd like to be able to test, on linux, what it's like for those poor souls that
use g++/libstdc++ without support for weak symbols. Suckers!

Look for -fno-weak:
http://gcc.gnu.org/onlinedocs/gcc/C---Dialect-Options.html#C++%20Dialect%20Options

Yeah, this works, linkage-wise. However, using -fno-weak on linux doesn't
undefine __GXX_WEAK__, which makes it less useful for me, since this is what the
libstc++ tests use to determine if the active compiler actually use weak symbols.

ie, this fails on linux:

g++ -fno-weak test.cc

test.cc:
#if !defined(__GXX_WEAK__)
#error should_be_here
#else
#error should_not_be_here
#endif

gives:

#error should_not_be_here

This has been broken since at least 3.3.2.

-benjamin

-- 
           Summary: -fno-weak vs. __GXX_WEAK__
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bkoz at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]