On 01/20/2012 08:04 AM, Dominique Dhumieres wrote:
The following patch fixes the problem.
The test fails on *-apple-darwin*: pr51916.
TIA
Dominique
Dominique or Iain, may I ask you to test this patch on darwin? I have a
sporadic access to a darwin machine.
Bootstrapped and tested on x86_64-unknown-linux-gnu.
--
Patrick.
PR lto/51916
* lto-object.c (LTO_SEGMENT_NAME): Define segment name.
(lto_obj_file_open): Use it.
Index: lto-wrapper.c
===================================================================
--- lto-wrapper.c (revision 183345)
+++ lto-wrapper.c (working copy)
@@ -54,6 +54,11 @@ along with GCC; see the file COPYING3. If not see
/* End of lto-streamer.h copy. */
+/* Segment name for LTO sections. This is only used for Mach-O.
+ FIXME: This needs to be kept in sync with darwin.c. */
+
+#define LTO_SEGMENT_NAME "__GNU_LTO"
+
int debug; /* true if -save-temps. */
int verbose; /* true if -v. */
@@ -479,7 +484,8 @@ run_gcc (unsigned argc, char *argv[])
fd = open (argv[i], O_RDONLY);
if (fd == -1)
continue;
- sobj = simple_object_start_read (fd, file_offset, NULL, &errmsg, &err);
+ sobj = simple_object_start_read (fd, file_offset, LTO_SEGMENT_NAME,
+ &errmsg, &err);
if (!sobj)
{
close (fd);