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

Re: [PATCH] Makefile: add NO_CLOCK_GETTIME check

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 3, 2014, 19:45 UTC
Message-ID
<xmqqwq9kwkrg.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1409771687-5597-1-git-send-email-reubenhwk@gmail.com>
Reuben Hawkins <reubenhwk@gmail.com> writes:
Show 18 quoted lines
> Some really old platforms, rhel3, which don't define CLOCK_MONOTONIC, still
> need a way to build git.  Some high resolution timer code was added Jul 12,
> 2014 to aid debugging performance issues.  That code uses clock_gettime and
> CLOCK_MONOTONIC.  That change breaks building git on ancient platforms which
> don't support CLOCK_MONOTONIC, so a way to disable that code is needed.
>
> To use this feature...
>
> $ make NO_CLOCK_GETTIME=1
>
> This change amends the commit...
>
>  commit 148d6771bf5e00aa1d7fa2221507a3dfe4c1e37f
>  Author: Karsten Blees <karsten.blees@gmail.com>
>  Date:   Sat Jul 12 02:05:42 2014 +0200
>
>   trace: add high resolution timer function to debug performance issues
> ---
Show 17 quoted lines
>  Makefile | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index 9f984a9..0c1c8cf 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1502,10 +1502,12 @@ ifdef GMTIME_UNRELIABLE_ERRORS
>  	BASIC_CFLAGS += -DGMTIME_UNRELIABLE_ERRORS
>  endif
>  
> +ifndef NO_CLOCK_GETTIME
>  ifdef HAVE_CLOCK_GETTIME
>  	BASIC_CFLAGS += -DHAVE_CLOCK_GETTIME
>  	EXTLIBS += -lrt
>  endif
> +endif

I am not sure why you even need this change. Wouldn't you get exactly the same result if you did not define HAVE_CLOCK_GETTIME when building?

>  
>  ifeq ($(TCLTK_PATH),)
>  NO_TCLTK = NoThanks
Previous: Reuben HawkinsNext: Junio C Hamano
Message 2 of 3 in “Makefile: add NO_CLOCK_GETTIME check”
  1. Makefile: add NO_CLOCK_GETTIME checkReuben Hawkins, Sep 3, 2014
  2. Junio C HamanoSep 3, 2014
  3. Junio C HamanoSep 3, 2014

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.