diff -r 58b0e301b78a Modules/_ctypes/libffi/configure --- a/Modules/_ctypes/libffi/configure Thu Apr 25 12:01:36 2013 -0400 +++ b/Modules/_ctypes/libffi/configure Fri Apr 26 15:19:42 2013 +0800 @@ -14505,10 +14505,10 @@ $as_echo_n "(cached) " >&6 else - libffi_cv_as_x86_pcrel=yes + libffi_cv_as_x86_pcrel=no echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then - libffi_cv_as_x86_pcrel=no + libffi_cv_as_x86_pcrel=yes fi fi diff -r 58b0e301b78a Modules/_ctypes/libffi/configure.ac --- a/Modules/_ctypes/libffi/configure.ac Thu Apr 25 12:01:36 2013 -0400 +++ b/Modules/_ctypes/libffi/configure.ac Fri Apr 26 15:19:42 2013 +0800 @@ -367,10 +367,10 @@ if test x$TARGET = xX86 || test x$TARGET = xX86_WIN32 || test x$TARGET = xX86_64; then AC_CACHE_CHECK([assembler supports pc related relocs], libffi_cv_as_x86_pcrel, [ - libffi_cv_as_x86_pcrel=yes + libffi_cv_as_x86_pcrel=no echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then - libffi_cv_as_x86_pcrel=no + libffi_cv_as_x86_pcrel=yes fi ]) if test "x$libffi_cv_as_x86_pcrel" = xyes; then diff -r 58b0e301b78a configure --- a/configure Thu Apr 25 12:01:36 2013 -0400 +++ b/configure Fri Apr 26 15:19:42 2013 +0800 @@ -5599,7 +5599,7 @@ ;; Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*) LDLIBRARY='libpython$(LDVERSION).so' - BLDLIBRARY='-L. -lpython$(LDVERSION)' + BLDLIBRARY='-Wl,-R $(LIBDIR) -L. -lpython$(LDVERSION)' RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} case $ac_sys_system in FreeBSD*) diff -r 58b0e301b78a configure.ac --- a/configure.ac Thu Apr 25 12:01:36 2013 -0400 +++ b/configure.ac Fri Apr 26 15:19:42 2013 +0800 @@ -936,7 +936,7 @@ ;; Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*) LDLIBRARY='libpython$(LDVERSION).so' - BLDLIBRARY='-L. -lpython$(LDVERSION)' + BLDLIBRARY='-Wl,-R $(LIBDIR) -L. -lpython$(LDVERSION)' RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} case $ac_sys_system in FreeBSD*)