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.
gentoo-overlay/media-libs/x264/files/x264-x32.patch

35 lines
1.2 KiB

https://bugs.gentoo.org/420241
initial x32 support -- no asm code, just pure C
--- a/configure
+++ b/configure
@@ -567,7 +567,13 @@ case $host_cpu in
x86_64)
ARCH="X86_64"
AS="yasm"
- [ $compiler = GNU ] && CFLAGS="-m64 $CFLAGS" && LDFLAGS="-m64 $LDFLAGS"
+ if [ $compiler = GNU ]; then
+ if cpp_check "" "" "__ILP32__" ; then
+ CFLAGS="-mx32 $CFLAGS" && LDFLAGS="-mx32 $LDFLAGS"
+ else
+ CFLAGS="-m64 $CFLAGS" && LDFLAGS="-m64 $LDFLAGS"
+ fi
+ fi
if [ "$SYS" = MACOSX ]; then
ASFLAGS="$ASFLAGS -f macho64 -m amd64 -DPIC -DPREFIX"
if cc_check '' "-arch x86_64"; then
@@ -580,7 +586,11 @@ case $host_cpu in
[ $compiler = GNU ] && cc_check "" "-S" && grep -q "_main:" conftest && ASFLAGS="$ASFLAGS -DPREFIX"
[ $compiler = GNU ] && RCFLAGS="--target=pe-x86-64 $RCFLAGS"
else
- ASFLAGS="$ASFLAGS -f elf -m amd64"
+ if cpp_check "" "" "__ILP32__" ; then
+ AS="${cross_prefix}as"
+ else
+ ASFLAGS="$ASFLAGS -f elf -m amd64"
+ fi
fi
;;
powerpc|powerpc64)