From martin at NetBSD.org Fri Jul 4 17:34:12 2025 From: martin at NetBSD.org (Martin Husemann) Date: Fri, 4 Jul 2025 17:34:12 +0000 Subject: [diffoscope] Need a way to select objdump for different architectures Message-ID: Hi folks, I am trying to use diffoscoe to find differences in builds generated for atari and this is quite tricky due to the native objdump not being able to decode atari elf binaries. The suggested workaround in https://salsa.debian.org/reproducible-builds/diffoscope/-/issues/375 does not work with current diffoscope, if I make the m68k objdump available as "objdump" in some dir in my $PATH early diffoscope will fail to start up at all - apparently the ffi code accessing libarchive.so requires a native objdump. So I am lost, short of hacking the installed script (which I did for now) like this (in the python site-packages diffoscope/comparators/elf.py): @tool_required("objdump") def cmdline(self): return ( # HACK: hard code path to proper cross-objdump # [get_tool_name("objdump")] ['/home/builds/ab/HEAD/atari/20250703130037Z-tools/bin/m68k--netbsdelf-objdump'] + self.objdump_options() + ["--section={}".format(self._section_name), self.path] ) Would be cool if that path could be overriden by a command line option. Martin From chris at reproducible-builds.org Tue Jul 8 21:55:05 2025 From: chris at reproducible-builds.org (Chris Lamb) Date: Tue, 08 Jul 2025 14:55:05 -0700 Subject: [diffoscope] Need a way to select objdump for different architectures In-Reply-To: References: Message-ID: Hey Martin, > Would be cool if that path could be overriden by a command line option. Yes! Quick thought - does the following work for you? diffoscope --tool-prefix-binutils=/home/builds/ab/HEAD/atari/20250703130037Z-tools/bin/m68k--netbsdelf- file1 file2 NB. the trailing "-" on the --tool-prefix line is deliberate. Best wishes, -- o ? ? Chris Lamb o o reproducible-builds.org ? ? ? o From martin at NetBSD.org Wed Jul 9 11:52:43 2025 From: martin at NetBSD.org (Martin Husemann) Date: Wed, 9 Jul 2025 11:52:43 +0000 Subject: [diffoscope] Need a way to select objdump for different architectures In-Reply-To: References: Message-ID: On Tue, Jul 08, 2025 at 02:55:05PM -0700, Chris Lamb wrote: > Hey Martin, > > > Would be cool if that path could be overriden by a command line option. > > Yes! Quick thought - does the following work for you? > > diffoscope > --tool-prefix-binutils=/home/builds/ab/HEAD/atari/20250703130037Z-tools/bin/m68k--netbsdelf- > file1 > file2 > > NB. the trailing "-" on the --tool-prefix line is deliberate. Perfect - not sure how I overlooked that in the usage output. Thanks! Martin From chris at reproducible-builds.org Wed Jul 9 17:36:52 2025 From: chris at reproducible-builds.org (Chris Lamb) Date: Wed, 09 Jul 2025 10:36:52 -0700 Subject: [diffoscope] Need a way to select objdump for different architectures In-Reply-To: References: Message-ID: Hi Martin, >> diffoscope >> --tool-prefix-binutils=/home/builds/ab/HEAD/atari/20250703130037Z-tools/bin/m68k--netbsdelf- >> file1 >> file2 >> >> NB. the trailing "-" on the --tool-prefix line is deliberate. > > Perfect - not sure how I overlooked that in the usage output. No problem, it's a little-used feature after all, and the name "tool-prefix-binutils" won't jump out to you when looking at the --help output. I don't think I ever considered that users would pass a full, absolute path too, so I'm glad that works. Best wishes, -- o ? ? Chris Lamb o o reproducible-builds.org ? ? ? o