From 7100393da2c93cdb35aa1728e1b5b133cb13696c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Barto=C5=88?= Date: Mon, 4 Dec 2023 20:16:44 +0100 Subject: [PATCH] Fix x86_64-pc-linux-gnu and aarch64-pc-linux-gnu build (#8) * * fix undefined references in libgfortran * * fix internal compiler error in gfortran * Revert "* fix internal compiler error in gfortran" This reverts commit 4c81782ca9e75120eb91e1b6b89559f277233621. * * revert changes for undefined references in gfortran * Fix build on x86_64-pc-linux-gnu when host is aarch64-w64-mingw32 (#6) * Fix x86_64-pc-linux-gnu and aarch64-pc-linux-gnu build --------- Co-authored-by: Evgeny Karpov --- gcc/common/config/aarch64/aarch64-common.cc | 4 ++++ gcc/config/aarch64/aarch64.cc | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/common/config/aarch64/aarch64-common.cc b/gcc/common/config/aarch64/aarch64-common.cc index 2e53549a48b06..32152cfde5c3f 100644 --- a/gcc/common/config/aarch64/aarch64-common.cc +++ b/gcc/common/config/aarch64/aarch64-common.cc @@ -441,6 +441,8 @@ aarch64_rewrite_mcpu (int argc, const char **argv) return aarch64_rewrite_selected_cpu (argv[argc - 1]); } +#if TARGET_64BIT_MS_ABI + /* Implement TARGET_EXCEPT_UNWIND_INFO. */ static enum unwind_info_type @@ -465,6 +467,8 @@ aarch64_except_unwind_info (struct gcc_options *opts) #undef TARGET_EXCEPT_UNWIND_INFO #define TARGET_EXCEPT_UNWIND_INFO aarch64_except_unwind_info +#endif // TARGET_64BIT_MS_ABI + struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER; #undef AARCH64_CPU_NAME_LENGTH diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index e03d9d815f1d9..fdd671a47bafc 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -2908,7 +2908,9 @@ get_dllimport_decl (tree decl, bool beimport) if (!beimport) { SYMBOL_REF_FLAGS (rtl) |= SYMBOL_FLAG_EXTERNAL; +#if defined(TARGET_64BIT_MS_ABI) i386_pe_record_stub (name); +#endif // TARGET_64BIT_MS_ABI } rtl = gen_const_mem (Pmode, rtl); @@ -18454,8 +18456,10 @@ aarch64_override_options_after_change_1 (struct gcc_options *opts) flag_mrecip_low_precision_sqrt = true; /* Enable unwind tables for MS */ - if (TARGET_64BIT_MS_ABI && opts->x_flag_unwind_tables == 0) +#if defined(TARGET_64BIT_MS_ABI) + if (opts->x_flag_unwind_tables == 0) opts->x_flag_unwind_tables = 1; +#endif // TARGET_64BIT_MS_ABI } /* 'Unpack' up the internal tuning structs and update the options