git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Compile Error on Git 2.0.1 on Redhat 5.9 with Fix
@ 2014-07-02 15:56 Eldon Nelson
  2014-07-02 16:25 ` Matthieu Moy
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eldon Nelson @ 2014-07-02 15:56 UTC (permalink / raw
  To: git

When compiling Git 2.0.1 on RedHat 5.9 as a non-root user I get the
following error:

BUILD ERROR

```
make prefix=/home/eldon/local all doc info
...
    CC zlib.o
    CC unix-socket.o
    CC thread-utils.o
    CC compat/strlcpy.o
    AR libgit.a
/bin/sh: gar: command not found
make: *** [libgit.a] Error 127
```

My fix was to make a symlink below:

SYMLINK

```
gar -> /usr/bin/ar
```

LINUX VERSION

```
> lsb_release -i -r
Distributor ID: RedHatEnterpriseClient
Release:        5.9
```

I think the fix is to allow the use of "ar" if "gar" does not exist. I
don't know if this exists for every Redhat install but "gar" is not
available in /usr/bin but "ar" does.

```
> /usr/bin/ar --version
GNU ar 2.17.50.0.6-20.el5_8.3 20061020
Copyright 2005 Free Software Foundation, Inc.
```

It could just be my corporate install of RedHat that is weird, but
thought this might be at least a point to describe a fix.

```
gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-54)
Copyright (C) 2006 Free Software Foundation, Inc.
```

~~~~~~~~~~~~
Eldon Nelson
eldon_nelson@ieee.org
Cell: 952-393-3481

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compile Error on Git 2.0.1 on Redhat 5.9 with Fix
  2014-07-02 15:56 Compile Error on Git 2.0.1 on Redhat 5.9 with Fix Eldon Nelson
@ 2014-07-02 16:25 ` Matthieu Moy
  2014-07-02 16:29 ` Jeff King
  2014-07-03 20:13 ` Eldon Nelson
  2 siblings, 0 replies; 4+ messages in thread
From: Matthieu Moy @ 2014-07-02 16:25 UTC (permalink / raw
  To: Eldon Nelson; +Cc: git

Eldon Nelson <eldon_nelson@ieee.org> writes:

> make prefix=/home/eldon/local all doc info
> ...
>     CC zlib.o
>     CC unix-socket.o
>     CC thread-utils.o
>     CC compat/strlcpy.o
>     AR libgit.a
> /bin/sh: gar: command not found
[...]
> I think the fix is to allow the use of "ar" if "gar" does not exist.

It is already the case. The Makefile defaults to "ar" and does not even
contain any mention of "gar". The configure script checks for both:

configure.ac:AC_CHECK_TOOLS(AR, [gar ar], :)

My guess is that you ran the configure script on a machine where gar is
present, and then used the result on a machine where it isn't.

Normally, at configure time you should see this:

checking for ar... ar

You actually don't need to run the configure script, the Makefile runs
fine without it. Delete config.mak.autogen to cancel the effect of
./configure.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compile Error on Git 2.0.1 on Redhat 5.9 with Fix
  2014-07-02 15:56 Compile Error on Git 2.0.1 on Redhat 5.9 with Fix Eldon Nelson
  2014-07-02 16:25 ` Matthieu Moy
@ 2014-07-02 16:29 ` Jeff King
  2014-07-03 20:13 ` Eldon Nelson
  2 siblings, 0 replies; 4+ messages in thread
From: Jeff King @ 2014-07-02 16:29 UTC (permalink / raw
  To: Eldon Nelson; +Cc: git

On Wed, Jul 02, 2014 at 10:56:25AM -0500, Eldon Nelson wrote:

> When compiling Git 2.0.1 on RedHat 5.9 as a non-root user I get the
> following error:
> 
> BUILD ERROR
> 
> ```
> make prefix=/home/eldon/local all doc info
> ...
>     CC zlib.o
>     CC unix-socket.o
>     CC thread-utils.o
>     CC compat/strlcpy.o
>     AR libgit.a
> /bin/sh: gar: command not found
> make: *** [libgit.a] Error 127
> ```

The Makefile defines AR as:

  $ git grep ^AR Makefile
  Makefile:AR = ar

so it should already do what you want by default.  But that make
variable can be overridden. Can you show us the contents of your
config.mak and config.mak.autogen files (if either exists)?

It's also possible that you have AR set in your environment (show us
"echo $AR"), but that would usually not override the Makefile unless
"make -e" is used (and that is not in your command-line above, but it's
possible that make is a shell alias or something).

> My fix was to make a symlink below:
> 
> SYMLINK
> 
> ```
> gar -> /usr/bin/ar
> ```

A simpler workaround is probably:

  make AR=ar ...

but probably the "right" solution is to eliminate whatever is providing
the bogus override in the first place.

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compile Error on Git 2.0.1 on Redhat 5.9 with Fix
  2014-07-02 15:56 Compile Error on Git 2.0.1 on Redhat 5.9 with Fix Eldon Nelson
  2014-07-02 16:25 ` Matthieu Moy
  2014-07-02 16:29 ` Jeff King
@ 2014-07-03 20:13 ` Eldon Nelson
  2 siblings, 0 replies; 4+ messages in thread
From: Eldon Nelson @ 2014-07-03 20:13 UTC (permalink / raw
  To: git

Thanks for the tip Jeff.  "config.mak.autogen" is created in the git
compile only when you do a "./configure".  Mine had the bad reference
to "gar" in it due to the following.

It was caused because my path had a reference to a non-related "gar"
executable (some internal command).  I saw the compile trying to
execute it and removed it from my path.  Doing a "make clean"
afterwards didn't remove the "config.mak.autogen" which had mistakenly
thought that I was using "gar" and not "ar".

When I fixed my path to not include the company specific "gar" and
started with a fresh untar it worked perfectly.  It also didn't make a
"config.mak.autogen" since that isn't what is recommended to do in the
git docs for install.

This is closed due to my own user error.

config.mak.autogen

# git Makefile configuration, included in main Makefile
# config.mak.autogen.  Generated from config.mak.in by configure.

CC = cc
CFLAGS = -g -O2
CPPFLAGS =
LDFLAGS =
AR = gar
TAR = gtar

~~~~~~~~~~~~
Eldon Nelson
eldon_nelson@ieee.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-03 20:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-02 15:56 Compile Error on Git 2.0.1 on Redhat 5.9 with Fix Eldon Nelson
2014-07-02 16:25 ` Matthieu Moy
2014-07-02 16:29 ` Jeff King
2014-07-03 20:13 ` Eldon Nelson

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).