From e91efef4ffc37076402fbb96c5c2ff9b6a3a4640 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Fri, 2 Jul 2021 09:14:59 +0200 Subject: [PATCH] app-crypt/mit-krb5: add warn-crossbuild.patch Set PYTHON_COMPAT to python 3.6 and 3.7 to be suitable for the current code base. Add a custom patch to replace error with warning when running autoconf for cross builds, because libkrb5 is not able to detect cross-compilation. See also https://github.com/kinvolk/Flatcar/issues/369 . --- .../files/mit-krb5-warn-crossbuild.patch | 35 +++++++++++++++++++ .../mit-krb5/mit-krb5-1.18.2-r4.ebuild | 3 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 sdk_container/src/third_party/coreos-overlay/app-crypt/mit-krb5/files/mit-krb5-warn-crossbuild.patch diff --git a/sdk_container/src/third_party/coreos-overlay/app-crypt/mit-krb5/files/mit-krb5-warn-crossbuild.patch b/sdk_container/src/third_party/coreos-overlay/app-crypt/mit-krb5/files/mit-krb5-warn-crossbuild.patch new file mode 100644 index 0000000000..37d6eca0b6 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-crypt/mit-krb5/files/mit-krb5-warn-crossbuild.patch @@ -0,0 +1,35 @@ +diff --git a/aclocal.m4 b/aclocal.m4 +index 8709a7f5..fe6d41b4 100644 +--- a/aclocal.m4 ++++ b/aclocal.m4 +@@ -746,7 +746,7 @@ AC_TRY_RUN([ + #include + regex_t x; regmatch_t m; + int main() { return regcomp(&x,"pat.*",0) || regexec(&x,"pattern",1,&m,0); } +-], ac_cv_func_regcomp=yes, ac_cv_func_regcomp=no, AC_MSG_ERROR([Cannot test regcomp when cross compiling]))]) ++], ac_cv_func_regcomp=yes, ac_cv_func_regcomp=no, AC_MSG_WARN([Cannot test regcomp when cross compiling]))]) + AC_MSG_RESULT($ac_cv_func_regcomp) + test $ac_cv_func_regcomp = yes && AC_DEFINE(HAVE_REGCOMP,1,[Define if regcomp exists and functions]) + dnl +@@ -1608,7 +1608,7 @@ void foo2() __attribute__((destructor)); + void foo2() { unlink("conftest.2"); } + int main () { return 0; }], + [test -r conftest.1 || a=yes +-test -r conftest.2 || b=yes], , AC_MSG_ERROR(Cannot test for constructor/destructor support when cross compiling)) ++test -r conftest.2 || b=yes], , AC_MSG_WARN(Cannot test for constructor/destructor support when cross compiling)) + case $krb5_cv_host in + *-*-aix4.*) + # Under AIX 4.3.3, at least, shared library destructor functions +diff --git a/configure.ac b/configure.ac +index 234f4281..0e9f86dd 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -928,7 +928,7 @@ int main () { + }], + ac_cv_printf_positional=yes, + ac_cv_printf_positional=no, +- AC_MSG_ERROR([Cannot test for printf positional argument support when cross compiling]))]) ++ AC_MSG_WARN([Cannot test for printf positional argument support when cross compiling]))]) + # Nothing for autoconf.h for now. + AC_MSG_RESULT($ac_cv_printf_positional) + diff --git a/sdk_container/src/third_party/coreos-overlay/app-crypt/mit-krb5/mit-krb5-1.18.2-r4.ebuild b/sdk_container/src/third_party/coreos-overlay/app-crypt/mit-krb5/mit-krb5-1.18.2-r4.ebuild index 228d7891ac..efa92d1b1f 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-crypt/mit-krb5/mit-krb5-1.18.2-r4.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/app-crypt/mit-krb5/mit-krb5-1.18.2-r4.ebuild @@ -3,7 +3,7 @@ EAPI=7 -PYTHON_COMPAT=( python3_{7,8,9} ) +PYTHON_COMPAT=( python3_{6,7} ) inherit autotools flag-o-matic multilib-minimal python-any-r1 systemd toolchain-funcs MY_P="${P/mit-}" @@ -62,6 +62,7 @@ PATCHES=( "${FILESDIR}/CVE-2020-28196.patch" "${FILESDIR}/${PN}-1.18.2-krb5-config.patch" "${FILESDIR}/${PN}-1.18.2-autoconf-2.70.patch" + "${FILESDIR}/${PN}-warn-crossbuild.patch" ) MULTILIB_CHOST_TOOLS=(