]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
linux.h (TARGET_HAS_F_SETLKW): Renamed to ...
authorH.J. Lu <hongjiu.lu@intel.com>
Wed, 13 Jul 2005 16:28:25 +0000 (16:28 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Wed, 13 Jul 2005 16:28:25 +0000 (09:28 -0700)
2005-07-13  H.J. Lu  <hongjiu.lu@intel.com>

* config/alpha/linux.h (TARGET_HAS_F_SETLKW): Renamed to ...
(TARGET_POSIX_IO): This.
* config/darwin.h: Likewise.
* config/freebsd.h: Likewise.
* config/linux.h: Likewise.
* config/lynx.h: Likewise.
* config/netbsd.h: Likewise.
* config/rs6000/linux64.h: Likewise.
* config/rs6000/linux.h: Likewise.
* config/s390/tpf.h: Likewise.
* config/sh/embed-elf.h: Likewise.
* config/sparc/linux64.h: Likewise.
* config/sparc/linux.h: Likewise.
* config/svr4.h: Likewise.
* gcov-io.h: Likewise.

* doc/tm.texi: Updated.

* libgcov.c (create_file_directory): Defined only if
TARGET_POSIX_IO is defined.
(gcov_exit): Call create_file_directory only if TARGET_POSIX_IO
is defined.

From-SVN: r101973

17 files changed:
gcc/ChangeLog
gcc/config/alpha/linux.h
gcc/config/darwin.h
gcc/config/freebsd.h
gcc/config/linux.h
gcc/config/lynx.h
gcc/config/netbsd.h
gcc/config/rs6000/linux.h
gcc/config/rs6000/linux64.h
gcc/config/s390/tpf.h
gcc/config/sh/embed-elf.h
gcc/config/sparc/linux.h
gcc/config/sparc/linux64.h
gcc/config/svr4.h
gcc/doc/tm.texi
gcc/gcov-io.h
gcc/libgcov.c

index 8a4ccc0c03f8214eceaaad75bdd27f20233e2146..03ca42bd23a354b74a26140b30194b26b6f872f3 100644 (file)
@@ -1,3 +1,28 @@
+2005-07-13  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * config/alpha/linux.h (TARGET_HAS_F_SETLKW): Renamed to ...
+       (TARGET_POSIX_IO): This.
+       * config/darwin.h: Likewise.
+       * config/freebsd.h: Likewise.
+       * config/linux.h: Likewise.
+       * config/lynx.h: Likewise.
+       * config/netbsd.h: Likewise.
+       * config/rs6000/linux64.h: Likewise.
+       * config/rs6000/linux.h: Likewise.
+       * config/s390/tpf.h: Likewise.
+       * config/sh/embed-elf.h: Likewise.
+       * config/sparc/linux64.h: Likewise.
+       * config/sparc/linux.h: Likewise.
+       * config/svr4.h: Likewise.
+       * gcov-io.h: Likewise.
+
+       * doc/tm.texi: Updated.
+
+       * libgcov.c (create_file_directory): Defined only if
+       TARGET_POSIX_IO is defined.
+       (gcov_exit): Call create_file_directory only if TARGET_POSIX_IO
+       is defined.
+
 2005-07-13  Jan Hubicka  <jh@suse.cz>
 
        * tree-ssa-operands.c (get_expr_operands): Fix typo in previous patch.
index 2509fe9eef05392cb4444fb64bc0cbc9973a7edf..0773462692d4082c9996dcb4f8b793de5475334e 100644 (file)
@@ -71,7 +71,7 @@ Boston, MA 02110-1301, USA.  */
    runtime library.  */
 #define TARGET_C99_FUNCTIONS 1
 
-#define TARGET_HAS_F_SETLKW
+#define TARGET_POSIX_IO
 
 #define LINK_GCC_C_SEQUENCE_SPEC \
   "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
index b5cb068007bf155d21e848fed05157ac891266fe..c33e2030e4a97b22e05522f1425415a8aa46323f 100644 (file)
@@ -1026,7 +1026,7 @@ void darwin_register_objc_includes (const char *, const char *, int);
 void add_framework_path (char *);
 #define TARGET_OPTF add_framework_path
 
-#define TARGET_HAS_F_SETLKW
+#define TARGET_POSIX_IO
 
 /* All new versions of Darwin have C99 functions.  */
 #define TARGET_C99_FUNCTIONS 1
index bf7a52e83d168cd31d25f797f37d2956e833ac86..21dc81e6013a13fa549c0321cf004b931d9cd52b 100644 (file)
@@ -84,4 +84,4 @@ Boston, MA 02110-1301, USA.  */
 /* Used by libgcc2.c.  We support file locking with fcntl / F_SETLKW.
    This enables the test coverage code to use file locking when exiting a
    program, which avoids race conditions if the program has forked.  */
-#define TARGET_HAS_F_SETLKW
+#define TARGET_POSIX_IO
index c173d7bad623f333c740943bf794918977c97c98..3853fa42a005bff30d7b487123fbff43488fbd61 100644 (file)
@@ -103,4 +103,4 @@ Boston, MA 02110-1301, USA.  */
    is present in the runtime library.  */
 #define TARGET_C99_FUNCTIONS 1
 
-#define TARGET_HAS_F_SETLKW
+#define TARGET_POSIX_IO
index 2805a57d336e621d1ba3816e6780f8ebce216b66..271fb626df392a06512c57bc39315d81a2e32aa1 100644 (file)
@@ -173,6 +173,6 @@ Boston, MA 02110-1301, USA.  */
 # define NO_IMPLICIT_EXTERN_C
 #endif
 
-#ifndef TARGET_HAS_F_SETLKW
-# define TARGET_HAS_F_SETLKW
+#ifndef TARGET_POSIX_IO
+# define TARGET_POSIX_IO
 #endif
index 2cc6f8058fab572cac564b2340b049cac1ca05c4..5386b656512b5367248b790f7ffa9c3202e4e63c 100644 (file)
@@ -156,8 +156,8 @@ Boston, MA 02110-1301, USA.  */
     fprintf ((STREAM), "void __fini() {\n\t%s();\n}\n", (FUNC));       \
   } while (0)
 
