зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1471556 - Support mingw clang in configure scripts. r=glandium
MozReview-Commit-ID: GKLbHvYgXnL --HG-- extra : rebase_source : 61c7c7b11373a7ef3fd6b653b1baf828c322ee0b
This commit is contained in:
Родитель
1cd9afb82a
Коммит
53527f20c4
|
@ -451,8 +451,12 @@ if test "$GNU_CC"; then
|
|||
fi
|
||||
WARNINGS_AS_ERRORS='-Werror'
|
||||
DSO_CFLAGS=''
|
||||
DSO_PIC_CFLAGS='-fPIC'
|
||||
ASFLAGS="$ASFLAGS -fPIC"
|
||||
|
||||
if test "$OS_ARCH" != "WINNT"; then
|
||||
DSO_PIC_CFLAGS='-fPIC'
|
||||
ASFLAGS="$ASFLAGS -fPIC"
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for --noexecstack option to as])
|
||||
_SAVE_CFLAGS=$CFLAGS
|
||||
CFLAGS="$CFLAGS -Wa,--noexecstack"
|
||||
|
@ -648,14 +652,20 @@ case "$target" in
|
|||
MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
|
||||
MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
|
||||
RC='$(WINDRES)'
|
||||
# Use static libgcc and libstdc++
|
||||
LDFLAGS="$LDFLAGS -static"
|
||||
# Use temp file for windres (bug 213281)
|
||||
RCFLAGS='-O coff --use-temp-file'
|
||||
# mingw doesn't require kernel32, user32, and advapi32 explicitly
|
||||
LIBS="$LIBS -lusp10 -lgdi32 -lwinmm -lwsock32"
|
||||
MOZ_FIX_LINK_PATHS=
|
||||
|
||||
if test -z "$CLANG_CC"; then
|
||||
# Use static libgcc and libstdc++
|
||||
LDFLAGS="$LDFLAGS -static"
|
||||
else
|
||||
# Silence problematic clang warnings
|
||||
CXXFLAGS="$CXXFLAGS -Wno-incompatible-ms-struct"
|
||||
fi
|
||||
|
||||
MOZ_OPTIMIZE_FLAGS="-O2"
|
||||
|
||||
WIN32_CONSOLE_EXE_LDFLAGS=-mconsole
|
||||
|
@ -810,7 +820,7 @@ case "$target" in
|
|||
;;
|
||||
esac
|
||||
|
||||
if test -n "$GNU_CC"; then
|
||||
if test -n "$GNU_CC" -a -z "$CLANG_CC"; then
|
||||
CFLAGS="$CFLAGS -fno-keep-inline-dllexport"
|
||||
CXXFLAGS="$CXXFLAGS -fno-keep-inline-dllexport"
|
||||
fi
|
||||
|
|
|
@ -536,8 +536,12 @@ if test "$GNU_CC"; then
|
|||
MKCSHLIB='$(CC) $(COMPUTED_C_LDFLAGS) $(PGO_CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$(DSO_SONAME) -o $@'
|
||||
WARNINGS_AS_ERRORS='-Werror'
|
||||
DSO_CFLAGS=''
|
||||
DSO_PIC_CFLAGS='-fPIC'
|
||||
ASFLAGS="$ASFLAGS -fPIC"
|
||||
|
||||
if test "$OS_ARCH" != "WINNT" -o -z "$CLANG_CC"; then
|
||||
DSO_PIC_CFLAGS='-fPIC'
|
||||
ASFLAGS="$ASFLAGS -fPIC"
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for --noexecstack option to as])
|
||||
_SAVE_CFLAGS=$CFLAGS
|
||||
CFLAGS="$CFLAGS -Wa,--noexecstack"
|
||||
|
@ -856,8 +860,6 @@ case "$target" in
|
|||
MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
|
||||
MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
|
||||
RC='$(WINDRES)'
|
||||
# Use static libgcc and libstdc++
|
||||
LDFLAGS="$LDFLAGS -static"
|
||||
# Use temp file for windres (bug 213281)
|
||||
RCFLAGS='-O coff --use-temp-file'
|
||||
# mingw doesn't require kernel32, user32, and advapi32 explicitly
|
||||
|
@ -869,11 +871,19 @@ case "$target" in
|
|||
WIN32_CONSOLE_EXE_LDFLAGS=-mconsole
|
||||
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"
|
||||
if test -z "$CLANG_CC"; then
|
||||
# Use static libgcc and libstdc++
|
||||
LDFLAGS="$LDFLAGS -static"
|
||||
|
||||
# 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
|
||||
# Silence problematic clang warnings
|
||||
CXXFLAGS="$CXXFLAGS -Wno-incompatible-ms-struct"
|
||||
fi
|
||||
else
|
||||
TARGET_COMPILER_ABI=msvc
|
||||
if test "$AS_BIN"; then
|
||||
|
@ -1054,7 +1064,7 @@ case "$target" in
|
|||
;;
|
||||
esac
|
||||
|
||||
if test -n "$GNU_CC"; then
|
||||
if test -n "$GNU_CC" -a -z "$CLANG_CC"; then
|
||||
CFLAGS="$CFLAGS -fno-keep-inline-dllexport"
|
||||
CXXFLAGS="$CXXFLAGS -fno-keep-inline-dllexport"
|
||||
fi
|
||||
|
|
Загрузка…
Ссылка в новой задаче