Skip to content

Commit

Permalink
Add new GCC shard for iains' GCC port to Darwin Aarch64 (#1626)
Browse files Browse the repository at this point in the history
Iain Sandoe is working on a port of GCC to Darwin Aaarch64 over at
https://github.com/iains/gcc-darwin-arm64. This is effort is what
Apple recommended we use for Fortran support. To help with testing
the port, define a new GCC shard that builds Iain's fork of GCC,
as well as using a local copy of the macOS SDK, so it can be built
against the NDA'd version of the Darwin AArch64 SDK for testing.
  • Loading branch information
Keno authored Sep 2, 2020
1 parent 82a8c70 commit 06647aa
Show file tree
Hide file tree
Showing 69 changed files with 164 additions and 5 deletions.
1 change: 1 addition & 0 deletions 0_RootFS/DarwinSDKs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sdk
2 changes: 2 additions & 0 deletions 0_RootFS/GCCBootstrap@11-IainS/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include("../gcc_common.jl")
build_and_upload_gcc(v"11.0.0-iains")
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
From 5dc1001e6a8ed88b11080d5fe065aaa4960e7415 Mon Sep 17 00:00:00 2001
From: Iain Sandoe <iain@codesourcery.com>
Date: Fri, 27 Jul 2018 14:10:04 +0100
Subject: [PATCH] pr81033-v2

---
gcc/dwarf2out.c | 11 +++++++++--
gcc/final.c | 3 +++
2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 208f2e97e7..806b081605 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -297,6 +297,10 @@ static unsigned int rnglist_idx;
#define FUNC_BEGIN_LABEL "LFB"
#endif

+#ifndef FUNC_SECOND_SECT_LABEL
+#define FUNC_SECOND_SECT_LABEL "LFSB"
+#endif
+
#ifndef FUNC_END_LABEL
#define FUNC_END_LABEL "LFE"
#endif
@@ -1212,21 +1216,24 @@ static void set_cur_line_info_table (section *);
void
dwarf2out_switch_text_section (void)
{
+ char label[MAX_ARTIFICIAL_LABEL_BYTES];
section *sect;
dw_fde_ref fde = cfun->fde;

gcc_assert (cfun && fde && fde->dw_fde_second_begin == NULL);

+ ASM_GENERATE_INTERNAL_LABEL (label, FUNC_SECOND_SECT_LABEL,
+ current_function_funcdef_no);
+
+ fde->dw_fde_second_begin = xstrdup (label);
if (!in_cold_section_p)
{
fde->dw_fde_end = crtl->subsections.cold_section_end_label;
- fde->dw_fde_second_begin = crtl->subsections.hot_section_label;
fde->dw_fde_second_end = crtl->subsections.hot_section_end_label;
}
else
{
fde->dw_fde_end = crtl->subsections.hot_section_end_label;
- fde->dw_fde_second_begin = crtl->subsections.cold_section_label;
fde->dw_fde_second_end = crtl->subsections.cold_section_end_label;
}
have_multiple_function_sections = true;
diff --git a/gcc/final.c b/gcc/final.c
index 6fa4acdaa2..2572325265 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -2223,6 +2223,9 @@ final_scan_insn_1 (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED,
ASM_OUTPUT_LABEL (asm_out_file,
IDENTIFIER_POINTER (cold_function_name));
#endif
+ if (dwarf2out_do_frame ()
+ && cfun->fde->dw_fde_second_begin != NULL)
+ ASM_OUTPUT_LABEL (asm_out_file, cfun->fde->dw_fde_second_begin);
}
break;

--
2.17.1

9 changes: 7 additions & 2 deletions 0_RootFS/PlatformSupport/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,20 @@ sources = [
"b5de28fd594a01edacd06e53491ad0890293e5fbf98329346426cf6030ef1ea6"),
ArchiveSource("https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/mingw-w64-v7.0.0.tar.bz2",
"aa20dfff3596f08a7f427aab74315a6cb80c2b086b4a107ed35af02f9496b628"),
ArchiveSource("https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.12.sdk.tar.xz",
"6852728af94399193599a55d00ae9c4a900925b6431534a3816496b354926774"),
ArchiveSource("https://download.freebsd.org/ftp/releases/amd64/11.4-RELEASE/base.txz",
"3bac8257bdd5e5b071f7b80cc591ebecd01b9314ca7839a2903096cbf82169f9"),
ArchiveSource("https://github.com/llvm/llvm-project/releases/download/llvmorg-8.0.1/libcxx-8.0.1.src.tar.xz",
"7f0652c86a0307a250b5741ab6e82bb10766fb6f2b5a5602a63f30337e629b78"),
DirectorySource("./bundled"),
]

if compiler_target isa MacOS && compiler_target.arch == :aarch64
push!(sources, DirectorySource(joinpath(@__DIR__, "..", "DarwinSDKs")))
else
push!(sources, ArchiveSource("https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.12.sdk.tar.xz",
"6852728af94399193599a55d00ae9c4a900925b6431534a3816496b354926774"))
end

script = "COMPILER_TARGET=$(BinaryBuilder.aatriplet(compiler_target))\n" * raw"""
## Function to take in a target such as `aarch64-linux-gnu`` and spit out a
## linux kernel arch like "arm64".
Expand Down
24 changes: 21 additions & 3 deletions 0_RootFS/gcc_common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,18 @@ function gcc_sources(gcc_version::VersionNumber, compiler_target::Platform; kwar
ArchiveSource("https://mirrors.kernel.org/gnu/gmp/gmp-6.1.2.tar.xz",
"87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912"),
],
v"11.0.0-iains" => [
GitSource("https://github.com/iains/gcc-darwin-arm64.git",
"03d8ff79b7a2d408db953667f81f76c0b8da26f0"),
ArchiveSource("https://mirrors.kernel.org/gnu/mpfr/mpfr-4.0.1.tar.xz",
"67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e"),
ArchiveSource("https://mirrors.kernel.org/gnu/mpc/mpc-1.1.0.tar.gz",
"6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e"),
ArchiveSource("https://gcc.gnu.org/pub/gcc/infrastructure/isl-0.18.tar.bz2",
"6b8b0fd7f81d0a957beb3679c81bbb34ccc7568d5682844d8924424a0dadcb1b"),
ArchiveSource("https://mirrors.kernel.org/gnu/gmp/gmp-6.1.2.tar.xz",
"87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912"),
]
)


Expand Down Expand Up @@ -159,10 +171,16 @@ function gcc_sources(gcc_version::VersionNumber, compiler_target::Platform; kwar
"db59a8578226b98373f5b27e61f0dd29ad2456f4aa9cec587ba8c24508e4c1d9"),
]
elseif isa(compiler_target, MacOS)
libc_sources = [
ArchiveSource("https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.12.sdk.tar.xz",
if gcc_version == v"11.0.0-iains"
libc_sources = [
DirectorySource(joinpath(@__DIR__, "DarwinSDKs"))
]
else
libc_sources = [
ArchiveSource("https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.12.sdk.tar.xz",
"6852728af94399193599a55d00ae9c4a900925b6431534a3816496b354926774"),
]
]
end
elseif isa(compiler_target, FreeBSD)
libc_sources = [
ArchiveSource("https://download.freebsd.org/ftp/releases/amd64/11.4-RELEASE/base.txz",
Expand Down

0 comments on commit 06647aa

Please sign in to comment.