Re: [PATCH] Fix linking for not-so-clever linkers.

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] Fix linking for not-so-clever linkers.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:33

Johannes Schindelin [off-list ref] writes:
On one of my systems, the linker is not intelligent enough to link with
pager.o (in libgit.a) when only the variable pager_in_use is needed. The
consequence is that the linker complains about an undefined
variable.
I do not understand this quite yet -- which executable is your
linker building when it does this?

Maybe we need ranlib?

Re: [PATCH] Fix linking for not-so-clever linkers.

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:33


On Mon, 10 Jul 2006, Junio C Hamano wrote:
Johannes Schindelin [off-list ref] writes:
quoted
On one of my systems, the linker is not intelligent enough to link with
pager.o (in libgit.a) when only the variable pager_in_use is needed. The
consequence is that the linker complains about an undefined
variable.
I do not understand this quite yet -- which executable is your
linker building when it does this?

Maybe we need ranlib?
Shouldn't be needed, since we use "$(AR) rcs", where that "s" should do 
the equivalent of the old-fashioned "ranlib" call.

However, that said, I think Johannes' patch is worth applying regardless, 
since it's kind of sad to link in pager.o just because of a variable that 
ends up never mattering (ie any program that uses "diff.c" but isn't 
built-in).

Of course, once/if everything is built-in, this doesn't matter, but in the 
meantime this isn't the first time we've re-organized things so that you 
don't have to link in files that you don't need. After all, that was the 
whole reason environment.c ended up existing in the first place..

			Linus

Re: [PATCH] Fix linking for not-so-clever linkers.

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:42:33

Hi,

On Mon, 10 Jul 2006, Junio C Hamano wrote:
Johannes Schindelin [off-list ref] writes:
quoted
On one of my systems, the linker is not intelligent enough to link with
pager.o (in libgit.a) when only the variable pager_in_use is needed. The
consequence is that the linker complains about an undefined
variable.
I do not understand this quite yet -- which executable is your
linker building when it does this?
The problem arises for the first time with git-blame. (Have not checked 
which other executables might be affected.)
Maybe we need ranlib?
Does not help. pager.o is in libgit.a. Still, Darwin's linker does not 
want to link to pager.o (probably because no function from pager.o is 
called, so this is a real bug in the Darwin linker -- but being easy to 
fix, I think it is worthwhile to fix it).

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help