Bug 1260996 - Don't set HOST_{C,CXX,LD}FLAGS from {C,CXX,LD}FLAGS on cross compiles. r?gps draft
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 31 Mar 2016 18:11:19 +0900
changeset 346204 6761c3571c76190546b2ef48f1ccbaabce9ffe9c
parent 345774 a21a7ef3d8834e3ba1d87c03ca3ec2ea4920100e
child 346205 b68ade80e7ab333963584d11084017880508c145
push id14283
push userbmo:mh+mozilla@glandium.org
push dateThu, 31 Mar 2016 09:15:44 +0000
reviewersgps
bugs1260996
milestone48.0a1
Bug 1260996 - Don't set HOST_{C,CXX,LD}FLAGS from {C,CXX,LD}FLAGS on cross compiles. r?gps The only cross compiles we actively support were resetting pre-setting those values to avoid it anyways, so it wasn't doing anything useful.
build/autoconf/android.m4
build/autoconf/toolchain.m4
js/src/old-configure.in
old-configure.in
--- a/build/autoconf/android.m4
+++ b/build/autoconf/android.m4
@@ -141,30 +141,16 @@ case "$target" in
     CXXFLAGS="-mandroid -fno-short-enums -fno-exceptions $CXXFLAGS"
     ASFLAGS="-idirafter $android_platform/usr/include -DANDROID $ASFLAGS"
 
     dnl Add -llog by default, since we use it all over the place.
     dnl Add --allow-shlib-undefined, because libGLESv2 links to an
     dnl undefined symbol (present on the hardware, just not in the
     dnl NDK.)
     LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform -llog -Wl,--allow-shlib-undefined $LDFLAGS"
-    dnl prevent cross compile section from using these flags as host flags
-    if test -z "$HOST_CPPFLAGS" ; then
-        HOST_CPPFLAGS=" "
-    fi
-    if test -z "$HOST_CFLAGS" ; then
-        HOST_CFLAGS=" "
-    fi
-    if test -z "$HOST_CXXFLAGS" ; then
-        HOST_CXXFLAGS=" "
-    fi
-    if test -z "$HOST_LDFLAGS" ; then
-        HOST_LDFLAGS=" "
-    fi
-
     ANDROID_NDK="${android_ndk}"
     ANDROID_TOOLCHAIN="${android_toolchain}"
     ANDROID_PLATFORM="${android_platform}"
 
     AC_DEFINE(ANDROID)
     AC_SUBST(ANDROID_NDK)
     AC_SUBST(ANDROID_TOOLCHAIN)
     AC_SUBST(ANDROID_PLATFORM)
--- a/build/autoconf/toolchain.m4
+++ b/build/autoconf/toolchain.m4
@@ -130,25 +130,16 @@ fi
 AC_MSG_RESULT([$HOST_CC])
 AC_MSG_CHECKING([for host c++ compiler])
 AC_CHECK_PROGS(HOST_CXX, c++ g++ clang++ cl, "")
 if test -z "$HOST_CXX"; then
     AC_MSG_ERROR([no acceptable c++ compiler found in \$PATH])
 fi
 AC_MSG_RESULT([$HOST_CXX])
 
-if test -z "$HOST_CFLAGS"; then
-    HOST_CFLAGS="$CFLAGS"
-fi
-if test -z "$HOST_CXXFLAGS"; then
-    HOST_CXXFLAGS="$CXXFLAGS"
-fi
-if test -z "$HOST_LDFLAGS"; then
-    HOST_LDFLAGS="$LDFLAGS"
-fi
 if test -z "$HOST_AR_FLAGS"; then
     HOST_AR_FLAGS="$AR_FLAGS"
 fi
 AC_CHECK_PROGS(HOST_RANLIB, $HOST_RANLIB ranlib, ranlib, :)
 AC_CHECK_PROGS(HOST_AR, $HOST_AR ar, ar, :)
 CC="$HOST_CC"
 CFLAGS="$HOST_CFLAGS"
 LDFLAGS="$HOST_LDFLAGS"
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -98,30 +98,16 @@ if test -n "$gonkdir" ; then
     CPPFLAGS="-DANDROID $TARGET_C_INCLUDES -I$gonkdir/frameworks/base/native/include -I$gonkdir/system/core/include -isystem $gonkdir/bionic $CPPFLAGS -I$gonkdir/external/valgrind/fxos-include"
     CFLAGS="-mandroid -fno-short-enums -fno-exceptions $CFLAGS"
     CXXFLAGS="-mandroid -fno-short-enums -fno-exceptions $CXXFLAGS $STLPORT_CPPFLAGS"
     LIBS="$LIBS $STLPORT_LIBS"
 
     dnl Add -llog by default, since we use it all over the place.
     LDFLAGS="-mandroid -L$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib -Wl,-rpath-link=$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib --sysroot=$gonkdir/out/target/product/$GONK_PRODUCT/obj/ -llog $LDFLAGS"
 
-    dnl prevent cross compile section from using these flags as host flags
-    if test -z "$HOST_CPPFLAGS" ; then
-        HOST_CPPFLAGS=" "
-    fi
-    if test -z "$HOST_CFLAGS" ; then
-        HOST_CFLAGS=" "
-    fi
-    if test -z "$HOST_CXXFLAGS" ; then
-        HOST_CXXFLAGS=" "
-    fi
-    if test -z "$HOST_LDFLAGS" ; then
-        HOST_LDFLAGS=" "
-    fi
-
     AC_DEFINE(ANDROID)
     AC_DEFINE(GONK)
 else
     MOZ_ANDROID_NDK
 fi
 
 case "$target" in
 *-apple-darwin*)
--- a/old-configure.in
+++ b/old-configure.in
@@ -189,30 +189,16 @@ if test -n "$gonkdir" ; then
     CPPFLAGS="-DANDROID $TARGET_C_INCLUDES -I$gonkdir/system -I$gonkdir/system/core/include -isystem $gonkdir/bionic -I$gonkdir/hardware/libhardware/include -I$gonkdir/external/valgrind/fxos-include $GONK_INCLUDES $CPPFLAGS"
     CFLAGS="-mandroid -fno-short-enums -fno-exceptions $CFLAGS"
     CXXFLAGS="-mandroid -fno-short-enums -fno-exceptions $CXXFLAGS $STLPORT_CPPFLAGS"
     dnl Add -llog by default, since we use it all over the place.
     LIBS="$LIBS -llog"
 
     LDFLAGS="-mandroid -L$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib -Wl,-rpath-link=$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib --sysroot=$gonkdir/out/target/product/$GONK_PRODUCT/obj/ $LDFLAGS"
 
-    dnl prevent cross compile section from using these flags as host flags
-    if test -z "$HOST_CPPFLAGS" ; then
-        HOST_CPPFLAGS=" "
-    fi
-    if test -z "$HOST_CFLAGS" ; then
-        HOST_CFLAGS=" "
-    fi
-    if test -z "$HOST_CXXFLAGS" ; then
-        HOST_CXXFLAGS=" "
-    fi
-    if test -z "$HOST_LDFLAGS" ; then
-        HOST_LDFLAGS=" "
-    fi
-
     AC_DEFINE(ANDROID)
     AC_DEFINE_UNQUOTED(ANDROID_VERSION, $ANDROID_VERSION)
     AC_SUBST(ANDROID_VERSION)
     AC_DEFINE(HAVE_SYS_UIO_H)
     AC_DEFINE(HAVE_PTHREADS)
     MOZ_CHROME_FILE_FORMAT=omni
     direct_nspr_config=1
     android_cxx_stl=mozstlport