When BR2_TOOLCHAIN_HAS_LIBQUADMATH is set, --enable-libquadmath-support
option is missing. So the float128 support is not fully enabled in gcc.
This lead to a build issue with gcc 12 on PowerPC power8 due to missing
M_2_SQRTPIq definition (provided by libquadmath.h).
../../../libgfortran/intrinsics/erfc_scaled.c: In function ‘erfc_scaled_r17’:
../../../libgfortran/intrinsics/erfc_scaled.c:143:22: error: ‘M_2_SQRTPIq’ undeclared (first use in this function); did you mean ‘M_2_SQRTPIf’?
143 | # define _M_2_SQRTPI M_2_SQRTPIq
| ^~~~~~~~~~~
This is fixed by adding --enable-libquadmath-support (like crosstool-ng
handling [1]).
Fixes:
https://gitlab.com/kubu93/toolchains-builder/-/jobs/
2510178766
[1] https://github.com/crosstool-ng/crosstool-ng/blob/crosstool-ng-1.25.0/scripts/build/cc/gcc.sh#L370
Signed-off-by: Romain Naour <[email protected]>
Signed-off-by: Thomas Petazzoni <[email protected]>
# quadmath support requires wchar
ifeq ($(BR2_USE_WCHAR)$(BR2_TOOLCHAIN_HAS_LIBQUADMATH),yy)
-HOST_GCC_COMMON_CONF_OPTS += --enable-libquadmath
+HOST_GCC_COMMON_CONF_OPTS += --enable-libquadmath --enable-libquadmath-support
else
HOST_GCC_COMMON_CONF_OPTS += --disable-libquadmath --disable-libquadmath-support
endif