Skip to content

llvm-objdump: error: unknown argument '--arch-name'

Diffoscope fails when comparing two builds of the JavaFX native WebKit shared library for macOS and prints the following error message:

$ diffoscope libjfxwebkit.5.dylib libjfxwebkit.6.dylib
--- libjfxwebkit.5.dylib
+++ libjfxwebkit.6.dylib
├── x86_64
│┄ Command `'llvm-objdump --arch-name x86_64 --section __TEXT,__text --macho
   --demangle --no-leading-addr --no-show-raw-insn {}'`
   failed with exit code 1. Standard output:
│┄     llvm-objdump: error: unknown argument '--arch-name'
│ @@ -118,15 +118,15 @@
│  00000750: 0200 0000 1800 0000 08f5 5504 a83c 0200  ..........U..<..
│  00000760: 50ce 7904 400a bd00 0b00 0000 5000 0000  P.y.@.......P...
|  ...
│  03ffffe0: 3504 3504 2000 3204 4004 3504 3c04 4f04  5.5. .2.@.5.<.O.
│ -[ Too much input for diff (SHA256: 439d...ae6b) ]
│ +[ Too much input for diff (SHA256: 38cc...8b86) ]

The error appears to occur because an equal sign (=) is required between the --arch-name command-line option and its value. The following script, for example, works fine:

#!/bin/bash
# Dumps macOS shared libraries
# Diffoscope fails due to missing '=' after '--arch-name' option:
#     llvm-objdump: error: unknown argument '--arch-name'
llvm-objdump --arch-name=x86_64 --section="__TEXT,__text" --macho \
    --demangle --no-leading-addr --no-show-raw-insn "$@"

For more context, see this comment on my OpenJFX pull request to add support for reproducible builds of JavaFX.

I'm running Diffoscope version 180 and LLVM version 13.0.0:

$ diffoscope --version
diffoscope 180
$ llvm-objdump --version 
LLVM (http://llvm.org/):
  LLVM version 13.0.0
  
  Optimized build.
  Default target: x86_64-pc-linux-gnu
  Host CPU: skylake

  Registered Targets:
    aarch64    - AArch64 (little endian)
    ...
    xcore      - XCore
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information