public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR88422
@ 2019-01-22  9:47 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2019-01-22  9:47 UTC (permalink / raw)
  To: gcc-patches; +Cc: nidal.faour


The following patch from Nidal Faour fixes LTO issues on windows.

Thanks for tracking this down.

Aplied to trunk and GCC 8 branch.

Richard.

2019-01-22  Nidal Faour  <nidal.faour@wdc.com>

	PR lto/88422
	* simple-object.c (O_BINARY): Define if not already defined.
	(simple_object_copy_lto_debug_sections): Create file in binary
	mode.

Index: libiberty/simple-object.c
===================================================================
--- libiberty/simple-object.c	(revision 268137)
+++ libiberty/simple-object.c	(working copy)
@@ -44,6 +44,10 @@ Boston, MA 02110-1301, USA.  */
 #define SEEK_SET 0
 #endif
 
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
 #include "simple-object-common.h"
 
 /* The known object file formats.  */
@@ -349,7 +353,7 @@ simple_object_copy_lto_debug_sections (s
       return errmsg;
     }
 
-  outfd = creat (dest, 00777);
+  outfd = open (dest, O_CREAT|O_WRONLY|O_TRUNC|O_BINARY, 00777);
   if (outfd == -1)
     {
       *err = errno;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-01-22  9:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-22  9:47 [PATCH] Fix PR88422 Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).