On Thu, 4 Jan 2018, blargh wrote:
Hi,
I've been building nettle with Clang from a generated toolchain with the latest Android NDK (16b).
Form architecture with available assembler code (x86 in particular), compilation fails because the generated asm is not compatible with clang. So I use --disable-assembler, thinking it would fix the problem. But it still fails (see log below):
The workaround has been to entirely disable (comment) the asm rule in Makefile.in:
#.asm.$(OBJEXT): $(srcdir)/asm.m4 machine.m4 config.m4 # $(M4) $(srcdir)/asm.m4 machine.m4 config.m4 $< >$*.s # $(COMPILE) -c $*.s # @echo "$@ : $< $(srcdir)/asm.m4 machine.m4 config.m4" >$@.d
For some reason, this rule generates asm files even when --disable-assembler is specified and it gets in the way later in the build.
The proper fix would be to make sure this rule never kicks in with --disable-assembler. And also maybe force --disable-assembler when clang is the compiler, or update the asm generation macro (asm.m4) to produce .s files compatible with clang.
The error messages you quoted below show an attempt of assembling arm assembly when targeting i686. This sounds like a case of not running "make distclean" in the nettle source repo before reconfiguring for a different target.
Once you've cleaned the build tree properly, you could maybe retry even without the hacks and without --disable-assembler to see if it works even without that.
// Martin