[Buildroot] [git commit] toolchain/helper: check_fortran: silence error message

Yann E. MORIN yann.morin.1998 at free.fr
Tue Jul 25 21:03:33 UTC 2023


commit: https://git.buildroot.net/buildroot/commit/?id=8d33993395a9002448bf21bb734c55c36fcd4c62
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

check_fortran will display an error message if there is no Fortran
compiler in the toolchain. In the past, running into this error message
would be unlikely, since the Fortran test was only execuded when
BR2_TOOLCHAIN_HAS_FORTRAN was set.

However, since commit c7f641cbaae9 (toolchain/toolchain-external: always
call checks with dependencies), the Fortran check is unconditional. The
error itself benign, and the macro will handle the situation correctly,
since that is what it is designed to do. However, the error message
looks ugly and can be confusing.

[...]
>>> toolchain-external-custom  Extracting
>>> toolchain-external-custom  Patching
>>> toolchain-external-custom  Configuring
/bin/bash: line 1: .../bin/aarch64-linux-gfortran: No such file or directory
>>> toolchain-external-custom  Building
... everything continues normally ...

Let's suppress the error message, since triggerig the error is an
integral part of how the test works and doesn't mean that anything is
wrong.

Signed-off-by: Markus Mayer <mmayer at broadcom.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998 at free.fr>
---
 toolchain/helpers.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index 030ddfda70..27a5470ca3 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -382,7 +382,7 @@ check_fortran = \
 	__CROSS_FC=$(strip $1) ; \
 	__o=$(BUILD_DIR)/.br-toolchain-test-fortran.tmp ; \
 	__HAS_FORTRAN=`printf 'program hello\n\tprint *, "Hello Fortran!\\\n"\nend program hello\n' | \
-		$${__CROSS_FC} -x f95 -ffree-form -o $${__o} - && echo y`; \
+		$${__CROSS_FC} -x f95 -ffree-form -o $${__o} - 2>/dev/null && echo y`; \
 	rm -f $${__o}* ; \
 	if [ "$${__HAS_FORTRAN}" != "y" -a "$(BR2_TOOLCHAIN_HAS_FORTRAN)" = y ] ; then \
 		echo "Fortran support is selected but is not available in external toolchain" ; \



More information about the buildroot mailing list