{"thread":{"id":"51050","subject":"[PATCH] Improving HP-UX support","startedAt":"2019-05-08T11:05:47Z","lastAt":"2019-06-07T17:03:58Z","messageCount":19,"participants":["Osipov, Michael","Ævar Arnfjörð Bjarmason","Jeff King","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"375111","messageId":"603989bd-f86d-c61d-c6f5-fb6748a65ba9@siemens.com","threadId":"51050","inReplyTo":null,"subject":"[PATCH] Improving HP-UX support","fromName":"Osipov, Michael","fromEmail":"michael.osipov@siemens.com","sentAt":"2019-05-08T10:45:11Z","receivedAt":"2019-05-08T11:05:47Z","isPatch":true,"sender":{"key":"michael.osipov@siemens.com","avatar":"https://avatars.githubusercontent.com/u/573017?v=4"},"body":"Hi folks,\n\nplease find a patch attached to properly compile and link Git 2.21.0 on \nHP-UX IA64.\n\nThe patch includes basically two changes:\n\n* Detection of big endian on HP-UX otherwise SHA1 calc is broken\n* Detection of linking style with HP aCC\n\n> export PREFIX=/opt/ports\n> export LIBDIR=$PREFIX/lib/hpux32\n> export CC=/opt/aCC/bin/aCC\n> export CXX=/opt/aCC/bin/aCC\n> export CONFIGURE=\"./configure --prefix=$PREFIX --libdir=$LIBDIR\"\n> export CPPFLAGS=\"-I$PREFIX/include\"\n> export LDFLAGS=\"-L$LIBDIR\"\n> autoreconf -fi\n> $CONFIGURE --with-editor=vim --with-zlib=$PREFIX --with-perl=/usr/bin/perl --with-iconv=$PREFIX \\\n>   --with-libpcre=$PREFIX --with-gitconfig=$PREFIX/etc/gitconfig --with-gitattributes=$PREFIX/etc/gitattributes \\\n>   --without-tcltk --disable-pthreads --with-lib=lib/hpux32\n> gmake INSTALL=$INSTALL_SH install\n\nNote: I am not subscribed to this list.\n\nRegards,\n\nMichael\n\n\ndiff -ur configure.ac configure.ac\n--- configure.ac\t2019-02-24 16:55:19 +0000\n+++ configure.ac\t2019-05-08 11:31:42 +0000\n@@ -475,8 +475,18 @@\n       if test \"$git_cv_ld_rpath\" = \"yes\"; then\n          CC_LD_DYNPATH=-rpath\n       else\n-         CC_LD_DYNPATH=\n-         AC_MSG_WARN([linker does not support runtime path to dynamic libraries])\n+         AC_CACHE_CHECK([if linker supports -Wl,+b,], git_cv_ld_wl_b, [\n+            SAVE_LDFLAGS=\"${LDFLAGS}\"\n+            LDFLAGS=\"${SAVE_LDFLAGS} -Wl,+b,/\"\n+            AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [git_cv_ld_wl_b=yes], [git_cv_ld_wl_b=no])\n+            LDFLAGS=\"${SAVE_LDFLAGS}\"\n+         ])\n+         if test \"$git_cv_ld_wl_b\" = \"yes\"; then\n+            CC_LD_DYNPATH=-Wl,+b,\n+          else\n+             CC_LD_DYNPATH=\n+             AC_MSG_WARN([linker does not support runtime path to dynamic libraries])\n+          fi\n       fi\n    fi\n fi\ndiff -ur sha1dc/sha1.c sha1dc/sha1.c\n--- sha1dc/sha1.c\t2019-02-24 16:55:19 +0000\n+++ sha1dc/sha1.c\t2019-05-04 01:26:22 +0000\n@@ -93,7 +93,7 @@\n #define SHA1DC_BIGENDIAN\n \n /* Not under GCC-alike or glibc or *BSD or newlib or <processor whitelist> */\n-#elif (defined(_AIX))\n+#elif (defined(_AIX) || defined(__hpux))\n \n /*\n  * Defines Big Endian on a whitelist of OSs that are known to be Big\n"},{"id":"375204","messageId":"87lfzggk1n.fsf@evledraar.gmail.com","threadId":"51050","inReplyTo":"603989bd-f86d-c61d-c6f5-fb6748a65ba9@siemens.com","subject":"Re: [PATCH] Improving HP-UX support","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2019-05-09T07:32:20Z","receivedAt":"2019-05-09T07:32:25Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Wed, May 08 2019, Osipov, Michael wrote:\n\n> Hi folks,\n\nHi see Documentation/SubmittingPatches for how to submit patches inline\ninstead of as attachments.\n\nFor the sha1dc change it seems trivially correct, but we import that\nupstream project as-is, could you please submit a pull request at\nhttps://github.com/cr-marcstevens/sha1collisiondetection then we can\nupdate our version?\n\n> diff -ur configure.ac configure.ac\n> --- configure.ac\t2019-02-24 16:55:19 +0000\n> +++ configure.ac\t2019-05-08 11:31:42 +0000\n> @@ -475,8 +475,18 @@\n>        if test \"$git_cv_ld_rpath\" = \"yes\"; then\n>           CC_LD_DYNPATH=-rpath\n>        else\n> -         CC_LD_DYNPATH=\n> -         AC_MSG_WARN([linker does not support runtime path to dynamic libraries])\n> +         AC_CACHE_CHECK([if linker supports -Wl,+b,], git_cv_ld_wl_b, [\n> +            SAVE_LDFLAGS=\"${LDFLAGS}\"\n> +            LDFLAGS=\"${SAVE_LDFLAGS} -Wl,+b,/\"\n> +            AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [git_cv_ld_wl_b=yes], [git_cv_ld_wl_b=no])\n> +            LDFLAGS=\"${SAVE_LDFLAGS}\"\n> +         ])\n> +         if test \"$git_cv_ld_wl_b\" = \"yes\"; then\n> +            CC_LD_DYNPATH=-Wl,+b,\n> +          else\n> +             CC_LD_DYNPATH=\n> +             AC_MSG_WARN([linker does not support runtime path to dynamic libraries])\n> +          fi\n>        fi\n>     fi\n>  fi\n\nDo we want to also have something in config.mak.uname to always do this\non HP/UX?\n\n>  /* Not under GCC-alike or glibc or *BSD or newlib or <processor whitelist> */\n> -#elif (defined(_AIX))\n> +#elif (defined(_AIX) || defined(__hpux))\n\nSeems sane, and per my googling even though HP/UX now runs on\nlittle-endian hardware it's always big-endian. But in this manual they\nadvice doing it at runtime with a TEST_ENDIAN() macro in sys/portal.h:\nhttp://h20628.www2.hp.com/km-ext/kmcsdirect/emr_na-c01921401-1.pdf\n\nIs that something we need to worry about / support? E.g. in the\nconfigure script?\n"},{"id":"375208","messageId":"3cabed9e-3949-93cc-2c9c-500a9cd9d4cd@siemens.com","threadId":"51050","inReplyTo":"87lfzggk1n.fsf@evledraar.gmail.com","subject":"Re: [PATCH] Improving HP-UX support","fromName":"Osipov, Michael","fromEmail":"michael.osipov@siemens.com","sentAt":"2019-05-09T08:09:40Z","receivedAt":"2019-05-09T08:09:45Z","isPatch":true,"sender":{"key":"michael.osipov@siemens.com","avatar":"https://avatars.githubusercontent.com/u/573017?v=4"},"body":"Hey there,\n\nAm 2019-05-09 um 09:32 schrieb Ævar Arnfjörð Bjarmason:\n> \n> On Wed, May 08 2019, Osipov, Michael wrote:\n> \n>> Hi folks,\n> \n> Hi see Documentation/SubmittingPatches for how to submit patches inline\n> instead of as attachments.\n\nDo you want me to resend the configure.ac change as per wiki article? I \ncan also create a PR on GitHub. I am happy with both as long as I don't \nhave to retain the patch for myself only ;-)\n\n> For the sha1dc change it seems trivially correct, but we import that\n> upstream project as-is, could you please submit a pull request at\n> https://github.com/cr-marcstevens/sha1collisiondetection then we can\n> update our version?\n\nSure thing, will do.\n\n>> diff -ur configure.ac configure.ac\n>> --- configure.ac\t2019-02-24 16:55:19 +0000\n>> +++ configure.ac\t2019-05-08 11:31:42 +0000\n>> @@ -475,8 +475,18 @@\n>>         if test \"$git_cv_ld_rpath\" = \"yes\"; then\n>>            CC_LD_DYNPATH=-rpath\n>>         else\n>> -         CC_LD_DYNPATH=\n>> -         AC_MSG_WARN([linker does not support runtime path to dynamic libraries])\n>> +         AC_CACHE_CHECK([if linker supports -Wl,+b,], git_cv_ld_wl_b, [\n>> +            SAVE_LDFLAGS=\"${LDFLAGS}\"\n>> +            LDFLAGS=\"${SAVE_LDFLAGS} -Wl,+b,/\"\n>> +            AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [git_cv_ld_wl_b=yes], [git_cv_ld_wl_b=no])\n>> +            LDFLAGS=\"${SAVE_LDFLAGS}\"\n>> +         ])\n>> +         if test \"$git_cv_ld_wl_b\" = \"yes\"; then\n>> +            CC_LD_DYNPATH=-Wl,+b,\n>> +          else\n>> +             CC_LD_DYNPATH=\n>> +             AC_MSG_WARN([linker does not support runtime path to dynamic libraries])\n>> +          fi\n>>         fi\n>>      fi\n>>   fi\n> \n> Do we want to also have something in config.mak.uname to always do this\n> on HP/UX?\n\nI am not convinced by that. I wouldn't mix operating system with \ncompiler settings. One could also use GCC on HP-UX. The one above is for \nHP aCC.\n\n>>   /* Not under GCC-alike or glibc or *BSD or newlib or <processor whitelist> */\n>> -#elif (defined(_AIX))\n>> +#elif (defined(_AIX) || defined(__hpux))\n> \n> Seems sane, and per my googling even though HP/UX now runs on\n> little-endian hardware it's always big-endian. But in this manual they\n> advice doing it at runtime with a TEST_ENDIAN() macro in sys/portal.h:\n> http://h20628.www2.hp.com/km-ext/kmcsdirect/emr_na-c01921401-1.pdf\n> \n> Is that something we need to worry about / support? E.g. in the\n> configure script?\n> \n\nThat'd be much more work to extend configure.ac for that because is a \nruntime check. Since there are no real products vailable on x86 for \nHP-UX I'd neglect that. Our HPE salesman told us that this will be \navailable somewhere in the future. So, I think this is very good for now.\n\nMichael\n"},{"id":"375421","messageId":"20190513221701.1837-1-avarab@gmail.com","threadId":"51050","inReplyTo":"3cabed9e-3949-93cc-2c9c-500a9cd9d4cd@siemens.com","subject":"[PATCH] sha1dc: update from upstream","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2019-05-13T22:17:01Z","receivedAt":"2019-05-13T22:17:08Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Update sha1dc from the latest version by the upstream\nmaintainer[1]. See 07a20f569b (\"Makefile: fix unaligned loads in\nsha1dc with UBSan\", 2019-03-12) for the last update.\n\nThis fixes an issue where HP-UX IA64 was wrongly detected as a\nLittle-endian instead of a Big-endian system, see [2] and [3].\n\n1. https://github.com/cr-marcstevens/sha1collisiondetection/commit/855827c583bc30645ba427885caa40c5b81764d2\n2. https://public-inbox.org/git/603989bd-f86d-c61d-c6f5-fb6748a65ba9@siemens.com/\n3. https://github.com/cr-marcstevens/sha1collisiondetection/pull/50\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n\nn Thu, May 09 2019, Osipov, Michael wrote:\n\n> Hey there,\n>\n> Am 2019-05-09 um 09:32 schrieb Ævar Arnfjörð Bjarmason:\n>>\n>> On Wed, May 08 2019, Osipov, Michael wrote:\n>>\n>>> Hi folks,\n>>\n>> Hi see Documentation/SubmittingPatches for how to submit patches inline\n>> instead of as attachments.\n>\n> Do you want me to resend the configure.ac change as per wiki article?\n> I can also create a PR on GitHub. I am happy with both as long as I\n> don't have to retain the patch for myself only ;-)\n\nYeah that patch to git.git should be done separately. I see your PR\nwent in upstream, here's a patch to update our code to match.\n\n> That'd be much more work to extend configure.ac for that because is a\n> runtime check. Since there are no real products vailable on x86 for\n> HP-UX I'd neglect that. Our HPE salesman told us that this will be\n> available somewhere in the future. So, I think this is very good for\n> now.\n\nSure, makes sense. I'm not familiar with HP/UX. So just thought I'd\nask.\n\n sha1collisiondetection | 2 +-\n sha1dc/sha1.c          | 2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/sha1collisiondetection b/sha1collisiondetection\nindex 16033998da..855827c583 160000\n--- a/sha1collisiondetection\n+++ b/sha1collisiondetection\n@@ -1 +1 @@\n-Subproject commit 16033998da4b273aebd92c84b1e1b12e4aaf7009\n+Subproject commit 855827c583bc30645ba427885caa40c5b81764d2\ndiff --git a/sha1dc/sha1.c b/sha1dc/sha1.c\nindex 5931cf25d5..9d3cf81d4d 100644\n--- a/sha1dc/sha1.c\n+++ b/sha1dc/sha1.c\n@@ -93,7 +93,7 @@\n #define SHA1DC_BIGENDIAN\n \n /* Not under GCC-alike or glibc or *BSD or newlib or <processor whitelist> */\n-#elif (defined(_AIX))\n+#elif (defined(_AIX) || defined(__hpux))\n \n /*\n  * Defines Big Endian on a whitelist of OSs that are known to be Big\n-- \n2.21.0.1020.gf2820cf01a\n\n"},{"id":"375504","messageId":"09f64da1-b8aa-3cd7-89d7-475b8722e176@siemens.com","threadId":"51050","inReplyTo":"20190513221701.1837-1-avarab@gmail.com","subject":"Re: [PATCH] sha1dc: update from upstream","fromName":"Osipov, Michael","fromEmail":"michael.osipov@siemens.com","sentAt":"2019-05-14T11:17:27Z","receivedAt":"2019-05-14T11:17:36Z","isPatch":true,"sender":{"key":"michael.osipov@siemens.com","avatar":"https://avatars.githubusercontent.com/u/573017?v=4"},"body":"Hi,\n\nAm 2019-05-14 um 00:17 schrieb Ævar Arnfjörð Bjarmason:\n> Update sha1dc from the latest version by the upstream\n> maintainer[1]. See 07a20f569b (\"Makefile: fix unaligned loads in\n> sha1dc with UBSan\", 2019-03-12) for the last update.\n> \n> This fixes an issue where HP-UX IA64 was wrongly detected as a\n> Little-endian instead of a Big-endian system, see [2] and [3].\n> \n> 1. https://github.com/cr-marcstevens/sha1collisiondetection/commit/855827c583bc30645ba427885caa40c5b81764d2\n> 2. https://public-inbox.org/git/603989bd-f86d-c61d-c6f5-fb6748a65ba9@siemens.com/\n> 3. https://github.com/cr-marcstevens/sha1collisiondetection/pull/50\n> \n> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> ---\n> \n> n Thu, May 09 2019, Osipov, Michael wrote:\n> \n>> Hey there,\n>>\n>> Am 2019-05-09 um 09:32 schrieb Ævar Arnfjörð Bjarmason:\n>>>\n>>> On Wed, May 08 2019, Osipov, Michael wrote:\n>>>\n>>>> Hi folks,\n>>>\n>>> Hi see Documentation/SubmittingPatches for how to submit patches inline\n>>> instead of as attachments.\n>>\n>> Do you want me to resend the configure.ac change as per wiki article?\n>> I can also create a PR on GitHub. I am happy with both as long as I\n>> don't have to retain the patch for myself only ;-)\n> \n> Yeah that patch to git.git should be done separately. I see your PR\n> went in upstream, here's a patch to update our code to match.\n\nTo avoid misunderstandings, I have factored out the Git patch and \ncreated a PR: https://github.com/git/git/pull/608\n\nLooks good to me now:\n> osipovmi@deblndw024v:~/git\n> $ uname -a\n> HP-UX deblndw0 B.11.31 U ia64 HP-UX\n> osipovmi@deblndw024v:~/git\n> $ ./git --version\n> git version 2.22.0.rc0.dirty\n> osipovmi@deblndw024v:~/git\n> $ ldd ./git\n> \n> ./git:\n>         libz.so =>      /opt/ports/lib/hpux32/libz.so\n>         libiconv.so.8 =>        /opt/ports/lib/hpux32/libiconv.so.8\n>         libintl.so.9 => /opt/ports/lib/hpux32/libintl.so.9\n>         libc.so.1 =>    /usr/lib/hpux32/libc.so.1\n>         libc.so.1 =>    /usr/lib/hpux32/libc.so.1\n>         libc.so.1 =>    /usr/lib/hpux32/libc.so.1\n>         libc.so.1 =>    /usr/lib/hpux32/libc.so.1\n>         libdl.so.1 =>   /usr/lib/hpux32/libdl.so.1\n\nLooking forward for a merge.\n\nRegards,\n\nMichael\n"},{"id":"375623","messageId":"87a7fovsz8.fsf@evledraar.gmail.com","threadId":"51050","inReplyTo":"09f64da1-b8aa-3cd7-89d7-475b8722e176@siemens.com","subject":"Re: [PATCH] sha1dc: update from upstream","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2019-05-15T11:48:27Z","receivedAt":"2019-05-15T11:48:34Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Tue, May 14 2019, Osipov, Michael wrote:\n\n> Hi,\n>\n> Am 2019-05-14 um 00:17 schrieb Ævar Arnfjörð Bjarmason:\n>> Update sha1dc from the latest version by the upstream\n>> maintainer[1]. See 07a20f569b (\"Makefile: fix unaligned loads in\n>> sha1dc with UBSan\", 2019-03-12) for the last update.\n>>\n>> This fixes an issue where HP-UX IA64 was wrongly detected as a\n>> Little-endian instead of a Big-endian system, see [2] and [3].\n>>\n>> 1. https://github.com/cr-marcstevens/sha1collisiondetection/commit/855827c583bc30645ba427885caa40c5b81764d2\n>> 2. https://public-inbox.org/git/603989bd-f86d-c61d-c6f5-fb6748a65ba9@siemens.com/\n>> 3. https://github.com/cr-marcstevens/sha1collisiondetection/pull/50\n>>\n>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n>> ---\n>>\n>> n Thu, May 09 2019, Osipov, Michael wrote:\n>>\n>>> Hey there,\n>>>\n>>> Am 2019-05-09 um 09:32 schrieb Ævar Arnfjörð Bjarmason:\n>>>>\n>>>> On Wed, May 08 2019, Osipov, Michael wrote:\n>>>>\n>>>>> Hi folks,\n>>>>\n>>>> Hi see Documentation/SubmittingPatches for how to submit patches inline\n>>>> instead of as attachments.\n>>>\n>>> Do you want me to resend the configure.ac change as per wiki article?\n>>> I can also create a PR on GitHub. I am happy with both as long as I\n>>> don't have to retain the patch for myself only ;-)\n>>\n>> Yeah that patch to git.git should be done separately. I see your PR\n>> went in upstream, here's a patch to update our code to match.\n>\n> To avoid misunderstandings, I have factored out the Git patch and\n> created a PR: https://github.com/git/git/pull/608\n\nThanks. If you want to submit it for inclusion you'll need to submit it\nas a patch here to the ML as described here:\nhttps://github.com/git/git/blob/master/Documentation/SubmittingPatches\n\nOr you can use this pull-request-by-proxy thing:\nhttps://gitgitgadget.github.io/\n\nOr if you don't want to deal with any of that crap just say and I'll\nE-Mail this to the list for you. Just want to give you a chance to do it\n:)\n\n> Looks good to me now:\n>> osipovmi@deblndw024v:~/git\n>> $ uname -a\n>> HP-UX deblndw0 B.11.31 U ia64 HP-UX\n>> osipovmi@deblndw024v:~/git\n>> $ ./git --version\n>> git version 2.22.0.rc0.dirty\n>> osipovmi@deblndw024v:~/git\n>> $ ldd ./git\n>>\n>> ./git:\n>>         libz.so =>      /opt/ports/lib/hpux32/libz.so\n>>         libiconv.so.8 =>        /opt/ports/lib/hpux32/libiconv.so.8\n>>         libintl.so.9 => /opt/ports/lib/hpux32/libintl.so.9\n>>         libc.so.1 =>    /usr/lib/hpux32/libc.so.1\n>>         libc.so.1 =>    /usr/lib/hpux32/libc.so.1\n>>         libc.so.1 =>    /usr/lib/hpux32/libc.so.1\n>>         libc.so.1 =>    /usr/lib/hpux32/libc.so.1\n>>         libdl.so.1 =>   /usr/lib/hpux32/libdl.so.1\n>\n> Looking forward for a merge.\n>\n> Regards,\n>\n> Michael\n"},{"id":"375705","messageId":"6aabf669-a73f-d23d-8d65-8b96eefbae4b@siemens.com","threadId":"51050","inReplyTo":"87a7fovsz8.fsf@evledraar.gmail.com","subject":"Re: [PATCH] sha1dc: update from upstream","fromName":"Osipov, Michael","fromEmail":"michael.osipov@siemens.com","sentAt":"2019-05-16T07:13:16Z","receivedAt":"2019-05-16T07:13:20Z","isPatch":true,"sender":{"key":"michael.osipov@siemens.com","avatar":"https://avatars.githubusercontent.com/u/573017?v=4"},"body":"\n\nAm 2019-05-15 um 13:48 schrieb Ævar Arnfjörð Bjarmason:\n> \n> On Tue, May 14 2019, Osipov, Michael wrote:\n> \n>> Hi,\n>>\n>> Am 2019-05-14 um 00:17 schrieb Ævar Arnfjörð Bjarmason:\n>>> Update sha1dc from the latest version by the upstream\n>>> maintainer[1]. See 07a20f569b (\"Makefile: fix unaligned loads in\n>>> sha1dc with UBSan\", 2019-03-12) for the last update.\n>>>\n>>> This fixes an issue where HP-UX IA64 was wrongly detected as a\n>>> Little-endian instead of a Big-endian system, see [2] and [3].\n>>>\n>>> 1. https://github.com/cr-marcstevens/sha1collisiondetection/commit/855827c583bc30645ba427885caa40c5b81764d2\n>>> 2. https://public-inbox.org/git/603989bd-f86d-c61d-c6f5-fb6748a65ba9@siemens.com/\n>>> 3. https://github.com/cr-marcstevens/sha1collisiondetection/pull/50\n>>>\n>>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n>>> ---\n>>>\n>>> n Thu, May 09 2019, Osipov, Michael wrote:\n>>>\n>>>> Hey there,\n>>>>\n>>>> Am 2019-05-09 um 09:32 schrieb Ævar Arnfjörð Bjarmason:\n>>>>>\n>>>>> On Wed, May 08 2019, Osipov, Michael wrote:\n>>>>>\n>>>>>> Hi folks,\n>>>>>\n>>>>> Hi see Documentation/SubmittingPatches for how to submit patches inline\n>>>>> instead of as attachments.\n>>>>\n>>>> Do you want me to resend the configure.ac change as per wiki article?\n>>>> I can also create a PR on GitHub. I am happy with both as long as I\n>>>> don't have to retain the patch for myself only ;-)\n>>>\n>>> Yeah that patch to git.git should be done separately. I see your PR\n>>> went in upstream, here's a patch to update our code to match.\n>>\n>> To avoid misunderstandings, I have factored out the Git patch and\n>> created a PR: https://github.com/git/git/pull/608\n> \n> Thanks. If you want to submit it for inclusion you'll need to submit it\n> as a patch here to the ML as described here:\n> https://github.com/git/git/blob/master/Documentation/SubmittingPatches\n> \n> Or you can use this pull-request-by-proxy thing:\n> https://gitgitgadget.github.io/\n> \n> Or if you don't want to deal with any of that crap just say and I'll\n> E-Mail this to the list for you. Just want to give you a chance to do it\n> :)\n\nYes, please do so. It seems like our corporate mail relay server does \nnot allow sending emails outside of our dns namespace. I get bounces \nfrom mailer daemon.\n\nMichael\n"},{"id":"375707","messageId":"87y336vm0h.fsf@evledraar.gmail.com","threadId":"51050","inReplyTo":"6aabf669-a73f-d23d-8d65-8b96eefbae4b@siemens.com","subject":"Re: [PATCH] sha1dc: update from upstream","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2019-05-16T08:31:10Z","receivedAt":"2019-05-16T08:31:16Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, May 16 2019, Osipov, Michael wrote:\n\n> Am 2019-05-15 um 13:48 schrieb Ævar Arnfjörð Bjarmason:\n>>\n>> On Tue, May 14 2019, Osipov, Michael wrote:\n>>\n>>> Hi,\n>>>\n>>> Am 2019-05-14 um 00:17 schrieb Ævar Arnfjörð Bjarmason:\n>>>> Update sha1dc from the latest version by the upstream\n>>>> maintainer[1]. See 07a20f569b (\"Makefile: fix unaligned loads in\n>>>> sha1dc with UBSan\", 2019-03-12) for the last update.\n>>>>\n>>>> This fixes an issue where HP-UX IA64 was wrongly detected as a\n>>>> Little-endian instead of a Big-endian system, see [2] and [3].\n>>>>\n>>>> 1. https://github.com/cr-marcstevens/sha1collisiondetection/commit/855827c583bc30645ba427885caa40c5b81764d2\n>>>> 2. https://public-inbox.org/git/603989bd-f86d-c61d-c6f5-fb6748a65ba9@siemens.com/\n>>>> 3. https://github.com/cr-marcstevens/sha1collisiondetection/pull/50\n>>>>\n>>>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n>>>> ---\n>>>>\n>>>> n Thu, May 09 2019, Osipov, Michael wrote:\n>>>>\n>>>>> Hey there,\n>>>>>\n>>>>> Am 2019-05-09 um 09:32 schrieb Ævar Arnfjörð Bjarmason:\n>>>>>>\n>>>>>> On Wed, May 08 2019, Osipov, Michael wrote:\n>>>>>>\n>>>>>>> Hi folks,\n>>>>>>\n>>>>>> Hi see Documentation/SubmittingPatches for how to submit patches inline\n>>>>>> instead of as attachments.\n>>>>>\n>>>>> Do you want me to resend the configure.ac change as per wiki article?\n>>>>> I can also create a PR on GitHub. I am happy with both as long as I\n>>>>> don't have to retain the patch for myself only ;-)\n>>>>\n>>>> Yeah that patch to git.git should be done separately. I see your PR\n>>>> went in upstream, here's a patch to update our code to match.\n>>>\n>>> To avoid misunderstandings, I have factored out the Git patch and\n>>> created a PR: https://github.com/git/git/pull/608\n>>\n>> Thanks. If you want to submit it for inclusion you'll need to submit it\n>> as a patch here to the ML as described here:\n>> https://github.com/git/git/blob/master/Documentation/SubmittingPatches\n>>\n>> Or you can use this pull-request-by-proxy thing:\n>> https://gitgitgadget.github.io/\n>>\n>> Or if you don't want to deal with any of that crap just say and I'll\n>> E-Mail this to the list for you. Just want to give you a chance to do it\n>> :)\n>\n> Yes, please do so. It seems like our corporate mail relay server does\n> not allow sending emails outside of our dns namespace. I get bounces\n> from mailer daemon.\n\nHi. No problem, but I just noticed your commit is missing a\nsigned-off-by (required for inclusion in git.git), please \"git commit\n--amend -s\" it and re-push that PR, then I can pull it from there.\n"},{"id":"375709","messageId":"bd8bf9da-23e6-a2a6-1e90-ed2a62c73cb4@siemens.com","threadId":"51050","inReplyTo":"87y336vm0h.fsf@evledraar.gmail.com","subject":"Re: [PATCH] sha1dc: update from upstream","fromName":"Osipov, Michael","fromEmail":"michael.osipov@siemens.com","sentAt":"2019-05-16T08:40:04Z","receivedAt":"2019-05-16T08:40:10Z","isPatch":true,"sender":{"key":"michael.osipov@siemens.com","avatar":"https://avatars.githubusercontent.com/u/573017?v=4"},"body":"Am 2019-05-16 um 10:31 schrieb Ævar Arnfjörð Bjarmason:\n> \n> On Thu, May 16 2019, Osipov, Michael wrote:\n> \n>> Am 2019-05-15 um 13:48 schrieb Ævar Arnfjörð Bjarmason:\n>>>\n>>> On Tue, May 14 2019, Osipov, Michael wrote:\n>>>\n>>>> Hi,\n>>>>\n>>>> Am 2019-05-14 um 00:17 schrieb Ævar Arnfjörð Bjarmason:\n>>>>> Update sha1dc from the latest version by the upstream\n>>>>> maintainer[1]. See 07a20f569b (\"Makefile: fix unaligned loads in\n>>>>> sha1dc with UBSan\", 2019-03-12) for the last update.\n>>>>>\n>>>>> This fixes an issue where HP-UX IA64 was wrongly detected as a\n>>>>> Little-endian instead of a Big-endian system, see [2] and [3].\n>>>>>\n>>>>> 1. https://github.com/cr-marcstevens/sha1collisiondetection/commit/855827c583bc30645ba427885caa40c5b81764d2\n>>>>> 2. https://public-inbox.org/git/603989bd-f86d-c61d-c6f5-fb6748a65ba9@siemens.com/\n>>>>> 3. https://github.com/cr-marcstevens/sha1collisiondetection/pull/50\n>>>>>\n>>>>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n>>>>> ---\n>>>>>\n>>>>> n Thu, May 09 2019, Osipov, Michael wrote:\n>>>>>\n>>>>>> Hey there,\n>>>>>>\n>>>>>> Am 2019-05-09 um 09:32 schrieb Ævar Arnfjörð Bjarmason:\n>>>>>>>\n>>>>>>> On Wed, May 08 2019, Osipov, Michael wrote:\n>>>>>>>\n>>>>>>>> Hi folks,\n>>>>>>>\n>>>>>>> Hi see Documentation/SubmittingPatches for how to submit patches inline\n>>>>>>> instead of as attachments.\n>>>>>>\n>>>>>> Do you want me to resend the configure.ac change as per wiki article?\n>>>>>> I can also create a PR on GitHub. I am happy with both as long as I\n>>>>>> don't have to retain the patch for myself only ;-)\n>>>>>\n>>>>> Yeah that patch to git.git should be done separately. I see your PR\n>>>>> went in upstream, here's a patch to update our code to match.\n>>>>\n>>>> To avoid misunderstandings, I have factored out the Git patch and\n>>>> created a PR: https://github.com/git/git/pull/608\n>>>\n>>> Thanks. If you want to submit it for inclusion you'll need to submit it\n>>> as a patch here to the ML as described here:\n>>> https://github.com/git/git/blob/master/Documentation/SubmittingPatches\n>>>\n>>> Or you can use this pull-request-by-proxy thing:\n>>> https://gitgitgadget.github.io/\n>>>\n>>> Or if you don't want to deal with any of that crap just say and I'll\n>>> E-Mail this to the list for you. Just want to give you a chance to do it\n>>> :)\n>>\n>> Yes, please do so. It seems like our corporate mail relay server does\n>> not allow sending emails outside of our dns namespace. I get bounces\n>> from mailer daemon.\n> \n> Hi. No problem, but I just noticed your commit is missing a\n> signed-off-by (required for inclusion in git.git), please \"git commit\n> --amend -s\" it and re-push that PR, then I can pull it from there.\n\nDone as requested!\n\nMichael\n"},{"id":"375711","messageId":"20190516093412.14795-1-avarab@gmail.com","threadId":"51050","inReplyTo":"6aabf669-a73f-d23d-8d65-8b96eefbae4b@siemens.com","subject":"[PATCH] configure: Detect linking style for HP aCC on HP-UX","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2019-05-16T09:34:12Z","receivedAt":"2019-05-16T09:34:23Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"From: Michael Osipov <michael.osipov@siemens.com>\n\nHP aCC does not accept any of the previously tested CC_LD_DYNPATH\nformats, but only its own[1] \"-Wl,+b\" format. Add it to configure.ac.\n\n1. http://nixdoc.net/man-pages/hp-ux/man1/ld_pa.1.html\n\nSigned-off-by: Michael Osipov <michael.osipov@siemens.com>\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n\nI took the liberty of slightly amending the commit message.\n\n configure.ac | 14 ++++++++++++--\n 1 file changed, 12 insertions(+), 2 deletions(-)\n\ndiff --git a/configure.ac b/configure.ac\nindex be3b55f1cc..a43b476402 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -475,8 +475,18 @@ else\n       if test \"$git_cv_ld_rpath\" = \"yes\"; then\n          CC_LD_DYNPATH=-rpath\n       else\n-         CC_LD_DYNPATH=\n-         AC_MSG_WARN([linker does not support runtime path to dynamic libraries])\n+         AC_CACHE_CHECK([if linker supports -Wl,+b,], git_cv_ld_wl_b, [\n+            SAVE_LDFLAGS=\"${LDFLAGS}\"\n+            LDFLAGS=\"${SAVE_LDFLAGS} -Wl,+b,/\"\n+            AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [git_cv_ld_wl_b=yes], [git_cv_ld_wl_b=no])\n+            LDFLAGS=\"${SAVE_LDFLAGS}\"\n+         ])\n+         if test \"$git_cv_ld_wl_b\" = \"yes\"; then\n+            CC_LD_DYNPATH=-Wl,+b,\n+          else\n+             CC_LD_DYNPATH=\n+             AC_MSG_WARN([linker does not support runtime path to dynamic libraries])\n+          fi\n       fi\n    fi\n fi\n-- \n2.21.0.1020.gf2820cf01a\n\n"},{"id":"375729","messageId":"20190516180521.1933-1-avarab@gmail.com","threadId":"51050","inReplyTo":"20190516093412.14795-1-avarab@gmail.com","subject":"[PATCH] Makefile: remove the NO_R_TO_GCC_LINKER flag","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2019-05-16T18:05:21Z","receivedAt":"2019-05-16T18:05:33Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Remove the NO_R_TO_GCC_LINKER flag, thus switching the default to\n\"-Wl,-rpath,$LIBPATH\" instead of our current \"-R$LIBPATH\". This is a\nrelatively obscure thing that only kicks in when using one of the\nLIBDIR flags, e.g. LIBPCREDIR or CURLDIR.\n\nHow we invoke the linker to do this can still be overridden with\nCC_LD_DYNPATH, as seen in our configure.ac script.\n\nOur use of \"-R\" dates back to 455a7f3275 (\"More portability.\",\n2005-09-30). Soon after that in bbfc63dd78 (\"gcc does not necessarily\npass runtime libpath with -R\", 2006-12-27) the NO_R_TO_GCC flag was\nadded, allowing optional use of \"-Wl,-rpath=\".\n\nThen in f5b904db6b (\"Makefile: Allow CC_LD_DYNPATH to be overriden\",\n2008-08-16) the ability to override this flag to something else\nentirely was added, as some linkers use neither \"-Wl,-rpath,\" nor\n\"-R\".\n\nFrom what I can tell we should, with the benefit of hindsight, have\nmade this change back in 2006. GCC & ld supported this type of\ninvocation back then, or since at least binutils-gdb.git's[1]\na1ad915dc4 (\"[...]Add support for -rpath[...]\", 1994-07-20). Most\npeople compiling git with a custom LIBDIR are going to be on a GNU-ish\nsystem, and having to provide this NO_R_TO_GCC_LINKER flag on top of a\ncustom LIBDIR is annoying.\n\nThere are some OS's that don't support -rpath, e.g. AIX ld just\nsupports \"-R\". Perhaps we should follow this up with some\nconfig.mak.uname changes, but as noted it's quite possible that nobody\non these platforms uses this (instead libraries in the system's search\npath). We *could* also use \"-Wl,-R\", but let's not introduce something\nnew.\n\nFurther reading and prior art can be found at [2][3][4][5]. Making a\nplain \"-R\" an error seems from reading those reports to have been\nintroduced in GCC 4.6 released on March 25, 2011, but I couldn't\nconfirm this with absolute certainty, its release notes are ambiguous\non the subject, and I couldn't be bothered to try to build & bisect it\nagainst GCC 4.5.\n\n1. git://sourceware.org/git/binutils-gdb.git\n2. https://github.com/tsuna/boost.m4/issues/15\n3. https://bugzilla.gnome.org/show_bug.cgi?id=641416\n4. https://stackoverflow.com/questions/12629042/g-4-6-real-error-unrecognized-option-r\n5. https://curl.haxx.se/mail/archive-2014-11/0005.html\n6. https://gcc.gnu.org/gcc-4.6/changes.html\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n\nLooking at that HP/UX configure patch I was reminded of being annoyed\nby the NO_R_TO_GCC_LINKER flag.\n\n Makefile | 15 +--------------\n 1 file changed, 1 insertion(+), 14 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex f965509b3c..ce7a489d64 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -265,10 +265,6 @@ all::\n #\n # Define NO_DEFLATE_BOUND if your zlib does not have deflateBound.\n #\n-# Define NO_R_TO_GCC_LINKER if your gcc does not like \"-R/path/lib\"\n-# that tells runtime paths to dynamic libraries;\n-# \"-Wl,-rpath=/path/lib\" is used instead.\n-#\n # Define NO_NORETURN if using buggy versions of gcc 4.6+ and profile feedback,\n # as the compiler can crash (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299)\n #\n@@ -1160,6 +1156,7 @@ endif\n # which'll override these defaults.\n CFLAGS = -g -O2 -Wall\n LDFLAGS =\n+CC_LD_DYNPATH = -Wl,-rpath,\n BASIC_CFLAGS = -I.\n BASIC_LDFLAGS =\n \n@@ -1287,16 +1284,6 @@ ifeq ($(uname_S),Darwin)\n \tPTHREAD_LIBS =\n endif\n \n-ifndef CC_LD_DYNPATH\n-\tifdef NO_R_TO_GCC_LINKER\n-\t\t# Some gcc does not accept and pass -R to the linker to specify\n-\t\t# the runtime dynamic library path.\n-\t\tCC_LD_DYNPATH = -Wl,-rpath,\n-\telse\n-\t\tCC_LD_DYNPATH = -R\n-\tendif\n-endif\n-\n ifdef NO_LIBGEN_H\n \tCOMPAT_CFLAGS += -DNO_LIBGEN_H\n \tCOMPAT_OBJS += compat/basename.o\n-- \n2.21.0.1020.gf2820cf01a\n\n"},{"id":"375754","messageId":"20190516222525.GC11784@sigill.intra.peff.net","threadId":"51050","inReplyTo":"20190516180521.1933-1-avarab@gmail.com","subject":"Re: [PATCH] Makefile: remove the NO_R_TO_GCC_LINKER flag","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-05-16T22:25:25Z","receivedAt":"2019-05-16T22:25:28Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, May 16, 2019 at 08:05:21PM +0200, Ævar Arnfjörð Bjarmason wrote:\n\n> From what I can tell we should, with the benefit of hindsight, have\n> made this change back in 2006. GCC & ld supported this type of\n> invocation back then, or since at least binutils-gdb.git's[1]\n> a1ad915dc4 (\"[...]Add support for -rpath[...]\", 1994-07-20). Most\n> people compiling git with a custom LIBDIR are going to be on a GNU-ish\n> system, and having to provide this NO_R_TO_GCC_LINKER flag on top of a\n> custom LIBDIR is annoying.\n> \n> There are some OS's that don't support -rpath, e.g. AIX ld just\n> supports \"-R\". Perhaps we should follow this up with some\n> config.mak.uname changes, but as noted it's quite possible that nobody\n> on these platforms uses this (instead libraries in the system's search\n> path). We *could* also use \"-Wl,-R\", but let's not introduce something\n> new.\n\nSo...does this mean with just your patch that the build is now broken on\nAIX if you use CURLDIR?\n\nFar be it from me to care about AIX, but it seems like this is ripe for\nregressions, because we don't know which platforms were relying on \"-R\"\ninstead of \"-Wl,-rpath\", and now everybody will be using the latter by\ndefault.\n\n-Peff\n"},{"id":"375765","messageId":"xmqqd0ki3s0q.fsf@gitster-ct.c.googlers.com","threadId":"51050","inReplyTo":"20190516222525.GC11784@sigill.intra.peff.net","subject":"Re: [PATCH] Makefile: remove the NO_R_TO_GCC_LINKER flag","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-05-16T23:21:09Z","receivedAt":"2019-05-16T23:21:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> Far be it from me to care about AIX, but it seems like this is ripe for\n> regressions, because we don't know which platforms were relying on \"-R\"\n> instead of \"-Wl,-rpath\", and now everybody will be using the latter by\n> default.\n\nI do not have a stake in AIX, either, but I had the same reaction.\n\nThose who found having to give NO_R_TO_GCC_LINKER=NoThanks annoying\ncould have passed CC_LD_DYNPATH=-Wl,-rpath instead, but that is not\nmuch shorter or sweeter X-<; with this change, they do not have to\ndo anything, but those who are broken can pass CC_LD_DYNPATH=-R to\nunbreak it.  So it may not be the end of the world, but this move\ncertainly smells like robbing non-GCC users to pay GCC users to me.\n"},{"id":"375770","messageId":"20190517002303.GB13525@sigill.intra.peff.net","threadId":"51050","inReplyTo":"xmqqd0ki3s0q.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] Makefile: remove the NO_R_TO_GCC_LINKER flag","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-05-17T00:23:04Z","receivedAt":"2019-05-17T00:23:07Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, May 17, 2019 at 08:21:09AM +0900, Junio C Hamano wrote:\n\n> Jeff King <peff@peff.net> writes:\n> \n> > Far be it from me to care about AIX, but it seems like this is ripe for\n> > regressions, because we don't know which platforms were relying on \"-R\"\n> > instead of \"-Wl,-rpath\", and now everybody will be using the latter by\n> > default.\n> \n> I do not have a stake in AIX, either, but I had the same reaction.\n> \n> Those who found having to give NO_R_TO_GCC_LINKER=NoThanks annoying\n> could have passed CC_LD_DYNPATH=-Wl,-rpath instead, but that is not\n> much shorter or sweeter X-<; with this change, they do not have to\n> do anything, but those who are broken can pass CC_LD_DYNPATH=-R to\n> unbreak it.  So it may not be the end of the world, but this move\n> certainly smells like robbing non-GCC users to pay GCC users to me.\n\nThanks, I wasn't quite clear on whether there was an escape hatch for\npeople who were broken (I took Ævar's \"perhaps we should follow this up\"\nmeaning we needed to add new knobs, but it is really just \"perhaps we\nshould set this existing knob by default on AIX\"). So that at least\nquells the worst of my worries.\n\nAfter that, I agree it's now just a question of the default. I don't\nhave a sense whether the majority is helped or hurt here (I admit that I\ndid not even know about these flags, despite compiling with gcc for the\npast 13 years, so possibly everybody was perfectly happy with the\nexisting behavior).\n\n-Peff\n"},{"id":"375832","messageId":"20190517215847.28179-1-avarab@gmail.com","threadId":"51050","inReplyTo":"xmqqd0ki3s0q.fsf@gitster-ct.c.googlers.com","subject":"[PATCH v2] Makefile: remove the NO_R_TO_GCC_LINKER flag","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2019-05-17T21:58:47Z","receivedAt":"2019-05-17T21:59:01Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change our default CC_LD_DYNPATH invocation to something GCC likes\nthese days. Since the GCC 4.6 release unknown flags haven't been\npassed through to ld(1). Thus our previous default of CC_LD_DYNPATH=-R\nwould cause an error on modern GCC unless NO_R_TO_GCC_LINKER was set.\n\nThis CC_LD_DYNPATH flag is really obscure, and I don't expect anyone\nexcept those working on git development ever use this.\n\nIt's not needed to simply link to libraries like say libpcre,\nbut *only* for those cases where we're linking to such a library not\npresent in the OS's library directories. See e.g. ldconfig(8) on Linux\nfor more details.\n\nI use this to compile my git with a LIBPCREDIR=$HOME/g/pcre2/inst as\nI'm building that from source, but someone maintaining an OS package\nis almost certainly not going to use this. They're just going to set\nUSE_LIBPCRE=YesPlease after installing the libpcre dependency,\nwhich'll point to OS libraries which ld(1) will find without the help\nof CC_LD_DYNPATH.\n\nAnother thing that helps mitigate any potential breakage is that we\ndetect the right type of invocation in configure.ac, which e.g. HP/UX\nuses[1], as does IBM's AIX package[2]. From what I can tell both AIX\nand Solaris packagers are building git with GCC, so I'm not adding a\ncorresponding config.mak.uname default to cater to their OS-native\nlinkers.\n\nNow for an overview of past development in this area:\n\nOur use of \"-R\" dates back to 455a7f3275 (\"More portability.\",\n2005-09-30). Soon after that in bbfc63dd78 (\"gcc does not necessarily\npass runtime libpath with -R\", 2006-12-27) the NO_R_TO_GCC flag was\nadded, allowing optional use of \"-Wl,-rpath=\".\n\nThen in f5b904db6b (\"Makefile: Allow CC_LD_DYNPATH to be overriden\",\n2008-08-16) the ability to override this flag to something else\nentirely was added, as some linkers use neither \"-Wl,-rpath,\" nor\n\"-R\".\n\nFrom what I can tell we should, with the benefit of hindsight, have\nmade this change back in 2006. GCC & ld supported this type of\ninvocation back then, or since at least binutils-gdb.git's[3]\na1ad915dc4 (\"[...]Add support for -rpath[...]\", 1994-07-20).\n\nFurther reading and prior art can be found at [4][5][6][7]. Making a\nplain \"-R\" an error seems from reading those reports to have been\nintroduced in GCC 4.6 released on March 25, 2011[8], but I couldn't\nconfirm this with absolute certainty, its release notes are ambiguous\non the subject, and I couldn't be bothered to try to build & bisect it\nagainst GCC 4.5.\n\n1. https://public-inbox.org/git/20190516093412.14795-1-avarab@gmail.com/\n2. https://www.ibm.com/developerworks/aix/library/aix-toolbox/alpha.html\n3. git://sourceware.org/git/binutils-gdb.git\n4. https://github.com/tsuna/boost.m4/issues/15\n5. https://bugzilla.gnome.org/show_bug.cgi?id=641416\n6. https://stackoverflow.com/questions/12629042/g-4-6-real-error-unrecognized-option-r\n7. https://curl.haxx.se/mail/archive-2014-11/0005.html\n8. https://gcc.gnu.org/gcc-4.6/changes.html\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n\nOn Fri, May 17 2019, Junio C Hamano wrote:\n\n> Jeff King <peff@peff.net> writes:\n>\n>> Far be it from me to care about AIX, but it seems like this is ripe for\n>> regressions, because we don't know which platforms were relying on \"-R\"\n>> instead of \"-Wl,-rpath\", and now everybody will be using the latter by\n>> default.\n>\n> I do not have a stake in AIX, either, but I had the same reaction.\n\nI did a bad job of summarizing why this change makes sense. Here's a\nv2 with a changed commit message. The first 4 pargaraphs are most\nrelevant.\n\nRange-diff:\n1:  bd9558b1cf ! 1:  56abcd0fae Makefile: remove the NO_R_TO_GCC_LINKER flag\n    @@ -2,13 +2,34 @@\n     \n         Makefile: remove the NO_R_TO_GCC_LINKER flag\n     \n    -    Remove the NO_R_TO_GCC_LINKER flag, thus switching the default to\n    -    \"-Wl,-rpath,$LIBPATH\" instead of our current \"-R$LIBPATH\". This is a\n    -    relatively obscure thing that only kicks in when using one of the\n    -    LIBDIR flags, e.g. LIBPCREDIR or CURLDIR.\n    +    Change our default CC_LD_DYNPATH invocation to something GCC likes\n    +    these days. Since the GCC 4.6 release unknown flags haven't been\n    +    passed through to ld(1). Thus our previous default of CC_LD_DYNPATH=-R\n    +    would cause an error on modern GCC unless NO_R_TO_GCC_LINKER was set.\n     \n    -    How we invoke the linker to do this can still be overridden with\n    -    CC_LD_DYNPATH, as seen in our configure.ac script.\n    +    This CC_LD_DYNPATH flag is really obscure, and I don't expect anyone\n    +    except those working on git development ever use this.\n    +\n    +    It's not needed to simply link to libraries like say libpcre,\n    +    but *only* for those cases where we're linking to such a library not\n    +    present in the OS's library directories. See e.g. ldconfig(8) on Linux\n    +    for more details.\n    +\n    +    I use this to compile my git with a LIBPCREDIR=$HOME/g/pcre2/inst as\n    +    I'm building that from source, but someone maintaining an OS package\n    +    is almost certainly not going to use this. They're just going to set\n    +    USE_LIBPCRE=YesPlease after installing the libpcre dependency,\n    +    which'll point to OS libraries which ld(1) will find without the help\n    +    of CC_LD_DYNPATH.\n    +\n    +    Another thing that helps mitigate any potential breakage is that we\n    +    detect the right type of invocation in configure.ac, which e.g. HP/UX\n    +    uses[1], as does IBM's AIX package[2]. From what I can tell both AIX\n    +    and Solaris packagers are building git with GCC, so I'm not adding a\n    +    corresponding config.mak.uname default to cater to their OS-native\n    +    linkers.\n    +\n    +    Now for an overview of past development in this area:\n     \n         Our use of \"-R\" dates back to 455a7f3275 (\"More portability.\",\n         2005-09-30). Soon after that in bbfc63dd78 (\"gcc does not necessarily\n    @@ -22,32 +43,24 @@\n     \n         From what I can tell we should, with the benefit of hindsight, have\n         made this change back in 2006. GCC & ld supported this type of\n    -    invocation back then, or since at least binutils-gdb.git's[1]\n    -    a1ad915dc4 (\"[...]Add support for -rpath[...]\", 1994-07-20). Most\n    -    people compiling git with a custom LIBDIR are going to be on a GNU-ish\n    -    system, and having to provide this NO_R_TO_GCC_LINKER flag on top of a\n    -    custom LIBDIR is annoying.\n    -\n    -    There are some OS's that don't support -rpath, e.g. AIX ld just\n    -    supports \"-R\". Perhaps we should follow this up with some\n    -    config.mak.uname changes, but as noted it's quite possible that nobody\n    -    on these platforms uses this (instead libraries in the system's search\n    -    path). We *could* also use \"-Wl,-R\", but let's not introduce something\n    -    new.\n    +    invocation back then, or since at least binutils-gdb.git's[3]\n    +    a1ad915dc4 (\"[...]Add support for -rpath[...]\", 1994-07-20).\n     \n    -    Further reading and prior art can be found at [2][3][4][5]. Making a\n    +    Further reading and prior art can be found at [4][5][6][7]. Making a\n         plain \"-R\" an error seems from reading those reports to have been\n    -    introduced in GCC 4.6 released on March 25, 2011, but I couldn't\n    +    introduced in GCC 4.6 released on March 25, 2011[8], but I couldn't\n         confirm this with absolute certainty, its release notes are ambiguous\n         on the subject, and I couldn't be bothered to try to build & bisect it\n         against GCC 4.5.\n     \n    -    1. git://sourceware.org/git/binutils-gdb.git\n    -    2. https://github.com/tsuna/boost.m4/issues/15\n    -    3. https://bugzilla.gnome.org/show_bug.cgi?id=641416\n    -    4. https://stackoverflow.com/questions/12629042/g-4-6-real-error-unrecognized-option-r\n    -    5. https://curl.haxx.se/mail/archive-2014-11/0005.html\n    -    6. https://gcc.gnu.org/gcc-4.6/changes.html\n    +    1. https://public-inbox.org/git/20190516093412.14795-1-avarab@gmail.com/\n    +    2. https://www.ibm.com/developerworks/aix/library/aix-toolbox/alpha.html\n    +    3. git://sourceware.org/git/binutils-gdb.git\n    +    4. https://github.com/tsuna/boost.m4/issues/15\n    +    5. https://bugzilla.gnome.org/show_bug.cgi?id=641416\n    +    6. https://stackoverflow.com/questions/12629042/g-4-6-real-error-unrecognized-option-r\n    +    7. https://curl.haxx.se/mail/archive-2014-11/0005.html\n    +    8. https://gcc.gnu.org/gcc-4.6/changes.html\n     \n         Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n     \n\n Makefile | 15 +--------------\n 1 file changed, 1 insertion(+), 14 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex f965509b3c..ce7a489d64 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -265,10 +265,6 @@ all::\n #\n # Define NO_DEFLATE_BOUND if your zlib does not have deflateBound.\n #\n-# Define NO_R_TO_GCC_LINKER if your gcc does not like \"-R/path/lib\"\n-# that tells runtime paths to dynamic libraries;\n-# \"-Wl,-rpath=/path/lib\" is used instead.\n-#\n # Define NO_NORETURN if using buggy versions of gcc 4.6+ and profile feedback,\n # as the compiler can crash (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299)\n #\n@@ -1160,6 +1156,7 @@ endif\n # which'll override these defaults.\n CFLAGS = -g -O2 -Wall\n LDFLAGS =\n+CC_LD_DYNPATH = -Wl,-rpath,\n BASIC_CFLAGS = -I.\n BASIC_LDFLAGS =\n \n@@ -1287,16 +1284,6 @@ ifeq ($(uname_S),Darwin)\n \tPTHREAD_LIBS =\n endif\n \n-ifndef CC_LD_DYNPATH\n-\tifdef NO_R_TO_GCC_LINKER\n-\t\t# Some gcc does not accept and pass -R to the linker to specify\n-\t\t# the runtime dynamic library path.\n-\t\tCC_LD_DYNPATH = -Wl,-rpath,\n-\telse\n-\t\tCC_LD_DYNPATH = -R\n-\tendif\n-endif\n-\n ifdef NO_LIBGEN_H\n \tCOMPAT_CFLAGS += -DNO_LIBGEN_H\n \tCOMPAT_OBJS += compat/basename.o\n-- \n2.21.0.1020.gf2820cf01a\n\n"},{"id":"375864","messageId":"xmqqa7fj2ren.fsf@gitster-ct.c.googlers.com","threadId":"51050","inReplyTo":"20190517215847.28179-1-avarab@gmail.com","subject":"Re: [PATCH v2] Makefile: remove the NO_R_TO_GCC_LINKER flag","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-05-19T00:56:32Z","receivedAt":"2019-05-19T01:05:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n\n> It's not needed to simply link to libraries like say libpcre,\n> but *only* for those cases where we're linking to such a library not\n> present in the OS's library directories. See e.g. ldconfig(8) on Linux\n> for more details.\n>\n> I use this to compile my git with a LIBPCREDIR=$HOME/g/pcre2/inst as\n> I'm building that from source, but someone maintaining an OS package\n> is almost certainly not going to use this. They're just going to set\n> USE_LIBPCRE=YesPlease after installing the libpcre dependency,\n> which'll point to OS libraries which ld(1) will find without the help\n> of CC_LD_DYNPATH.\n> ...\n> Our use of \"-R\" dates back to 455a7f3275 (\"More portability.\",\n> 2005-09-30). Soon after that in bbfc63dd78 (\"gcc does not necessarily\n> pass runtime libpath with -R\", 2006-12-27) the NO_R_TO_GCC flag was\n> added, allowing optional use of \"-Wl,-rpath=\".\n\nYeah, I recall I had to add -R back when I was with my previous\nemployer, where I had Sun with GNU toolchain as the primary\nenvironment and many libraries were custom built outside the system\npath.\n\n\n> diff --git a/Makefile b/Makefile\n> index f965509b3c..ce7a489d64 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -265,10 +265,6 @@ all::\n>  #\n>  # Define NO_DEFLATE_BOUND if your zlib does not have deflateBound.\n>  #\n> -# Define NO_R_TO_GCC_LINKER if your gcc does not like \"-R/path/lib\"\n> -# that tells runtime paths to dynamic libraries;\n> -# \"-Wl,-rpath=/path/lib\" is used instead.\n> -#\n\nI am not sure if -R was a GCC-only thing; we might want to, instead\nof removing this seciton, replace it with something like\n\n    # Use \"CC_LD_DYNPATH = -R\" if your compiler uses \"-R/path/to/lib\"\n    # to specify the runtime paths to dynamic libraries.  These days,\n    # GCC uses -Wl,-rpath=/path/to/lib and that is used by default\n    # instead.\n\nto help those whose build suddenly starts breaking.\n\n   >  # Define NO_NORETURN if using buggy versions of gcc 4.6+ and profile feedback,\n>  # as the compiler can crash (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299)\n>  #\n> @@ -1160,6 +1156,7 @@ endif\n>  # which'll override these defaults.\n>  CFLAGS = -g -O2 -Wall\n>  LDFLAGS =\n\nOr it could be a single liner at this point in the file, perhaps\n\n    # Really old GCC used \"CC_LD_DYNPATH = -R\" for the runtime dynlib path\n\n> +CC_LD_DYNPATH = -Wl,-rpath,\n"},{"id":"375885","messageId":"20190519050115.GA2672@sigill.intra.peff.net","threadId":"51050","inReplyTo":"20190517215847.28179-1-avarab@gmail.com","subject":"Re: [PATCH v2] Makefile: remove the NO_R_TO_GCC_LINKER flag","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-05-19T05:01:15Z","receivedAt":"2019-05-19T18:28:06Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, May 17, 2019 at 11:58:47PM +0200, Ævar Arnfjörð Bjarmason wrote:\n\n> On Fri, May 17 2019, Junio C Hamano wrote:\n> \n> > Jeff King <peff@peff.net> writes:\n> >\n> >> Far be it from me to care about AIX, but it seems like this is ripe for\n> >> regressions, because we don't know which platforms were relying on \"-R\"\n> >> instead of \"-Wl,-rpath\", and now everybody will be using the latter by\n> >> default.\n> >\n> > I do not have a stake in AIX, either, but I had the same reaction.\n> \n> I did a bad job of summarizing why this change makes sense. Here's a\n> v2 with a changed commit message. The first 4 pargaraphs are most\n> relevant.\n\nThanks for the additional context. After reading the revised\nexplanation, I agree it's probably OK to move in this direction.\n\n-Peff\n"},{"id":"376822","messageId":"c12ec5ff-87c9-a6d0-e9f6-6d7e1cf343c5@siemens.com","threadId":"51050","inReplyTo":"20190516093412.14795-1-avarab@gmail.com","subject":"Re: [PATCH] configure: Detect linking style for HP aCC on HP-UX","fromName":"Osipov, Michael","fromEmail":"michael.osipov@siemens.com","sentAt":"2019-06-07T14:51:19Z","receivedAt":"2019-06-07T14:51:31Z","isPatch":true,"sender":{"key":"michael.osipov@siemens.com","avatar":"https://avatars.githubusercontent.com/u/573017?v=4"},"body":"\n\nAm 2019-05-16 um 11:34 schrieb Ævar Arnfjörð Bjarmason:\n> From: Michael Osipov <michael.osipov@siemens.com>\n> \n> HP aCC does not accept any of the previously tested CC_LD_DYNPATH\n> formats, but only its own[1] \"-Wl,+b\" format. Add it to configure.ac.\n> \n> 1. http://nixdoc.net/man-pages/hp-ux/man1/ld_pa.1.html\n> \n> Signed-off-by: Michael Osipov <michael.osipov@siemens.com>\n> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> ---\n> \n> I took the liberty of slightly amending the commit message.\n> \n>   configure.ac | 14 ++++++++++++--\n>   1 file changed, 12 insertions(+), 2 deletions(-)\n> \n> diff --git a/configure.ac b/configure.ac\n> index be3b55f1cc..a43b476402 100644\n> --- a/configure.ac\n> +++ b/configure.ac\n> @@ -475,8 +475,18 @@ else\n>         if test \"$git_cv_ld_rpath\" = \"yes\"; then\n>            CC_LD_DYNPATH=-rpath\n>         else\n> -         CC_LD_DYNPATH=\n> -         AC_MSG_WARN([linker does not support runtime path to dynamic libraries])\n> +         AC_CACHE_CHECK([if linker supports -Wl,+b,], git_cv_ld_wl_b, [\n> +            SAVE_LDFLAGS=\"${LDFLAGS}\"\n> +            LDFLAGS=\"${SAVE_LDFLAGS} -Wl,+b,/\"\n> +            AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [git_cv_ld_wl_b=yes], [git_cv_ld_wl_b=no])\n> +            LDFLAGS=\"${SAVE_LDFLAGS}\"\n> +         ])\n> +         if test \"$git_cv_ld_wl_b\" = \"yes\"; then\n> +            CC_LD_DYNPATH=-Wl,+b,\n> +          else\n> +             CC_LD_DYNPATH=\n> +             AC_MSG_WARN([linker does not support runtime path to dynamic libraries])\n> +          fi\n>         fi\n>      fi\n>   fi\n> \n\nI can see that this one has not yet been committed nor my PR has been \npulled.\n\nAny chances to get this into master?\n\nMichael\n"},{"id":"376825","messageId":"xmqqr285pbta.fsf@gitster-ct.c.googlers.com","threadId":"51050","inReplyTo":"c12ec5ff-87c9-a6d0-e9f6-6d7e1cf343c5@siemens.com","subject":"Re: [PATCH] configure: Detect linking style for HP aCC on HP-UX","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-06-07T17:03:45Z","receivedAt":"2019-06-07T17:03:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Osipov, Michael\" <michael.osipov@siemens.com> writes:\n\n> Am 2019-05-16 um 11:34 schrieb Ævar Arnfjörð Bjarmason:\n>> From: Michael Osipov <michael.osipov@siemens.com>\n>>\n>> HP aCC does not accept any of the previously tested CC_LD_DYNPATH\n>> formats, but only its own[1] \"-Wl,+b\" format. Add it to configure.ac.\n>>\n>> 1. http://nixdoc.net/man-pages/hp-ux/man1/ld_pa.1.html\n>>\n>> Signed-off-by: Michael Osipov <michael.osipov@siemens.com>\n>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n>> ---\n>>\n>> I took the liberty of slightly amending the commit message.\n>>\n>>   configure.ac | 14 ++++++++++++--\n>>   1 file changed, 12 insertions(+), 2 deletions(-)\n>>\n>> diff --git a/configure.ac b/configure.ac\n>> index be3b55f1cc..a43b476402 100644\n>> --- a/configure.ac\n>> +++ b/configure.ac\n>> @@ -475,8 +475,18 @@ else\n>>         if test \"$git_cv_ld_rpath\" = \"yes\"; then\n>>            CC_LD_DYNPATH=-rpath\n>>         else\n>> -         CC_LD_DYNPATH=\n>> -         AC_MSG_WARN([linker does not support runtime path to dynamic libraries])\n>> +         AC_CACHE_CHECK([if linker supports -Wl,+b,], git_cv_ld_wl_b, [\n>> +            SAVE_LDFLAGS=\"${LDFLAGS}\"\n>> +            LDFLAGS=\"${SAVE_LDFLAGS} -Wl,+b,/\"\n>> +            AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [git_cv_ld_wl_b=yes], [git_cv_ld_wl_b=no])\n>> +            LDFLAGS=\"${SAVE_LDFLAGS}\"\n>> +         ])\n>> +         if test \"$git_cv_ld_wl_b\" = \"yes\"; then\n>> +            CC_LD_DYNPATH=-Wl,+b,\n>> +          else\n>> +             CC_LD_DYNPATH=\n>> +             AC_MSG_WARN([linker does not support runtime path to dynamic libraries])\n>> +          fi\n>>         fi\n>>      fi\n>>   fi\n>>\n>\n> I can see that this one has not yet been committed nor my PR has been\n> pulled.\n>\n> Any chances to get this into master?\n>\n> Michael\n\nSorry, it jsut fell of the cracks.  The way the new test was added\nlooks very good --- any platform that is happy with the existing\ntest will continue to function the same way, and a platform that\nknows -Wl,+b would use it instead of failing.\n\nWill pick it up.\n\nThanks.\n"}]}