This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objcopy] Hook up the -V alias to --version, output "GNU strip"
ClosedPublic

Authored by mstorsjo on Nov 27 2018, 1:39 AM.

Details

Summary

This allows libtool to detect the presence of llvm-strip and use it with the options --strip-debug and --strip-unneeded, see http://git.savannah.gnu.org/cgit/libtool.git/tree/m4/libtool.m4?h=v2.4.6#n2210.

Also hook up the -V alias for objcopy.

Diff Detail

Event Timeline

mstorsjo created this revision.Nov 27 2018, 1:39 AM
jhenderson requested changes to this revision.Nov 27 2018, 2:53 AM

Should we do the same thing (adding "comptabile with GNU objcopy") for llvm-objcopy as well as llvm-strip?

test/tools/llvm-objcopy/strip-version.test
5

This should probably check both {{version}} and "GNU strip", right?

This revision now requires changes to proceed.Nov 27 2018, 2:53 AM
mstorsjo marked an inline comment as done.Nov 27 2018, 3:11 AM

Should we do the same thing (adding "comptabile with GNU objcopy") for llvm-objcopy as well as llvm-strip?

I don't know of any build system that checks for that in the output, but I guess we could do that for consistency.

test/tools/llvm-objcopy/strip-version.test
5

Right, I can keep that check as well. Will update the patch in a few hours.

mstorsjo updated this revision to Diff 175446.Nov 27 2018, 4:00 AM

Changed to keep the check for {{ version }} in the llvm-strip output, outputting "compatible with GNU objcopy" as well (but no test for that as I haven't seen a specific need for that string somewhere yet).

jhenderson accepted this revision.Nov 27 2018, 4:39 AM

I think it would make sense to test in both cases, honestly, but I'm not too fussed.

Otherwise, LGTM.

You might want to wait on @jakehehrlich to give his opinion on "GNU compatible" output in both tools before committing.

This revision is now accepted and ready to land.Nov 27 2018, 4:39 AM

I think this is fine. GNU compatibility is a tricky subject with lots of nuances that I keep discovering but it is decidedly a stated goal.

This revision was automatically updated to reflect the committed changes.