{"thread":{"id":"37482","subject":"[PATCH] Makefile: add NO_CLOCK_GETTIME check","startedAt":"2014-09-03T19:14:47Z","lastAt":"2014-09-03T20:58:33Z","messageCount":3,"participants":["Reuben Hawkins","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"248794","messageId":"1409771687-5597-1-git-send-email-reubenhwk@gmail.com","threadId":"37482","inReplyTo":null,"subject":"[PATCH] Makefile: add NO_CLOCK_GETTIME check","fromName":"Reuben Hawkins","fromEmail":"reubenhwk@gmail.com","sentAt":"2014-09-03T19:14:47Z","receivedAt":"2014-09-03T19:14:47Z","isPatch":true,"sender":{"key":"reubenhwk@gmail.com","avatar":"https://avatars.githubusercontent.com/u/201595?v=4"},"body":"Some really old platforms, rhel3, which don't define CLOCK_MONOTONIC, still\nneed a way to build git.  Some high resolution timer code was added Jul 12,\n2014 to aid debugging performance issues.  That code uses clock_gettime and\nCLOCK_MONOTONIC.  That change breaks building git on ancient platforms which\ndon't support CLOCK_MONOTONIC, so a way to disable that code is needed.\n\nTo use this feature...\n\n$ make NO_CLOCK_GETTIME=1\n\nThis change amends the commit...\n\n commit 148d6771bf5e00aa1d7fa2221507a3dfe4c1e37f\n Author: Karsten Blees <karsten.blees@gmail.com>\n Date:   Sat Jul 12 02:05:42 2014 +0200\n\n  trace: add high resolution timer function to debug performance issues\n---\n Makefile | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/Makefile b/Makefile\nindex 9f984a9..0c1c8cf 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1502,10 +1502,12 @@ ifdef GMTIME_UNRELIABLE_ERRORS\n \tBASIC_CFLAGS += -DGMTIME_UNRELIABLE_ERRORS\n endif\n \n+ifndef NO_CLOCK_GETTIME\n ifdef HAVE_CLOCK_GETTIME\n \tBASIC_CFLAGS += -DHAVE_CLOCK_GETTIME\n \tEXTLIBS += -lrt\n endif\n+endif\n \n ifeq ($(TCLTK_PATH),)\n NO_TCLTK = NoThanks\n-- \n1.9.1\n"},{"id":"248801","messageId":"xmqqwq9kwkrg.fsf@gitster.dls.corp.google.com","threadId":"37482","inReplyTo":"1409771687-5597-1-git-send-email-reubenhwk@gmail.com","subject":"Re: [PATCH] Makefile: add NO_CLOCK_GETTIME check","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-09-03T19:45:39Z","receivedAt":"2014-09-03T19:45:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Reuben Hawkins <reubenhwk@gmail.com> writes:\n\n> Some really old platforms, rhel3, which don't define CLOCK_MONOTONIC, still\n> need a way to build git.  Some high resolution timer code was added Jul 12,\n> 2014 to aid debugging performance issues.  That code uses clock_gettime and\n> CLOCK_MONOTONIC.  That change breaks building git on ancient platforms which\n> don't support CLOCK_MONOTONIC, so a way to disable that code is needed.\n>\n> To use this feature...\n>\n> $ make NO_CLOCK_GETTIME=1\n>\n> This change amends the commit...\n>\n>  commit 148d6771bf5e00aa1d7fa2221507a3dfe4c1e37f\n>  Author: Karsten Blees <karsten.blees@gmail.com>\n>  Date:   Sat Jul 12 02:05:42 2014 +0200\n>\n>   trace: add high resolution timer function to debug performance issues\n> ---\n\n>  Makefile | 2 ++\n>  1 file changed, 2 insertions(+)\n>\n> diff --git a/Makefile b/Makefile\n> index 9f984a9..0c1c8cf 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -1502,10 +1502,12 @@ ifdef GMTIME_UNRELIABLE_ERRORS\n>  \tBASIC_CFLAGS += -DGMTIME_UNRELIABLE_ERRORS\n>  endif\n>  \n> +ifndef NO_CLOCK_GETTIME\n>  ifdef HAVE_CLOCK_GETTIME\n>  \tBASIC_CFLAGS += -DHAVE_CLOCK_GETTIME\n>  \tEXTLIBS += -lrt\n>  endif\n> +endif\n\nI am not sure why you even need this change.  Wouldn't you get\nexactly the same result if you did not define HAVE_CLOCK_GETTIME\nwhen building?\n\n\n\n>  \n>  ifeq ($(TCLTK_PATH),)\n>  NO_TCLTK = NoThanks\n"},{"id":"248803","messageId":"xmqqsik8whdy.fsf@gitster.dls.corp.google.com","threadId":"37482","inReplyTo":"xmqqwq9kwkrg.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] Makefile: add NO_CLOCK_GETTIME check","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-09-03T20:58:33Z","receivedAt":"2014-09-03T20:58:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>> +ifndef NO_CLOCK_GETTIME\n>>  ifdef HAVE_CLOCK_GETTIME\n>>  \tBASIC_CFLAGS += -DHAVE_CLOCK_GETTIME\n>>  \tEXTLIBS += -lrt\n>>  endif\n>> +endif\n>\n> I am not sure why you even need this change.  Wouldn't you get\n> exactly the same result if you did not define HAVE_CLOCK_GETTIME\n> when building?\n\nThat is, doing something like:\n\n    $ make HAVE_CLOCK_GETTIME= V=1\n\nwould show lines like:\n\n    cc -o credential-store.o -c -MF ./.depend/credential-store.o.d\n    -MQ credential-store.o -MMD -MP  -O2 -Wall -Wvla\n    -Wdeclaration-after-statement -Wno-format-zero-length -g\n    -I. -DHAVE_ALLOCA_H  -DHAVE_PATHS_H -DHAVE_DEV_TTY\n    -DXDL_FAST_HASH -DSHA1_HEADER='\"block-sha1/sha1.h\"'\n    -DNO_STRLCPY -DNO_MKSTEMPS -DSHELL_PATH='\"/bin/sh\"'  credential-store.c\n\nthat does not have -DHAVE_CLOCK_GETTIME on the command line, no?\n"}]}