[llvm] Add llvm-extract-bundle-entry to extend llvm-objcopy (PR #169386)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 12 00:50:13 PST 2026


================
@@ -1670,3 +1716,45 @@ objcopy::parseStripOptions(ArrayRef<const char *> RawArgsArr,
 
   return std::move(DC);
 }
+
+Expected<DriverConfig> objcopy::parseExtractBundleEntryOptions(
+    ArrayRef<const char *> ArgsArr, function_ref<Error(Error)> ErrorCallback) {
+  DriverConfig DC;
+  ExtractBundleEntryOptTable T;
+  unsigned MissingArgumentIndex, MissingArgumentCount;
+  opt::InputArgList InputArgs =
+      T.ParseArgs(ArgsArr, MissingArgumentIndex, MissingArgumentCount);
+
+  if (InputArgs.size() == 0) {
+    printHelp(T, errs(), ToolType::ExtractBundleEntry);
+    exit(1);
+  }
+
+  if (InputArgs.hasArg(EXTRACT_BUNDLE_ENTRY_help)) {
+    printHelp(T, outs(), ToolType::ExtractBundleEntry);
+    exit(0);
+  }
+
+  if (InputArgs.hasArg(EXTRACT_BUNDLE_ENTRY_version)) {
+    outs() << "llvm-extract-bundle-entry, compatible with roc-obj-ls\n";
----------------
jh7370 wrote:

IIRC, the only reason we had the "compatible with..." part of the message in other cases is because some system configuration scripts expected some particular string to be present in order to correctly identify the llvm tool as `strip` or `objcopy` or whatever. If you aren't under the same constraints here, I'd drop this phrase.

https://github.com/llvm/llvm-project/pull/169386


More information about the llvm-commits mailing list