Subject: Re: bug#71595: error message improvement: "only absolute run-paths are allowed"

From: Ileana Dumitrescu <[email-masked]>
Date: Tue, 2 Jul 2024 16:57:54 +0300

On 02/07/2024 01:19, Karl Berry wrote:
>      I have applied the change on the development branch:
>      https://git.savannah.gnu.org/cgit/libtool.git/commit/?h=development&id=33be3e965345ffeb49f22190243ea523c637a1bf
> 
> Thanks much.
> 
>      Let me know if you would like me to change it.
> 
> It's a minor point, but my suggested wording of
>    error: argument to -rpath is not absolute: libfoo.lo
> feels even clearer to me, since it explains what libtool is parsing
> (which is not what the user is intending).
> 
> Also, I didn't realize the error message occurred twice. Given that, I
> think the best practice would be to make the two cases have different
> wording, so that users/debuggers/maintainers can discern which is being
> triggered. (I don't know what the second case is, so I don't have a
> suggestion, sorry.)

Sorry, I see that I overlooked that. It has been applied now in the
attached patch with a rework of the wording for the second case.

Here is a reference from the manpage for ld:
```
For compatibility with other ELF linkers, if the -R option is followed
by a directory name, rather than a file name, it is treated as the
-rpath option.
```
If I understand it correctly, the new wording should be accurate. Let
me know what you think.

>      Okay, I will ask.
> 
> Thanks for that too. --all the best, karl.

Here is the relevant commit for why the spacing was added:
 
https://git.savannah.gnu.org/cgit/libtool.git/commit/?h=master&id=eda239d9899e81f616cc34c55c84fd2dddc4f2eb

Here is Gary's further explanation:
   https://github.com/gnulib-modules/bootstrap/issues/33

As I stated in the issue, I do not think there is any good reason to
remove the additional spacing, but if you have one, please continue
this on the thread in gnulib-modules/bootstrap.

-- 
Ileana Dumitrescu

GPG Public Key: FA26 CA78 4BE1 8892 7F22 B99F 6570 EA01 146F 7354
From f5a7acee1db1b785ec2506e89026fb46ebd518a8 Mon Sep 17 00:00:00 2001
From: Ileana Dumitrescu <[email-masked]>
Date: Tue, 2 Jul 2024 16:42:20 +0300
Subject: [PATCH] ltmain: Further error message improvement

* build-aux/ltmain.in: Edit message of each instance where run-paths
  are not absolute to better reflect the issue occurring to the user.
---
 build-aux/ltmain.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
index 87bea8e1..63377541 100644
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -4938,7 +4938,7 @@ func_mode_link ()
 	  case $arg in
 	  [\\/]* | [A-Za-z]:[\\/]*) ;;
 	  *)
-	    func_fatal_error "only absolute run-paths are allowed: \"$arg\""
+	    func_fatal_error "argument to -rpath is not absolute: $arg"
 	    ;;
 	  esac
 	  if test rpath = "$prev"; then
@@ -5289,7 +5289,7 @@ func_mode_link ()
 	  dir=$lt_sysroot$func_stripname_result
 	  ;;
 	*)
-	  func_fatal_error "only absolute run-paths are allowed: \"$dir\""
+	  func_fatal_error "argument ($arg) to '-R' is not an absolute path: $dir"
 	  ;;
 	esac
 	case "$xrpath " in
-- 
2.45.1