This is the mail archive of the
mailing list for the GCC project.
Bug in lto-plugin.c ?
- From: Georg-Johann Lay <avr at gjlay dot de>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 18 Jul 2017 18:36:01 +0200
- Subject: Bug in lto-plugin.c ?
- Authentication-results: sourceware.org; auth=none
Hi, I tried to build a canadian cross with Configured with
While the result appears to work under wine, I am getting the
following error from ld in a non-LTO compile + link:
error: asprintf failed
After playing around I found that -fno-use-linker-plugin avoids that
message, and I speculated that the error is emit by lto-plugin.c
In claim_file_handler() we have:
/* We pass the offset of the actual file, not the archive header.
Can't use PRIx64, because that's C99, so we have to print the
64-bit hex int as two 32-bit ones. */
int lo, hi, t;
lo = file->offset & 0xffffffff;
hi = ((int64_t)file->offset >> 32) & 0xffffffff;
t = hi ? asprintf (&objname, "%s@0x%x%08x", file->name, lo, hi)
: asprintf (&objname, "%s@0x%x", file->name, lo);
check (t >= 0, LDPL_FATAL, "asprintf failed");
If hi != 0, then why is hi printed at the low end? Shouldn't hi and lo
be swapped like so
t = hi ? asprintf (&objname, "%s@0x%x%08x", file->name, hi, lo)
if this is supposed to yield a 64-bit print?
What else could lead to an "asprintf failed" ? Unfortunately I have
no idea how to debug that on the host...