make 'ASMFLAGS' behavior similar to 'CFLAGS' and 'CXXFLAGS' variables

Marc Glisse marc.glisse at
Thu Feb 1 10:07:16 UTC 2018

(moved from gcc-bugs)

It is too bad yasm doesn't ignore '-c', using automake's CCAS support (as 
suggested in tasks.html) might have worked otherwise (not sure). Still, I 
think it would make sense to use the name CCASFLAGS for consistency. There 
may be a bit more to it than this patch though.

If it is the main blocking issue for a visual studio build, at least that 
gives some motivation.

On Sun, 4 Jun 2017, sav_ix at wrote:

> Hello, everyone,
> Currently, if 'CFLAGS' and 'CXXFLAGS' variables not defined by User, they're autodetected during GMP configuration and used for appropriate compiler 'gcc' and 'g++' respectively during build.
> For some reason 'ASMFLAGS' variable don't autodetected at all; if defined by User, it doesn't used for assembler check during configuration, and used with 'CFLAGS' and 'CXXFLAGS' during build.
> Even if don't take into account, that "the same things are done in different way", this makes binding of GMP to a particular assembler (GCC or GCC-like). As a consequence, 3rd party assembler (e.g. YASM, can't be used for GMP build, since it receive GCC C and C++ compiler keys, instead of expected from 'ASMFLAGS' variable, and throw error.
> This could be changed by setting 'ASMFLAGS' as the only variable, used with 'CCAS', and initializing 'ASMFLAGS' from 'CFLAGS', if it wasn't defined by User (patch added in attachment).
> Tested build and check using mingw-w64 for <Debug|Release><Shared|Static> configurations with and without YASM as 3rd party assembler, and found no regressions (all tasks finished successfully). Didn't tested tune, as it's not available for this compiler; expected, that it should be built without errors too.
> Don't know the reason, why 'CCAS' variable was used with 'CPPFLAGS' in addition to 'CFLAGS' (object files, built from 'mpn/*.asm' files, are linked only with 'gmp' C library, but not 'gmpxx' C++ library; in addition, 'CXXFLAGS' could contain C++ compiler specific keys, e.g. '-std=gnu++11', which would be passed to C compiler 'gcc'). Thus this patch initialize 'ASMFLAGS' from 'CFLAGS' variable only, but not 'CXXFLAGS'.
> Environment: Windows 10 x64, mingw-w64 6.3.0 x86_64, MSYS2 20161025 x86_64,GMP-6.2.0-dev (changeset 17426:330407782736).
> Alexander

Marc Glisse

More information about the gmp-discuss mailing list