On Wed, Oct 28, 2020 at 11:56 PM Alexander Egorenkov
<egorenar(a)posteo.net> wrote:
Bhupesh Sharma <bhsharma(a)redhat.com> writes:
>
> ifneq ($(CROSS_COMPILE),)
> SUBARCH := $(shell echo $(CROSS_COMPILE) | cut -d- -f1 | sed 's:^.*/::g')
> else
> SUBARCH := $(shell uname -m)
> endif
> SUBARCH := $(shell echo $(SUBARCH) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
> -e s/arm.*/arm/ -e s/sa110/arm/ \
> -e s/s390x/s390/ -e s/parisc64/parisc/ \
> -e s/ppc.*/powerpc/ -e s/mips.*/mips/ )
>
> ARCH ?= $(SUBARCH)
Hmm,
but the Makefile needs to differentiate between 64 and 32bit archs, e.g. in
if [ "${ARCH}" = "ppc64le" ]
So "-e s/ppc.*/powerpc/" won't cut it, i think.
Sure, that was just an example, not a complete code blob :)
Furthermore, we have to convert ARCH to TARGET to pass it to
configure.c which also
differentiates between 32 and 64 bit archs.
Need to think about it more.
Sure, but I think we don't need to reinvent the wheel there.
CROSS_COMPILING user-space tools
and kernel bits have been standardized since some time and in the
respective Makefiles (you can refer to the Busybox and Linux kernel
Makefile) you can find helpful logic already existing for the same.
Thanks,
Bhupesh