[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: binutils and llvm for cross-building



I just ran a few more experiments with fresh eyes (haven't looked at
this in a few weeks). I see that

- llvm-objcopy:amd64 actually appears to work on arm64 binaries. Can
  this be relied-upon?

- The GNU aarch64-linux-gnu-objcopy tool works too, but objcopy from
  binutils:amd64 does not (unlike nm from binutils:amd64, which does
  work)

So maybe I answered my own Debian cross-building question. Let me ask
another related question.

As upstream, how do I write Makefiles that work for different distros
and for both native and cross-building in Debian? I can do this:


  DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE 2>/dev/null)
  tst.o: tst.c
          ....
          $(if $(DEB_HOST_GNU_TYPE),$(DEB_HOST_GNU_TYPE)-)objcopy ...

But that's a mouthful. Is there a better way?

Thanks.


Reply to: