From: Junio C Hamano <gitster@pobox.com>
To: "Giovanni Funchal" <gafunchal@gmail.com>
Cc: "Junio C Hamano" <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: Patch for NO_R_TO_GCC_LINKER
Date: Wed, 13 Aug 2008 15:12:34 -0700 [thread overview]
Message-ID: <7vbpzwlg31.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <7vhc9olh4n.fsf@gitster.siamese.dyndns.org> (Junio C. Hamano's message of "Wed, 13 Aug 2008 14:50:00 -0700")
Junio C Hamano <gitster@pobox.com> writes:
> "Giovanni Funchal" <gafunchal@gmail.com> writes:
>
>> My changes should not break a lot of people's setups. Most people will
>> find the new default better because it works straight on
>> linux/windows.
>
> My understanding is that Linux/Windows people won't be using
> NO_R_TO_GCC_LINKER. What I was afraid of breaking was people who have
> their own config.mak (which is included by Makefile) to customize the way
> the linkage works, setting NO_R_TO_GCC_LINKER appropriately. Doesn't your
> change to the Makefile in a way not to pay attention to the variable break
> them?
In other words, wouldn't a patch like this (based on your change to
configure.ac, but I only hacked autoconf in very distant past so the
details may be wrong) be with much less impact to existing users and
achieve the same autodetection that configure.ac currently does not do?
I am not sure about another aspect of your change, which changes the use
of "-Wl,-rpath=$(path)" to "-Wl,-rpath,$(path)". If both of them always
work (or neither of them and -R works), that would be great. Otherwise,
if we need to detect one platform that accepts only -Wl,-rpath,$(path) and
other ones that accept only -Wl,-rpath=$(path), then it would make more
sense to check them separately in configure.ac, and override CC_LD_DYNPATH
directly, in which case Makefile needs to be modified as well.
config.mak.in | 1 +
configure.ac | 22 ++++++++++++++++++++++
2 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/config.mak.in b/config.mak.in
index b776149..c079864 100644
--- a/config.mak.in
+++ b/config.mak.in
@@ -7,6 +7,7 @@ AR = @AR@
TAR = @TAR@
#INSTALL = @INSTALL@ # needs install-sh or install.sh in sources
TCLTK_PATH = @TCLTK_PATH@
+NO_R_TO_GCC_LINKER = @no_r_to_gcc_linker@
prefix = @prefix@
exec_prefix = @exec_prefix@
diff --git a/configure.ac b/configure.ac
index 7c2856e..a23a7f6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -103,6 +103,28 @@ GIT_PARSE_WITH(tcltk))
AC_MSG_NOTICE([CHECKS for programs])
#
AC_PROG_CC([cc gcc])
+# which switch to pass runtime path to dynamic libraries to the linker
+AC_CACHE_CHECK([if linker supports -R], ld_dashr, [
+ SAVE_LDFLAGS="${LDFLAGS}"
+ LDFLAGS="${SAVE_LDFLAGS} -R /"
+ AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [ld_dashr=yes], [ld_dashr=no])
+ LDFLAGS="${SAVE_LDFLAGS}"
+])
+if test "$ld_dashr" = "yes"; then
+ AC_SUBST(no_r_to_gcc_linker, [ ])
+else
+ AC_CACHE_CHECK([if linker supports -Wl,rpath,], ld_wl_rpath, [
+ SAVE_LDFLAGS="${LDFLAGS}"
+ LDFLAGS="${SAVE_LDFLAGS} -Wl,-rpath,/"
+ AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [ld_wl_rpath=yes], [ld_wl_rpath=no])
+ LDFLAGS="${SAVE_LD_FLAGS}"
+ ])
+ if test "$ld_wl_rpath" = "yes"; then
+ AC_SUBST(no_r_to_gcc_linker, [YesPlease])
+ else
+ AC_MSG_ERROR([no linker support for runtime path to dynamic libraries])
+ fi
+fi
#AC_PROG_INSTALL # needs install-sh or install.sh in sources
AC_CHECK_TOOLS(AR, [gar ar], :)
AC_CHECK_PROGS(TAR, [gtar tar])
prev parent reply other threads:[~2008-08-13 22:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-13 10:42 Patch for NO_R_TO_GCC_LINKER Giovanni Funchal
2008-08-13 11:32 ` Matthieu Moy
2008-08-13 20:10 ` Junio C Hamano
2008-08-13 21:20 ` Giovanni Funchal
2008-08-13 21:50 ` Junio C Hamano
2008-08-13 22:12 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vbpzwlg31.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=gafunchal@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).