-#undef TARGET_HAS_F_SETLKW
-#define TARGET_HAS_F_SETLKW
+#undef TARGET_POSIX_IO
+#define TARGET_POSIX_IO
 
 /* Handle #pragma weak and #pragma pack.  */
 
index 79eb199f9529916d3a11c7a93f1942d250936428..497fcca2bc15eb07ff05415c23ae2bb576de76d1 100644 (file)
 
 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
 
-#define TARGET_HAS_F_SETLKW
+#define TARGET_POSIX_IO
 
 #define MD_UNWIND_SUPPORT "config/rs6000/linux-unwind.h"
 
index 7343cbb8723f7b232ab927859757cc75ca97f194..31bf8ac86ed369ab823c21166ce44de60bd18981 100644 (file)
@@ -536,7 +536,7 @@ while (0)
 
 #define TARGET_ASM_FILE_END rs6000_elf_end_indicate_exec_stack
 
-#define TARGET_HAS_F_SETLKW
+#define TARGET_POSIX_IO
 
 #define LINK_GCC_C_SEQUENCE_SPEC \
   "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
index e8c7f80893acac8cffb0d5cc3c922cb64a65adf2..c1feaba09ae01b0368c2d6dba2f733ae733e0fb1 100644 (file)
@@ -32,7 +32,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
 #undef ASM_APP_OFF
 #define ASM_APP_OFF "#NO_APP\n"
 #define NO_IMPLICIT_EXTERN_C
-#define TARGET_HAS_F_SETLKW
+#define TARGET_POSIX_IO
 #undef MD_EXEC_PREFIX
 #undef MD_STARTFILE_PREFIX
 
index 3c96f3fa2c97d703860a4a21b993b10eb17c3dec..2542c4c16bc696fa1c8293202ab44808ca2910e7 100644 (file)
@@ -23,4 +23,4 @@ Boston, MA 02110-1301, USA.  */
 #undef USER_LABEL_PREFIX
 #define USER_LABEL_PREFIX "_"
 
