Improving HP-UX support
PATCH 1/1 Improving HP-UX support
Hi folks,
please find a patch attached to properly compile and link Git 2.21.0 on HP-UX IA64.
The patch includes basically two changes:
* Detection of big endian on HP-UX otherwise SHA1 calc is broken
* Detection of linking style with HP aCC
Quoted 4 lines
export PREFIX=/opt/ports
export LIBDIR=$PREFIX/lib/hpux32
export CC=/opt/aCC/bin/aCC
export CXX=/opt/aCC/bin/aCC
Quoted 8 lines
export CONFIGURE="./configure --prefix=$PREFIX --libdir=$LIBDIR"
export CPPFLAGS="-I$PREFIX/include"
export LDFLAGS="-L$LIBDIR"
autoreconf -fi
$CONFIGURE --with-editor=vim --with-zlib=$PREFIX --with-perl=/usr/bin/perl --with-iconv=$PREFIX \
--with-libpcre=$PREFIX --with-gitconfig=$PREFIX/etc/gitconfig --with-gitattributes=$PREFIX/etc/gitattributes \
--without-tcltk --disable-pthreads --with-lib=lib/hpux32
gmake INSTALL=$INSTALL_SH install
Note: I am not subscribed to this list.
Regards,
Michael
configure.ac +12 -2
@@ -475,8 +475,18 @@ if test "$git_cv_ld_rpath" = "yes"; then CC_LD_DYNPATH=-rpath else - CC_LD_DYNPATH= - AC_MSG_WARN([linker does not support runtime path to dynamic libraries]) + AC_CACHE_CHECK([if linker supports -Wl,+b,], git_cv_ld_wl_b, [ + SAVE_LDFLAGS="${LDFLAGS}" + LDFLAGS="${SAVE_LDFLAGS} -Wl,+b,/" + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [git_cv_ld_wl_b=yes], [git_cv_ld_wl_b=no]) + LDFLAGS="${SAVE_LDFLAGS}" + ]) + if test "$git_cv_ld_wl_b" = "yes"; then + CC_LD_DYNPATH=-Wl,+b, + else + CC_LD_DYNPATH= + AC_MSG_WARN([linker does not support runtime path to dynamic libraries]) + fi fi fi fi
sha1.c +1 -1
@@ -93,7 +93,7 @@#define SHA1DC_BIGENDIAN /* Not under GCC-alike or glibc or *BSD or newlib or <processor whitelist> */ -#elif (defined(_AIX)) +#elif (defined(_AIX) || defined(__hpux))/* * Defines Big Endian on a whitelist of OSs that are known to be Big
Quoted 1 line · Michael
Hi folks,
Hi see Documentation/SubmittingPatches for how to submit patches inline instead of as attachments.
For the sha1dc change it seems trivially correct, but we import that upstream project as-is, could you please submit a pull request at
https://github.com/cr-marcstevens/sha1collisiondetection then we can update our version?
Quoted 14 lines
diff -ur configure.ac configure.ac
configure.ac +5
-2@@ -475,8 +475,18 @@ if test "$git_cv_ld_rpath" = "yes"; then CC_LD_DYNPATH=-rpath else - CC_LD_DYNPATH= - AC_MSG_WARN([linker does not support runtime path to dynamic libraries]) + AC_CACHE_CHECK([if linker supports -Wl,+b,], git_cv_ld_wl_b, [ + SAVE_LDFLAGS="${LDFLAGS}" + LDFLAGS="${SAVE_LDFLAGS} -Wl,+b,/" + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [git_cv_ld_wl_b=yes], [git_cv_ld_wl_b=no]) + LDFLAGS="${SAVE_LDFLAGS}"
configure.ac line 492
Quoted 10 lines
configure.ac +7
-0+ ]) + if test "$git_cv_ld_wl_b" = "yes"; then + CC_LD_DYNPATH=-Wl,+b, + else + CC_LD_DYNPATH= + AC_MSG_WARN([linker does not support runtime path to dynamic libraries]) + fi fi fi fi
Do we want to also have something in config.mak.uname to always do this on HP/UX?
configure.ac
Quoted 3 lines
/* Not under GCC-alike or glibc or *BSD or newlib or <processor whitelist> */
configure.ac +1
-1-#elif (defined(_AIX)) +#elif (defined(_AIX) || defined(__hpux))
Seems sane, and per my googling even though HP/UX now runs on little-endian hardware it's always big-endian. But in this manual they advice doing it at runtime with a TEST_ENDIAN() macro in sys/portal.h:
http://h20628.www2.hp.com/km-ext/kmcsdirect/emr_na-c01921401-1.pdf
Is that something we need to worry about / support? E.g. in the configure script?
Hey there,
Am 2019-05-09 um 09:32 schrieb Ævar Arnfjörð Bjarmason:
Quoted 7 lines · Michael
Quoted 2 lines
Hi folks,
Hi see
Documentation/SubmittingPatchesfor how to submit patches inline instead of as attachments.
Do you want me to resend the configure.ac change as per wiki article? I can also create a PR on GitHub. I am happy with both as long as I don't have to retain the patch for myself only ;-)
Quoted 4 lines
For the sha1dc change it seems trivially correct, but we import that upstream project as-is, could you please submit a pull request at
https://github.com/cr-marcstevens/sha1collisiondetection then we can update our version?
Sure thing, will do.
Quoted 19 lines
Quoted 19 lines
diff -ur configure.ac configure.ac
configure.ac +10
-2@@ -475,8 +475,18 @@ if test "$git_cv_ld_rpath" = "yes"; then CC_LD_DYNPATH=-rpath else - CC_LD_DYNPATH= - AC_MSG_WARN([linker does not support runtime path to dynamic libraries]) + AC_CACHE_CHECK([if linker supports -Wl,+b,], git_cv_ld_wl_b, [ + SAVE_LDFLAGS="${LDFLAGS}" + LDFLAGS="${SAVE_LDFLAGS} -Wl,+b,/" + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [git_cv_ld_wl_b=yes], [git_cv_ld_wl_b=no]) + LDFLAGS="${SAVE_LDFLAGS}" + ]) + if test "$git_cv_ld_wl_b" = "yes"; then + CC_LD_DYNPATH=-Wl,+b, + else + CC_LD_DYNPATH=
Quoted 8 lines
configure.ac line 492
Quoted 5 lines
configure.ac +2
-0+ AC_MSG_WARN([linker does not support runtime path to dynamic libraries]) + fi fi fi fiDo we want to also have something in config.mak.uname to always do this on HP/UX?
I am not convinced by that. I wouldn't mix operating system with compiler settings. One could also use GCC on HP-UX. The one above is for HP aCC.
Quoted 9 lines
configure.ac
Quoted 3 lines
/* Not under GCC-alike or glibc or *BSD or newlib or <processor whitelist> */
configure.ac +1
-1-#elif (defined(_AIX)) +#elif (defined(_AIX) || defined(__hpux))Seems sane, and per my googling even though HP/UX now runs on little-endian hardware it's always big-endian. But in this manual they advice doing it at runtime with a
TEST_ENDIAN()macro insys/portal.h:
http://h20628.www2.hp.com/km-ext/kmcsdirect/emr_na-c01921401-1.pdf
Quoted 3 lines
Is that something we need to worry about / support? E.g. in the configure script?
That'd be much more work to extend configure.ac for that because is a runtime check. Since there are no real products vailable on x86 for HP-UX I'd neglect that. Our HPE salesman told us that this will be available somewhere in the future. So, I think this is very good for now.
Michael
PATCH 1/1 sha1dc: update from upstream
Update sha1dc from the latest version by the upstream maintainer[1]. See 07a20f569b ("Makefile: fix unaligned loads in sha1dc with UBSan", 2019-03-12) for the last update.
This fixes an issue where HP-UX IA64 was wrongly detected as a Little-endian instead of a Big-endian system, see [2] and [3].
1. https://github.com/cr-marcstevens/sha1collisiondetection/commit/855827c583bc30645ba427885caa40c5b81764d2
2. https://public-inbox.org/git/[email protected]/
3. https://github.com/cr-marcstevens/sha1collisiondetection/pull/50
---
Quoted 6 lines · Michael
Hey there,
Am 2019-05-09 um 09:32 schrieb Ævar Arnfjörð Bjarmason:
Quoted 3 lines · Michael
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Hi folks,
Hi see
Documentation/SubmittingPatchesfor how to submit patches inline instead of as attachments.Do you want me to resend the configure.ac change as per wiki article? I can also create a PR on GitHub. I am happy with both as long as I don't have to retain the patch for myself only ;-)
Yeah that patch to git.git should be done separately. I see your PR went in upstream, here's a patch to update our code to match.
Quoted 5 lines
That'd be much more work to extend configure.ac for that because is a runtime check. Since there are no real products vailable on x86 for HP-UX I'd neglect that. Our HPE salesman told us that this will be available somewhere in the future. So, I think this is very good for now.
Sure, makes sense. I'm not familiar with HP/UX. So just thought I'd ask.
sha1collisiondetection | 2 +- sha1dc/sha1.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
sha1collisiondetection +1 -1
@@ -1 +1 @@ -Subproject commit 16033998da4b273aebd92c84b1e1b12e4aaf7009 +Subproject commit 855827c583bc30645ba427885caa40c5b81764d2
sha1dc/sha1.c +1 -1
@@ -93,7 +93,7 @@#define SHA1DC_BIGENDIAN /* Not under GCC-alike or glibc or *BSD or newlib or <processor whitelist> */ -#elif (defined(_AIX)) +#elif (defined(_AIX) || defined(__hpux))/* * Defines Big Endian on a whitelist of OSs that are known to be Big
Signature · 1 line
2.21.0.1020.gf2820cf01a
Re: [PATCH] sha1dc: update from upstream
Hi,
Am 2019-05-14 um 00:17 schrieb Ævar Arnfjörð Bjarmason:
Quoted 27 lines
Update sha1dc from the latest version by the upstream maintainer[1]. See
07a20f569b("Makefile: fix unaligned loads in sha1dc with UBSan", 2019-03-12) for the last update.This fixes an issue where HP-UX IA64 was wrongly detected as a Little-endian instead of a Big-endian system, see [2] and [3].
1. https://github.com/cr-marcstevens/sha1collisiondetection/commit/855827c583bc30645ba427885caa40c5b81764d2
2. https://public-inbox.org/git/[email protected]/
3. https://github.com/cr-marcstevens/sha1collisiondetection/pull/50Signed-off-by Ævar Arnfjörð Bjarmason <[email protected]>---
Quoted 11 lines · Michael
Hey there,
Am 2019-05-09 um 09:32 schrieb Ævar Arnfjörð Bjarmason:
Quoted 7 lines · Michael
Quoted 2 lines
Hi folks,
Hi see
Documentation/SubmittingPatchesfor how to submit patches inline instead of as attachments.
Quoted 6 lines
Quoted 3 lines
Do you want me to resend the configure.ac change as per wiki article? I can also create a PR on GitHub. I am happy with both as long as I don't have to retain the patch for myself only ;-)
Yeah that patch to git.git should be done separately. I see your PR went in upstream, here's a patch to update our code to match.
To avoid misunderstandings, I have factored out the Git patch and created a PR: https://github.com/git/git/pull/608
Looks good to me now:
Quoted 10 lines
osipovmi@deblndw024v:~/git
$ uname -a HP-UX deblndw0 B.11.31 U ia64 HP-UX osipovmi@deblndw024v:~/git $ ./git --version git version 2.22.0.rc0.dirty osipovmi@deblndw024v:~/git $ ldd ./git./git:
Quoted 8 lines
libz.so => /opt/ports/lib/hpux32/libz.so
libiconv.so.8 => /opt/ports/lib/hpux32/libiconv.so.8
libintl.so.9 => /opt/ports/lib/hpux32/libintl.so.9
libc.so.1 => /usr/lib/hpux32/libc.so.1
libc.so.1 => /usr/lib/hpux32/libc.so.1
libc.so.1 => /usr/lib/hpux32/libc.so.1
libc.so.1 => /usr/lib/hpux32/libc.so.1
libdl.so.1 => /usr/lib/hpux32/libdl.so.1Looking forward for a merge.
Regards,
Michael
Re: [PATCH] sha1dc: update from upstream
Quoted 34 lines · Michael
Hi,
Am 2019-05-14 um 00:17 schrieb Ævar Arnfjörð Bjarmason:
Quoted 31 lines
Update sha1dc from the latest version by the upstream maintainer[1]. See
07a20f569b("Makefile: fix unaligned loads in sha1dc with UBSan", 2019-03-12) for the last update.This fixes an issue where HP-UX IA64 was wrongly detected as a Little-endian instead of a Big-endian system, see [2] and [3].
1. https://github.com/cr-marcstevens/sha1collisiondetection/commit/855827c583bc30645ba427885caa40c5b81764d2
2. https://public-inbox.org/git/[email protected]/
3. https://github.com/cr-marcstevens/sha1collisiondetection/pull/50Signed-off-by Ævar Arnfjörð Bjarmason <[email protected]>---
Quoted 14 lines · Michael
Hey there,
Am 2019-05-09 um 09:32 schrieb Ævar Arnfjörð Bjarmason:
Quoted 7 lines · Michael
Quoted 2 lines
Hi folks,
Hi see
Documentation/SubmittingPatchesfor how to submit patches inline instead of as attachments.Do you want me to resend the configure.ac change as per wiki article? I can also create a PR on GitHub. I am happy with both as long as I don't have to retain the patch for myself only ;-)
Quoted 5 lines
Quoted 2 lines
Yeah that patch to git.git should be done separately. I see your PR went in upstream, here's a patch to update our code to match.
To avoid misunderstandings, I have factored out the Git patch and created a PR: https://github.com/git/git/pull/608
Thanks. If you want to submit it for inclusion you'll need to submit it as a patch here to the ML as described here:
https://github.com/git/git/blob/master/Documentation/SubmittingPatches
Or you can use this pull-request-by-proxy thing:
https://gitgitgadget.github.io/
Or if you don't want to deal with any of that crap just say and I'll E-Mail this to the list for you. Just want to give you a chance to do it :)
Quoted 25 lines
Looks good to me now:
Quoted 10 lines
osipovmi@deblndw024v:~/git
$ uname -a HP-UX deblndw0 B.11.31 U ia64 HP-UX osipovmi@deblndw024v:~/git $ ./git --version git version 2.22.0.rc0.dirty osipovmi@deblndw024v:~/git $ ldd ./git./git:
Quoted 8 lines
libz.so => /opt/ports/lib/hpux32/libz.so libiconv.so.8 => /opt/ports/lib/hpux32/libiconv.so.8 libintl.so.9 => /opt/ports/lib/hpux32/libintl.so.9 libc.so.1 => /usr/lib/hpux32/libc.so.1 libc.so.1 => /usr/lib/hpux32/libc.so.1 libc.so.1 => /usr/lib/hpux32/libc.so.1 libc.so.1 => /usr/lib/hpux32/libc.so.1 libdl.so.1 => /usr/lib/hpux32/libdl.so.1Looking forward for a merge.
Regards,
Michael
Re: [PATCH] sha1dc: update from upstream
Am 2019-05-15 um 13:48 schrieb Ævar Arnfjörð Bjarmason:
Quoted 47 lines · Michael
Quoted 35 lines
Hi,
Am 2019-05-14 um 00:17 schrieb Ævar Arnfjörð Bjarmason:
Quoted 31 lines
Update sha1dc from the latest version by the upstream maintainer[1]. See
07a20f569b("Makefile: fix unaligned loads in sha1dc with UBSan", 2019-03-12) for the last update.This fixes an issue where HP-UX IA64 was wrongly detected as a Little-endian instead of a Big-endian system, see [2] and [3].
1. https://github.com/cr-marcstevens/sha1collisiondetection/commit/855827c583bc30645ba427885caa40c5b81764d2
2. https://public-inbox.org/git/[email protected]/
3. https://github.com/cr-marcstevens/sha1collisiondetection/pull/50Signed-off-by Ævar Arnfjörð Bjarmason <[email protected]>---
Quoted 14 lines · Michael
Hey there,
Am 2019-05-09 um 09:32 schrieb Ævar Arnfjörð Bjarmason:
Quoted 7 lines · Michael
Quoted 2 lines
Hi folks,
Hi see
Documentation/SubmittingPatchesfor how to submit patches inline instead of as attachments.Do you want me to resend the configure.ac change as per wiki article? I can also create a PR on GitHub. I am happy with both as long as I don't have to retain the patch for myself only ;-)
Quoted 5 lines
Quoted 2 lines
Yeah that patch to git.git should be done separately. I see your PR went in upstream, here's a patch to update our code to match.
To avoid misunderstandings, I have factored out the Git patch and created a PR: https://github.com/git/git/pull/608
Thanks. If you want to submit it for inclusion you'll need to submit it as a patch here to the ML as described here:
https://github.com/git/git/blob/master/Documentation/SubmittingPatches
Quoted 6 lines
Or you can use this pull-request-by-proxy thing:
https://gitgitgadget.github.io/Or if you don't want to deal with any of that crap just say and I'll E-Mail this to the list for you. Just want to give you a chance to do it :)
Yes, please do so. It seems like our corporate mail relay server does not allow sending emails outside of our dns namespace. I get bounces from mailer daemon.
Michael
Re: [PATCH] sha1dc: update from upstream
Quoted 51 lines · Michael
Am 2019-05-15 um 13:48 schrieb Ævar Arnfjörð Bjarmason:
Quoted 50 lines · Michael
Quoted 35 lines
Hi,
Am 2019-05-14 um 00:17 schrieb Ævar Arnfjörð Bjarmason:
Quoted 31 lines
Update sha1dc from the latest version by the upstream maintainer[1]. See
07a20f569b("Makefile: fix unaligned loads in sha1dc with UBSan", 2019-03-12) for the last update.This fixes an issue where HP-UX IA64 was wrongly detected as a Little-endian instead of a Big-endian system, see [2] and [3].
1. https://github.com/cr-marcstevens/sha1collisiondetection/commit/855827c583bc30645ba427885caa40c5b81764d2
2. https://public-inbox.org/git/[email protected]/
3. https://github.com/cr-marcstevens/sha1collisiondetection/pull/50Signed-off-by Ævar Arnfjörð Bjarmason <[email protected]>---
Quoted 14 lines · Michael
Hey there,
Am 2019-05-09 um 09:32 schrieb Ævar Arnfjörð Bjarmason:
Quoted 7 lines · Michael
Quoted 2 lines
Hi folks,
Hi see
Documentation/SubmittingPatchesfor how to submit patches inline instead of as attachments.Do you want me to resend the configure.ac change as per wiki article? I can also create a PR on GitHub. I am happy with both as long as I don't have to retain the patch for myself only ;-)
Quoted 5 lines
Quoted 2 lines
Yeah that patch to git.git should be done separately. I see your PR went in upstream, here's a patch to update our code to match.
To avoid misunderstandings, I have factored out the Git patch and created a PR: https://github.com/git/git/pull/608
Thanks. If you want to submit it for inclusion you'll need to submit it as a patch here to the ML as described here:
https://github.com/git/git/blob/master/Documentation/SubmittingPatchesOr you can use this pull-request-by-proxy thing:
https://gitgitgadget.github.io/
Quoted 7 lines
Quoted 3 lines
Or if you don't want to deal with any of that crap just say and I'll E-Mail this to the list for you. Just want to give you a chance to do it :)
Yes, please do so. It seems like our corporate mail relay server does not allow sending emails outside of our dns namespace. I get bounces from mailer daemon.
Hi. No problem, but I just noticed your commit is missing a signed-off-by (required for inclusion in git.git), please "git commit --amend -s" it and re-push that PR, then I can pull it from there.
Re: [PATCH] sha1dc: update from upstream
Am 2019-05-16 um 10:31 schrieb Ævar Arnfjörð Bjarmason:
Quoted 58 lines · Michael
Quoted 56 lines
Am 2019-05-15 um 13:48 schrieb Ævar Arnfjörð Bjarmason:
Quoted 53 lines · Michael
Quoted 35 lines
Hi,
Am 2019-05-14 um 00:17 schrieb Ævar Arnfjörð Bjarmason:
Quoted 31 lines
Update sha1dc from the latest version by the upstream maintainer[1]. See
07a20f569b("Makefile: fix unaligned loads in sha1dc with UBSan", 2019-03-12) for the last update.This fixes an issue where HP-UX IA64 was wrongly detected as a Little-endian instead of a Big-endian system, see [2] and [3].
1. https://github.com/cr-marcstevens/sha1collisiondetection/commit/855827c583bc30645ba427885caa40c5b81764d2
2. https://public-inbox.org/git/[email protected]/
3. https://github.com/cr-marcstevens/sha1collisiondetection/pull/50Signed-off-by Ævar Arnfjörð Bjarmason <[email protected]>---
Quoted 14 lines · Michael
Hey there,
Am 2019-05-09 um 09:32 schrieb Ævar Arnfjörð Bjarmason:
Quoted 7 lines · Michael
Quoted 2 lines
Hi folks,
Hi see
Documentation/SubmittingPatchesfor how to submit patches inline instead of as attachments.Do you want me to resend the configure.ac change as per wiki article? I can also create a PR on GitHub. I am happy with both as long as I don't have to retain the patch for myself only ;-)
Quoted 5 lines
Quoted 2 lines
Yeah that patch to git.git should be done separately. I see your PR went in upstream, here's a patch to update our code to match.
To avoid misunderstandings, I have factored out the Git patch and created a PR: https://github.com/git/git/pull/608
Thanks. If you want to submit it for inclusion you'll need to submit it as a patch here to the ML as described here:
https://github.com/git/git/blob/master/Documentation/SubmittingPatchesOr you can use this pull-request-by-proxy thing:
https://gitgitgadget.github.io/Or if you don't want to deal with any of that crap just say and I'll E-Mail this to the list for you. Just want to give you a chance to do it :)
Quoted 7 lines
Quoted 3 lines
Yes, please do so. It seems like our corporate mail relay server does not allow sending emails outside of our dns namespace. I get bounces from mailer daemon.
Hi. No problem, but I just noticed your commit is missing a signed-off-by (required for inclusion in git.git), please "git commit --amend -s" it and re-push that PR, then I can pull it from there.
Done as requested!
Michael
PATCH 1/1 configure: Detect linking style for HP aCC on HP-UX
In reply to Osipov, MichaelFrom: Michael Osipov <[email protected]>
HP aCC does not accept any of the previously tested CC_LD_DYNPATH formats, but only its own[1] "-Wl,+b" format. Add it to configure.ac.
1. http://nixdoc.net/man-pages/hp-ux/man1/ld_pa.1.html
---
I took the liberty of slightly amending the commit message.
configure.ac | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
configure.ac +12 -2
@@ -475,8 +475,18 @@ else if test "$git_cv_ld_rpath" = "yes"; then CC_LD_DYNPATH=-rpath else - CC_LD_DYNPATH= - AC_MSG_WARN([linker does not support runtime path to dynamic libraries]) + AC_CACHE_CHECK([if linker supports -Wl,+b,], git_cv_ld_wl_b, [ + SAVE_LDFLAGS="${LDFLAGS}" + LDFLAGS="${SAVE_LDFLAGS} -Wl,+b,/" + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [git_cv_ld_wl_b=yes], [git_cv_ld_wl_b=no]) + LDFLAGS="${SAVE_LDFLAGS}" + ]) + if test "$git_cv_ld_wl_b" = "yes"; then + CC_LD_DYNPATH=-Wl,+b, + else + CC_LD_DYNPATH= + AC_MSG_WARN([linker does not support runtime path to dynamic libraries]) + fi fi fi fi
Signature · 1 line
2.21.0.1020.gf2820cf01a
PATCH 1/1 Makefile: remove the NO_R_TO_GCC_LINKER flag
Remove the NO_R_TO_GCC_LINKER flag, thus switching the default to "-Wl,-rpath,$LIBPATH" instead of our current "-R$LIBPATH". This is a relatively obscure thing that only kicks in when using one of the LIBDIR flags, e.g. LIBPCREDIR or CURLDIR.
How we invoke the linker to do this can still be overridden with CC_LD_DYNPATH, as seen in our configure.ac script.
Our use of "-R" dates back to 455a7f3275 ("More portability.", 2005-09-30). Soon after that in bbfc63dd78 ("gcc does not necessarily pass runtime libpath with -R", 2006-12-27) the NO_R_TO_GCC flag was added, allowing optional use of "-Wl,-rpath=".
Then in f5b904db6b ("Makefile: Allow CC_LD_DYNPATH to be overriden", 2008-08-16) the ability to override this flag to something else entirely was added, as some linkers use neither "-Wl,-rpath," nor "-R".
From what I can tell we should, with the benefit of hindsight, have made this change back in 2006. GCC & ld supported this type of invocation back then, or since at least binutils-gdb.git's[1] a1ad915dc4 ("[...]Add support for -rpath[...]", 1994-07-20). Most people compiling git with a custom LIBDIR are going to be on a GNU-ish system, and having to provide this NO_R_TO_GCC_LINKER flag on top of a custom LIBDIR is annoying.
There are some OS's that don't support -rpath, e.g. AIX ld just supports "-R". Perhaps we should follow this up with some config.mak.uname changes, but as noted it's quite possible that nobody on these platforms uses this (instead libraries in the system's search path). We *could* also use "-Wl,-R", but let's not introduce something new.
Further reading and prior art can be found at [2][3][4][5]. Making a plain "-R" an error seems from reading those reports to have been introduced in GCC 4.6 released on March 25, 2011, but I couldn't confirm this with absolute certainty, its release notes are ambiguous on the subject, and I couldn't be bothered to try to build & bisect it against GCC 4.5.
1. git://sourceware.org/git/binutils-gdb.git
2. https://github.com/tsuna/boost.m4/issues/15
3. https://bugzilla.gnome.org/show_bug.cgi?id=641416
4. https://stackoverflow.com/questions/12629042/g-4-6-real-error-unrecognized-option-r
5. https://curl.haxx.se/mail/archive-2014-11/0005.html
6. https://gcc.gnu.org/gcc-4.6/changes.html
---
Looking at that HP/UX configure patch I was reminded of being annoyed by the NO_R_TO_GCC_LINKER flag.
Makefile | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-)
Makefile +1 -14
@@ -265,10 +265,6 @@ all:: # # Define NO_DEFLATE_BOUND if your zlib does not have deflateBound. # -# Define NO_R_TO_GCC_LINKER if your gcc does not like "-R/path/lib" -# that tells runtime paths to dynamic libraries; -# "-Wl,-rpath=/path/lib" is used instead. -# # Define NO_NORETURN if using buggy versions of gcc 4.6+ and profile feedback, # as the compiler can crash (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299) #
@@ -1160,6 +1156,7 @@ endif # which'll override these defaults. CFLAGS = -g -O2 -Wall LDFLAGS = +CC_LD_DYNPATH = -Wl,-rpath, BASIC_CFLAGS = -I. BASIC_LDFLAGS =
@@ -1287,16 +1284,6 @@ ifeq ($(uname_S),Darwin) PTHREAD_LIBS = endif -ifndef CC_LD_DYNPATH - ifdef NO_R_TO_GCC_LINKER - # Some gcc does not accept and pass -R to the linker to specify - # the runtime dynamic library path. - CC_LD_DYNPATH = -Wl,-rpath, - else - CC_LD_DYNPATH = -R - endif -endif - ifdef NO_LIBGEN_H COMPAT_CFLAGS += -DNO_LIBGEN_H COMPAT_OBJS += compat/basename.o
Signature · 1 line
2.21.0.1020.gf2820cf01a
Re: [PATCH] Makefile: remove the NO_R_TO_GCC_LINKER flag
Quoted 8 lines · Ævar Arnfjörð Bjarmason
From what I can tell we should, with the benefit of hindsight, have made this change back in 2006. GCC & ld supported this type of invocation back then, or since at least binutils-gdb.git's[1]
a1ad915dc4("[...]Add support for -rpath[...]", 1994-07-20). Most people compiling git with a custom LIBDIR are going to be on a GNU-ish system, and having to provide thisNO_R_TO_GCC_LINKERflag on top of a custom LIBDIR is annoying.
Quoted 6 lines
There are some OS's that don't support -rpath, e.g. AIX ld just supports "-R". Perhaps we should follow this up with some config.mak.uname changes, but as noted it's quite possible that nobody on these platforms uses this (instead libraries in the system's search path). We *could* also use "-Wl,-R", but let's not introduce something new.
So...does this mean with just your patch that the build is now broken on AIX if you use CURLDIR?
Far be it from me to care about AIX, but it seems like this is ripe for regressions, because we don't know which platforms were relying on "-R" instead of "-Wl,-rpath", and now everybody will be using the latter by default.
-Peff
Re: [PATCH] Makefile: remove the NO_R_TO_GCC_LINKER flag
Quoted 4 lines · Jeff King
Far be it from me to care about AIX, but it seems like this is ripe for regressions, because we don't know which platforms were relying on "-R" instead of "-Wl,-rpath", and now everybody will be using the latter by default.
I do not have a stake in AIX, either, but I had the same reaction.
Those who found having to give NO_R_TO_GCC_LINKER=NoThanks annoying could have passed CC_LD_DYNPATH=-Wl,-rpath instead, but that is not much shorter or sweeter X-<; with this change, they do not have to do anything, but those who are broken can pass CC_LD_DYNPATH=-R to unbreak it. So it may not be the end of the world, but this move certainly smells like robbing non-GCC users to pay GCC users to me.
Re: [PATCH] Makefile: remove the NO_R_TO_GCC_LINKER flag
Quoted 7 lines · Junio C Hamano
Quoted 4 lines · Jeff King
Far be it from me to care about AIX, but it seems like this is ripe for regressions, because we don't know which platforms were relying on "-R" instead of "-Wl,-rpath", and now everybody will be using the latter by default.
Quoted 8 lines
I do not have a stake in AIX, either, but I had the same reaction.
Those who found having to give NO_R_TO_GCC_LINKER=NoThanks annoying could have passed CC_LD_DYNPATH=-Wl,-rpath instead, but that is not much shorter or sweeter X-<; with this change, they do not have to do anything, but those who are broken can pass CC_LD_DYNPATH=-R to unbreak it. So it may not be the end of the world, but this move certainly smells like robbing non-GCC users to pay GCC users to me.
Thanks, I wasn't quite clear on whether there was an escape hatch for people who were broken (I took Ævar's "perhaps we should follow this up" meaning we needed to add new knobs, but it is really just "perhaps we should set this existing knob by default on AIX"). So that at least quells the worst of my worries.
After that, I agree it's now just a question of the default. I don't have a sense whether the majority is helped or hurt here (I admit that I did not even know about these flags, despite compiling with gcc for the past 13 years, so possibly everybody was perfectly happy with the existing behavior).
-Peff
PATCH v2 1/1 Makefile: remove the NO_R_TO_GCC_LINKER flag
In reply to Junio C HamanoChange our default CC_LD_DYNPATH invocation to something GCC likes these days. Since the GCC 4.6 release unknown flags haven't been passed through to ld(1). Thus our previous default of CC_LD_DYNPATH=-R would cause an error on modern GCC unless NO_R_TO_GCC_LINKER was set.
This CC_LD_DYNPATH flag is really obscure, and I don't expect anyone except those working on git development ever use this.
It's not needed to simply link to libraries like say libpcre, but *only* for those cases where we're linking to such a library not present in the OS's library directories. See e.g. ldconfig(8) on Linux for more details.
I use this to compile my git with a LIBPCREDIR=$HOME/g/pcre2/inst as I'm building that from source, but someone maintaining an OS package is almost certainly not going to use this. They're just going to set USE_LIBPCRE=YesPlease after installing the libpcre dependency, which'll point to OS libraries which ld(1) will find without the help of CC_LD_DYNPATH.
Another thing that helps mitigate any potential breakage is that we detect the right type of invocation in configure.ac, which e.g. HP/UX uses[1], as does IBM's AIX package[2]. From what I can tell both AIX and Solaris packagers are building git with GCC, so I'm not adding a corresponding config.mak.uname default to cater to their OS-native linkers.
Now for an overview of past development in this area:
Our use of "-R" dates back to 455a7f3275 ("More portability.", 2005-09-30). Soon after that in bbfc63dd78 ("gcc does not necessarily pass runtime libpath with -R", 2006-12-27) the NO_R_TO_GCC flag was added, allowing optional use of "-Wl,-rpath=".
Then in f5b904db6b ("Makefile: Allow CC_LD_DYNPATH to be overriden", 2008-08-16) the ability to override this flag to something else entirely was added, as some linkers use neither "-Wl,-rpath," nor "-R".
From what I can tell we should, with the benefit of hindsight, have made this change back in 2006. GCC & ld supported this type of invocation back then, or since at least binutils-gdb.git's[3] a1ad915dc4 ("[...]Add support for -rpath[...]", 1994-07-20).
Further reading and prior art can be found at [4][5][6][7]. Making a plain "-R" an error seems from reading those reports to have been introduced in GCC 4.6 released on March 25, 2011[8], but I couldn't confirm this with absolute certainty, its release notes are ambiguous on the subject, and I couldn't be bothered to try to build & bisect it against GCC 4.5.
1. https://public-inbox.org/git/[email protected]/
2. https://www.ibm.com/developerworks/aix/library/aix-toolbox/alpha.html
3. git://sourceware.org/git/binutils-gdb.git
4. https://github.com/tsuna/boost.m4/issues/15
5. https://bugzilla.gnome.org/show_bug.cgi?id=641416
6. https://stackoverflow.com/questions/12629042/g-4-6-real-error-unrecognized-option-r
7. https://curl.haxx.se/mail/archive-2014-11/0005.html
8. https://gcc.gnu.org/gcc-4.6/changes.html
---
Quoted 8 lines · Junio C Hamano
Quoted 4 lines · Jeff King
Far be it from me to care about AIX, but it seems like this is ripe for regressions, because we don't know which platforms were relying on "-R" instead of "-Wl,-rpath", and now everybody will be using the latter by default.
I do not have a stake in AIX, either, but I had the same reaction.
I did a bad job of summarizing why this change makes sense. Here's a v2 with a changed commit message. The first 4 pargaraphs are most relevant.
Range-diff:
1: bd9558b1cf ! 1: 56abcd0fae Makefile: remove the NO_R_TO_GCC_LINKER flag
@@ -2,13 +2,34 @@
Makefile: remove the NO_R_TO_GCC_LINKER flag
- Remove the NO_R_TO_GCC_LINKER flag, thus switching the default to
- "-Wl,-rpath,$LIBPATH" instead of our current "-R$LIBPATH". This is a
- relatively obscure thing that only kicks in when using one of the
- LIBDIR flags, e.g. LIBPCREDIR or CURLDIR.
+ Change our default CC_LD_DYNPATH invocation to something GCC likes
+ these days. Since the GCC 4.6 release unknown flags haven't been
+ passed through to ld(1). Thus our previous default of CC_LD_DYNPATH=-R
+ would cause an error on modern GCC unless NO_R_TO_GCC_LINKER was set.
- How we invoke the linker to do this can still be overridden with
- CC_LD_DYNPATH, as seen in our configure.ac script.
+ This CC_LD_DYNPATH flag is really obscure, and I don't expect anyone
+ except those working on git development ever use this.
+
+ It's not needed to simply link to libraries like say libpcre,
+ but *only* for those cases where we're linking to such a library not
+ present in the OS's library directories. See e.g. ldconfig(8) on Linux
+ for more details.
+
+ I use this to compile my git with a LIBPCREDIR=$HOME/g/pcre2/inst as
+ I'm building that from source, but someone maintaining an OS package
+ is almost certainly not going to use this. They're just going to set
+ USE_LIBPCRE=YesPlease after installing the libpcre dependency,
+ which'll point to OS libraries which ld(1) will find without the help
+ of CC_LD_DYNPATH.
+
+ Another thing that helps mitigate any potential breakage is that we
+ detect the right type of invocation in configure.ac, which e.g. HP/UX
+ uses[1], as does IBM's AIX package[2]. From what I can tell both AIX
+ and Solaris packagers are building git with GCC, so I'm not adding a
+ corresponding config.mak.uname default to cater to their OS-native
+ linkers.
+
+ Now for an overview of past development in this area:
Our use of "-R" dates back to 455a7f3275 ("More portability.", 2005-09-30). Soon after that in bbfc63dd78 ("gcc does not necessarily
@@ -22,32 +43,24 @@
From what I can tell we should, with the benefit of hindsight, have made this change back in 2006. GCC & ld supported this type of
- invocation back then, or since at least binutils-gdb.git's[1]
- a1ad915dc4 ("[...]Add support for -rpath[...]", 1994-07-20). Most
- people compiling git with a custom LIBDIR are going to be on a GNU-ish
- system, and having to provide this NO_R_TO_GCC_LINKER flag on top of a
- custom LIBDIR is annoying.
-
- There are some OS's that don't support -rpath, e.g. AIX ld just
- supports "-R". Perhaps we should follow this up with some
- config.mak.uname changes, but as noted it's quite possible that nobody
- on these platforms uses this (instead libraries in the system's search
- path). We *could* also use "-Wl,-R", but let's not introduce something
- new.
+ invocation back then, or since at least binutils-gdb.git's[3]
+ a1ad915dc4 ("[...]Add support for -rpath[...]", 1994-07-20).
- Further reading and prior art can be found at [2][3][4][5]. Making a
+ Further reading and prior art can be found at [4][5][6][7]. Making a
plain "-R" an error seems from reading those reports to have been
- introduced in GCC 4.6 released on March 25, 2011, but I couldn't
+ introduced in GCC 4.6 released on March 25, 2011[8], but I couldn't
confirm this with absolute certainty, its release notes are ambiguous on the subject, and I couldn't be bothered to try to build & bisect it against GCC 4.5.
- 1. git://sourceware.org/git/binutils-gdb.git
- 2. https://github.com/tsuna/boost.m4/issues/15
- 3. https://bugzilla.gnome.org/show_bug.cgi?id=641416
- 4. https://stackoverflow.com/questions/12629042/g-4-6-real-error-unrecognized-option-r
- 5. https://curl.haxx.se/mail/archive-2014-11/0005.html
- 6. https://gcc.gnu.org/gcc-4.6/changes.html
+ 1. https://public-inbox.org/git/[email protected]/
+ 2. https://www.ibm.com/developerworks/aix/library/aix-toolbox/alpha.html
+ 3. git://sourceware.org/git/binutils-gdb.git
+ 4. https://github.com/tsuna/boost.m4/issues/15
+ 5. https://bugzilla.gnome.org/show_bug.cgi?id=641416
+ 6. https://stackoverflow.com/questions/12629042/g-4-6-real-error-unrecognized-option-r
+ 7. https://curl.haxx.se/mail/archive-2014-11/0005.html
+ 8. https://gcc.gnu.org/gcc-4.6/changes.html
Makefile | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-)
Makefile +1 -14
@@ -265,10 +265,6 @@ all:: # # Define NO_DEFLATE_BOUND if your zlib does not have deflateBound. # -# Define NO_R_TO_GCC_LINKER if your gcc does not like "-R/path/lib" -# that tells runtime paths to dynamic libraries; -# "-Wl,-rpath=/path/lib" is used instead. -# # Define NO_NORETURN if using buggy versions of gcc 4.6+ and profile feedback, # as the compiler can crash (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299) #
@@ -1160,6 +1156,7 @@ endif # which'll override these defaults. CFLAGS = -g -O2 -Wall LDFLAGS = +CC_LD_DYNPATH = -Wl,-rpath, BASIC_CFLAGS = -I. BASIC_LDFLAGS =
@@ -1287,16 +1284,6 @@ ifeq ($(uname_S),Darwin) PTHREAD_LIBS = endif -ifndef CC_LD_DYNPATH - ifdef NO_R_TO_GCC_LINKER - # Some gcc does not accept and pass -R to the linker to specify - # the runtime dynamic library path. - CC_LD_DYNPATH = -Wl,-rpath, - else - CC_LD_DYNPATH = -R - endif -endif - ifdef NO_LIBGEN_H COMPAT_CFLAGS += -DNO_LIBGEN_H COMPAT_OBJS += compat/basename.o
Signature · 1 line
2.21.0.1020.gf2820cf01a
Re: [PATCH v2] Makefile: remove the NO_R_TO_GCC_LINKER flag
Quoted 5 lines · Ævar Arnfjörð Bjarmason
It's not needed to simply link to libraries like say libpcre, but *only* for those cases where we're linking to such a library not present in the OS's library directories. See e.g. ldconfig(8) on Linux for more details.
Quoted 11 lines
I use this to compile my git with a LIBPCREDIR=$HOME/g/pcre2/inst as I'm building that from source, but someone maintaining an OS package is almost certainly not going to use this. They're just going to set USE_LIBPCRE=YesPlease after installing the libpcre dependency, which'll point to OS libraries which ld(1) will find without the help of
CC_LD_DYNPATH.
...
Our use of "-R" dates back to455a7f3275("More portability.", 2005-09-30). Soon after that inbbfc63dd78("gcc does not necessarily pass runtime libpath with -R", 2006-12-27) theNO_R_TO_GCCflag was added, allowing optional use of "-Wl,-rpath=".
Yeah, I recall I had to add -R back when I was with my previous employer, where I had Sun with GNU toolchain as the primary environment and many libraries were custom built outside the system path.
Makefile all:: · line 271
Quoted 12 lines
Makefile +0
-4@@ -265,10 +265,6 @@ all:: # # Define NO_DEFLATE_BOUND if your zlib does not have deflateBound. # -# Define NO_R_TO_GCC_LINKER if your gcc does not like "-R/path/lib" -# that tells runtime paths to dynamic libraries; -# "-Wl,-rpath=/path/lib" is used instead. -#
I am not sure if -R was a GCC-only thing; we might want to, instead of removing this seciton, replace it with something like
# Use "CC_LD_DYNPATH = -R" if your compiler uses "-R/path/to/lib" # to specify the runtime paths to dynamic libraries. These days, # GCC uses -Wl,-rpath=/path/to/lib and that is used by default # instead.
to help those whose build suddenly starts breaking.
Makefile endif · line 1158
Quoted 7 lines
Makefile +0
-0# Define NO_NORETURN if using buggy versions of gcc 4.6+ and profile feedback, # as the compiler can crash (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299) #@@ -1160,6 +1156,7 @@ endif # which'll override these defaults. CFLAGS = -g -O2 -Wall LDFLAGS =
Or it could be a single liner at this point in the file, perhaps
# Really old GCC used "CC_LD_DYNPATH = -R" for the runtime dynlib path
Quoted 1 line
Makefile +1
-0+CC_LD_DYNPATH = -Wl,-rpath,
Re: [PATCH v2] Makefile: remove the NO_R_TO_GCC_LINKER flag
In reply to Ævar Arnfjörð BjarmasonQuoted 9 lines · Ævar Arnfjörð Bjarmason
Quoted 7 lines · Junio C Hamano
Quoted 4 lines · Jeff King
Far be it from me to care about AIX, but it seems like this is ripe for regressions, because we don't know which platforms were relying on "-R" instead of "-Wl,-rpath", and now everybody will be using the latter by default.
Quoted 5 lines
Quoted 1 line
I do not have a stake in AIX, either, but I had the same reaction.
I did a bad job of summarizing why this change makes sense. Here's a v2 with a changed commit message. The first 4 pargaraphs are most relevant.
Thanks for the additional context. After reading the revised explanation, I agree it's probably OK to move in this direction.
-Peff
Re: [PATCH] configure: Detect linking style for HP aCC on HP-UX
In reply to Ævar Arnfjörð BjarmasonAm 2019-05-16 um 11:34 schrieb Ævar Arnfjörð Bjarmason:
Quoted 32 lines
From: Michael Osipov <[email protected]>
HP aCC does not accept any of the previously tested
CC_LD_DYNPATHformats, but only its own[1] "-Wl,+b" format. Add it to configure.ac.1. http://nixdoc.net/man-pages/hp-ux/man1/ld_pa.1.html
Signed-off-by Michael Osipov <[email protected]>Signed-off-by Ævar Arnfjörð Bjarmason <[email protected]>---
I took the liberty of slightly amending the commit message.
configure.ac | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)configure.ac +5
-2@@ -475,8 +475,18 @@ else if test "$git_cv_ld_rpath" = "yes"; then CC_LD_DYNPATH=-rpath else - CC_LD_DYNPATH= - AC_MSG_WARN([linker does not support runtime path to dynamic libraries]) + AC_CACHE_CHECK([if linker supports -Wl,+b,], git_cv_ld_wl_b, [ + SAVE_LDFLAGS="${LDFLAGS}" + LDFLAGS="${SAVE_LDFLAGS} -Wl,+b,/" + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [git_cv_ld_wl_b=yes], [git_cv_ld_wl_b=no]) + LDFLAGS="${SAVE_LDFLAGS}"
configure.ac else · line 492
Quoted 10 lines
configure.ac +7
-0+ ]) + if test "$git_cv_ld_wl_b" = "yes"; then + CC_LD_DYNPATH=-Wl,+b, + else + CC_LD_DYNPATH= + AC_MSG_WARN([linker does not support runtime path to dynamic libraries]) + fi fi fi fi
I can see that this one has not yet been committed nor my PR has been pulled.
Any chances to get this into master?
Michael
Re: [PATCH] configure: Detect linking style for HP aCC on HP-UX
Quoted 47 lines · Michael
Am 2019-05-16 um 11:34 schrieb Ævar Arnfjörð Bjarmason:
Quoted 32 lines
From: Michael Osipov <[email protected]>
HP aCC does not accept any of the previously tested
CC_LD_DYNPATHformats, but only its own[1] "-Wl,+b" format. Add it to configure.ac.1. http://nixdoc.net/man-pages/hp-ux/man1/ld_pa.1.html
Signed-off-by Michael Osipov <[email protected]>Signed-off-by Ævar Arnfjörð Bjarmason <[email protected]>---
I took the liberty of slightly amending the commit message.
configure.ac | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)configure.ac +5
-2@@ -475,8 +475,18 @@ else if test "$git_cv_ld_rpath" = "yes"; then CC_LD_DYNPATH=-rpath else - CC_LD_DYNPATH= - AC_MSG_WARN([linker does not support runtime path to dynamic libraries]) + AC_CACHE_CHECK([if linker supports -Wl,+b,], git_cv_ld_wl_b, [ + SAVE_LDFLAGS="${LDFLAGS}" + LDFLAGS="${SAVE_LDFLAGS} -Wl,+b,/" + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [git_cv_ld_wl_b=yes], [git_cv_ld_wl_b=no]) + LDFLAGS="${SAVE_LDFLAGS}"configure.ac else · line 492
Quoted 10 lines
configure.ac +7
-0+ ]) + if test "$git_cv_ld_wl_b" = "yes"; then + CC_LD_DYNPATH=-Wl,+b, + else + CC_LD_DYNPATH= + AC_MSG_WARN([linker does not support runtime path to dynamic libraries]) + fi fi fi fiI can see that this one has not yet been committed nor my PR has been pulled.
Quoted 3 lines
Any chances to get this into master?
Michael
Sorry, it jsut fell of the cracks. The way the new test was added looks very good --- any platform that is happy with the existing test will continue to function the same way, and a platform that knows -Wl,+b would use it instead of failing.
Will pick it up.
Thanks.