unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] Add a configure flag to disable rpaths
@ 2019-02-26  2:06 Luis Ressel
  2019-02-28 19:41 ` Tomi Ollila
  2019-03-13  0:02 ` David Bremner
  0 siblings, 2 replies; 5+ messages in thread
From: Luis Ressel @ 2019-02-26  2:06 UTC (permalink / raw)
  To: notmuch

---
 configure | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index a6f5dfa2..5e7e5aa9 100755
--- a/configure
+++ b/configure
@@ -82,6 +82,7 @@ WITH_API_DOCS=1
 WITH_EMACS=1
 WITH_DESKTOP=1
 WITH_BASH=1
+WITH_RPATH=1
 WITH_RUBY=1
 WITH_ZSH=1
 WITH_RETRY_LOCK=1
@@ -241,6 +242,14 @@ for option; do
 	fi
     elif [ "${option}" = '--without-bash-completion' ] ; then
 	WITH_BASH=0
+    elif [ "${option%%=*}" = '--with-rpath' ]; then
+	if [ "${option#*=}" = 'no' ]; then
+	    WITH_RPATH=0
+	else
+	    WITH_RPATH=1
+	fi
+    elif [ "${option}" = '--without-rpath' ] ; then
+	WITH_RPATH=0
     elif [ "${option%%=*}" = '--with-ruby' ]; then
 	if [ "${option#*=}" = 'no' ]; then
 	    WITH_RUBY=0
@@ -928,7 +937,7 @@ fi
 rm -f compat/check_asctime
 
 printf "Checking for rpath support... "
-if ${CC} -Wl,--enable-new-dtags -Wl,-rpath,/tmp/ -o minimal minimal.c >/dev/null 2>&1
+if [ $WITH_RPATH = "1" ] && ${CC} -Wl,--enable-new-dtags -Wl,-rpath,/tmp/ -o minimal minimal.c >/dev/null 2>&1
 then
     printf "Yes.\n"
     rpath_ldflags="-Wl,--enable-new-dtags -Wl,-rpath,\$(libdir)"
-- 
2.19.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add a configure flag to disable rpaths
  2019-02-26  2:06 [PATCH] Add a configure flag to disable rpaths Luis Ressel
@ 2019-02-28 19:41 ` Tomi Ollila
  2019-03-01 12:39   ` David Bremner
  2019-03-13  0:02 ` David Bremner
  1 sibling, 1 reply; 5+ messages in thread
From: Tomi Ollila @ 2019-02-28 19:41 UTC (permalink / raw)
  To: Luis Ressel, notmuch

On Tue, Feb 26 2019, Luis Ressel wrote:

although the commit message is a bit terse, this change looks simple and
reasonable enough to be pushed (i.e. if i think hard I can see reason
for this change even it is not described in commit message ;D)

Tomi

> ---
>  configure | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index a6f5dfa2..5e7e5aa9 100755
> --- a/configure
> +++ b/configure
> @@ -82,6 +82,7 @@ WITH_API_DOCS=1
>  WITH_EMACS=1
>  WITH_DESKTOP=1
>  WITH_BASH=1
> +WITH_RPATH=1
>  WITH_RUBY=1
>  WITH_ZSH=1
>  WITH_RETRY_LOCK=1
> @@ -241,6 +242,14 @@ for option; do
>  	fi
>      elif [ "${option}" = '--without-bash-completion' ] ; then
>  	WITH_BASH=0
> +    elif [ "${option%%=*}" = '--with-rpath' ]; then
> +	if [ "${option#*=}" = 'no' ]; then
> +	    WITH_RPATH=0
> +	else
> +	    WITH_RPATH=1
> +	fi
> +    elif [ "${option}" = '--without-rpath' ] ; then
> +	WITH_RPATH=0
>      elif [ "${option%%=*}" = '--with-ruby' ]; then
>  	if [ "${option#*=}" = 'no' ]; then
>  	    WITH_RUBY=0
> @@ -928,7 +937,7 @@ fi
>  rm -f compat/check_asctime
>  
>  printf "Checking for rpath support... "
> -if ${CC} -Wl,--enable-new-dtags -Wl,-rpath,/tmp/ -o minimal minimal.c >/dev/null 2>&1
> +if [ $WITH_RPATH = "1" ] && ${CC} -Wl,--enable-new-dtags -Wl,-rpath,/tmp/ -o minimal minimal.c >/dev/null 2>&1
>  then
>      printf "Yes.\n"
>      rpath_ldflags="-Wl,--enable-new-dtags -Wl,-rpath,\$(libdir)"
> -- 
> 2.19.2
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add a configure flag to disable rpaths
  2019-02-28 19:41 ` Tomi Ollila
