This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

Re: forcing the linker to be a particular one (i.e. gold vs bfd)


On 01/13/2011 08:33 PM, Ian Lance Taylor wrote:
Vladimir Simonov<sv@sw.ru> writes:

See link in my original e-mail.
http://svn.debian.org/viewsvn/gcccvs/branches/sid/gcc-4.4/debian/patches/gold-and-ld.diff?view=log&pathrev=4512

So. We have:
1. "-B" solution is unacceptable for package-based distributions.
In this case binutils-gold package must be introduced.
With different install-root. And so on...
2. Nick's patch implementing linker switch in gcc.
The patch may be slightly emended and pushed into gcc.
3. Matthias promises to implement the switch into
binutils. This patch may be pushed into binutils.

Am I correct?

IMO gcc/binutils maintainers opinion is important
here. What is the right place to do linker switch?

Ian?
Others?

It seems to clear to me that any choice of linker must be made in gcc, either in the gcc driver proper or in collect2.

I'm sorry I'm not up on the status of this.  Is there a patch awaiting
review?

Ian


Patch from Nick Clifton against gcc 4.4.x is here http://svn.debian.org/viewsvn/gcccvs/branches/sid/gcc-4.4/debian/patches/gold-and-ld.diff?view=log&pathrev=4512

I don't see Nick's comments so I suggest to discuss the patch.
Later it may be fixed according discussion results, adopted for
gcc trunk and put onto review by Nick, may be me, may be somebody
else.

I have the following points:
1. Looks like the patch is a bit outdated, with binutils-2.21 release ld/gold
placement/naming is defined and IMO the line
+  static const char *const gold_suffix       = "gold";
should be
+  static const char *const gold_suffix       = "ld.gold";

2. Ones you are not interested in "Single tree build" mode
support, the changes related to --enable-gold in configure.ac,
gcc/configure.ac, gcc/exec-tool.in may be dropped. They increase
the patch. After regeneration configures full patch becomes
about 25Kb.

3. It looks unclear for me what for conversion -fuse-ld=gold/ld into
-use-gold/-use-ld before call collect2 is used. I'd suggest to pass the
option to collect2 as is. In collect2 - extract
ld-name from the option, and use option's value as part of linker's name
for further search. This point is not too important for me.

OK?
Your opinion?

Regards
Vladimir

PS Could you briefly explain why changes in gcc/collect2 are better than
ones in binutils?
I've mentioned pro and contras - switch in binutils decreases binutils
install size, leaves gcc untouched but adds additional "exec" during link
process. Additional "exec" outweighs?


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