When autoconf 2.7.1 is used for compilation, the following compilation alarm is displayed:
CPPAS rolling_hash/aarch64/rolling_hash2_aarch64_multibinary.lo
<command-line>: warning: "__STDC_WANT_IEC_60559_ATTRIBS_EXT__" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "__STDC_WANT_IEC_60559_BFP_EXT__" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "__STDC_WANT_IEC_60559_DFP_EXT__" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "__STDC_WANT_IEC_60559_FUNCS_EXT__" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "__STDC_WANT_IEC_60559_TYPES_EXT__" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "__STDC_WANT_LIB_EXT2__" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "__STDC_WANT_MATH_SPEC_FUNCS__" redefined
<command-line>: note: this is the location of the previous definition
By viewing the config.log file, we can see that the redefinitions are from the ${DEFS} variable:
Because Aarc64 uses .S assembly files, it is compiled using CPPAS, which contains both${DEFS} variables and ${AM_CCASFLAGS}. Since ${Am_CCASFLAGS} already contains ${DEFS} in Makefile.am, As a result, the new macro definition (for example, __STDC_WANT_LIB_EXT2__) in ${DEFS} is repeatedly defined. But x86_64 uses .asm (MKTMP to .s), it is compiled using CCAS, with not contains ${DEFS}, but contains ${AM_CC_ASFLAGS}. So there is not compilation warning of redefined on x86_64.
Therefore, the conditional compilation statement based on the architecture is added. On the AARCH64 platform, ${DEFS} is not proactively added to ${AM_CCASFLAGS}. In this way, the definition of macros in ${DEFS} is not reduced. There is no longer a problem of duplicate definitions.
So I deleted ${DEFS} from ${AM_CCASFLAGS} for AARCH64 in Makefile.am, and the above problem did not occur:
Therefore, I infer that the problem is caused by the version of autoconf. How do we solve this problem, delete ${DEFS} for AARCH64, or is there a better solution?
When autoconf 2.7.1 is used for compilation, the following compilation alarm is displayed:
By viewing the config.log file, we can see that the redefinitions are from the
${DEFS}
variable:Because Aarc64 uses .S assembly files, it is compiled using
CPPAS
, which contains both${DEFS}
variables and${AM_CCASFLAGS}
. Since${Am_CCASFLAGS}
already contains${DEFS}
in Makefile.am, As a result, the new macro definition (for example,__STDC_WANT_LIB_EXT2__
) in${DEFS}
is repeatedly defined. But x86_64 uses .asm (MKTMP to .s), it is compiled usingCCAS
, with not contains${DEFS}
, but contains${AM_CC_ASFLAGS}
. So there is not compilation warning of redefined on x86_64.Therefore, the conditional compilation statement based on the architecture is added. On the AARCH64 platform,
${DEFS}
is not proactively added to${AM_CCASFLAGS}
. In this way, the definition of macros in${DEFS}
is not reduced. There is no longer a problem of duplicate definitions. So I deleted${DEFS}
from${AM_CCASFLAGS}
for AARCH64 in Makefile.am, and the above problem did not occur:The same problem does not occur when I use autoconf 2.69, because autoconf 2.69 does not contain the definition of
__STDC_WANT_LIB_EXT2__
.Therefore, I infer that the problem is caused by the version of autoconf. How do we solve this problem, delete ${DEFS} for AARCH64, or is there a better solution?