Don't compile some opcodes files when bfd is 32-bit only

Mike Frysinger vapier@gentoo.org
Thu Dec 2 16:48:50 GMT 2021


On 02 Dec 2021 19:26, Alan Modra via Binutils wrote:
> On Thu, Dec 02, 2021 at 12:19:37AM -0500, Mike Frysinger wrote:
> >  i don't
> > have specific familiarity with the bpf port as i didn't author it.  i only
> > just finished overhauling the sim build & test logic to support testing in a
> > multitarget build so they can all (or most at this point) be tested at the
> > same time.  and i can see the same runtime error you see now too.  is the
> > 64-bit bfd setting easy to detect in subdirs ?
> 
> I used
>     if grep '#define BFD_ARCH_SIZE 64' ../bfd/bfd-in3.h > /dev/null
> in opcodes/configure.ac and made configure-opcodes depend on
> configure-bfd in the top level Makefile.def.  bfd-in3.h is made during
> bfd configure.

hmm, that seems messy.  gdb & ld have specific --enable-64-bit-bfd options
(albeit, copied & pasted from bfd/configure.ac).  should that instead be
refactored into e.g. config/bfd64.m4 and then all these subdirs get that
same configure logic ?

> >  if so, i think we can change
> > the sim to skip 64-bit-only ports if 64-bit bfd isn't available.
> 
> Yes, I think that is the right way to go for --enable-targets=all.
> 
> > riscv i think is a bit diff in that it supports 32-bit & 64-bit.
> 
> You can argue that with the riscv maintainers.  ;-)
> 
> Note that if a user specifically wants a riscv32 sim then using
> --target=riscv32-elf or even --enable-targets=riscv32-elf will get
> them a 64-bit bfd.

--enable-targets=all does not though, and riscv32 only needs a 32-bit bfd.
the symbols in question aren't tied to the bfd size.

tbh, i haven't been following what's been going on, i just raise my head
when the sim fails to link.  and it's failing to link now after this change.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20211202/e4efd35c/attachment.sig>


More information about the Binutils mailing list