An Autoconf configure script does fail, because some file it generated
does unexpectedly contain output from some command it called in an
if-statement that had output directed to >& /dev/null . Various
alterations to the script do produce strange outcomes. Sometimes it
avoids the bug, sometimes it will result in the line "extern void free
(void *__ptr) __attribute__ ((__nothrow__ , __leaf__));" to be inserted
into the file in addition to the behavior. This line is seemingly in
some cases also be generated by the command itself that generated the
misplaced output, which suggests that the bug is not in bash but some
API bash is written in.
Go to line 6532: if diff "$cache_file" confcache >/dev/null 2>&1; then
:; else
Hint: $cache_file is always /dev/null , hence the if-statement will
evaluate false
This diff command is the source of the insertion in
build.LibreELEC-AMLGX.aarch64-9.80-devel/build/ccache-3.7.12/config.status :
0a1,97:
> # This file is a shell script that caches the results of
configure
> # tests run on this system so they can be shared between
configure
...
Remove the line and the corresponding "fi" that closes the if-statement
-> script inserts "extern void free ..." instead into
./config.status at line 533
Replace line with: if diff "$cache_file" confcache >& /tmp/nothing; then
:; else
-> script inserts not only "extern void free ..." in config.status,
but also the following into /tmp/nothing at the top in addition to the
output:
> # This file is a shell script that caches the results of
configure
...
Replace line with if cat /tmp/nothing >& /dev/null; then :; else
-> script inserts content of /tmp/nothing into ./config.status at
line 533
Replace line with if false; then :; else # or other random commands
-> script works
Content of /tmp/nothing (all characters are exact part of the file):
1c1,97
< extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));
---
> # This file is a shell script that caches the results of configure
> # tests run on this system so they can be shared between configure
> # scripts and configure runs, see configure's option --config-cache.
> # It is not useful on other systems. If it contains results you don't
> # want to keep, you may remove or edit it.
> #
> # config.status only pays attention to the cache file if you give it
> # the --recheck option to rerun configure.
> #
> # `ac_cv_env_foo' variables (set or unset) will be overridden when
> # loading this file, other *unset* `ac_cv_foo' will be assigned the
> # following values.
>
> ac_cv_build=${ac_cv_build=x86_64-pc-linux-gnu}
> ac_cv_c_bigendian=${ac_cv_c_bigendian=no}
> ac_cv_c_compiler_clang=${ac_cv_c_compiler_clang=no}
> ac_cv_c_compiler_gnu=${ac_cv_c_compiler_gnu=yes}
> ac_cv_c_extern_inline=${ac_cv_c_extern_inline=no}
> ac_cv_c_inline=${ac_cv_c_inline=inline}
> ac_cv_env_CC_set=set
> ac_cv_env_CC_value=/bin/gcc
> ac_cv_env_CFLAGS_set=set