Bug 1330142 - part 2 - move TARGET_XPCOM_ABI to moz.configure; r=chmanchester
☠☠ backed out by 43f7bdbadc7d ☠ ☠
authorNathan Froyd <froydnj@mozilla.com>
Tue, 03 Oct 2017 10:33:44 -0500
changeset 437462 a4914a29fb2677cb0fa935ca0482ae6a7f4ff556
parent 437461 e3914113117f9fd4a27ff89cac8513717a72d6ac
child 437463 43f7bdbadc7d68b32d0e321720a27f9936cd35a9
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschmanchester
bugs1330142
milestone58.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 1330142 - part 2 - move TARGET_XPCOM_ABI to moz.configure; r=chmanchester Nothing in js/ uses TARGET_XPCOM_ABI, so the code in js's configure is dead. Since TARGET_XPCOM_ABI is a Gecko-only thing, the reasonable place for it is toolkit/moz.configure. TARGET_XPCOM depends on TARGET_COMPILER_ABI, and the value of TARGET_COMPILER_ABI is easily derivable from the current target and compiler. The only notable change we make in the conversion to moz.configure is that the ARM old-ABI is no longer supported by any of our current targets: Android and Linux for ARM targets are both exclusively EABI nowadays, so we have one less case to worry about. TARGET_COMPILER_ABI's sole purpose was to provide information for TARGET_XPCOM_ABI, and since we are deriving TARGET_XPCOM_ABI exclusively inside moz.configure, we can remove TARGET_COMPILER_ABI.
js/src/old-configure.in
old-configure.in
toolkit/moz.configure
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -642,17 +642,16 @@ case "$target" in
         RCFLAGS='-O coff --use-temp-file'
         # mingw doesn't require kernel32, user32, and advapi32 explicitly
         LIBS="$LIBS -lgdi32 -lwinmm -lwsock32"
         MOZ_FIX_LINK_PATHS=
 
         WIN32_CONSOLE_EXE_LDFLAGS=-mconsole
         WIN32_GUI_EXE_LDFLAGS=-mwindows
     else
-        TARGET_COMPILER_ABI=msvc
         HOST_CC='$(CC)'
         HOST_CXX='$(CXX)'
         if test "$AS_BIN"; then
             AS="$(basename "$AS_BIN")"
         fi
         AR='lib'
         AR_FLAGS='-NOLOGO -OUT:$@'
         AR_EXTRACT=
@@ -1230,42 +1229,16 @@ if test "x$ac_cv_va_val_copy" = "xno"; t
 fi
 
 dnl ===================================================================
 dnl ========================================================
 dnl Put your C++ language/feature checks below
 dnl ========================================================
 AC_LANG_CPLUSPLUS
 
