Bug 1195477 - part 2 - pass -no-integrated-as to libffi when building with clang; r=glandium
authorNathan Froyd <froydnj@gmail.com>
Tue, 28 Jun 2016 23:48:49 -0400
changeset 303013 7c3a439aee1c9e5a35fe96d9864c0f741ccb6207
parent 303012 0f7edd43d27ecc27622c08c03d1229cdef729339
child 303014 cf1089793debba142296ec204fce66e60e8ae492
push id30379
push usercbook@mozilla.com
push dateWed, 29 Jun 2016 14:13:35 +0000
treeherdermozilla-central@b69a5bbb5e40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1195477
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1195477 - part 2 - pass -no-integrated-as to libffi when building with clang; r=glandium The ARM assembly sources in libffi don't work well with clang's integrated assembler, so disable the integrated assembler for libffi.
build/autoconf/ffi.m4
--- a/build/autoconf/ffi.m4
+++ b/build/autoconf/ffi.m4
@@ -32,16 +32,22 @@ if test "$MOZ_BUILD_APP" != js -o -n "$J
       ac_configure_args="$ac_configure_args --enable-debug"
     fi
     if test "$DSO_PIC_CFLAGS"; then
       ac_configure_args="$ac_configure_args --with-pic"
     fi
     for var in AS CC CXX CPP LD AR RANLIB STRIP; do
       ac_configure_args="$ac_configure_args $var='`eval echo \\${${var}}`'"
     done
+    old_cflags="$CFLAGS"
+    # The libffi sources (especially the ARM ones) are written expecting gas
+    # syntax, and clang's integrated assembler doesn't handle all of gas syntax.
+    if test -n "$CLANG_CC" -a "$CPU_ARCH" = arm; then
+      CFLAGS="-no-integrated-as $CFLAGS"
+    fi
     if test "$CROSS_COMPILE"; then
       export CPPFLAGS CFLAGS LDFLAGS
     fi
     ac_configure_args="$ac_configure_args --build=$build --host=$target"
     if test "$_MSC_VER"; then
       # Use a wrapper script for cl and ml that looks more like gcc.
       # autotools can't quite handle an MSVC build environment yet.
       LDFLAGS=
@@ -72,13 +78,14 @@ if test "$MOZ_BUILD_APP" != js -o -n "$J
 
     # Use a separate cache file for libffi, since it does things differently
     # from our configure.
     old_config_files=$CONFIG_FILES
     unset CONFIG_FILES
     AC_OUTPUT_SUBDIRS(js/src/ctypes/libffi)
     ac_configure_args="$_SUBDIR_CONFIG_ARGS"
     CONFIG_FILES=$old_config_files
+    CFLAGS="$old_cflags"
   fi
 
 fi
 ])