git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>,
	Michael Osipov <michael.osipov@siemens.com>
Subject: Re: [PATCH v2] Makefile: remove the NO_R_TO_GCC_LINKER flag
Date: Sun, 19 May 2019 09:56:32 +0900	[thread overview]
Message-ID: <xmqqa7fj2ren.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20190517215847.28179-1-avarab@gmail.com> ("Ævar Arnfjörð Bjarmason"'s message of "Fri, 17 May 2019 23:58:47 +0200")

Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> 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.
> ...
> 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=".

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.


> diff --git a/Makefile b/Makefile
> index f965509b3c..ce7a489d64 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -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.

   >  # 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

> +CC_LD_DYNPATH = -Wl,-rpath,

  reply	other threads:[~2019-05-19  1:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-08 10:45 [PATCH] Improving HP-UX support Osipov, Michael
2019-05-09  7:32 ` Ævar Arnfjörð Bjarmason
2019-05-09  8:09   ` Osipov, Michael
2019-05-13 22:17     ` [PATCH] sha1dc: update from upstream Ævar Arnfjörð Bjarmason
2019-05-14 11:17       ` Osipov, Michael
2019-05-15 11:48         ` Ævar Arnfjörð Bjarmason
2019-05-16  7:13           ` Osipov, Michael
2019-05-16  8:31             ` Ævar Arnfjörð Bjarmason
2019-05-16  8:40               ` Osipov, Michael
2019-05-16  9:34             ` [PATCH] configure: Detect linking style for HP aCC on HP-UX Ævar Arnfjörð Bjarmason
2019-05-16 18:05               ` [PATCH] Makefile: remove the NO_R_TO_GCC_LINKER flag Ævar Arnfjörð Bjarmason
2019-05-16 22:25                 ` Jeff King
2019-05-16 23:21                   ` Junio C Hamano
2019-05-17  0:23                     ` Jeff King
2019-05-17 21:58                     ` [PATCH v2] " Ævar Arnfjörð Bjarmason
2019-05-19  0:56                       ` Junio C Hamano [this message]
2019-05-19  5:01                       ` Jeff King
2019-06-07 14:51               ` [PATCH] configure: Detect linking style for HP aCC on HP-UX Osipov, Michael
2019-06-07 17:03                 ` Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqa7fj2ren.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=michael.osipov@siemens.com \
    --cc=peff@peff.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).