Skip to content

Commit

Permalink
Fix darwin11 build problem
Browse files Browse the repository at this point in the history
  • Loading branch information
atgreen committed Nov 12, 2011
1 parent c411f14 commit 236c939
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 45 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Expand Up @@ -2,6 +2,9 @@

* m4/ax_enable_builddir: Change from string comparison to numeric
comparison for wc output.
* configure.ac: Enable FFI_MMAP_EXEC_WRIT for darwin11 aka Mac OS
X 10.7.
* configure: Rebuilt.

2011-11-10 Richard Henderson <rth@redhat.com>

Expand Down
48 changes: 4 additions & 44 deletions configure
Expand Up @@ -12240,45 +12240,6 @@ $as_echo "$icc_archflag" >&6; }
# default optimization flags for gcc on all systems
CFLAGS="-O3 -fomit-frame-pointer"

# -malign-double for x86 systems
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -malign-double" >&5
$as_echo_n "checking whether C compiler accepts -malign-double... " >&6; }
if ${ax_cv_c_flags__malign_double+:} false; then :
$as_echo_n "(cached) " >&6
else

ax_save_FLAGS=$CFLAGS
CFLAGS="-malign-double"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ax_cv_c_flags__malign_double=yes
else
ax_cv_c_flags__malign_double=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS=$ax_save_FLAGS
fi

eval ax_check_compiler_flags=$ax_cv_c_flags__malign_double
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5
$as_echo "$ax_check_compiler_flags" >&6; }
if test "x$ax_check_compiler_flags" = xyes; then
CFLAGS="$CFLAGS -malign-double"
else
:
fi


# -fstrict-aliasing for gcc-2.95+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fstrict-aliasing" >&5
$as_echo_n "checking whether C compiler accepts -fstrict-aliasing... " >&6; }
Expand Down Expand Up @@ -12318,7 +12279,6 @@ else
fi


# note that we enable "unsafe" fp optimization with other compilers, too
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -ffast-math" >&5
$as_echo_n "checking whether C compiler accepts -ffast-math... " >&6; }
if ${ax_cv_c_flags__ffast_math+:} false; then :
Expand Down Expand Up @@ -13105,7 +13065,7 @@ case "$host" in
TARGET=FRV; TARGETDIR=frv
;;
hppa*-*-linux* | parisc*-*-linux*)
hppa*-*-linux* | parisc*-*-linux* | hppa*-*-openbsd*)
TARGET=PA_LINUX; TARGETDIR=pa
;;
hppa*64-*-hpux*)
Expand Down Expand Up @@ -13155,7 +13115,7 @@ case "$host" in
mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
TARGET=MIPS; TARGETDIR=mips
;;
mips*-*-linux*)
mips*-*-linux* | mips*-*-openbsd*)
# Support 128-bit long double for NewABI.
HAVE_LONG_DOUBLE='defined(__mips64)'
TARGET=MIPS; TARGETDIR=mips
Expand All @@ -13177,7 +13137,7 @@ case "$host" in
powerpc-*-aix* | rs6000-*-aix*)
TARGET=POWERPC_AIX; TARGETDIR=powerpc
;;
powerpc-*-freebsd*)
powerpc-*-freebsd* | powerpc-*-openbsd*)
TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
;;
powerpc64-*-freebsd*)
Expand Down Expand Up @@ -14337,7 +14297,7 @@ case "$target" in
$as_echo "#define FFI_EXEC_TRAMPOLINE_TABLE 1" >>confdefs.h
;;
*-apple-darwin10* | *-*-freebsd* | *-*-openbsd* | *-pc-solaris*)
*-apple-darwin1[10]* | *-*-freebsd* | *-*-openbsd* | *-pc-solaris*)
$as_echo "#define FFI_MMAP_EXEC_WRIT 1" >>confdefs.h
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -339,7 +339,7 @@ case "$target" in
[Cannot use PROT_EXEC on this target, so, we revert to
alternative means])
;;
*-apple-darwin10* | *-*-freebsd* | *-*-openbsd* | *-pc-solaris*)
*-apple-darwin1[[10]]* | *-*-freebsd* | *-*-openbsd* | *-pc-solaris*)
AC_DEFINE(FFI_MMAP_EXEC_WRIT, 1,
[Cannot use malloc on this target, so, we revert to
alternative means])
Expand Down
121 changes: 121 additions & 0 deletions patches/darwin11
@@ -0,0 +1,121 @@
Index: libffi/ChangeLog
===================================================================
--- libffi.orig/ChangeLog
+++ libffi/ChangeLog
@@ -2,6 +2,9 @@

