#1034429 coreutils: install: -s runs ["strip", $f] instead of ["strip", "--", $f]; should use strip from $STRIP

Package:
coreutils
Source:
coreutils
Description:
GNU core utilities
Submitter:
наб
Date:
2023-04-21 18:21:05 UTC
Severity:
normal
#1034429#5
Date:
2023-04-15 02:13:21 UTC
From:
To:
Dear Maintainer,
#1034429#10
Date:
2023-04-15 13:04:18 UTC
From:
To:
Fair point.
But perhaps the strip program doesn't handle the convention
that -- indicates end of option processing?
Perhaps a more portable workaround would be to prepend "./"
if the name starts with "-".

Yes it's a fair point that calling strip without options is quite restrictive.
Though I suppose --strip-program can point to a script that calls strip appropriately.
There are some security issues with env vars that impact what is executed.
I do see that FreeBSD install(1) does support $STRIPBIN, though they
don't support --strip-program, so functionality is equivalent from that point of view.

cheers,
Pádraig

#1034429#15
Date:
2023-04-15 14:47:39 UTC
From:
To:
Inasmuch as "perhaps strip doesn't use getopt(3)" /and/
            "perhaps strip doesn't conform to the XCU"
(https://pubs.opengroup.org/onlinepubs/9699919799/utilities/strip.html;
 note no changes since Issue 2, which means this has been a requirement
 realistically since 1989
 (it's in my copy of XSI Issue 3, saying it's equivalent to Issue 2,
  but it's only Volume 1, and it's unclear to me if the XBD USG
  was fully developed; Issue 2 hasn't been archived),
 and definitely since SUSv1, whose Guideline 10 and Utility Description
 Defaults, OPTIONS, Default Behaviour are both as present-day)
can both hold at the same time, I guess?
You can probably tell I'm quite sceptical any such strip exists.
My target usecase is for third-party programs running install -s,
which, without modification, cannot be made to work if strip is binutils
strip and the binary is non-native.

Of course I can edit them to be install --strip-program=llvm-strip -s ...,
but, y'know, at some point using install instead of cp and strip
stops making sense. I guess it'd just be nice if ${CC:-cc}
synergised with ${STRIP:-strip}.
Functionality is greatly improved since the target is no longer
effectively hard-coded into the caller. The impact of this is reduced on
FreeBSD since it uses elftoolchain strip, which appears to be
target-agnostic.

Best,
наб

#1034429#20
Date:
2023-04-20 16:59:50 UTC
From:
To:
I was thinking of the more general case where the strip program
may be a shell wrapper or something that doesn't handle -- appropriately.
The main point is that we should fix this issue in any case.

Well one could adjust the $PATH so an appropriate strip wrapper is found.

cheers,
Pádraig

#1034429#25
Date:
2023-04-21 18:17:48 UTC
From:
To: