Skip to content

Commit 21ef383

Browse files
author
hyeshik.chang
committed
Fix build on MIPS for libffi. I haven't tested this yet because I
don't have an access on MIPS machines. Will be tested by buildbot. :) git-svn-id: http://svn.python.org/projects/python/trunk@45735 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 76c0b25 commit 21ef383

4 files changed

Lines changed: 15 additions & 2 deletions

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ Build
156156

157157
- Patch #1429775: Link extension modules with the shared libpython.
158158

159+
- Fixed a libffi build problem on MIPS systems.
160+
159161
C API
160162
-----
161163

Modules/_ctypes/libffi/configure

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ ac_includes_default="\
310310
# include <unistd.h>
311311
#endif"
312312

313-
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC ac_ct_CC EXEEXT OBJEXT CFLAGS CPP CPPFLAGS EGREP ALLOCA HAVE_LONG_DOUBLE TARGET TARGETDIR LIBOBJS LTLIBOBJS'
313+
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC ac_ct_CC EXEEXT OBJEXT CFLAGS CPP CPPFLAGS EGREP ALLOCA HAVE_LONG_DOUBLE TARGET TARGETDIR MKTARGET LIBOBJS LTLIBOBJS'
314314
ac_subst_files=''
315315

316316
# Initialize some variables set by options.
@@ -3534,6 +3534,8 @@ echo "$as_me: error: \"libffi has not been ported to $host.\"" >&2;}
35343534
{ (exit 1); exit 1; }; }
35353535
fi
35363536
3537+
MKTARGET=$TARGET
3538+
35373539
case x$TARGET in
35383540
xMIPS*) TARGET=MIPS ;;
35393541
*) ;;
@@ -5457,6 +5459,7 @@ fi
54575459
54585460
54595461
5462+
54605463
cat >>confdefs.h <<\_ACEOF
54615464
#define FFI_NO_RAW_API 1
54625465
_ACEOF
@@ -6129,6 +6132,7 @@ s,@ALLOCA@,$ALLOCA,;t t
61296132
s,@HAVE_LONG_DOUBLE@,$HAVE_LONG_DOUBLE,;t t
61306133
s,@TARGET@,$TARGET,;t t
61316134
s,@TARGETDIR@,$TARGETDIR,;t t
6135+
s,@MKTARGET@,$MKTARGET,;t t
61326136
s,@LIBOBJS@,$LIBOBJS,;t t
61336137
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
61346138
CEOF

Modules/_ctypes/libffi/configure.ac

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ if test $TARGETDIR = unknown; then
7070
AC_MSG_ERROR(["libffi has not been ported to $host."])
7171
fi
7272

73+
dnl libffi changes TARGET for MIPS to define a such macro in the header
74+
dnl while MIPS_IRIX or MIPS_LINUX is separatedly used to decide which
75+
dnl files will be compiled. So, we need to keep the original decision
76+
dnl of TARGET to use in fficonfig.py.in.
77+
MKTARGET=$TARGET
78+
7379
case x$TARGET in
7480
xMIPS*) TARGET=MIPS ;;
7581
*) ;;
@@ -183,6 +189,7 @@ AH_BOTTOM([
183189

184190
AC_SUBST(TARGET)
185191
AC_SUBST(TARGETDIR)
192+
AC_SUBST(MKTARGET)
186193

187194
AC_SUBST(SHELL)
188195

Modules/_ctypes/libffi/fficonfig.py.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ ffi_platforms = {
2727
}
2828

2929
ffi_srcdir = '@srcdir@'
30-
ffi_sources += ffi_platforms['@TARGET@']
30+
ffi_sources += ffi_platforms['@MKTARGET@']
3131
ffi_sources = [os.path.join('@srcdir@', f) for f in ffi_sources]
3232

3333
ffi_cflags = '@CFLAGS@'

0 commit comments

Comments
 (0)