Bug 1049510 - Fix GCC_USE_GNU_LD when building with clang on linux. r=mshal
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 07 Aug 2014 02:59:31 +0900
changeset 198224 55e77a59da6d189934e390645e770a8754fd157c
parent 198223 c8f667080880e02f642cf3f6a18f52d6e9e64845
child 198225 1b7fd4e3536bd1b9bfa0896fd4a8c12b6df9451c
push id27264
push usernigelbabu@gmail.com
push dateThu, 07 Aug 2014 03:31:37 +0000
treeherdermozilla-central@afcb3af79d09 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1049510
milestone34.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 1049510 - Fix GCC_USE_GNU_LD when building with clang on linux. r=mshal
build/autoconf/toolchain.m4
--- a/build/autoconf/toolchain.m4
+++ b/build/autoconf/toolchain.m4
@@ -50,22 +50,16 @@ fi
 
 if test "`echo | $AS -o conftest.out -v 2>&1 | grep -c GNU`" != "0"; then
     GNU_AS=1
 fi
 rm -f conftest.out
 if test "`echo | $LD -v 2>&1 | grep -c GNU`" != "0"; then
     GNU_LD=1
 fi
-if test "$GNU_CC"; then
-    if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
-        GCC_USE_GNU_LD=1
-    fi
-fi
-
 INTEL_CC=
 INTEL_CXX=
 if test "$compiler" = "icc"; then
    INTEL_CC=1
    INTEL_CXX=1
 fi
 
 CLANG_CC=
@@ -76,16 +70,22 @@ if test "$compiler" = "clang"; then
     GNU_CXX=1
     CLANG_CC=1
     CLANG_CXX=1
 fi
 if test "$compiler" = "clang-cl"; then
     CLANG_CL=1
 fi
 
+if test "$GNU_CC"; then
+    if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
+        GCC_USE_GNU_LD=1
+    fi
+fi
+
 AC_SUBST(CLANG_CXX)
 AC_SUBST(CLANG_CL)
 ])
 
 AC_DEFUN([MOZ_CROSS_COMPILER],
 [
 echo "cross compiling from $host to $target"