* m4/ax_enable_builddir: Change from string comparison to numeric
comparison for wc output.
+ * configure.ac: Enable FFI_MMAP_EXEC_WRIT for darwin11 aka Mac OS
+ X 10.7.
+ * configure: Rebuilt.

2011-11-10 Richard Henderson <rth@redhat.com>

Index: libffi/configure
===================================================================
--- libffi.orig/configure
+++ libffi/configure
@@ -12240,45 +12240,6 @@ $as_echo "$icc_archflag" >&6; }
# default optimization flags for gcc on all systems
CFLAGS="-O3 -fomit-frame-pointer"

- # -malign-double for x86 systems
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -malign-double" >&5
-$as_echo_n "checking whether C compiler accepts -malign-double... " >&6; }
-if ${ax_cv_c_flags__malign_double+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- ax_save_FLAGS=$CFLAGS
- CFLAGS="-malign-double"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ax_cv_c_flags__malign_double=yes
-else
- ax_cv_c_flags__malign_double=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS=$ax_save_FLAGS
-fi
-
-eval ax_check_compiler_flags=$ax_cv_c_flags__malign_double
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_compiler_flags" >&5
-$as_echo "$ax_check_compiler_flags" >&6; }
-if test "x$ax_check_compiler_flags" = xyes; then
- CFLAGS="$CFLAGS -malign-double"
-else
- :
-fi
-
-
# -fstrict-aliasing for gcc-2.95+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fstrict-aliasing" >&5
$as_echo_n "checking whether C compiler accepts -fstrict-aliasing... " >&6; }
@@ -12318,7 +12279,6 @@ else
fi


- # note that we enable "unsafe" fp optimization with other compilers, too
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -ffast-math" >&5
$as_echo_n "checking whether C compiler accepts -ffast-math... " >&6; }
if ${ax_cv_c_flags__ffast_math+:} false; then :
@@ -13105,7 +13065,7 @@ case "$host" in
TARGET=FRV; TARGETDIR=frv
;;

- hppa*-*-linux* | parisc*-*-linux*)
+ hppa*-*-linux* | parisc*-*-linux* | hppa*-*-openbsd*)
TARGET=PA_LINUX; TARGETDIR=pa
;;
hppa*64-*-hpux*)
@@ -13155,7 +13115,7 @@ case "$host" in
mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
TARGET=MIPS; TARGETDIR=mips
;;
- mips*-*-linux*)
+ mips*-*-linux* | mips*-*-openbsd*)
# Support 128-bit long double for NewABI.
HAVE_LONG_DOUBLE='defined(__mips64)'
TARGET=MIPS; TARGETDIR=mips
@@ -13177,7 +13137,7 @@ case "$host" in
powerpc-*-aix* | rs6000-*-aix*)
TARGET=POWERPC_AIX; TARGETDIR=powerpc
;;
- powerpc-*-freebsd*)
+ powerpc-*-freebsd* | powerpc-*-openbsd*)
TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
;;
powerpc64-*-freebsd*)
@@ -14337,7 +14297,7 @@ case "$target" in
$as_echo "#define FFI_EXEC_TRAMPOLINE_TABLE 1" >>confdefs.h

;;
- *-apple-darwin10* | *-*-freebsd* | *-*-openbsd* | *-pc-solaris*)
+ *-apple-darwin1[10]* | *-*-freebsd* | *-*-openbsd* | *-pc-solaris*)

$as_echo "#define FFI_MMAP_EXEC_WRIT 1" >>confdefs.h

Index: libffi/configure.ac
===================================================================
--- libffi.orig/configure.ac
+++ libffi/configure.ac
@@ -339,7 +339,7 @@ case "$target" in
[Cannot use PROT_EXEC on this target, so, we revert to
alternative means])
;;
- *-apple-darwin10* | *-*-freebsd* | *-*-openbsd* | *-pc-solaris*)
+ *-apple-darwin1[[10]]* | *-*-freebsd* | *-*-openbsd* | *-pc-solaris*)
AC_DEFINE(FFI_MMAP_EXEC_WRIT, 1,
[Cannot use malloc on this target, so, we revert to
alternative means])
1 change: 1 addition & 0 deletions patches/series
Expand Up @@ -27,6 +27,7 @@ fix-ppc32
darwin-EH-fix
more-openbsd
more-openbsd-mips
darwin11
minix

interix-patch
Expand Down

0 comments on commit 236c939

Please sign in to comment.