This is the mail archive of the gcc@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]

Re: -fno-exceptions and libgcc.a



>>>>> "Paul" == Paul Koning <pkoning@xedia.com> writes:

>>>>> "Mark" == Mark Mitchell <mmitchell@usa.net> writes:

>>>>> "Per" == Per Bothner <bothner@cygnus.com> writes:

    >>>> It is reasonable to either change the default for exception
    >>>> handling to off for C,

    Per> I don't understand why there is even any discussion of this.
    Per> The default for C *has* to -fno-exceptions, unless there is
    Per> *no* cost for code that does not use the exceptions.
    Per> Anything else is a public relations disaster in terms of the
    Per> perceived code quality of gcc.  This *must* be fixed before
    Per> egcs (or gcc 2.8) is released.

    Mark> I suggest a different scheme:

    Mark> o The default remains -fno-exceptions when compiling.

    Mark> o At link-time, if gcc is used to link the executable, we
    Mark> remove the .eh_frame section.  If g++/c++ is used, we keep
    Mark> it.

    Paul> Hm. I tend to forget "g++" even exists -- I always compile
    Paul> everything by calling "gcc" and letting it sort out what to
    Paul> do with the file.  That's the whole point of the existence
    Paul> of the gcc front end driver, isn't it?

    Paul> So if I say "gcc foo.cc" it would be nice to have the Right
    Paul> Thing happen.  It is undesirable to have to change
    Paul> makefiles.

I'm a little confused.  You're correct that "gcc foo.cc" knows that
foo.cc is C++, but it doesn't link with the C++ standard library.
But, I agree, in this case, we should leave the .eh_frame section in.
So, consider that a modification to my suggestion.

    Paul> Conversely, you also need a solution for those who invoke
    Paul> "ld" directly (as opposed to indirectly via gcc or g++).

Well, we're going to need a means of dropping the entire .eh_frame
section at link-time in my scheme.  This means that ld will have to do
this for us, and that we'll have to tell it to do so.  Therefore,
there's a way for a user to do this when invoking ld directly.

    Paul> 	paul

-- 
Mark Mitchell		mmitchell@usa.net
Stanford University	http://www.stanford.edu



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