* configure.ac: Check for readv function also.
authorIan Lance Taylor <ian@airs.com>
Fri, 9 Oct 2009 23:20:44 +0000 (23:20 +0000)
committerIan Lance Taylor <ian@airs.com>
Fri, 9 Oct 2009 23:20:44 +0000 (23:20 +0000)
* fileread.cc (readv): Define if not HAVE_READV.
* fileread.h (File_read:: max_readv_entries): Set to 1 if readv
does not exist.
* config.in: Regenerate.
* configure: Regenerate.

gold/ChangeLog
gold/config.in
gold/configure
gold/configure.ac
gold/fileread.cc
gold/fileread.h

index 2b31fa68334816277fded54ef85a4bd633f3f539..0072baa4f69c66848d534285d613c1a73099cee5 100644 (file)
@@ -1,3 +1,13 @@
+2009-10-09  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+           Ian Lance Taylor  <iant@google.com>
+
+       * configure.ac: Check for readv function also.
+       * fileread.cc (readv): Define if not HAVE_READV.
+       * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
+       does not exist.
+       * config.in: Regenerate.
+       * configure: Regenerate.
+
 2009-10-09  Doug Kwan  <dougkwan@google.com>
 
        * layout.cc (Layout::make_output_section): Call target hook to make
index 5fccefb5750c190f64e34fee97152738eaf89b9f..93d7517caa72fd6de9036ed2309b3dc24b982efe 100644 (file)
@@ -99,6 +99,9 @@
 /* Define to 1 if you have the `pread' function. */
 #undef HAVE_PREAD
 
+/* Define to 1 if you have the `readv' function. */
+#undef HAVE_READV
+
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
index 4fa30b8a69dffc0771e85496f15863048f690780..e4eb9fb82a9dd4ea412a2d72d571eb1ac37ce293 100755 (executable)
@@ -6701,7 +6701,7 @@ fi
 
 done
 
-for ac_func in mallinfo posix_fallocate
+for ac_func in mallinfo posix_fallocate readv
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var"
index 2492c7a11b2b3003ed959d8c8d1c48cc0d20c1d5..85e23f9ce456c92fc78ceeae3dc3c34ab089aa27 100644 (file)
@@ -338,7 +338,7 @@ AC_LANG_PUSH(C++)
 AC_CHECK_HEADERS(tr1/unordered_set tr1/unordered_map)
 AC_CHECK_HEADERS(ext/hash_map ext/hash_set)
 AC_CHECK_HEADERS(byteswap.h)
-AC_CHECK_FUNCS(mallinfo posix_fallocate)
+AC_CHECK_FUNCS(mallinfo posix_fallocate readv)
 AC_CHECK_DECLS([basename, ffs, asprintf, vasprintf, snprintf, vsnprintf, strverscmp, strndup, memmem])
 
 # Use of ::std::tr1::unordered_map::rehash causes undefined symbols
index 02f0571a5d0b3ef367b8990575c45f29094f3448..aed1c1d642807d59d4ceb178a58cc6311156d2af 100644 (file)
 #include "descriptors.h"
 #include "fileread.h"
 
+#ifndef HAVE_READV
+struct iovec { void* iov_base; size_t iov_len };
+ssize_t
+readv(int, const iovec*, int)
+{
+  gold_unreachable();
+}
+#endif
+
 namespace gold
 {
 
index 920a4da7b518149b11e4ffc946caa806aa1763f1..bdffdd15fec7a74d1e33877b0795f2ff03bb36cc 100644 (file)
@@ -370,7 +370,13 @@ class File_read
   { return (file_size + (page_size - 1)) & ~ (page_size - 1); }
 
   // The maximum number of entries we will pass to ::readv.
+#ifdef HAVE_READV
   static const size_t max_readv_entries = 128;
+#else
+  // On targets that don't have readv set the max to 1 so readv is not
+  // used.
+  static const size_t max_readv_entries = 1;
+#endif
 
   // Use readv to read data.
   void
This page took 0.03538 seconds and 4 git commands to generate.