summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-09-19 04:01:26 +0100
committerSam James <sam@gentoo.org>2022-09-19 17:26:40 +0100
commit0acd23de8af61e7b900c3ff2c0fcbfe0b0ddc3a3 (patch)
tree680b62b6ea0ef8d0380881b3f6ed6c1ff97b6ac5 /sys-devel/autoconf/files/autoconf-2.71-AC_C_BIGENDIAN-lto.patch
parentsys-libs/musl: drop libcrypt.a too for USE=-crypt (diff)
downloadgentoo-0acd23de8af61e7b900c3ff2c0fcbfe0b0ddc3a3.tar.gz
gentoo-0acd23de8af61e7b900c3ff2c0fcbfe0b0ddc3a3.tar.bz2
gentoo-0acd23de8af61e7b900c3ff2c0fcbfe0b0ddc3a3.zip
sys-devel/autoconf: backport K&R decls fix to 2.71
Backport the K&R decls fix to 2.71 to avoid configure tests failing (often "silently", i.e. doesn't fail the build of the package overall, just leads to wrong results) with newer compilers like the upcoming Clang 16. A consequence of this whole fuss is that we're going to have to eautoreconf in a bunch of older packages, but as Ionen pointed out on IRC, this means we get some other stuff for free like Python 3.10 fixes, so it's not all bad. Undecided how to handle any packages with a generated configure from autoconfs not in tree. We may just patch the configure manually. Will see. See linked bug 870412 and the Discourse thread therein for details if unfamiliar. Patches: - AC_C_BIGENDIAN-lto.patch ("Port AC_C_BIGENDIAN to cross gcc -std=c11 -flto") - AC_LANG_CALL_C_cxx.patch ("Port AC_LANG_CALL(C) to C++") - K-R-decls-clang.patch ("Port to compilers that moan about K&R func decls") The first two are included to make the latter apply cleanly, but they're also both harmless and desirable. As I remarked on IRC, it's unfortunate to have to backport anything which will then infect generated configure, as it's somewhat a repeat of the --runstatedir situation, and it leads to confusion/hassle when sending patches upstream where a generated/bootstrapped configure is required. But this is different - it's a (serious) bug being fixed rather than a gratuitous (although) understandable given we weren't sure if we'd ever see another autoconf release backport of a new feature. Backports to 2.69 & 2.13 to follow. Bug: https://bugs.gentoo.org/806376 Bug: https://bugs.gentoo.org/870412 Thanks-to: Arsen Arsenovic <arsen@aarsen.me> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-devel/autoconf/files/autoconf-2.71-AC_C_BIGENDIAN-lto.patch')
-rw-r--r--sys-devel/autoconf/files/autoconf-2.71-AC_C_BIGENDIAN-lto.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/sys-devel/autoconf/files/autoconf-2.71-AC_C_BIGENDIAN-lto.patch b/sys-devel/autoconf/files/autoconf-2.71-AC_C_BIGENDIAN-lto.patch
new file mode 100644
index 000000000000..48fbdc6f544b
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.71-AC_C_BIGENDIAN-lto.patch
@@ -0,0 +1,50 @@
+https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=234fc6c86613ed3f366dd1d88996e4d5d85ee222
+
+From 234fc6c86613ed3f366dd1d88996e4d5d85ee222 Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Wed, 27 Jul 2022 08:53:35 -0700
+Subject: Port AC_C_BIGENDIAN to cross gcc -std=c11 -flto
+
+* lib/autoconf/c.m4 (AC_C_BIGENDIAN): Improve the
+inherently-unportable grep trick well enough to survive gcc
+-std=c11 -flto when cross-compiling (sr#110687).
+--- a/lib/autoconf/c.m4
++++ b/lib/autoconf/c.m4
+@@ -1838,8 +1838,8 @@ AC_DEFUN([AC_C_BIGENDIAN],
+ [ac_cv_c_bigendian=no],
+ [ac_cv_c_bigendian=yes],
+ [# Try to guess by grepping values from an object file.
+- AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM(
++ AC_LINK_IFELSE(
++ [AC_LANG_SOURCE(
+ [[unsigned short int ascii_mm[] =
+ { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+ unsigned short int ascii_ii[] =
+@@ -1854,13 +1854,20 @@ AC_DEFUN([AC_C_BIGENDIAN],
+ int use_ebcdic (int i) {
+ return ebcdic_mm[i] + ebcdic_ii[i];
+ }
+- extern int foo;
+- ]],
+- [[return use_ascii (foo) == use_ebcdic (foo);]])],
+- [if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
++ int
++ main (int argc, char **argv)
++ {
++ /* Intimidate the compiler so that it does not
++ optimize the arrays away. */
++ char *p = argv[0];
++ ascii_mm[1] = *p++; ebcdic_mm[1] = *p++;
++ ascii_ii[1] = *p++; ebcdic_ii[1] = *p++;
++ return use_ascii (argc) == use_ebcdic (*p);
++ }]])],
++ [if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then
+ ac_cv_c_bigendian=yes
+ fi
+- if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
++ if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then
+ if test "$ac_cv_c_bigendian" = unknown; then
+ ac_cv_c_bigendian=no
+ else
+cgit v1.1