make 'ASMFLAGS' behavior similar to 'CFLAGS' and 'CXXFLAGS' variables
Torbjörn Granlund
tg at gmplib.org
Fri Aug 18 15:49:17 UTC 2017
I don't plan to work on this, and I am not sure that doing major work in
this area is worth the potential portability destabilisation. (Please
use this list for bug reports and gmp-discuss for other subjects.)
sav_ix at ukr.net writes:
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,
yasm.torall.net) 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
_______________________________________________
gmp-bugs mailing list
gmp-bugs at gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs
--
Torbjörn
Please encrypt, key id 0xC8601622
More information about the gmp-bugs
mailing list