Bug 61311 - missing LTO/WPA serialization API for use by regular IPA passes implemented in a plugin
Summary: missing LTO/WPA serialization API for use by regular IPA passes implemented i...
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: plugins (show other bugs)
Version: lto
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-25 20:34 UTC by PaX Team
Modified: 2014-05-25 20:34 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description PaX Team 2014-05-25 20:34:38 UTC
I recently faced the problem of implementing the four summary read/write callbacks for an IPA pass in a plugin. It turned out that the high level APIs for creating the input/output streams (e.g., create_output_block) expect 'enum lto_section_type' (instead of, say, a string). Given that this enum obviously cannot be expanded without patching the compiler itself, using the serialization API from a plugin requires some code duplication to avoid calling lto_get_section_name() deep down and the manual construction of the ELF section name. Given that the enum isn't used for much else but to look up the basic section name in lto_section_name[] and some statistics gathering, I think its use for constructing the streams (and in particular the section name) should be deprecated and instead plugins (and even in-tree users) should just be able to provide their part of the section name as a simple string instead.

The second problem is the usual case of missing headers, I had to manually install the following ones for gcc 4.9:

gcc/lto-streamer.h
gcc/gcov-io.h
gcc/data-streamer.h
gcc/lto-compress.h
gcc/lto/lto.h
<build_dir>/gcc/gcov-iov.h