[Buildroot] [git commit branch/2023.08.x] package/gcc: fix disabling the documentation

Peter Korsgaard peter at korsgaard.com
Thu Nov 30 08:04:21 UTC 2023


commit: https://git.buildroot.net/buildroot/commit/?id=b1a3096f1c65cf1f0d605a1e596cbcf41fbf31bf
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/2023.08.x

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 at green-communications.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998 at free.fr>
(cherry picked from commit f7b9d3ad2b4acccad5252737003e8a0db4f43340)
Signed-off-by: Peter Korsgaard <peter at korsgaard.com>
---
 package/gcc/gcc.mk | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
index 5d023d725f..834da24925 100644
--- a/package/gcc/gcc.mk
+++ b/package/gcc/gcc.mk
@@ -88,9 +88,12 @@ HOST_GCC_COMMON_CONF_OPTS += --with-debug-prefix-map=$(BASE_DIR)=buildroot
 endif
 
 # 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 = \
 	MAKEINFO=missing
+HOST_GCC_COMMON_MAKE_OPTS = \
+	gcc_cv_prog_makeinfo_modern=no
 
 GCC_COMMON_TARGET_CFLAGS = $(TARGET_CFLAGS)
 GCC_COMMON_TARGET_CXXFLAGS = $(TARGET_CXXFLAGS)
@@ -295,7 +298,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
 # available or not in the C library is not working properly for
 # 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)
 
 ifeq ($(BR2_CCACHE),y)



More information about the buildroot mailing list