]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add LTO support
authorEvgeny Karpov <evgeny.karpov@microsoft.com>
Thu, 11 Jul 2024 13:27:35 +0000 (15:27 +0200)
committerEvgeny Karpov <eukarpov@gmail.com>
Tue, 19 Nov 2024 13:27:33 +0000 (14:27 +0100)
The patch reuses the configuration for LTO from ix86 and adds the
aarch64 architecture to the list of supported COFF headers.

gcc/ChangeLog:

* config/aarch64/cygming.h (TARGET_ASM_LTO_START): New.
(TARGET_ASM_LTO_END): Likewise.
* config/i386/cygming.h (TARGET_ASM_LTO_START): Update.
(TARGET_ASM_LTO_END): Likewise.
* config/i386/i386-protos.h (i386_pe_asm_lto_start): Delete.
(i386_pe_asm_lto_end): Likewise.
* config/mingw/winnt.cc (i386_pe_asm_lto_start): Rename
into ...
(mingw_pe_asm_lto_start): ... this.
(i386_pe_asm_lto_end): Rename into ...
(mingw_pe_asm_lto_end): ... this.
* config/mingw/winnt.h (mingw_pe_asm_lto_start): New.
(mingw_pe_asm_lto_end): Likewise.

libiberty/ChangeLog:

* simple-object-coff.c: Add aarch64.

gcc/config/aarch64/cygming.h
gcc/config/i386/cygming.h
gcc/config/i386/i386-protos.h
gcc/config/mingw/winnt.cc
gcc/config/mingw/winnt.h
libiberty/simple-object-coff.c

index 3afeb77110d16eb48eaf82bb706d99ff3a2eddd5..8b9038ccf88c37d3961f89f20c0962e1dffe6e4e 100644 (file)
@@ -245,4 +245,10 @@ still needed for compilation.  */
 
 #define HAVE_64BIT_POINTERS 1
 
+/* Kludge because of missing PE-COFF support for early LTO debug.  */
+#undef  TARGET_ASM_LTO_START
+#define TARGET_ASM_LTO_START mingw_pe_asm_lto_start
+#undef  TARGET_ASM_LTO_END
+#define TARGET_ASM_LTO_END mingw_pe_asm_lto_end
+
 #endif
index 7852af6050a49b76a5ca8cda675eb057b7eb5229..7a97d02b81b5fd0dee67248069583242b8cdd116 100644 (file)
@@ -348,9 +348,9 @@ do {                                                \
 
 /* Kludge because of missing PE-COFF support for early LTO debug.  */
 #undef  TARGET_ASM_LTO_START
-#define TARGET_ASM_LTO_START i386_pe_asm_lto_start
+#define TARGET_ASM_LTO_START mingw_pe_asm_lto_start
 #undef  TARGET_ASM_LTO_END
-#define TARGET_ASM_LTO_END i386_pe_asm_lto_end
+#define TARGET_ASM_LTO_END mingw_pe_asm_lto_end
 
 #undef ASM_COMMENT_START
 #define ASM_COMMENT_START " #"
index c26ae5e4f1d22eefe69bf0a00a26a81b55e6e42b..78e72c50c6ddc7f77df73829bd02b25be820973b 100644 (file)
@@ -320,8 +320,6 @@ extern void i386_pe_asm_output_aligned_decl_common (FILE *, tree,
                                                    const char *,
                                                    HOST_WIDE_INT,
                                                    HOST_WIDE_INT);
-extern void i386_pe_asm_lto_start (void);
-extern void i386_pe_asm_lto_end (void);
 extern void i386_pe_start_function (FILE *, const char *, tree);
 extern void i386_pe_end_function (FILE *, const char *, tree);
 extern void i386_pe_end_cold_function (FILE *, const char *, tree);
index 59d4a6e27b9cd2ced89669186d7e6fae1796312f..56904925d5d5be3f52bc31b66e56c7331f6b753e 100644 (file)
@@ -832,14 +832,14 @@ mingw_pe_file_end (void)
 static enum debug_info_levels saved_debug_info_level;
 
 void
-i386_pe_asm_lto_start (void)
+mingw_pe_asm_lto_start (void)
 {
   saved_debug_info_level = debug_info_level;
   debug_info_level = DINFO_LEVEL_NONE;
 }
 
 void
-i386_pe_asm_lto_end (void)
+mingw_pe_asm_lto_end (void)
 {
   debug_info_level = saved_debug_info_level;
 }
index 14bff19e69724d380f91c652f1c04ca1f044e864..1ac19fd2386dae3a607a399798977417714d62c0 100644 (file)
@@ -23,6 +23,8 @@ http://www.gnu.org/licenses/.  */
 extern tree mingw_handle_selectany_attribute (tree *, tree, tree, int, bool *);
 
 extern void mingw_pe_asm_named_section (const char *, unsigned int, tree);
+extern void mingw_pe_asm_lto_start (void);
+extern void mingw_pe_asm_lto_end (void);
 extern void mingw_pe_declare_type (FILE *, const char *, bool, bool);
 extern void mingw_pe_encode_section_info (tree, rtx, int);
 extern void mingw_pe_file_end (void);
index e748205972f2a97f20ec4fbb45eb62fab7848160..fd3c310db5125756bf1d7c5862e184a564ed5410 100644 (file)
@@ -219,7 +219,9 @@ static const struct coff_magic_struct coff_magic[] =
   /* i386.  */
   { 0x14c, 0, F_EXEC | IMAGE_FILE_SYSTEM | IMAGE_FILE_DLL },
   /* x86_64.  */
-  { 0x8664, 0, F_EXEC | IMAGE_FILE_SYSTEM | IMAGE_FILE_DLL }
+  { 0x8664, 0, F_EXEC | IMAGE_FILE_SYSTEM | IMAGE_FILE_DLL },
+  /* AArch64.  */
+  { 0xaa64, 0, F_EXEC | IMAGE_FILE_SYSTEM | IMAGE_FILE_DLL }
 };
 
 /* See if we have a COFF file.  */