Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame^] | 1 | From f30b99b5b8d3f2a8d8e4973cd155a4b9f1849039 Mon Sep 17 00:00:00 2001 |
| 2 | From: Nagaraju <nmekala@xilinx.com> |
| 3 | Date: Thu, 14 Mar 2019 18:08:06 +0530 |
| 4 | Subject: [PATCH 56/57] fix the lto-wrapper issue on windows |
| 5 | |
| 6 | --- |
| 7 | libiberty/simple-object.c | 6 +++++- |
| 8 | 1 file changed, 5 insertions(+), 1 deletion(-) |
| 9 | |
| 10 | diff --git a/libiberty/simple-object.c b/libiberty/simple-object.c |
| 11 | index 42aa6ac..d2465c6 100644 |
| 12 | --- a/libiberty/simple-object.c |
| 13 | +++ b/libiberty/simple-object.c |
| 14 | @@ -44,6 +44,10 @@ Boston, MA 02110-1301, USA. */ |
| 15 | #define SEEK_SET 0 |
| 16 | #endif |
| 17 | |
| 18 | +#ifndef O_BINARY |
| 19 | +#define O_BINARY 0 |
| 20 | +#endif |
| 21 | + |
| 22 | #include "simple-object-common.h" |
| 23 | |
| 24 | /* The known object file formats. */ |
| 25 | @@ -326,7 +330,7 @@ simple_object_copy_lto_debug_sections (simple_object_read *sobj, |
| 26 | return errmsg; |
| 27 | } |
| 28 | |
| 29 | - outfd = creat (dest, 00777); |
| 30 | + outfd = open (dest, O_CREAT|O_WRONLY|O_TRUNC|O_BINARY, 00777); |
| 31 | if (outfd == -1) |
| 32 | { |
| 33 | *err = errno; |
| 34 | -- |
| 35 | 2.7.4 |
| 36 | |