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

Alan Modra amodra@gmail.com
Thu Dec 2 22:02:07 GMT 2021


On Thu, Dec 02, 2021 at 11:48:50AM -0500, Mike Frysinger wrote:
> 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 ?

You're right, it would be cleaner to do it that way.  What we have in
opcodes at the moment came about from me trying to automatically
choose the set of opcodes targets that need a 64-bit bfd by parsing
bfd config files.  I gave up on implementing that idea, but was then
in the mindset of depending on bfd config rather than depending on
top-level config options.

> > >  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

Reverting the opcodes Makefile changes will currently result in
opcodes failing to link.  The riscv opcodes objects now depend on
riscv bfd objects that are only compiled for a 64-bit bfd.

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list