0011-configure.ac-fixup-CC-print-multiarch-output-for-mus.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. From 3eccbd53df3c51c1c6ece217d19f1d01eb9575a7 Mon Sep 17 00:00:00 2001
  2. From: Peter Korsgaard <peter@korsgaard.com>
  3. Date: Fri, 2 Aug 2019 15:53:16 +0200
  4. Subject: [PATCH] configure.ac: fixup $CC --print-multiarch output for
  5. musl/uclibc GCC 8+ toolchains
  6. GCC commit 6834b83784dcf0364eb820e8 (multiarch support for non-glibc linux
  7. systems), which is part of GCC 8+, changed the multiarch logic to use
  8. $arch-linux-musl / $arch-linux-uclibc rather than $arch-linux-gnu.
  9. This then causes the python3 configure script to error out:
  10. checking for the platform triplet based on compiler characteristics... powerpc-linux-gnu
  11. configure: error: internal configure error for the platform triplet, please file a bug report
  12. http://autobuild.buildroot.net/results/cb4/cb49c539501342e45cbe5ade82e588fcdf51f05b
  13. As it requires that the --print-multiarch output (if not empty) matches the
  14. deduced triplet (which always uses -linux-gnu).
  15. It isn't quite clear why --print-multiarch returns something for a
  16. non-multiarch toolchain on some architectures (E.G. PowerPC), but as a
  17. workaround, rewrite the --print-multiarch output to match older GCC versions
  18. to keep the configure script happy.
  19. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
  20. [Peter: updated for 3.10.2]
  21. Signed-off-by: Vincent Fazio <vfazio@gmail.com>
  22. [Vincent: fixup offsets for 3.12.4]
  23. ---
  24. configure.ac | 6 +++++-
  25. 1 file changed, 5 insertions(+), 1 deletion(-)
  26. diff --git a/configure.ac b/configure.ac
  27. index 1cb95f41fd..d142af404a 100644
  28. --- a/configure.ac
  29. +++ b/configure.ac
  30. @@ -1128,7 +1128,11 @@ AC_MSG_CHECKING([for multiarch])
  31. AS_CASE([$ac_sys_system],
  32. [Darwin*], [MULTIARCH=""],
  33. [FreeBSD*], [MULTIARCH=""],
  34. - [MULTIARCH=$($CC --print-multiarch 2>/dev/null)]
  35. + [
  36. + # GCC 8+ returns $arch-linux-{musl,uclibc} for musl/uClibc based
  37. + # toolchains confusing python. Fix that up
  38. + MULTIARCH=$($CC --print-multiarch 2>/dev/null | sed -E 's/-linux-(musl|uclibc)*$/-linux-gnu/')
  39. + ]
  40. )
  41. AC_SUBST([MULTIARCH])
  42. AC_MSG_RESULT([$MULTIARCH])
  43. --
  44. 2.34.1