package/gcc: fix disabling the documentation

gcc.mk attempts to disable building the documentation by setting
MAKEINFO=missing, but it is not working.  If makeinfo is installed
and recent enough, gcc still uses it.  This can be checked easily:

grep BUILD_INFO='info' host-gcc-initial-*/build/gcc/config.log

It happens because the root ./configure script will check
$MAKEINFO --version (aka 'missing --version') and will overwrite it with
MAKEINFO='missing makeinfo' because the version does not match.

Having MAKEINFO='missing makeinfo' is a problem because
'missing makeinfo' will actually attempt to run 'makeinfo' before
failing with an error message.  If makeinfo is installed on the host,
then 'missing makeinfo' will successfully run makeinfo anyway.

Many gcc subprojects will check $MAKEINFO --version and enable building
the documentation if it is recent enough.  This patch overrides these
checks by forcing gcc_cv_prog_makeinfo_modern=no.

Building the GCC documentation can fail with the wrong makeinfo version.
It happened at least when building GCC 11.3.0 with makeinfo 7.1.

Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This commit is contained in:
Nicolas Cavallari 2023-11-22 16:47:36 +01:00 committed by Yann E. MORIN
parent 6a94b0b763
commit f7b9d3ad2b

View File

@ -91,9 +91,12 @@ HOST_GCC_COMMON_CONF_OPTS += --with-debug-prefix-map=$(BASE_DIR)=buildroot
endif endif
# Don't build documentation. It takes up extra space / build time, # Don't build documentation. It takes up extra space / build time,
# and sometimes needs specific makeinfo versions to work # and sometimes needs specific makeinfo versions to work. Override the check
# for a modern makeinfo otherwise the configure scripts will still enable it.
HOST_GCC_COMMON_CONF_ENV = \ HOST_GCC_COMMON_CONF_ENV = \
MAKEINFO=missing MAKEINFO=missing
HOST_GCC_COMMON_MAKE_OPTS = \
gcc_cv_prog_makeinfo_modern=no
GCC_COMMON_TARGET_CFLAGS = $(TARGET_CFLAGS) GCC_COMMON_TARGET_CFLAGS = $(TARGET_CFLAGS)
GCC_COMMON_TARGET_CXXFLAGS = $(TARGET_CXXFLAGS) GCC_COMMON_TARGET_CXXFLAGS = $(TARGET_CXXFLAGS)
@ -298,7 +301,7 @@ HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS += -DBR_CROSS_PATH_SUFFIX='".br_real"'
# For gcc-final, the gcc logic to detect whether SSP support is # For gcc-final, the gcc logic to detect whether SSP support is
# available or not in the C library is not working properly for # available or not in the C library is not working properly for
# uClibc, so let's be explicit as well. # uClibc, so let's be explicit as well.
HOST_GCC_COMMON_MAKE_OPTS = \ HOST_GCC_COMMON_MAKE_OPTS += \
gcc_cv_libc_provides_ssp=$(if $(BR2_TOOLCHAIN_HAS_SSP),yes,no) gcc_cv_libc_provides_ssp=$(if $(BR2_TOOLCHAIN_HAS_SSP),yes,no)
ifeq ($(BR2_CCACHE),y) ifeq ($(BR2_CCACHE),y)