Fix build regression in commit 18fae96

Commit 18fae96 broke the build with a GCC_NO_EXECUTABLES configure
complaint because it introduced a linking test, which is not allowed.

This redoes that change so it does not overload the native Linux version
and take in its linking test.  The test in question is to determine
whether default linking is behaving as under --enable-new-dtags.
The answer is no with our binutils.

BUG=http://code.google.com/p/nativeclient/issues/detail?id=1580
TEST='make build-with-newlib' now works

R=halyavin@google.com,khim@google.com

Review URL: http://codereview.chromium.org/6813007
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 36767da..a6f21b3 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -10169,8 +10169,23 @@
   dynamic_linker=no
   ;;
 
+nacl*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+  ;;
+
 # This must be Linux ELF.
-nacl* | linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -10266,9 +10281,7 @@
   # most powerpc-linux boxes support dynamic linking these days and
   # people can always --disable-shared, the test was removed, and we
   # assume the GNU/Linux dynamic linker is in use.
-  if [ $host_os != 'nacl' ] ; then
-    dynamic_linker='GNU/Linux ld.so'
-  fi
+  dynamic_linker='GNU/Linux ld.so'
   ;;
 
 netbsd*)
@@ -11244,7 +11257,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11245 "configure"
+#line 11260 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11340,7 +11353,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11341 "configure"
+#line 11356 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -13366,11 +13379,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13367: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13382: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13371: \$? = $ac_status" >&5
+   echo "$as_me:13386: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -13465,11 +13478,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13466: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13481: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13470: \$? = $ac_status" >&5
+   echo "$as_me:13485: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -13517,11 +13530,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13518: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13533: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13522: \$? = $ac_status" >&5
+   echo "$as_me:13537: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -14097,8 +14110,23 @@
   dynamic_linker=no
   ;;
 
+nacl*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+  ;;
+
 # This must be Linux ELF.
-nacl* | linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -14194,9 +14222,7 @@
   # most powerpc-linux boxes support dynamic linking these days and
   # people can always --disable-shared, the test was removed, and we
   # assume the GNU/Linux dynamic linker is in use.
-  if [ $host_os != 'nacl' ] ; then
-    dynamic_linker='GNU/Linux ld.so'
-  fi
+  dynamic_linker='GNU/Linux ld.so'
   ;;
 
 netbsd*)
@@ -14596,7 +14622,7 @@
     #
     # Fake what AC_TRY_COMPILE does.  XXX Look at redoing this new-style.
     cat > conftest.$ac_ext << EOF
-#line 14595 "configure"
+#line 14625 "configure"
 struct S { ~S(); };
 void bar();
 void foo()
@@ -14768,7 +14794,7 @@
   # unnecessary for a builtins test.
 
     cat > conftest.$ac_ext << EOF
-#line 14767 "configure"
+#line 14797 "configure"
 int main()
 {
   typedef bool atomic_type;
@@ -14807,7 +14833,7 @@
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 14806 "configure"
+#line 14836 "configure"
 int main()
 {
   typedef short atomic_type;
@@ -14846,7 +14872,7 @@
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 14845 "configure"
+#line 14875 "configure"
 int main()
 {
   // NB: _Atomic_word not necessarily int.
@@ -14886,7 +14912,7 @@
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 14885 "configure"
+#line 14915 "configure"
 int main()
 {
   typedef long long atomic_type;
diff --git a/libtool.m4 b/libtool.m4
index 5f50db9..e3c0a17 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -2444,8 +2444,23 @@
   dynamic_linker=no
   ;;
 
+nacl*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+  ;;
+
 # This must be Linux ELF.
-nacl* | linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -2487,9 +2502,7 @@
   # most powerpc-linux boxes support dynamic linking these days and
   # people can always --disable-shared, the test was removed, and we
   # assume the GNU/Linux dynamic linker is in use.
-  if [ $host_os != 'nacl' ] ; then
-    dynamic_linker='GNU/Linux ld.so'
-  fi
+  dynamic_linker='GNU/Linux ld.so'
   ;;
 
 netbsd*)