{"thread":{"id":"20079","subject":"[PATCH FYI 0/5] How I compile on IRIX 6.5 with the MIPSpro compiler and ksh","startedAt":"2009-07-10T17:10:42Z","lastAt":"2009-07-11T06:44:54Z","messageCount":8,"participants":["Brandon Casey","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"117780","messageId":"39niBtmtFs5Sy_fjtaztVh4dAZGS3bCbUWv-xJglfvb9KPJ_qQhUB4GiCpcoxguAgbDPS36AjnI@cipher.nrlssc.navy.mil","threadId":"20079","inReplyTo":null,"subject":"[PATCH FYI 0/5] How I compile on IRIX 6.5 with the MIPSpro compiler and ksh","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-07-10T17:10:42Z","receivedAt":"2009-07-10T17:10:42Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"From: Brandon Casey <drafnel@gmail.com>\n\nThis email describes how I have successfully compiled git on IRIX6.5 with the\nnative MIPSpro compiler version 7.4.4m and successfully run nearly all of the\ntests using the Korn shell.\n\nA config.mak file is provided at the end of this email.\n\nThe GIT_SKIP_TESTS environment variable was used to skip tests which still\nfail.  The number of tests which must be skipped has been greatly reduced.\nWhen I sent this email last year, 23 individual tests were skipped plus all\nof t3901.  With current master, only 13 tests must be skipped.  The remaining\ntests which fail are due to the installed iconv lacking support for the\ntested languages.\n\nTwo lingering concerns:\n  1) Building with -Ofast produces an executable which segfaults and can not\n     pass the tests.\n  2) Building with mmap support produces an executable which segfaults on\n     t1400-update-ref when it calls\n\n         'git rev-parse --verify \"master@{May 25 2005}\"'\n\n     Previously, this fault was avoided when THREADED_DELTA_SEARCH was set,\n     but there is a warning during compilation when THREADED_DELTA_SEARCH is\n     enabled that suggests Variable Length Arrays should not be used when\n     threads are used.  So it is left unset, and now NO_MMAP is set.\n\n     From my notes:\n     I tracked the mmap issue down to the mmap in refs.c:read_ref_at().  The\n     mmap succeeds, and the loop is executed properly until rec is rewound\n     into the first line (reflog entry) of the file. I don't know why it\n     fails, the code looks correct. I can't reproduce it with a similarly\n     structured stand-alone test program.  For the mentioned test that fails\n     above, if the rev-parse argument is changed to something that does not\n     reference the first entry in the log file, then it will succeed\n     e.g. \"master@{3}\".\n\nI have no debugger.\n\nOtherwise, I've been using this executable somewhat and have not experienced\nany problems.  Maybe it will be useful to others.\n\nAre there actually any IRIX users out there?\n\nThese patches are all submitted For-Your-Information only.  Junio, feel free\nto apply any of them or none, and to add my Signed-off-by.\n\n-brandon\n\n\nBrandon Casey (5):\n  unpack-trees.c: work around run-time array initialization flaw on\n    IRIX 6.5\n  git-compat-util.h: adjust for SGI IRIX 6.5\n  Makefile: add NEEDS_LIBGEN to optionally add -lgen to compile\n    arguments\n  Makefile: add section for SGI IRIX 6.5\n  test-lib.sh: work around ksh's trap shortcomings\n\n Makefile          |   18 ++++++++++++++++++\n configure.ac      |    6 ++++++\n git-compat-util.h |    3 ++-\n t/lib-git-svn.sh  |   15 ++++++++++-----\n t/test-lib.sh     |    3 ++-\n unpack-trees.c    |    2 +-\n 6 files changed, 39 insertions(+), 8 deletions(-)\n\n\n--->8--- config.mak --->8---\n\nGIT_SKIP_TESTS := \\\n   t3900.1[129] t3900.2[0234] \\\n   t5100.5 t5100.1[06] \\\n   t8005.[234]\nexport GIT_SKIP_TESTS\n\nSHELL_PATH = /bin/ksh\nTAR = gtar\nCC = c99\nCFLAGS = -n32 -O2\nNO_C99_FORMAT = 1\nNO_CURL = 1\nNO_OPENSSL = 1\nNO_TCLTK = 1\n"},{"id":"117781","messageId":"39niBtmtFs5Sy_fjtaztVmZBc5gMLjrIQhevVkHr5EAuPYiuRd5i__yABkFEZOZNG-W8HrgSclE@cipher.nrlssc.navy.mil","threadId":"20079","inReplyTo":"39niBtmtFs5Sy_fjtaztVh4dAZGS3bCbUWv-xJglfvb9KPJ_qQhUB4GiCpcoxguAgbDPS36AjnI@cipher.nrlssc.navy.mil","subject":"[PATCH FYI 1/5] unpack-trees.c: work around run-time array initialization flaw on IRIX 6.5","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-07-10T17:10:43Z","receivedAt":"2009-07-10T17:10:43Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"The c99 MIPSpro Compiler version 7.4.4m on IRIX 6.5 does not properly\ninitialize run-time initialized arrays.  An array which is initialized with\nfewer elements than the length of the array should have the unitialized\nelements initialized to zero.  This compiler only initializes the remaining\nelements when the last element is a static parameter.  So work around it\nby adding a \"NULL\" initialization parameter.\n---\n unpack-trees.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/unpack-trees.c b/unpack-trees.c\nindex 05d0bb1..7894c07 100644\n--- a/unpack-trees.c\n+++ b/unpack-trees.c\n@@ -128,7 +128,7 @@ static inline int call_unpack_fn(struct cache_entry **src, struct unpack_trees_o\n \n static int unpack_index_entry(struct cache_entry *ce, struct unpack_trees_options *o)\n {\n-\tstruct cache_entry *src[5] = { ce, };\n+\tstruct cache_entry *src[5] = { ce, NULL, };\n \n \to->pos++;\n \tif (ce_stage(ce)) {\n-- \n1.6.4.rc0.5.g76f7cf\n"},{"id":"117782","messageId":"39niBtmtFs5Sy_fjtaztVioF-DSUgPaeb2z2kLxvo9ZK1x9ZQKe11vCjlSyOtjKf_tm_u4WsJQY@cipher.nrlssc.navy.mil","threadId":"20079","inReplyTo":"39niBtmtFs5Sy_fjtaztVmZBc5gMLjrIQhevVkHr5EAuPYiuRd5i__yABkFEZOZNG-W8HrgSclE@cipher.nrlssc.navy.mil","subject":"[PATCH FYI 2/5] git-compat-util.h: adjust for SGI IRIX 6.5","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-07-10T17:10:44Z","receivedAt":"2009-07-10T17:10:44Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Don't define _XOPEN_SOURCE\nDo    define _SGI_SOURCE\n\nDefining _XOPEN_SOURCE prevents many of the common functions and macros\nfrom being defined. _Not_ setting _XOPEN_SOURCE, and instead setting\n_SGI_SOURCE, provides all of the XPG4, XPG5, BSD, POSIX functions and\ndeclarations, _BUT_ provides a horribly broken snprintf(). SGI does have\na working snprintf(), but it is only provided when _NO_XOPEN5 evaluates\nto zero, and this only happens if _XOPEN_SOURCE is defined which, as\nmentioned above, prevents many other common functions and defines.\n---\n git-compat-util.h |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 9609eaa..913f41a 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -52,7 +52,7 @@\n # else\n # define _XOPEN_SOURCE 500\n # endif\n-#elif !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !defined(_M_UNIX)\n+#elif !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !defined(_M_UNIX) && !defined(sgi)\n #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */\n #ifndef __sun__\n #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */\n@@ -62,6 +62,7 @@\n #define _GNU_SOURCE 1\n #define _BSD_SOURCE 1\n #define _NETBSD_SOURCE 1\n+#define _SGI_SOURCE 1\n \n #include <unistd.h>\n #include <stdio.h>\n-- \n1.6.4.rc0.5.g76f7cf\n"},{"id":"117785","messageId":"39niBtmtFs5Sy_fjtaztVs0m0Z6eHu_U8OSsTLFxj4rzNA1wRn0zCZA2fZ7PNTjvs9tczSQBvpc@cipher.nrlssc.navy.mil","threadId":"20079","inReplyTo":"39niBtmtFs5Sy_fjtaztVioF-DSUgPaeb2z2kLxvo9ZK1x9ZQKe11vCjlSyOtjKf_tm_u4WsJQY@cipher.nrlssc.navy.mil","subject":"[PATCH FYI 3/5] Makefile: add NEEDS_LIBGEN to optionally add -lgen to compile arguments","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-07-10T17:10:45Z","receivedAt":"2009-07-10T17:10:45Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"From: Brandon Casey <drafnel@gmail.com>\n\nCommit 003b33a8 recently added a call to basename().  On IRIX 6.5, this\nfunction resides in libgen and -lgen is required for the linker.\n\nUpdate configure.ac too.\n---\n\n\nconfigure.ac changes are untested.\n\n-brandon\n\n\n Makefile     |    5 +++++\n configure.ac |    6 ++++++\n 2 files changed, 11 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 311ce7d..faaab5e 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -61,6 +61,8 @@ all::\n #\n # Define NO_LIBGEN_H if you don't have libgen.h.\n #\n+# Define NEEDS_LIBGEN if your libgen needs -lgen when linking\n+#\n # Define NO_SYS_SELECT_H if you don't have sys/select.h.\n #\n # Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.\n@@ -1019,6 +1021,9 @@ ifdef NEEDS_LIBICONV\n \tendif\n \tEXTLIBS += $(ICONV_LINK) -liconv\n endif\n+ifdef NEEDS_LIBGEN\n+\tEXTLIBS += -lgen\n+endif\n ifdef NEEDS_SOCKET\n \tEXTLIBS += -lsocket\n endif\ndiff --git a/configure.ac b/configure.ac\nindex 1885674..74d0af5 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -485,6 +485,12 @@ AC_CHECK_LIB([resolv], [hstrerror],\n AC_SUBST(NEEDS_RESOLV)\n test -n \"$NEEDS_RESOLV\" && LIBS=\"$LIBS -lresolv\"\n \n+AC_CHECK_LIB([gen], [basename],\n+[NEEDS_LIBGEN=],\n+[NEEDS_LIBGEN=YesPlease])\n+AC_SUBST(NEEDS_LIBGEN)\n+test -n \"$NEEDS_LIBGEN\" && LIBS=\"$LIBS -lgen\"\n+\n ## Checks for header files.\n AC_MSG_NOTICE([CHECKS for header files])\n #\n-- \n1.6.4.rc0.5.g76f7cf\n"},{"id":"117784","messageId":"39niBtmtFs5Sy_fjtaztVnLg9Lrx8Lsu5hbcnz9Fsc7tFJx0Z7UST-sRmKU2bdVlCmfkGTgtbs4@cipher.nrlssc.navy.mil","threadId":"20079","inReplyTo":"39niBtmtFs5Sy_fjtaztVs0m0Z6eHu_U8OSsTLFxj4rzNA1wRn0zCZA2fZ7PNTjvs9tczSQBvpc@cipher.nrlssc.navy.mil","subject":"[PATCH FYI 4/5] Makefile: add section for SGI IRIX 6.5","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-07-10T17:10:46Z","receivedAt":"2009-07-10T17:10:46Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"---\n Makefile |   13 +++++++++++++\n 1 files changed, 13 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex faaab5e..d404524 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -830,6 +830,19 @@ ifeq ($(uname_S),GNU)\n \tNO_STRLCPY=YesPlease\n \tNO_MKSTEMPS = YesPlease\n endif\n+ifeq ($(uname_S),IRIX)\n+\tNO_SETENV = YesPlease\n+\tNO_UNSETENV = YesPlease\n+\tNO_STRCASESTR = YesPlease\n+\tNO_MEMMEM = YesPlease\n+\tNO_MKSTEMPS = YesPlease\n+\tNO_MKDTEMP = YesPlease\n+\tNO_MMAP = YesPlease\n+\tNO_EXTERNAL_GREP = UnfortunatelyYes\n+\tSNPRINTF_RETURNS_BOGUS = YesPlease\n+\tSHELL_PATH = /usr/gnu/bin/bash\n+\tNEEDS_LIBGEN = YesPlease\n+endif\n ifeq ($(uname_S),IRIX64)\n \tNO_IPV6=YesPlease\n \tNO_SETENV=YesPlease\n-- \n1.6.4.rc0.5.g76f7cf\n"},{"id":"117783","messageId":"39niBtmtFs5Sy_fjtaztVpzvYMB2VqzJqRa_5SCfycpkVR-qsHwAomyoqf7KXKH-vbxIhbJxKJM@cipher.nrlssc.navy.mil","threadId":"20079","inReplyTo":"39niBtmtFs5Sy_fjtaztVnLg9Lrx8Lsu5hbcnz9Fsc7tFJx0Z7UST-sRmKU2bdVlCmfkGTgtbs4@cipher.nrlssc.navy.mil","subject":"[PATCH FYI 5/5] test-lib.sh: work around ksh's trap shortcomings","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-07-10T17:10:47Z","receivedAt":"2009-07-10T17:10:47Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"From: Brandon Casey <casey@argon.nrlssc.navy.mil>\n\nIn ksh, if trap is called within a function with 0 or EXIT as its signal,\nthen the trap will be executed at the time the function returns. This\ncauses a problem in the test functions since 'trap - EXIT' is called\nwithin the test_done function in order to remove the trap which calls\ndie() on exit. This means trap has to be called from the scripts top-level.\nDo so by renaming the test_done function to test_done_func, and then,\nremove the trap and call test_done_func from within a new alias named\ntest_done.\n\nAdditionally, there is some strangeness with respect to aliases and sourced\nscript files; the alias is not available within the sourced file. So call\n'trap - EXIT' directly in lib-git-svn.sh before calling the test_done_func\nfunction.\n---\n t/lib-git-svn.sh |   15 ++++++++++-----\n t/test-lib.sh    |    3 ++-\n 2 files changed, 12 insertions(+), 6 deletions(-)\n\ndiff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh\nindex 5654962..c49971c 100644\n--- a/t/lib-git-svn.sh\n+++ b/t/lib-git-svn.sh\n@@ -6,11 +6,13 @@ git_svn_id=git\"\"-svn-id\n if test -n \"$NO_SVN_TESTS\"\n then\n \tsay 'skipping git svn tests, NO_SVN_TESTS defined'\n-\ttest_done\n+\ttrap - EXIT\n+\ttest_done_func\n fi\n if ! test_have_prereq PERL; then\n \tsay 'skipping git svn tests, perl not available'\n-\ttest_done\n+\ttrap - EXIT\n+\ttest_done_func\n fi\n \n GIT_DIR=$PWD/.git\n@@ -21,7 +23,8 @@ svn >/dev/null 2>&1\n if test $? -ne 1\n then\n     say 'skipping git svn tests, svn not found'\n-    test_done\n+    trap - EXIT\n+    test_done_func\n fi\n \n svnrepo=$PWD/svnrepo\n@@ -46,7 +49,8 @@ then\n \t\terr='Perl SVN libraries not found or unusable, skipping test'\n \tfi\n \tsay \"$err\"\n-\ttest_done\n+\ttrap - EXIT\n+\ttest_done_func\n fi\n \n rawsvnrepo=\"$svnrepo\"\n@@ -159,7 +163,8 @@ require_svnserve () {\n     if test -z \"$SVNSERVE_PORT\"\n     then\n         say 'skipping svnserve test. (set $SVNSERVE_PORT to enable)'\n-        test_done\n+\ttrap - EXIT\n+\ttest_done_func\n     fi\n }\n \ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 5fdc5d9..d7c12db 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -504,7 +504,7 @@ test_create_repo () {\n \tcd \"$owd\"\n }\n \n-test_done () {\n+test_done_func () {\n \tGIT_EXIT_OK=t\n \ttest_results_dir=\"$TEST_DIRECTORY/test-results\"\n \tmkdir -p \"$test_results_dir\"\n@@ -544,6 +544,7 @@ test_done () {\n \n \tesac\n }\n+alias test_done='trap - EXIT && test_done_func'\n \n # Test the binaries we have just built.  The tests are kept in\n # t/ subdirectory and are run in 'trash directory' subdirectory.\n-- \n1.6.4.rc0.5.g76f7cf\n"},{"id":"117790","messageId":"stPsg0ZZV3g6iZzJJntBzwwYW5t-03cXjs4wphlspoOTzCVzFQjvHF1wtQgAA7hq1rWxe4CvZHs@cipher.nrlssc.navy.mil","threadId":"20079","inReplyTo":"39niBtmtFs5Sy_fjtaztVpzvYMB2VqzJqRa_5SCfycpkVR-qsHwAomyoqf7KXKH-vbxIhbJxKJM@cipher.nrlssc.navy.mil","subject":"[PATCH FYI 6/5] Makefile: update IRIX64 section","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-07-10T18:31:19Z","receivedAt":"2009-07-10T18:31:19Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"From: Brandon Casey <drafnel@gmail.com>\n\n---\n\n\nHere's the update for the 64-bit version of IRIX.  This has been tested to\nthe same extent that the 32-bit version has been tested.  The 64-bit test\nsystem is a little bit older than the 32-bit system, so a few more tests are\nskipped (related to a too old gtar), and NO_STRLCPY and NO_DEFLATE_BOUND\nmacros are set.\n\n-brandon\n\n\n Makefile |   12 ++++++------\n 1 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex d404524..baa0296 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -844,17 +844,17 @@ ifeq ($(uname_S),IRIX)\n \tNEEDS_LIBGEN = YesPlease\n endif\n ifeq ($(uname_S),IRIX64)\n-\tNO_IPV6=YesPlease\n \tNO_SETENV=YesPlease\n+\tNO_UNSETENV = YesPlease\n \tNO_STRCASESTR=YesPlease\n \tNO_MEMMEM = YesPlease\n \tNO_MKSTEMPS = YesPlease\n-\tNO_STRLCPY = YesPlease\n-\tNO_SOCKADDR_STORAGE=YesPlease\n+\tNO_MKDTEMP = YesPlease\n+\tNO_MMAP = YesPlease\n+\tNO_EXTERNAL_GREP = UnfortunatelyYes\n+\tSNPRINTF_RETURNS_BOGUS = YesPlease\n \tSHELL_PATH=/usr/gnu/bin/bash\n-\tBASIC_CFLAGS += -DPATH_MAX=1024\n-\t# for now, build 32-bit version\n-\tBASIC_LDFLAGS += -L/usr/lib32\n+\tNEEDS_LIBGEN = YesPlease\n endif\n ifeq ($(uname_S),HP-UX)\n \tNO_IPV6=YesPlease\n-- \n1.6.4.rc0.5.g76f7cf\n"},{"id":"117816","messageId":"7v4otjoh09.fsf@alter.siamese.dyndns.org","threadId":"20079","inReplyTo":"39niBtmtFs5Sy_fjtaztVh4dAZGS3bCbUWv-xJglfvb9KPJ_qQhUB4GiCpcoxguAgbDPS36AjnI@cipher.nrlssc.navy.mil","subject":"Re: [PATCH FYI 0/5] How I compile on IRIX 6.5 with the MIPSpro compiler and ksh","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-07-11T06:44:54Z","receivedAt":"2009-07-11T06:44:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brandon Casey <casey@nrlssc.navy.mil> writes:\n\n> Otherwise, I've been using this executable somewhat and have not experienced\n> any problems.  Maybe it will be useful to others.\n>\n> Are there actually any IRIX users out there?\n\nI thought at some point Dscho was suffering from IRIX but perhaps he got\nout of it?\n\n> These patches are all submitted For-Your-Information only.  Junio, feel free\n> to apply any of them or none, and to add my Signed-off-by.\n\nExcept for 5/5 all of them looked trivially safe and none of them looked\niffy.  Will queue, possibly with minor tweaks.\n"}]}