Bug 1195477 - part 2 - pass -no-integrated-as to libffi when building with clang; r=glandium
☠☠ backed out by 9c245b0c0aaf ☠ ☠
authorNathan Froyd <froydnj@gmail.com>
Thu, 23 Jun 2016 17:46:59 -0400
changeset 302475 45a6a74c46ea709d4e6af586e9227f8b626bf595
parent 302474 4f607b7635fdbb054fcf48b89d03dc973ec9cfde
child 302476 8a1a3f39c99bb847bc4c9fa2428fa0bf5e45ebba
push id78751
push usernfroyd@mozilla.com
push dateThu, 23 Jun 2016 13:48:22 +0000
treeherdermozilla-inbound@45a6a74c46ea [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"; 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
 ])