https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87498
Bug ID: 87498 Summary: Inconsistent behaviour for passing -DNO_ASM and host=none Product: gcc Version: 7.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: bootstrap Assignee: unassigned at gcc dot gnu.org Reporter: miro.kropacek at gmail dot com Target Milestone: --- While testing recent 7.3.0 on m68k I have noticed an inconsistency when it comes to enabling/disabling assemly routines for gmp. Commit 4b2246ef8ab1687ade4dfeaa82b1da3934e74213 introduces passing -DNO_ASM to avoid building in-tree version of GMP with assembly inlines (due to safety reasons). That's good. However what I don't understand is the behaviour happening during the canadian cross - in my case where build=x86_64 and host=target=m68k. For x86_64's gmp, host is passed as "none-pc-linux-gnu", thus disabling assembly and passing -DNO_ASM to CFLAGS from gmp's configure (making the toplevel AM_CFLAGS useless). For m68k's gmp, host is passed as "m68k-elf", thus not disabling assembly and passing -DNO_ASM from toplevel AM_CFLAGS. This leads to an inconsistent state because some asm routines (files) are still used in GMP however inlines are disabled due to NO_ASM. I assume that in the m68k case, some check determines that m68k-gcc cross compiler is outside the build tree (what is) and decides to pass true host id. What is fine with me but in that case AM_CFLAGS's -DNO_ASM shouldn't be passed along.