This is the mail archive of the
mailing list for the libstdc++ project.
Re: patch to check ld
- To: jason at redhat dot com
- Subject: Re: patch to check ld
- From: Phil Edwards <pedwards at disaster dot jaj dot com>
- Date: Mon, 31 Jul 2000 12:40:58 -0400
- Cc: libstdc++ at sources dot redhat dot com
Jason Merrill <firstname.lastname@example.org>:
> Phil Edwards <email@example.com> writes:
> > I could see the linker's -On only being turned on at the compiler's
> > -O(n+delta), but (n+delta) would probably still be used for all the object
> > files, not just the final step.
> > Maybe gcc needs an -Ofinal to do things that only make good sense when
> > creating a binary (or a library).
> That seems silly. Under what circumstances would you want to compile
> with optimization but link without or vice versa? Seems to me that a
> -O on the compiler link command line should pass through to the
> linker, though perhaps only for n>1.
Well, sort of. My assumption was that when linking, you'd use /at least/
whatever was used when compiling. Feeding -O1 to gld can be really
Say, during compiling, one would pass -On, and when linking, one would pass
-On -Ofinal. The latter would pass on to the linker all those flags that
make sense for linking. And if -Ofinal were passed during a compile-only
step, it would be ignored.
I suppose this behavior could be built in to the current -On setup, though.
> And perhaps there should be an -flink-gc option that would imply
> -ffunction-sections -fdata-sections -fvtable-gc -Wl,--gc-sections.
I'd go for that.