cross compile dietlibc (on x86_64 for arm)

[email protected] Wed, 24 Jan 2018 10:11:13 +0100 (CET)
Newsgroups gmane.linux.lib.dietlibc
Message-ID <[email protected]>
Hi,

I'm trying to cross compile dietlibc for arm:

# make ARCH=arm CROSS="arm-cortexa15-linux-gnueabihf-" EXTRACFLAGS="-O2 -Wall -march=armv7-a -mfloat-abi=hard -mfpu=neon-vfpv4 -mabi=aapcs-linux -mtune=cortex-a15 -fno-stack-protector -std=gnu99" all
...
...
bin-x86_64/diet arm-cortexa15-linux-gnueabihf-gcc -D__dietlibc__ -pipe -nostdinc -D_REENTRANT -O2 -Wall -march=armv7-a -mfloat-abi=hard -mfpu=neon-vfpv4 -mabi=aapcs-linux -mtune=cortex-a15 -fno-stack-protector -std=gnu99 -O2 -fomit-frame-pointer -fstrict-aliasing -O0 -g -Wall -march=armv7-a -mfloat-abi=hard -mfpu=neon-vfpv4 -mabi=aapcs-linux -mtune=cortex-a15 -fno-stack-protector -std=gnu99 -W -Wall -Wextra -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -Wno-switch -Wno-unused -Wredundant-decls -Wshadow -o bin-arm/elftrunc contrib/elftrunc.c
make[4]: bin-x86_64/diet: Command not found
make[4]: *** [Makefile:352: bin-arm/elftrunc] Error 127

The failing make target is in the root Makefile:

...
$(OBJDIR)/elftrunc: $(OBJDIR)/diet contrib/elftrunc.c
	bin-$(MYARCH)/diet $(CCC) $(CFLAGS) -o $@ contrib/elftrunc.c
...

here $(OBJDIR)/elftrunc depends on $(OBJDIR)/diet but in the recipe bin-$(MYARCH)/diet
is used.

Do I have to build the dietlibc src tree natively first and then cross ?

giorgio