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>
This commit is contained in:
Alexey Neyman 2022-02-06 15:12:59 -08:00
parent a59503c872
commit c6ff1eca5b
5 changed files with 35 additions and 0 deletions

View File

@ -1 +1,11 @@
# gettext options
config GETTEXT_INCOMPATIBLE_WITH_UCLIBC_NG
def_bool y
depends on GETTEXT_0_21_or_later
if GETTEXT_INCOMPATIBLE_WITH_UCLIBC_NG
comment "This version of gettext is not compatible with uClibc-NG. Select"
comment "a different version if uClibc-NG is used on the target or (in a"
comment "Canadian cross build) on the host."
endif

View File

@ -5,3 +5,4 @@ bootstrap='./autogen.sh'
mirrors='$(CT_Mirrors GNU gettext)'
archive_formats='.tar.xz .tar.gz'
signature_format='packed/.sig'
milestones='0.21'

View File

@ -4,3 +4,4 @@ CT_CANADIAN=y
CT_HOST="powerpc-unknown-linux-uclibc"
CT_KERNEL_LINUX=y
CT_THREADS_LT=y
CT_GETTEXT_V_0_20_1=y

View File

@ -6,6 +6,7 @@ CT_HOST="x86_64-multilib-linux-uclibc"
CT_BINUTILS_PLUGINS=y
CT_CC_LANG_CXX=y
CT_DEBUG_GDB=y
CT_GETTEXT_V_0_20_1=y
CT_COMP_TOOLS_FOR_HOST=y
CT_COMP_TOOLS_M4=y
CT_COMP_TOOLS_MAKE=y

View File

@ -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