This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objcopy] Make llvm-strip --only-keep-debug suppress default --strip-all
ClosedPublic

Authored by jmciver on Apr 14 2022, 8:21 AM.

Details

Summary

The following commit resolves Issue #54417. Fixes llvm-strip conditional command
line option logic to not enable --strip-all in the presence of
--only-keep-debug.

Diff Detail

Event Timeline

jmciver created this revision.Apr 14 2022, 8:21 AM
jmciver published this revision for review.Apr 14 2022, 12:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 14 2022, 12:27 PM

Patch is ready for review.

I am not sure if there would be value in adding a test with --only-keep-debug and --strip-all. Let me know if you think this would be useful and I can add it.

Thanks in advance for your feedback.

MaskRay accepted this revision.Apr 17 2022, 10:15 AM

[llvm-objcopy] llvm-strip option --only-keep-debug should suppress default --strip-all

An imperative sentence is more common as the subject line.
option in option --only-keep-debug does not convey extra information.
You may use [llvm-objcopy] Make llvm-strip --only-keep-debug suppress default --strip-all

llvm/test/tools/llvm-objcopy/ELF/only-keep-debug.test
8

Add a comment ## --only-keep-debug suppresses the default --strip-all.

This revision is now accepted and ready to land.Apr 17 2022, 10:15 AM
jmciver updated this revision to Diff 423323.Apr 17 2022, 7:53 PM

Updating D123798: [llvm-objcopy] llvm-strip option --only-keep-debug should suppress default --strip-all

Add comment to ELF/only-keep-debug.test explaining default option override. This
change is per feedback provided during the patch review process.

jmciver updated this revision to Diff 423324.Apr 17 2022, 7:58 PM

[llvm-objcopy] llvm-strip option --only-keep-debug should suppress default --strip-all

The following commit resolves Issue #54417. Fixes llvm-strip conditional command
line option logic to not enable --strip-all in the presence of
--only-keep-debug.

jmciver updated this revision to Diff 423326.Apr 17 2022, 8:03 PM

[llvm-objcopy] llvm-strip option --only-keep-debug should suppress default --strip-all

The following commit resolves Issue #54417. Fixes llvm-strip conditional command
line option logic to not enable --strip-all in the presence of
--only-keep-debug.

jmciver retitled this revision from [llvm-objcopy] llvm-strip option --only-keep-debug should suppress default --strip-all to [llvm-objcopy] Make llvm-strip --only-keep-debug suppress default --strip-all.Apr 17 2022, 8:05 PM

@MaskRay Thank you for your feedback! I have implemented the following changes:

  • Comment has been added to ELF/only-keep-debug.test explaining that --only-keep-debug overrides --strip-all
  • Differential title has been updated to be more imperative

Sorry about the extra revision diffs (still learning arc), squashing commits worked.

Once this is re-approved can someone please commit on my behalf:
Name: John McIver
Email: john.mciver.iii@gmail.com

Thanks again @MaskRay for taking the time to review!

jmciver marked an inline comment as done.Apr 18 2022, 9:13 AM
This revision was landed with ongoing or failed builds.Apr 18 2022, 2:16 PM
This revision was automatically updated to reflect the committed changes.