Skip to content

Commit b674118

Browse files
eukarpovgithub-actions
authored andcommitted
Add LTO support (#25)
The patch reuse configuration for LTO from x64 and add aarch64 architecture to the list of supported COFF headers. Renaming for i386_ functions will be done on the patch series preparation.
1 parent 8b141f2 commit b674118

File tree

6 files changed

+15
-7
lines changed

6 files changed

+15
-7
lines changed

gcc/config/aarch64/cygming.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,12 @@ do { \
318318

319319
#define HAVE_64BIT_POINTERS 1
320320

321+
/* Kludge because of missing PE-COFF support for early LTO debug. */
322+
#undef TARGET_ASM_LTO_START
323+
#define TARGET_ASM_LTO_START mingw_pe_asm_lto_start
324+
#undef TARGET_ASM_LTO_END
325+
#define TARGET_ASM_LTO_END mingw_pe_asm_lto_end
326+
321327
/* According to Windows x64 software convention, the maximum stack allocatable
322328
in the prologue is 4G - 8 bytes. Furthermore, there is a limited set of
323329
instructions allowed to adjust the stack pointer in the epilog, forcing the

gcc/config/i386/cygming.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,9 @@ do { \
348348

349349
/* Kludge because of missing PE-COFF support for early LTO debug. */
350350
#undef TARGET_ASM_LTO_START
351-
#define TARGET_ASM_LTO_START i386_pe_asm_lto_start
351+
#define TARGET_ASM_LTO_START mingw_pe_asm_lto_start
352352
#undef TARGET_ASM_LTO_END
353-
#define TARGET_ASM_LTO_END i386_pe_asm_lto_end
353+
#define TARGET_ASM_LTO_END mingw_pe_asm_lto_end
354354

355355
#undef ASM_COMMENT_START
356356
#define ASM_COMMENT_START " #"

gcc/config/i386/i386-protos.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,6 @@ extern void i386_pe_asm_output_aligned_decl_common (FILE *, tree,
317317
const char *,
318318
HOST_WIDE_INT,
319319
HOST_WIDE_INT);
320-
extern void i386_pe_asm_lto_start (void);
321-
extern void i386_pe_asm_lto_end (void);
322320
extern void i386_pe_start_function (FILE *, const char *, tree);
323321
extern void i386_pe_end_function (FILE *, const char *, tree);
324322
extern void i386_pe_end_cold_function (FILE *, const char *, tree);

gcc/config/mingw/winnt.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -820,14 +820,14 @@ mingw_pe_file_end (void)
820820
static enum debug_info_levels saved_debug_info_level;
821821

822822
void
823-
i386_pe_asm_lto_start (void)
823+
mingw_pe_asm_lto_start (void)
824824
{
825825
saved_debug_info_level = debug_info_level;
826826
debug_info_level = DINFO_LEVEL_NONE;
827827
}
828828

829829
void
830-
i386_pe_asm_lto_end (void)
830+
mingw_pe_asm_lto_end (void)
831831
{
832832
debug_info_level = saved_debug_info_level;
833833
}

gcc/config/mingw/winnt.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ along with GCC; see the file COPYING3. If not see
2323
extern tree mingw_handle_selectany_attribute (tree *, tree, tree, int, bool *);
2424

2525
extern void mingw_pe_asm_named_section (const char *, unsigned int, tree);
26+
extern void mingw_pe_asm_lto_start (void);
27+
extern void mingw_pe_asm_lto_end (void);
2628
extern void mingw_pe_declare_function_type (FILE *file, const char *name,
2729
int pub);
2830
extern void mingw_pe_encode_section_info (tree, rtx, int);

libiberty/simple-object-coff.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ static const struct coff_magic_struct coff_magic[] =
219219
/* i386. */
220220
{ 0x14c, 0, F_EXEC | IMAGE_FILE_SYSTEM | IMAGE_FILE_DLL },
221221
/* x86_64. */
222-
{ 0x8664, 0, F_EXEC | IMAGE_FILE_SYSTEM | IMAGE_FILE_DLL }
222+
{ 0x8664, 0, F_EXEC | IMAGE_FILE_SYSTEM | IMAGE_FILE_DLL },
223+
/* AArch64. */
224+
{ 0xaa64, 0, F_EXEC | IMAGE_FILE_SYSTEM | IMAGE_FILE_DLL }
223225
};
224226

225227
/* See if we have a COFF file. */

0 commit comments

Comments
 (0)