{"thread":{"id":"31583","subject":"RE: [PATCH/RFC] Port to HP NonStop","startedAt":"2012-09-18T06:49:57Z","lastAt":"2012-09-18T17:07:04Z","messageCount":5,"participants":["Joachim Schmitz","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"199337","messageId":"000201cd9569$d16515e0$742f41a0$@schmitz-digital.de","threadId":"31583","inReplyTo":null,"subject":"RE: [PATCH/RFC] Port to HP NonStop","fromName":"Joachim Schmitz","fromEmail":"jojo@schmitz-digital.de","sentAt":"2012-09-18T06:49:57Z","receivedAt":"2012-09-18T06:49:57Z","isPatch":true,"sender":{"key":"jojo@schmitz-digital.de","avatar":"https://avatars.githubusercontent.com/u/1786669?v=4"},"body":"Signed-off-by: Joachim Schmitz <jojo@schmitz-digital.de>\n---\nThis needs the 4 compat-poll patches posted earlier.\nNeeds a different link order in Makefile: libintl before libiconv.\nThis may affect other platforms, so needs some checking.\nAlso I'm not really sure how to best #ifdef the #include <strings.h> \nand the typedef (u)intptr_t. \nFurthermore the -DHAVE_STRING_H=1, needed for\ncompat/fnmatch/fnmatch.c doesn't look quite right to me?\n\n Makefile          | 54 +++++++++++++++++++++++++++++++++++++++++++++++++-----\n git-compat-util.h | 10 +++++++++-\n 2 files changed, 58 insertions(+), 6 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 3d40860..b1d4ef5 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1324,6 +1324,52 @@ ifeq ($(uname_S),Minix)\n \tNO_CURL =\n \tNO_EXPAT =\n endif\n+ifeq ($(uname_S),NONSTOP_KERNEL)\n+\tCC = cc -c99 # needs some C99 features, \"inline\" is just one of them\n+\t# INLINE='' would just replace one set of warnings with another and\n+\t# still not compile in c89 mode, for non-const array initializations\n+\tCFLAGS = -g -O0 # disable all optimization, seems to result in bad code,\n+\t# with -O1 or -O0 /usr/local/libexec/git-core/git-pack-objects\n+\t# abends on \"git push\"\n+\tprefix = /usr/local\n+\t# our's are in ${prefix}/bin\n+\tPERL_PATH = ${prefix}/bin/perl\n+\tPYTHON_PATH = ${prefix}/bin/python\n+\n+\t# as detected by './configure'\n+\t#NO_CURL = YesPlease # missdetected, disabled, see below\n+\tNEEDS_SSL_WITH_CURL = YesPlease # added manually, see above\n+\tHAVE_LIBCHARSET_H=YesPlease\n+\tNEEDS_LIBICONV = YesPlease # needs libiconv first, changed further down\n+\tNO_SYS_SELECT_H=UnfortunatelyYes\n+\tNO_D_TYPE_IN_DIRENT = YesPlease\n+\tNO_HSTRERROR=YesPlease\n+\tNO_STRCASESTR=YesPlease\n+\tNO_FNMATCH_CASEFOLD = YesPlease\n+\tNO_MEMMEM = YesPlease\n+\tNO_STRLCPY = YesPlease\n+\tNO_SETENV = YesPlease\n+\tNO_UNSETENV = YesPlease\n+\tNO_MKDTEMP = YesPlease\n+\tNO_MKSTEMPS = YesPlease\n+\tOLD_ICONV=UnfortunatelyYes # currently libiconv-1.9.1\n+\tNO_REGEX=YesPlease # Why? ToDo?\n+\tNO_PTHREADS=UnfortunatelyYes # ToDo? Using PUT, maybe?\n+\t#CFLAGS += -put # not suffient? Seems the wrong fnmatch.h gets included?\n+\t#CFLAGS += -DFNM_CASEFOLD=16 # (1 << 4), to get dir.c compiled!?!\n+\t#CFLAGS += -Icompat/fnmatch # this doesn't help\n+\n+\t# not detected (nor checked for) by './configure'\n+\tCOMPAT_CFLAGS += -DSA_RESTART=0 # we don't have SA_RESTART on NonStop\n+\tCOMPAT_CFLAGS += -DHAVE_STRING_H=1 # needed in compat/fnmatch/fnmatch.c\n+\tNO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease\n+\tNO_NSEC = YesPlease\n+\tNO_PREAD = YesPlease\n+\tNO_MMAP = YesPlease\n+\tNO_POLL = YesPlease\n+\tMKDIR_WO_TRAILING_SLASH = YesPlease\n+\tNO_SETITIMER = UnfortunatelyYes\n+endif\n ifneq (,$(findstring MINGW,$(uname_S)))\n \tpathsep = ;\n \tNO_PREAD = YesPlease\n@@ -1555,6 +1599,11 @@ else\n \tLIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto\n endif\n endif\n+ifndef NO_GETTEXT\n+ifndef LIBC_CONTAINS_LIBINTL\n+\tEXTLIBS += -lintl\n+endif\n+endif\n ifdef NEEDS_LIBICONV\n \tifdef ICONVDIR\n \t\tBASIC_CFLAGS += -I$(ICONVDIR)/include\n@@ -1567,11 +1616,6 @@ endif\n ifdef NEEDS_LIBGEN\n \tEXTLIBS += -lgen\n endif\n-ifndef NO_GETTEXT\n-ifndef LIBC_CONTAINS_LIBINTL\n-\tEXTLIBS += -lintl\n-endif\n-endif\n ifdef NEEDS_SOCKET\n \tEXTLIBS += -lsocket\n endif\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 24b5432..7e70361 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -74,7 +74,8 @@\n # define _XOPEN_SOURCE 500\n # endif\n #elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \\\n-      !defined(_M_UNIX) && !defined(__sgi) && !defined(__DragonFly__)\n+      !defined(_M_UNIX) && !defined(__sgi) && !defined(__DragonFly__) && \\\n+      !defined(__TANDEM)\n #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */\n #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */\n #endif\n@@ -98,6 +99,9 @@\n #include <stdlib.h>\n #include <stdarg.h>\n #include <string.h>\n+#ifdef __TANDEM /* or HAVE_STRINGS_H or !NO_STRINGS_H? */\n+#include <strings.h> /* for strcasecmp() */\n+#endif\n #include <errno.h>\n #include <limits.h>\n #include <sys/param.h>\n@@ -141,6 +145,10 @@\n #else\n #include <stdint.h>\n #endif\n+#ifdef __TANDEM /* or NO_INTPTR_T resp. NO_UINTPTR_T? */\n+typedef int intptr_t;\n+typedef unsigned int uintptr_t;\n+#endif\n #if defined(__CYGWIN__)\n #undef _XOPEN_SOURCE\n #include <grp.h>\n-- \n1.7.12\n"},{"id":"199346","messageId":"7vvcfbojbl.fsf@alter.siamese.dyndns.org","threadId":"31583","inReplyTo":"000201cd9569$d16515e0$742f41a0$@schmitz-digital.de","subject":"Re: [PATCH/RFC] Port to HP NonStop","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-18T07:56:30Z","receivedAt":"2012-09-18T07:56:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Joachim Schmitz\" <jojo@schmitz-digital.de> writes:\n\n> Needs a different link order in Makefile: libintl before libiconv.\n> This may affect other platforms, so needs some checking.\n\nIt will, and it needs customization, not checking.\n\n> Also I'm not really sure how to best #ifdef the #include <strings.h> \n> and the typedef (u)intptr_t. \n\nFor now, nobody needs these, so enclosing in TANDEM is fine. When\nanother platform is found to need the same change, which might be\nunlikely, new symbols that NONSTOP_KERNEL and that other platform\nshare can be introduced to replace these #ifdefs.\n\n> Furthermore the -DHAVE_STRING_H=1, needed for\n> compat/fnmatch/fnmatch.c doesn't look quite right to me?\n>\n>  Makefile          | 54 +++++++++++++++++++++++++++++++++++++++++++++++++-----\n>  git-compat-util.h | 10 +++++++++-\n>  2 files changed, 58 insertions(+), 6 deletions(-)\n>\n> diff --git a/Makefile b/Makefile\n> index 3d40860..b1d4ef5 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -1324,6 +1324,52 @@ ifeq ($(uname_S),Minix)\n>  \tNO_CURL =\n>  \tNO_EXPAT =\n>  endif\n> +ifeq ($(uname_S),NONSTOP_KERNEL)\n> +\tCC = cc -c99 # needs some C99 features, \"inline\" is just one of them\n> +\t# INLINE='' would just replace one set of warnings with another and\n> +\t# still not compile in c89 mode, for non-const array initializations\n> +\tCFLAGS = -g -O0 # disable all optimization, seems to result in bad code,\n> +\t# with -O1 or -O0 /usr/local/libexec/git-core/git-pack-objects\n> +\t# abends on \"git push\"\n> +\tprefix = /usr/local\n> +\t# our's are in ${prefix}/bin\n> +\tPERL_PATH = ${prefix}/bin/perl\n> +\tPYTHON_PATH = ${prefix}/bin/python\n> +\n> +\t# as detected by './configure'\n> +\t#NO_CURL = YesPlease # missdetected, disabled, see below\n> +\tNEEDS_SSL_WITH_CURL = YesPlease # added manually, see above\n> +\tHAVE_LIBCHARSET_H=YesPlease\n> +\tNEEDS_LIBICONV = YesPlease # needs libiconv first, changed further down\n> +\tNO_SYS_SELECT_H=UnfortunatelyYes\n> +\tNO_D_TYPE_IN_DIRENT = YesPlease\n> +\tNO_HSTRERROR=YesPlease\n> +\tNO_STRCASESTR=YesPlease\n> +\tNO_FNMATCH_CASEFOLD = YesPlease\n> +\tNO_MEMMEM = YesPlease\n> +\tNO_STRLCPY = YesPlease\n> +\tNO_SETENV = YesPlease\n> +\tNO_UNSETENV = YesPlease\n> +\tNO_MKDTEMP = YesPlease\n> +\tNO_MKSTEMPS = YesPlease\n> +\tOLD_ICONV=UnfortunatelyYes # currently libiconv-1.9.1\n> +\tNO_REGEX=YesPlease # Why? ToDo?\n> +\tNO_PTHREADS=UnfortunatelyYes # ToDo? Using PUT, maybe?\n> +\t#CFLAGS += -put # not suffient? Seems the wrong fnmatch.h gets included?\n> +\t#CFLAGS += -DFNM_CASEFOLD=16 # (1 << 4), to get dir.c compiled!?!\n> +\t#CFLAGS += -Icompat/fnmatch # this doesn't help\n> +\n> +\t# not detected (nor checked for) by './configure'\n> +\tCOMPAT_CFLAGS += -DSA_RESTART=0 # we don't have SA_RESTART on NonStop\n> +\tCOMPAT_CFLAGS += -DHAVE_STRING_H=1 # needed in compat/fnmatch/fnmatch.c\n> +\tNO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease\n> +\tNO_NSEC = YesPlease\n> +\tNO_PREAD = YesPlease\n> +\tNO_MMAP = YesPlease\n> +\tNO_POLL = YesPlease\n> +\tMKDIR_WO_TRAILING_SLASH = YesPlease\n> +\tNO_SETITIMER = UnfortunatelyYes\n> +endif\n>  ifneq (,$(findstring MINGW,$(uname_S)))\n>  \tpathsep = ;\n>  \tNO_PREAD = YesPlease\n> @@ -1555,6 +1599,11 @@ else\n>  \tLIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto\n>  endif\n>  endif\n> +ifndef NO_GETTEXT\n> +ifndef LIBC_CONTAINS_LIBINTL\n> +\tEXTLIBS += -lintl\n> +endif\n> +endif\n>  ifdef NEEDS_LIBICONV\n>  \tifdef ICONVDIR\n>  \t\tBASIC_CFLAGS += -I$(ICONVDIR)/include\n> @@ -1567,11 +1616,6 @@ endif\n>  ifdef NEEDS_LIBGEN\n>  \tEXTLIBS += -lgen\n>  endif\n> -ifndef NO_GETTEXT\n> -ifndef LIBC_CONTAINS_LIBINTL\n> -\tEXTLIBS += -lintl\n> -endif\n> -endif\n>  ifdef NEEDS_SOCKET\n>  \tEXTLIBS += -lsocket\n>  endif\n> diff --git a/git-compat-util.h b/git-compat-util.h\n> index 24b5432..7e70361 100644\n> --- a/git-compat-util.h\n> +++ b/git-compat-util.h\n> @@ -74,7 +74,8 @@\n>  # define _XOPEN_SOURCE 500\n>  # endif\n>  #elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \\\n> -      !defined(_M_UNIX) && !defined(__sgi) && !defined(__DragonFly__)\n> +      !defined(_M_UNIX) && !defined(__sgi) && !defined(__DragonFly__) && \\\n> +      !defined(__TANDEM)\n>  #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */\n>  #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */\n>  #endif\n> @@ -98,6 +99,9 @@\n>  #include <stdlib.h>\n>  #include <stdarg.h>\n>  #include <string.h>\n> +#ifdef __TANDEM /* or HAVE_STRINGS_H or !NO_STRINGS_H? */\n> +#include <strings.h> /* for strcasecmp() */\n> +#endif\n>  #include <errno.h>\n>  #include <limits.h>\n>  #include <sys/param.h>\n> @@ -141,6 +145,10 @@\n>  #else\n>  #include <stdint.h>\n>  #endif\n> +#ifdef __TANDEM /* or NO_INTPTR_T resp. NO_UINTPTR_T? */\n> +typedef int intptr_t;\n> +typedef unsigned int uintptr_t;\n> +#endif\n>  #if defined(__CYGWIN__)\n>  #undef _XOPEN_SOURCE\n>  #include <grp.h>\n"},{"id":"199350","messageId":"000401cd9575$38a98b40$a9fca1c0$@schmitz-digital.de","threadId":"31583","inReplyTo":"7vvcfbojbl.fsf@alter.siamese.dyndns.org","subject":"RE: [PATCH/RFC] Port to HP NonStop","fromName":"Joachim Schmitz","fromEmail":"jojo@schmitz-digital.de","sentAt":"2012-09-18T08:11:34Z","receivedAt":"2012-09-18T08:11:34Z","isPatch":true,"sender":{"key":"jojo@schmitz-digital.de","avatar":"https://avatars.githubusercontent.com/u/1786669?v=4"},"body":"> From: Junio C Hamano [mailto:gitster@pobox.com]\n> Sent: Tuesday, September 18, 2012 9:57 AM\n> To: Joachim Schmitz\n> Cc: git@vger.kernel.org\n> Subject: Re: [PATCH/RFC] Port to HP NonStop\n> \n> \"Joachim Schmitz\" <jojo@schmitz-digital.de> writes:\n> \n> > Needs a different link order in Makefile: libintl before libiconv.\n> > This may affect other platforms, so needs some checking.\n> \n> It will, and it needs customization, not checking.\n\nHow?\n\n> > Also I'm not really sure how to best #ifdef the #include <strings.h>\n> > and the typedef (u)intptr_t.\n> \n> For now, nobody needs these, so enclosing in TANDEM is fine. When\n> another platform is found to need the same change, which might be\n> unlikely, new symbols that NONSTOP_KERNEL and that other platform\n> share can be introduced to replace these #ifdefs.\n\nOK, I'm fine with that. So the git-compat-util.h part of my patch can go in as posted, right?\nWith or without the comments?\n\nBye, Jojo\n"},{"id":"199377","messageId":"7vehlznu0h.fsf@alter.siamese.dyndns.org","threadId":"31583","inReplyTo":"000401cd9575$38a98b40$a9fca1c0$@schmitz-digital.de","subject":"Re: [PATCH/RFC] Port to HP NonStop","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-18T17:03:10Z","receivedAt":"2012-09-18T17:03:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Joachim Schmitz\" <jojo@schmitz-digital.de> writes:\n\n>> From: Junio C Hamano [mailto:gitster@pobox.com]\n>> Sent: Tuesday, September 18, 2012 9:57 AM\n>> To: Joachim Schmitz\n>> Cc: git@vger.kernel.org\n>> Subject: Re: [PATCH/RFC] Port to HP NonStop\n>> \n>> \"Joachim Schmitz\" <jojo@schmitz-digital.de> writes:\n>> \n>> > Needs a different link order in Makefile: libintl before libiconv.\n>> > This may affect other platforms, so needs some checking.\n>> \n>> It will, and it needs customization, not checking.\n>\n> How?\n\nBy not moving things around to affect other people, but having them\nin the order you want only for your platform (and other future ports\nthat need similar treatment)?\n\nFor example, if you need libintl before libiconv, a quick and dirty\nway may be\n\ndiff --git i/Makefile w/Makefile\nindex a49d1db..9b2cfd6 100644\n--- i/Makefile\n+++ w/Makefile\n@@ -1552,6 +1552,9 @@ ifdef NEEDS_LIBICONV\n \telse\n \t\tICONV_LINK =\n \tendif\n+\tifdef NEEDS_LIBINTL_BEFORE_LIBICONV\n+\t\tICONV_LINK += -lintl\n+\tendif\n \tEXTLIBS += $(ICONV_LINK) -liconv\n endif\n ifdef NEEDS_LIBGEN\n\nand your linker command line may have \"-lintl -liconv -lintl\" but\nthat wouldn't be an error, and you know you won't be affecting\nother platforms that do not use NEEDS_LIBINTL_BEFORE_LIBICONV, no?\n"},{"id":"199378","messageId":"001701cd95c0$085a2f80$190e8e80$@schmitz-digital.de","threadId":"31583","inReplyTo":"7vehlznu0h.fsf@alter.siamese.dyndns.org","subject":"RE: [PATCH/RFC] Port to HP NonStop","fromName":"Joachim Schmitz","fromEmail":"jojo@schmitz-digital.de","sentAt":"2012-09-18T17:07:04Z","receivedAt":"2012-09-18T17:07:04Z","isPatch":true,"sender":{"key":"jojo@schmitz-digital.de","avatar":"https://avatars.githubusercontent.com/u/1786669?v=4"},"body":"> From: Junio C Hamano [mailto:gitster@pobox.com]\n> Sent: Tuesday, September 18, 2012 7:03 PM\n> To: Joachim Schmitz\n> Cc: git@vger.kernel.org\n> Subject: Re: [PATCH/RFC] Port to HP NonStop\n> \n> \"Joachim Schmitz\" <jojo@schmitz-digital.de> writes:\n> \n> >> From: Junio C Hamano [mailto:gitster@pobox.com]\n> >> Sent: Tuesday, September 18, 2012 9:57 AM\n> >> To: Joachim Schmitz\n> >> Cc: git@vger.kernel.org\n> >> Subject: Re: [PATCH/RFC] Port to HP NonStop\n> >>\n> >> \"Joachim Schmitz\" <jojo@schmitz-digital.de> writes:\n> >>\n> >> > Needs a different link order in Makefile: libintl before libiconv.\n> >> > This may affect other platforms, so needs some checking.\n> >>\n> >> It will, and it needs customization, not checking.\n> >\n> > How?\n> \n> By not moving things around to affect other people, but having them\n> in the order you want only for your platform (and other future ports\n> that need similar treatment)?\n> \n> For example, if you need libintl before libiconv, a quick and dirty\n> way may be\n> \n> diff --git i/Makefile w/Makefile\n> index a49d1db..9b2cfd6 100644\n> --- i/Makefile\n> +++ w/Makefile\n> @@ -1552,6 +1552,9 @@ ifdef NEEDS_LIBICONV\n>  \telse\n>  \t\tICONV_LINK =\n>  \tendif\n> +\tifdef NEEDS_LIBINTL_BEFORE_LIBICONV\n> +\t\tICONV_LINK += -lintl\n> +\tendif\n>  \tEXTLIBS += $(ICONV_LINK) -liconv\n>  endif\n>  ifdef NEEDS_LIBGEN\n> \n> and your linker command line may have \"-lintl -liconv -lintl\" but\n> that wouldn't be an error, and you know you won't be affecting\n> other platforms that do not use NEEDS_LIBINTL_BEFORE_LIBICONV, no?\n\nOK, sounds good, I'll try that and submit an updated patch if it works that way (and I'm pretty sure it does).\n\nAnything else I should change in my patch?\n"}]}