package/coreutils: fix glibc build with gcc >= 14

ac_cv_func_strerror_r_char_p is hardcoded to no since commit
74b9bf9945 back in 2005 however strerror_r
only returns an int with musl. With glibc or uclibc, strerror_r returns
a char* or an int depending on _GNU_SOURCE value resulting in the
following build failure with gcc >= 14:

strerror_r.c: In function 'rpl_strerror_r':
strerror_r.c:207:9: error: assignment to 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
  207 |     ret = strerror_r (errnum, buf, buflen);
      |         ^

To fix this build failure, don't hardcode ac_cv_func_strerror_r_char_p
to let coreutils pick the correct value

Fixes:
 - http://autobuild.buildroot.org/results/8bc649ca5490b0c29c90383edfa2e693f154ebc4

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
(cherry picked from commit 2822fdd0bc)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Fabrice Fontaine
2024-07-23 00:09:22 +02:00
committed by Peter Korsgaard
parent 001e416759
commit 5826cc2d9f

View File

@@ -27,7 +27,6 @@ COREUTILS_CONF_ENV = ac_cv_c_restrict=no \
ac_cv_func_getgroups=yes \
ac_cv_func_getgroups_works=yes \
ac_cv_func_getloadavg=no \
ac_cv_func_strerror_r_char_p=no \
ac_cv_func_strnlen_working=yes \
ac_cv_have_decl_strerror_r=yes \
ac_cv_have_decl_strnlen=yes \