mozilla-disable-neon-option.patch
changeset 371 ead21d122ed0
child 382 67f876aafae8
equal deleted inserted replaced
370:fb2107b60ba2 371:ead21d122ed0
       
     1 # HG changeset patch
       
     2 # User Joop Boonen <joop.boonen@opensuse.org>
       
     3 # Parent be20a0ae420eb2b3584ce2c5d241e2817bac8593
       
     4 Add configure option to allow disabling of neon.
       
     5 
       
     6 diff --git a/configure.in b/configure.in
       
     7 --- a/configure.in
       
     8 +++ b/configure.in
       
     9 @@ -1674,41 +1674,47 @@ if test -n "$all_flags"; then
       
    10      ASFLAGS="$ASFLAGS $all_flags"
       
    11      if test -n "$thumb_flag"; then
       
    12          LDFLAGS="$LDFLAGS $thumb_flag"
       
    13      fi
       
    14  fi
       
    15  
       
    16  AC_SUBST(MOZ_THUMB2)
       
    17  
       
    18 -if test "$CPU_ARCH" = "arm"; then
       
    19 -  AC_MSG_CHECKING(for ARM SIMD support in compiler)
       
    20 -  # We try to link so that this also fails when
       
    21 -  # building with LTO.
       
    22 -  AC_TRY_LINK([],
       
    23 -                 [asm("uqadd8 r1, r1, r2");],
       
    24 -                 result="yes", result="no")
       
    25 -  AC_MSG_RESULT("$result")
       
    26 -  if test "$result" = "yes"; then
       
    27 -      AC_DEFINE(HAVE_ARM_SIMD)
       
    28 -      HAVE_ARM_SIMD=1
       
    29 -  fi
       
    30 -
       
    31 -  AC_MSG_CHECKING(for ARM NEON support in compiler)
       
    32 -  # We try to link so that this also fails when
       
    33 -  # building with LTO.
       
    34 -  AC_TRY_LINK([],
       
    35 -                 [asm(".fpu neon\n vadd.i8 d0, d0, d0");],
       
    36 -                 result="yes", result="no")
       
    37 -  AC_MSG_RESULT("$result")
       
    38 -  if test "$result" = "yes"; then
       
    39 -      AC_DEFINE(HAVE_ARM_NEON)
       
    40 -      HAVE_ARM_NEON=1
       
    41 -  fi
       
    42 -fi # CPU_ARCH = arm
       
    43 +MOZ_ARG_DISABLE_BOOL(neon,
       
    44 +[  --disable-neon       Disable neon extensions],
       
    45 +    NS_DISABLE_NEON=1,
       
    46 +    NS_DISABLE_NEON= )
       
    47 +if test "$NS_DISABLE_NEON" != "1"; then
       
    48 +  if test "$CPU_ARCH" = "arm"; then
       
    49 +    AC_MSG_CHECKING(for ARM SIMD support in compiler)
       
    50 +    # We try to link so that this also fails when
       
    51 +    # building with LTO.
       
    52 +    AC_TRY_LINK([],
       
    53 +                   [asm("uqadd8 r1, r1, r2");],
       
    54 +                   result="yes", result="no")
       
    55 +    AC_MSG_RESULT("$result")
       
    56 +    if test "$result" = "yes"; then
       
    57 +        AC_DEFINE(HAVE_ARM_SIMD)
       
    58 +        HAVE_ARM_SIMD=1
       
    59 +    fi
       
    60 +
       
    61 +    AC_MSG_CHECKING(for ARM NEON support in compiler)
       
    62 +    # We try to link so that this also fails when
       
    63 +    # building with LTO.
       
    64 +    AC_TRY_LINK([],
       
    65 +                   [asm(".fpu neon\n vadd.i8 d0, d0, d0");],
       
    66 +                   result="yes", result="no")
       
    67 +    AC_MSG_RESULT("$result")
       
    68 +    if test "$result" = "yes"; then
       
    69 +        AC_DEFINE(HAVE_ARM_NEON)
       
    70 +        HAVE_ARM_NEON=1
       
    71 +    fi
       
    72 +  fi # CPU_ARCH = arm
       
    73 +fi
       
    74  
       
    75  AC_SUBST(HAVE_ARM_SIMD)
       
    76  AC_SUBST(HAVE_ARM_NEON)
       
    77  
       
    78  dnl ========================================================
       
    79  dnl Android libstdc++, placed here so it can use MOZ_ARCH
       
    80  dnl computed above.
       
    81  dnl ========================================================
       
    82 diff --git a/js/src/configure.in b/js/src/configure.in
       
    83 --- a/js/src/configure.in
       
    84 +++ b/js/src/configure.in
       
    85 @@ -1604,41 +1604,47 @@ if test -n "$all_flags"; then
       
    86      ASFLAGS="$ASFLAGS $all_flags"
       
    87      if test -n "$thumb_flag"; then
       
    88          LDFLAGS="$LDFLAGS $thumb_flag"
       
    89      fi
       
    90  fi
       
    91  
       
    92  AC_SUBST(MOZ_THUMB2)
       
    93  
       
    94 -if test "$CPU_ARCH" = "arm"; then
       
    95 -  AC_MSG_CHECKING(for ARM SIMD support in compiler)
       
    96 -  # We try to link so that this also fails when
       
    97 -  # building with LTO.
       
    98 -  AC_TRY_LINK([],
       
    99 -                 [asm("uqadd8 r1, r1, r2");],
       
   100 -                 result="yes", result="no")
       
   101 -  AC_MSG_RESULT("$result")
       
   102 -  if test "$result" = "yes"; then
       
   103 -      AC_DEFINE(HAVE_ARM_SIMD)
       
   104 -      HAVE_ARM_SIMD=1
       
   105 -  fi
       
   106 -
       
   107 -  AC_MSG_CHECKING(for ARM NEON support in compiler)
       
   108 -  # We try to link so that this also fails when
       
   109 -  # building with LTO.
       
   110 -  AC_TRY_LINK([],
       
   111 -                 [asm(".fpu neon\n vadd.i8 d0, d0, d0");],
       
   112 -                 result="yes", result="no")
       
   113 -  AC_MSG_RESULT("$result")
       
   114 -  if test "$result" = "yes"; then
       
   115 -      AC_DEFINE(HAVE_ARM_NEON)
       
   116 -      HAVE_ARM_NEON=1
       
   117 -  fi
       
   118 -fi # CPU_ARCH = arm
       
   119 +MOZ_ARG_DISABLE_BOOL(neon,
       
   120 +[  --disable-neon       Disable neon extensions],
       
   121 +    NS_DISABLE_NEON=1,
       
   122 +    NS_DISABLE_NEON= )
       
   123 +if test "$NS_DISABLE_NEON" != "1"; then
       
   124 +  if test "$CPU_ARCH" = "arm"; then
       
   125 +    AC_MSG_CHECKING(for ARM SIMD support in compiler)
       
   126 +    # We try to link so that this also fails when
       
   127 +    # building with LTO.
       
   128 +    AC_TRY_LINK([],
       
   129 +                   [asm("uqadd8 r1, r1, r2");],
       
   130 +                   result="yes", result="no")
       
   131 +    AC_MSG_RESULT("$result")
       
   132 +    if test "$result" = "yes"; then
       
   133 +        AC_DEFINE(HAVE_ARM_SIMD)
       
   134 +        HAVE_ARM_SIMD=1
       
   135 +    fi
       
   136 +
       
   137 +    AC_MSG_CHECKING(for ARM NEON support in compiler)
       
   138 +    # We try to link so that this also fails when
       
   139 +    # building with LTO.
       
   140 +    AC_TRY_LINK([],
       
   141 +                   [asm(".fpu neon\n vadd.i8 d0, d0, d0");],
       
   142 +                   result="yes", result="no")
       
   143 +    AC_MSG_RESULT("$result")
       
   144 +    if test "$result" = "yes"; then
       
   145 +        AC_DEFINE(HAVE_ARM_NEON)
       
   146 +        HAVE_ARM_NEON=1
       
   147 +    fi
       
   148 +  fi # CPU_ARCH = arm
       
   149 +fi
       
   150  
       
   151  AC_SUBST(HAVE_ARM_SIMD)
       
   152  AC_SUBST(HAVE_ARM_NEON)
       
   153  
       
   154  dnl ========================================================
       
   155  dnl Android libstdc++, placed here so it can use MOZ_ARCH
       
   156  dnl computed above.
       
   157  dnl ========================================================