-ARM_ABI_PREFIX=
-if test "$GNU_CC"; then
-  if test "$CPU_ARCH" = "arm" ; then
-    AC_CACHE_CHECK(for ARM EABI,
-        ac_cv_gcc_arm_eabi,
-        [AC_TRY_COMPILE([],
-                        [
-#if defined(__ARM_EABI__)
-  return 0;
-#else
-#error Not ARM EABI.
-#endif
-                        ],
-                        ac_cv_gcc_arm_eabi="yes",
-                        ac_cv_gcc_arm_eabi="no")])
-    if test "$ac_cv_gcc_arm_eabi" = "yes"; then
-        HAVE_ARM_EABI=1
-        ARM_ABI_PREFIX=eabi-
-    else
-        ARM_ABI_PREFIX=oabi-
-    fi
-  fi
-
-  TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
-fi
-
 dnl See if a dynamic_cast to void* gives the most derived object.
 AC_CACHE_CHECK(for C++ dynamic_cast to void*,
                ac_cv_cpp_dynamic_cast_void_ptr,
                [AC_TRY_RUN([class X { int i; public: virtual ~X() { } };
                             class Y { int j; public: virtual ~Y() { } };
                             class Z : public X, public Y { int k; };
 
                             int main() {
@@ -1334,21 +1307,16 @@ AC_CACHE_CHECK(for LC_MESSAGES,
 				ac_cv_i18n_lc_messages=no)])
 if test "$ac_cv_i18n_lc_messages" = yes; then
    AC_DEFINE(HAVE_I18N_LC_MESSAGES)
 fi
 
 AC_HAVE_FUNCS(localeconv)
 fi # ! SKIP_COMPILER_CHECKS
 
-TARGET_XPCOM_ABI=
-if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
-    TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
-fi
-
 dnl We can't run TRY_COMPILE tests on Windows, so hard-code some
 dnl features that Windows actually does support.
 
 if test -n "$SKIP_COMPILER_CHECKS"; then
    dnl Windows has malloc.h
    AC_DEFINE(MALLOC_H, [<malloc.h>])
    AC_DEFINE(HAVE_FORCEINLINE)
    AC_DEFINE(HAVE_LOCALECONV)
@@ -2028,18 +1996,16 @@ AC_SUBST(HOST_CPPFLAGS)
 AC_SUBST(HOST_CXXFLAGS)
 AC_SUBST(HOST_LDFLAGS)
 AC_SUBST(HOST_OPTIMIZE_FLAGS)
 AC_SUBST(HOST_AR)
 AC_SUBST(HOST_AR_FLAGS)
 AC_SUBST(HOST_RANLIB)
 AC_SUBST(HOST_BIN_SUFFIX)
 
-AC_SUBST(TARGET_XPCOM_ABI)
-
 AC_SUBST(WRAP_LDFLAGS)
 AC_SUBST(MKSHLIB)
 AC_SUBST(MKCSHLIB)
 AC_SUBST(DSO_CFLAGS)
 AC_SUBST(DSO_PIC_CFLAGS)
 AC_SUBST(DSO_LDOPTS)
 AC_SUBST(BIN_SUFFIX)
 AC_SUBST(USE_N32)
--- a/old-configure.in
+++ b/old-configure.in
@@ -874,17 +874,16 @@ case "$target" in
         WIN32_GUI_EXE_LDFLAGS=-mwindows
 
         # GCC/binutils can't link to a function if we try to include dllexport function
         # in the same library as dllimport caller. To work around it, we build NSPR
         # and NSS with -mnop-fun-dllimport flag. The drawback of this solution is that
         # function thunks need to be generated for cross-DLL calls.
         MOZ_FOLD_LIBS_FLAGS="-mnop-fun-dllimport"
     else
-        TARGET_COMPILER_ABI=msvc
         if test "$AS_BIN"; then
             AS="$(basename "$AS_BIN")"
         fi
         AR='lib'
         AR_FLAGS='-NOLOGO -OUT:$@'
         AR_EXTRACT=
         RANLIB='echo not_ranlib'
         STRIP='echo not_strip'
@@ -1642,42 +1641,16 @@ if test "x$ac_cv_va_val_copy" = "xno"; t
 fi
 
 dnl ===================================================================
 dnl ========================================================
 dnl Put your C++ language/feature checks below
 dnl ========================================================
 AC_LANG_CPLUSPLUS
 
-ARM_ABI_PREFIX=
-if test "$GNU_CC"; then
-  if test "$CPU_ARCH" = "arm" ; then
-    AC_CACHE_CHECK(for ARM EABI,
-        ac_cv_gcc_arm_eabi,
-        [AC_TRY_COMPILE([],
-                        [
-#if defined(__ARM_EABI__)
-  return 0;
-#else
-#error Not ARM EABI.
-#endif
-                        ],
-                        ac_cv_gcc_arm_eabi="yes",
-                        ac_cv_gcc_arm_eabi="no")])
-    if test "$ac_cv_gcc_arm_eabi" = "yes"; then
-        HAVE_ARM_EABI=1
-        ARM_ABI_PREFIX=eabi-
-    else
-        ARM_ABI_PREFIX=oabi-
-    fi
-  fi
-
-  TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
-fi
-
 dnl See if a dynamic_cast to void* gives the most derived object.
 AC_CACHE_CHECK(for C++ dynamic_cast to void*,
                ac_cv_cpp_dynamic_cast_void_ptr,
                [AC_TRY_RUN([class X { int i; public: virtual ~X() { } };
                             class Y { int j; public: virtual ~Y() { } };
                             class Z : public X, public Y { int k; };
 
                             int main() {
@@ -1811,22 +1784,16 @@ fi
 AC_HAVE_FUNCS(localeconv)
 
 fi # ! SKIP_COMPILER_CHECKS
 
 if test -n "${COMPILE_ENVIRONMENT}"; then
   MOZ_CHECK_ALLOCATOR
 fi
 
-TARGET_XPCOM_ABI=
-if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
-    TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
-    AC_DEFINE_UNQUOTED(TARGET_XPCOM_ABI, ["${TARGET_XPCOM_ABI}"])
-fi
-
 dnl We can't run TRY_COMPILE tests on Windows, so hard-code some
 dnl features that Windows actually does support.
 
 if test -n "$SKIP_COMPILER_CHECKS"; then
    dnl Windows has malloc.h
    AC_DEFINE(MALLOC_H, [<malloc.h>])
    AC_DEFINE(HAVE_FORCEINLINE)
    AC_DEFINE(HAVE_LOCALECONV)
@@ -4834,17 +4801,16 @@ AC_SUBST(HOST_CPPFLAGS)
 AC_SUBST(HOST_CXXFLAGS)
 AC_SUBST(HOST_LDFLAGS)
 AC_SUBST(HOST_OPTIMIZE_FLAGS)
 AC_SUBST(HOST_AR)
 AC_SUBST(HOST_AR_FLAGS)
 AC_SUBST(HOST_RANLIB)
 AC_SUBST(HOST_BIN_SUFFIX)
 
-AC_SUBST(TARGET_XPCOM_ABI)
 AC_SUBST(HAVE_TOOLCHAIN_SUPPORT_MSSSE3)
 AC_SUBST(HAVE_TOOLCHAIN_SUPPORT_MSSE4_1)
 AC_SUBST(HAVE_X86_AVX2)
 AC_SUBST(HAVE_ALTIVEC)
 AC_SUBST(GCC_USE_GNU_LD)
 
 AC_SUBST(WRAP_LDFLAGS)
 AC_SUBST(MKSHLIB)
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -1221,8 +1221,28 @@ option('--enable-address-sanitizer-repor
 
 @depends('--enable-address-sanitizer-reporter')
 def enable_asan_reporter(value):
     if value:
         return True
 
 set_config('MOZ_ASAN_REPORTER', enable_asan_reporter)
 set_define('MOZ_ASAN_REPORTER', enable_asan_reporter)
+
+@depends(target, c_compiler)
+def xpcom_abi(target, c_compiler):
+    if not c_compiler:
+        return ''
+
+    if c_compiler.type in ('msvc', 'clang-cl'):
+        assert target.kernel == 'WINNT'
+        return '%s-msvc' % target.cpu
+
+    assert c_compiler.type in ('gcc', 'clang')
+    # Everything else uses the gcc ABI.
+    return '%s-gcc3' % ('arm-eabi' if target.cpu == 'arm' else target.cpu,)
+
+@depends(xpcom_abi)
+def xpcom_abi_quoted(abi):
+    return '"%s"' % abi
+
+set_config('TARGET_XPCOM_ABI', xpcom_abi)
+set_define('TARGET_XPCOM_ABI', xpcom_abi_quoted)