-#undef TARGET_HAS_F_SETLKW
+#undef TARGET_POSIX_IO
index 87a043e53cf0878a7508a8dba7df54624269d2a6..c90080e1eed7700e49b3abbc1793c673c59df794 100644 (file)
@@ -208,7 +208,7 @@ do {                                                                        \
    runtime library.  */
 #define TARGET_C99_FUNCTIONS 1
 
-#define TARGET_HAS_F_SETLKW
+#define TARGET_POSIX_IO
 
 #undef LINK_GCC_C_SEQUENCE_SPEC
 #define LINK_GCC_C_SEQUENCE_SPEC \
index 82860fea24e8655023ad2b9e999083343f196ece..d7ebb86e945e7797386b903b304143323655e248 100644 (file)
@@ -342,7 +342,7 @@ do {                                                                        \
    runtime library.  */
 #define TARGET_C99_FUNCTIONS 1
 
-#define TARGET_HAS_F_SETLKW
+#define TARGET_POSIX_IO
 
 #undef LINK_GCC_C_SEQUENCE_SPEC
 #define LINK_GCC_C_SEQUENCE_SPEC \
index 74aa296a892d6e17159bb43252c1ede0c06e7ab5..6fa88fcd821ddace0b01ca2129c9102349bbf4c4 100644 (file)
@@ -203,4 +203,4 @@ Boston, MA 02110-1301, USA.
 #undef  WCHAR_TYPE_SIZE
 #define WCHAR_TYPE_SIZE BITS_PER_WORD
 
-#define TARGET_HAS_F_SETLKW
+#define TARGET_POSIX_IO
index 4eeb15669841d04d972f27f35e32d21043210bff..5feacf5668e68d92a11cb85a05efa65f0e8e1f1c 100644 (file)
@@ -9275,12 +9275,13 @@ You need only define this macro if the default of @samp{"LIBRARY_PATH"}
 is wrong.
 @end defmac
 
-@defmac TARGET_HAS_F_SETLKW
-Define this macro if the target supports file locking with fcntl / F_SETLKW@.
-Note that this functionality is part of POSIX@.
-Defining @code{TARGET_HAS_F_SETLKW} will enable the test coverage code
+@defmac TARGET_POSIX_IO
+Define this macro if the target supports the following POSIX@ file
+functions, access, mkdir and  file locking with fcntl / F_SETLKW@.
+Defining @code{TARGET_POSIX_IO} will enable the test coverage code
 to use file locking when exiting a program, which avoids race conditions
-if the program has forked.
+if the program has forked. It will also create directories at run-time
+for cross-profiling.  @xref{Cross-profiling}.
 @end defmac
 
 @defmac MAX_CONDITIONAL_EXECUTE
index 045f6657ace9044e8b97bfd66ca855e51742806c..f3607d978908c8902f2d70ffdc23b31b332cc186 100644 (file)
@@ -195,7 +195,7 @@ typedef signed gcov_type __attribute__ ((mode (QI)));
 #endif
 
 
-#if defined (TARGET_HAS_F_SETLKW)
+#if defined (TARGET_POSIX_IO)
 #define GCOV_LOCKED 1
 #else
 #define GCOV_LOCKED 0
index 09f3522537a7413c1157d8234c640a4778ff14a5..de44d911f017af9c1eb8c919b9f2a3c22ff994ae 100644 (file)
@@ -91,6 +91,7 @@ static gcov_unsigned_t gcov_crc32;
 /* Size of the longest file name. */
 static size_t gcov_max_filename = 0;
 
+#ifdef TARGET_POSIX_IO
 /* Make sure path component of the given FILENAME exists, create 
    missing directories. FILENAME must be writable. 
    Returns zero on success, or -1 if an error occurred.  */
@@ -122,6 +123,7 @@ create_file_directory (char *filename)
       };
   return 0;
 }
+#endif
 
 /* Check if VERSION of the info block PTR matches libgcov one.
    Return 1 on success, or zero in case of versions mismatch.
@@ -299,6 +301,7 @@ gcov_exit (void)
       
       if (!gcov_open (gi_filename))
        {
+#ifdef TARGET_POSIX_IO
          /* Open failed likely due to missed directory.
             Create directory and retry to open file. */
           if (create_file_directory (gi_filename))
@@ -306,6 +309,7 @@ gcov_exit (void)
              fprintf (stderr, "profiling:%s:Skip\n", gi_filename);
              continue;
            }
+#endif
          if (!gcov_open (gi_filename))
            {
               fprintf (stderr, "profiling:%s:Cannot open\n", gi_filename);