You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.7 KiB

  1. From 66b120079fb21ed38cab0900c63360b0a7853eaa Mon Sep 17 00:00:00 2001
  2. From: Christopher Larson <chris_larson@mentor.com>
  3. Date: Tue, 13 Dec 2016 14:22:32 -0700
  4. Subject: [PATCH] Fix X32 build by disabling asm
  5. This applies gentoo's x32 patch, adjusted slightly, which disables asm support
  6. for x32 as well as correcting -m.
  7. Debian has a different patch which does the same, and there's a superior yet
  8. out of date patch series on the x264 list which keeps asm support enabled, but
  9. doesn't successfully build at this time, and my assembly is very rusty.
  10. Upstream-Status: Pending
  11. Signed-off-by: Christopher Larson <chris_larson@mentor.com>
  12. ---
  13. configure | 14 ++++++++++++--
  14. 1 file changed, 12 insertions(+), 2 deletions(-)
  15. --- a/configure
  16. +++ b/configure
  17. @@ -769,7 +769,13 @@ case $host_cpu in
  18. AS_EXT=".asm"
  19. ASFLAGS="$ASFLAGS -DARCH_X86_64=1 -I\$(SRCPATH)/common/x86/"
  20. stack_alignment=16
  21. - [ $compiler = GNU ] && CFLAGS="-m64 $CFLAGS" && LDFLAGS="-m64 $LDFLAGS"
  22. + if [ $compiler = GNU ]; then
  23. + if cpp_check "" "" "__ILP32__" ; then
  24. + CFLAGS="-mx32 $CFLAGS" && LDFLAGS="-mx32 $LDFLAGS"
  25. + else
  26. + CFLAGS="-m64 $CFLAGS" && LDFLAGS="-m64 $LDFLAGS"
  27. + fi
  28. + fi
  29. if [ "$SYS" = MACOSX ]; then
  30. ASFLAGS="$ASFLAGS -f macho64 -DPREFIX"
  31. if cc_check '' "-arch x86_64"; then
  32. @@ -788,7 +794,11 @@ case $host_cpu in
  33. RCFLAGS="--target=pe-x86-64 $RCFLAGS"
  34. fi
  35. else
  36. - ASFLAGS="$ASFLAGS -f elf64"
  37. + if cpp_check "" "" "__ILP32__" ; then
  38. + asm=no
  39. + else
  40. + ASFLAGS="$ASFLAGS -f elf64"
  41. + fi
  42. fi
  43. ;;
  44. powerpc*)