summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2022-02-06 23:12:59 (GMT)
committerAlexey Neyman <stilor@att.net>2022-02-11 08:47:51 (GMT)
commitc6ff1eca5b2d41bbfd085413fad4652524b726a8 (patch)
treef78d4924b08b2fd578a453474a4ccadd16ffafad /scripts
parenta59503c8722f25097d58a81838e57e9afcb66614 (diff)
Restrict *-uclibc,* canadians to gettext 0.20
Newer gettext is incompatible with uClibc-NG in cross-compilation, see the comment in the code. Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build/companion_libs/330-gettext.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/build/companion_libs/330-gettext.sh b/scripts/build/companion_libs/330-gettext.sh
index 149d7d7..9fa3bdc 100644
--- a/scripts/build/companion_libs/330-gettext.sh
+++ b/scripts/build/companion_libs/330-gettext.sh
@@ -80,6 +80,28 @@ do_gettext_backend() {
return
;;
+ # Starting with 0.21, gettext cannot build against uClibc-NG: gettext
+ # checks if it needs to use fopen wrapper (using gnulib) and newer versions
+ # of gnulib also check if fopen provided by the system supports 'e' and 'x'
+ # modes. In cross-compile environment, gnulib falls back to assuming fopen
+ # does not support these modes unless the target tuple is glibc or musl
+ # (rightly so, since these fopen modes are optional in uClibc-NG).
+ # Unfortunately, the fopen() wrapper does not compile against uClibc-NG's
+ # stdio.h then because it includes <stdio.h> after defining __need_FILE macro.
+ # It looks like two bugs, one in each of uClibc-ng and gnulib:
+ # - uClibc-ng does not include its internal headers with the definitions for the
+ # __BEGIN_NAMESPACE_STD/__END_NAMESPACE_STD macros, which therefore escape
+ # unsubstituted into the including code.
+ # - gnulib shouldn't expect the fopen() prototype if it only asked for FILE
+ # structure definition by defining the __need_FILE macro.
+ # Until the maintainers sort this out, disallow newer gettext versions if
+ # linking against uClibc-NG.
+ *-uclibc*)
+ if [ "${CT_GETTEXT_INCOMPATIBLE_WITH_UCLIBC_NG}" = "y" ]; then
+ CT_Abort "This version of gettext is incompatible with uClibc-NG"
+ fi
+ ;;
+
# A bit ugly. D__USE_MINGW_ANSI_STDIO=1 has its own {v}asprintf functions
# but gettext configure doesn't see this flag when it checks for that. An
# alternative may be to use CC="${host}-gcc ${cflags}" but that didn't