@ 2019-03-01 12:39   ` David Bremner
  2019-03-10 19:28     ` Luis Ressel
  0 siblings, 1 reply; 5+ messages in thread
From: David Bremner @ 2019-03-01 12:39 UTC (permalink / raw)
  To: Tomi Ollila, Luis Ressel, notmuch

Tomi Ollila <tomi.ollila@iki.fi> writes:

> On Tue, Feb 26 2019, Luis Ressel wrote:
>
> although the commit message is a bit terse, this change looks simple and
> reasonable enough to be pushed (i.e. if i think hard I can see reason
> for this change even it is not described in commit message ;D)
>

For those of us too lazy to think hard, what is the reason? I can add to
the commit message.

d

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add a configure flag to disable rpaths
  2019-03-01 12:39   ` David Bremner
@ 2019-03-10 19:28     ` Luis Ressel
  0 siblings, 0 replies; 5+ messages in thread
From: Luis Ressel @ 2019-03-10 19:28 UTC (permalink / raw)
  To: David Bremner; +Cc: Tomi Ollila, notmuch

On Fri, Mar 01, 2019 at 08:39:25AM -0400, David Bremner wrote:
> Tomi Ollila <tomi.ollila@iki.fi> writes:
> 
> > On Tue, Feb 26 2019, Luis Ressel wrote:
> >
> > although the commit message is a bit terse, this change looks simple and
> > reasonable enough to be pushed (i.e. if i think hard I can see reason
> > for this change even it is not described in commit message ;D)
> >
> 
> For those of us too lazy to think hard, what is the reason? I can add to
> the commit message.
> 

Packagers often disable rpaths wherever possible. They can cause
confusion and, used carelessly, even security issues, and in the vast
majority of cases they're wholly unneccessary. notmuch's usage of rpaths
is rather innocuous, but I would still prefer to disable them when
they're not strictly needed.

Now, notmuch's configure script already tries to detect whether $libdir
is path of the standard library search path and disables -rpath in this
case. However, this detection logic invokes /sbin/ldconfig, which may
not be present on musl-based systems or at least not work as the
configure script expects. On my host, configure thus arrives at the
conclusion it needs to use -rpath even though $libdir is set to
/usr/lib/.

Since it seemed easy and straightforward to just add an option to
explicitly disable rpaths, and I wanted to avoid adding musl-specific
code to the autodetection logic, I decided to go this route.

Cheers,
Luis Ressel

(Resending due to trouble with my new MUA; apologies if you receive this
mail twice.)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add a configure flag to disable rpaths
  2019-02-26  2:06 [PATCH] Add a configure flag to disable rpaths Luis Ressel
  2019-02-28 19:41 ` Tomi Ollila
@ 2019-03-13  0:02 ` David Bremner
  1 sibling, 0 replies; 5+ messages in thread
From: David Bremner @ 2019-03-13  0:02 UTC (permalink / raw)
  To: Luis Ressel, notmuch

Luis Ressel <aranea@aixah.de> writes:

> ---
>  configure | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)

pushed, with updated commit message.

d

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-03-13  0:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-26  2:06 [PATCH] Add a configure flag to disable rpaths Luis Ressel
2019-02-28 19:41 ` Tomi Ollila
2019-03-01 12:39   ` David Bremner
2019-03-10 19:28     ` Luis Ressel
2019-03-13  0:02 ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.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).