зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1899097 - No longer use GNU_CC CLANG_CC and the likes in old-configure r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D211719
This commit is contained in:
Родитель
6193636f9b
Коммит
4c80e08fec
|
@ -38,7 +38,7 @@ if test -n "$ENABLE_CLANG_PLUGIN"; then
|
|||
CLANG_LDFLAGS="-lclangASTMatchers"
|
||||
fi
|
||||
|
||||
if test -n "$CLANG_CL"; then
|
||||
if test "$CC_TYPE" = clang-cl ; then
|
||||
dnl The llvm-config coming with clang-cl may give us arguments in the
|
||||
dnl /ARG form, which in msys will be interpreted as a path name. So we
|
||||
dnl need to split the args and convert the leading slashes that we find
|
||||
|
|
|
@ -11,7 +11,7 @@ dnl ========================================================
|
|||
dnl = Identical Code Folding
|
||||
dnl ========================================================
|
||||
|
||||
if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -z "$MOZ_DISABLE_ICF" -a -z "$DEVELOPER_OPTIONS"; then
|
||||
if test "$CC_TYPE" != "clang-cl" -a "$GCC_USE_GNU_LD" -a -z "$MOZ_DISABLE_ICF" -a -z "$DEVELOPER_OPTIONS"; then
|
||||
AC_CACHE_CHECK([whether the linker supports Identical Code Folding],
|
||||
moz_cv_opt_ld_supports_icf,
|
||||
[echo 'int foo() {return 42;}' \
|
||||
|
@ -77,7 +77,7 @@ dnl ========================================================
|
|||
dnl = Automatically remove dead symbols
|
||||
dnl ========================================================
|
||||
|
||||
if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -z "$DEVELOPER_OPTIONS" -a -z "$MOZ_PROFILE_GENERATE" -a -z "$SANCOV"; then
|
||||
if test "$CC_TYPE" != clang-cl -a "$GCC_USE_GNU_LD" -a -z "$DEVELOPER_OPTIONS" -a -z "$MOZ_PROFILE_GENERATE" -a -z "$SANCOV"; then
|
||||
if test -n "$MOZ_DEBUG_FLAGS"; then
|
||||
dnl See bug 670659
|
||||
AC_CACHE_CHECK([whether removing dead symbols breaks debugging],
|
||||
|
@ -107,7 +107,7 @@ if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -z "$DEVELOPER_OPTIONS" -a -z "$MOZ_PR
|
|||
fi
|
||||
fi
|
||||
|
||||
if test "$GNU_CC$CLANG_CC"; then
|
||||
if test "$CC_TYPE" != clang-cl ; then
|
||||
case "${OS_TARGET}" in
|
||||
Darwin|WASI)
|
||||
# It's the default on those targets, and clang complains about -pie
|
||||
|
|
|
@ -8,7 +8,7 @@ dnl ========================================================
|
|||
dnl = Use Address Sanitizer
|
||||
dnl ========================================================
|
||||
if test -n "$MOZ_ASAN"; then
|
||||
if test -n "$CLANG_CL"; then
|
||||
if test "$CC_TYPE" = clang-cl ; then
|
||||
# Look for the ASan runtime binary
|
||||
if test "$TARGET_CPU" = "x86_64"; then
|
||||
MOZ_CLANG_RT_ASAN_LIB=clang_rt.asan_dynamic-x86_64.dll
|
||||
|
@ -37,7 +37,7 @@ if test -n "$MOZ_ASAN"; then
|
|||
fi
|
||||
CFLAGS="$ASAN_FLAGS $CFLAGS"
|
||||
CXXFLAGS="$ASAN_FLAGS $CXXFLAGS"
|
||||
if test -z "$CLANG_CL"; then
|
||||
if test "$CC_TYPE" != clang-cl ; then
|
||||
LDFLAGS="-fsanitize=address -rdynamic $LDFLAGS"
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -142,7 +142,7 @@ case "$target" in
|
|||
if test "$res" != "yes"; then
|
||||
AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
|
||||
fi
|
||||
fi # !GNU_CC
|
||||
fi
|
||||
|
||||
AC_DEFINE(_USE_MATH_DEFINES) # Otherwise Windows' math.h doesn't #define M_PI.
|
||||
|
||||
|
@ -161,9 +161,6 @@ fi
|
|||
|
||||
fi # COMPILE_ENVIRONMENT
|
||||
|
||||
AC_SUBST(GNU_CC)
|
||||
AC_SUBST(GNU_CXX)
|
||||
|
||||
dnl ========================================================
|
||||
dnl set the defaults first
|
||||
dnl ========================================================
|
||||
|
@ -178,7 +175,7 @@ MOZ_CONFIG_SANITIZE
|
|||
dnl ========================================================
|
||||
dnl GNU specific defaults
|
||||
dnl ========================================================
|
||||
if test "$GNU_CC"; then
|
||||
if test "$CC_TYPE" != clang-cl ; then
|
||||
DSO_LDOPTS='-shared'
|
||||
if test "$GCC_USE_GNU_LD"; then
|
||||
# Some tools like ASan use a runtime library that is only
|
||||
|
@ -198,7 +195,7 @@ if test "$GNU_CC"; then
|
|||
_DEFINES_CFLAGS="-include $jsconfdefs -DMOZILLA_CLIENT"
|
||||
fi
|
||||
|
||||
if test "$GNU_CXX"; then
|
||||
if test "$CC_TYPE" != clang-cl ; then
|
||||
_DEFINES_CXXFLAGS="-DMOZILLA_CLIENT -include $jsconfdefs"
|
||||
fi
|
||||
|
||||
|
@ -262,16 +259,14 @@ case "$target" in
|
|||
|
||||
*-android*|*-linuxandroid*)
|
||||
MOZ_OPTIMIZE_FLAGS="-O3"
|
||||
if test -z "$CLANG_CC"; then
|
||||
if test "$CC_TYPE" == gcc ; then
|
||||
MOZ_OPTIMIZE_FLAGS="-fno-reorder-functions $MOZ_OPTIMIZE_FLAGS"
|
||||
fi
|
||||
;;
|
||||
|
||||
*-*linux*)
|
||||
if test "$GNU_CC" -o "$GNU_CXX"; then
|
||||
MOZ_PGO_OPTIMIZE_FLAGS="-O3"
|
||||
MOZ_OPTIMIZE_FLAGS="-O3"
|
||||
fi
|
||||
MOZ_PGO_OPTIMIZE_FLAGS="-O3"
|
||||
MOZ_OPTIMIZE_FLAGS="-O3"
|
||||
|
||||
case "${target_cpu}" in
|
||||
alpha*)
|
||||
|
@ -283,9 +278,9 @@ case "$target" in
|
|||
|
||||
*-mingw*)
|
||||
DSO_PIC_CFLAGS=
|
||||
if test -n "$GNU_CC" -o -n "$CLANG_CC"; then
|
||||
# $GNU_CC will match gcc and clang; while $CLANG_CC will match only clang
|
||||
if test -z "$CLANG_CC"; then
|
||||
if test -n "$CC_TYPE" != clang-cl ; then
|
||||
# != clang-cl will match gcc and clang
|
||||
if test "$CC_TYPE" = gcc ; then
|
||||
AC_MSG_ERROR(Firefox cannot be built with mingw-gcc and requires a mingw-clang toolchain to work)
|
||||
fi
|
||||
|
||||
|
@ -357,7 +352,7 @@ case "$target" in
|
|||
|
||||
case "$target" in
|
||||
i*86-*)
|
||||
if test -n "$GNU_CC"; then
|
||||
if test "$CC_TYPE" != clang-cl ; then
|
||||
CFLAGS="$CFLAGS -mstackrealign"
|
||||
CXXFLAGS="$CXXFLAGS -mstackrealign"
|
||||
LDFLAGS="$LDFLAGS -Wl,--large-address-aware"
|
||||
|
@ -446,7 +441,7 @@ dnl ========================================================
|
|||
AC_LANG_CPLUSPLUS
|
||||
|
||||
ARM_ABI_PREFIX=
|
||||
if test "$GNU_CC"; then
|
||||
if test "$CC_TYPE" != clang-cl ; then
|
||||
if test "$TARGET_CPU" = "arm" ; then
|
||||
AC_CACHE_CHECK(for ARM EABI,
|
||||
ac_cv_gcc_arm_eabi,
|
||||
|
@ -517,7 +512,7 @@ if test -n "$MOZ_OPTIMIZE"; then
|
|||
AC_MSG_ERROR([These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS])
|
||||
fi
|
||||
CFLAGS=$_SAVE_CFLAGS
|
||||
if test -n "$MOZ_LTO" -a -n "$CLANG_CC"; then
|
||||
if test -n "$MOZ_LTO" -a "$CC_TYPE" = clang ; then
|
||||
# When using llvm-based LTO, non numeric optimization levels are
|
||||
# not supported by the linker, so force the linker to use -O2 (
|
||||
# which doesn't influence the level compilation units are actually
|
||||
|
@ -675,7 +670,7 @@ else
|
|||
JS_LIBRARY_NAME="mozjs"
|
||||
fi
|
||||
JS_CONFIG_LIBS="$NSPR_LIBS $LIBS"
|
||||
if test -n "$GNU_CC"; then
|
||||
if test "$CC_TYPE" != clang-cl ; then
|
||||
JS_CONFIG_MOZ_JS_LIBS='-L${libdir} -l${JS_LIBRARY_NAME}'
|
||||
else
|
||||
JS_CONFIG_MOZ_JS_LIBS='${libdir}/${JS_LIBRARY_NAME}.lib'
|
||||
|
|
|
@ -133,7 +133,7 @@ case "$target" in
|
|||
# strsafe.h on mingw uses macros for function deprecation that pollutes namespace
|
||||
# causing problems with local implementations with the same name.
|
||||
AC_DEFINE(STRSAFE_NO_DEPRECATE)
|
||||
fi # !GNU_CC
|
||||
fi
|
||||
|
||||
AC_DEFINE(_USE_MATH_DEFINES) # Otherwise Windows' math.h doesn't #define M_PI.
|
||||
|
||||
|
@ -160,9 +160,6 @@ fi
|
|||
|
||||
fi # COMPILE_ENVIRONMENT
|
||||
|
||||
AC_SUBST(GNU_CC)
|
||||
AC_SUBST(GNU_CXX)
|
||||
|
||||
dnl ========================================================
|
||||
dnl set the defaults first
|
||||
dnl ========================================================
|
||||
|
@ -181,8 +178,8 @@ fi
|
|||
dnl ========================================================
|
||||
dnl GNU specific defaults
|
||||
dnl ========================================================
|
||||
if test "$GNU_CC"; then
|
||||
if test "$OS_ARCH" != "WINNT" -o -z "$CLANG_CC"; then
|
||||
if test "$CC_TYPE" != clang-cl; then
|
||||
if test "$OS_ARCH" != "WINNT" -o "$CC_TYPE" != clang ; then
|
||||
DSO_PIC_CFLAGS='-fPIC'
|
||||
ASFLAGS="$ASFLAGS -fPIC"
|
||||
fi
|
||||
|
@ -214,7 +211,7 @@ if test "$GNU_CC"; then
|
|||
ASFLAGS="$ASFLAGS $_DEFINES_CFLAGS"
|
||||
fi
|
||||
|
||||
if test "$GNU_CXX"; then
|
||||
if test "$CC_TYPE" != clang-cl ; then
|
||||
CXXFLAGS="$CXXFLAGS -fno-exceptions"
|
||||
|
||||
_DEFINES_CXXFLAGS="-DMOZILLA_CLIENT -include $_objdir/mozilla-config.h"
|
||||
|
@ -283,7 +280,7 @@ case "$target" in
|
|||
;;
|
||||
|
||||
*-*linux*)
|
||||
if test "$GNU_CC" -o "$GNU_CXX"; then
|
||||
if test "$CC_TYPE" != clang-cl ; then
|
||||
MOZ_PGO_OPTIMIZE_FLAGS="-O3"
|
||||
MOZ_OPTIMIZE_FLAGS="-O2"
|
||||
fi
|
||||
|
@ -299,9 +296,9 @@ case "$target" in
|
|||
DSO_PIC_CFLAGS=
|
||||
# certain versions of cygwin's makedepend barf on the
|
||||
# #include <string> vs -I./dist/include/string issue so don't use it
|
||||
if test -n "$GNU_CC" -o -n "$CLANG_CC"; then
|
||||
# $GNU_CC will match gcc and clang; while $CLANG_CC will match only clang
|
||||
if test -z "$CLANG_CC"; then
|
||||
if test "$CC_TYPE" != clang-cl ; then
|
||||
# != clang-cl will match gcc and clang
|
||||
if test "$CC_TYPE" = gcc; then
|
||||
AC_MSG_ERROR(Firefox cannot be built with mingw-gcc and requires a mingw-clang toolchain to work)
|
||||
fi
|
||||
|
||||
|
@ -374,7 +371,7 @@ case "$target" in
|
|||
|
||||
case "$target" in
|
||||
i*86-*)
|
||||
if test -n "$GNU_CC"; then
|
||||
if test "$CC_TYPE" != clang-cl ; then
|
||||
CFLAGS="$CFLAGS -mstackrealign"
|
||||
CXXFLAGS="$CXXFLAGS -mstackrealign"
|
||||
LDFLAGS="$LDFLAGS -Wl,--large-address-aware"
|
||||
|
@ -461,7 +458,7 @@ dnl ========================================================
|
|||
AC_LANG_CPLUSPLUS
|
||||
|
||||
ARM_ABI_PREFIX=
|
||||
if test "$GNU_CC"; then
|
||||
if test "$CC_TYPE" != clang-cl ; then
|
||||
if test "$TARGET_CPU" = "arm" ; then
|
||||
AC_CACHE_CHECK(for ARM EABI,
|
||||
ac_cv_gcc_arm_eabi,
|
||||
|
@ -615,7 +612,7 @@ if test -n "$MOZ_OPTIMIZE"; then
|
|||
AC_MSG_ERROR([These compiler flags for C are invalid: $MOZ_OPTIMIZE_FLAGS])
|
||||
fi
|
||||
CFLAGS=$_SAVE_CFLAGS
|
||||
if test -n "$MOZ_LTO" -a -n "$CLANG_CC"; then
|
||||
if test -n "$MOZ_LTO" -a "$CC_TYPE" = clang ; then
|
||||
# When using llvm-based LTO, non numeric optimization levels are
|
||||
# not supported by the linker, so force the linker to use -O2 (
|
||||
# which doesn't influence the level compilation units are actually
|
||||
|
|
Загрузка…
Ссылка в новой задаче