git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 10, 2006, 11:40 UTC
Message-ID
<Pine.LNX.4.63.0607101340080.29667@wbgn013.biozentrum.uni-wuerzburg.de>

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. So, put the variable into environment.o, where it is linked always.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
 environment.c |    1 +
 pager.c       |    2 --
 2 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/environment.c b/environment.c
index 43823ff..97d42b1 100644
--- a/environment.c
+++ b/environment.c
@@ -21,6 +21,7 @@ char git_commit_encoding[MAX_ENCODING_LE
 int shared_repository = PERM_UMASK;
 const char *apply_default_whitespace = NULL;
 int zlib_compression_level = Z_DEFAULT_COMPRESSION;
+int pager_in_use;
 
 static char *git_dir, *git_object_dir, *git_index_file, *git_refs_dir,
 	*git_graft_file;
diff --git a/pager.c b/pager.c
index bb14e99..280f57f 100644
--- a/pager.c
+++ b/pager.c
@@ -5,8 +5,6 @@ #include "cache.h"
  * something different on Windows, for example.
  */
 
-int pager_in_use;
-
 static void run_pager(const char *pager)
 {
 	execlp(pager, pager, NULL);
-- 
1.4.1.g6e33b-dirty
Next: Junio C Hamano
Message 1 of 5 in “Fix linking for not-so-clever linkers.”
  1. Fix linking for not-so-clever linkers.Johannes Schindelin, Jul 10, 2006
  2. Junio C HamanoJul 10, 2006
  3. Linus TorvaldsJul 10, 2006
  4. Junio C HamanoJul 10, 2006
  5. Johannes SchindelinJul 10, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.