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
6 This applies gentoo's x32 patch, adjusted slightly, which disables asm support
7 for x32 as well as correcting -m.
9 Debian has a different patch which does the same, and there's a superior yet
10 out of date patch series on the x264 list which keeps asm support enabled, but
11 doesn't successfully build at this time, and my assembly is very rusty.
13 Upstream-Status: Pending
14 Signed-off-by: Christopher Larson <chris_larson@mentor.com>
16 configure | 14 ++++++++++++--
17 1 file changed, 12 insertions(+), 2 deletions(-)
21 @@ -771,7 +771,13 @@ case $host_cpu in
23 ASFLAGS="$ASFLAGS -DARCH_X86_64=1 -I\$(SRCPATH)/common/x86/"
25 - [ $compiler = GNU ] && CFLAGS="-m64 $CFLAGS" && LDFLAGS="-m64 $LDFLAGS"
26 + if [ $compiler = GNU ]; then
27 + if cpp_check "" "" "__ILP32__" ; then
28 + CFLAGS="-mx32 $CFLAGS" && LDFLAGS="-mx32 $LDFLAGS"
30 + CFLAGS="-m64 $CFLAGS" && LDFLAGS="-m64 $LDFLAGS"
33 if [ "$SYS" = MACOSX ]; then
34 ASFLAGS="$ASFLAGS -f macho64 -DPREFIX"
35 if cc_check '' "-arch x86_64"; then
36 @@ -790,7 +796,11 @@ case $host_cpu in
37 RCFLAGS="--target=pe-x86-64 $RCFLAGS"
40 - ASFLAGS="$ASFLAGS -f elf64"
41 + if cpp_check "" "" "__ILP32__" ; then
44 + ASFLAGS="$ASFLAGS -f elf64"