Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion Formula/llvm@7.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ class LlvmAT7 < Formula
resource "clang" do
url "https://releases.llvm.org/7.1.0/cfe-7.1.0.src.tar.xz"
sha256 "e97dc472aae52197a4d5e0185eb8f9e04d7575d2dc2b12194ddc768e0f8a846d"
patch do
url "https://gist.githubusercontent.com/hjelmn/9fa1a7742acad71f404544a03bda414a/raw/b56a25f7208023d9724f671dfd7a80cbdac2a612/cfe-7.1.0-darwin-arm64.patch"
sha256 "eb6be925cdab150f5d01d51fa6bd6a4fe1dbf481794b83976ff877524192d1c1"
end
Comment on lines +32 to +35
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are gonna need to be submitted upstream to be considered for inclusion in homebrew

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LLVM 7 isn't updated anymore upstream, this is basically a legacy package.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's abandoned it should be deprecated and we still shouldn't use random patches that aren't submitted upstream

Copy link
Contributor Author

@hjelmn hjelmn Nov 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are all upstream. Just backported to llvm7 because it is no longer maintained. The only reason I request this is llvm7 is needed to build the ghc llvm backend. There is no native backend for ARM64 yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose the alternative is I make a keg, correct?

end

resource "clang-extra-tools" do
Expand All @@ -39,6 +43,10 @@ class LlvmAT7 < Formula
resource "compiler-rt" do
url "https://releases.llvm.org/7.1.0/compiler-rt-7.1.0.src.tar.xz"
sha256 "057bdac0581215b5ceb39edfd5bbef9eb79578f16a8908349f3066251fba88d8"
patch do
url "https://gist.githubusercontent.com/hjelmn/9fa1a7742acad71f404544a03bda414a/raw/b8066f65920155a103dd54c53682a981198c603e/compiler-rt-7.1.0-darwin-arm64.patch"
sha256 "717670499de38a0cf2668539ef57d7a8c4639730b2d9f25f62a3777998a4ded7"
end
end

resource "libcxx" do
Expand All @@ -59,6 +67,10 @@ class LlvmAT7 < Formula
resource "openmp" do
url "https://releases.llvm.org/7.1.0/openmp-7.1.0.src.tar.xz"
sha256 "1ee73aa1eef4ef7f75c96b24bf02445440602064c0074891ca5344a63f1fe5b5"
patch do
url "https://gist.githubusercontent.com/hjelmn/9fa1a7742acad71f404544a03bda414a/raw/01dcfa8859a7ed4d42e4deb47fbe0b29faf2e3b8/openmp-7.1.0-darwin-arm64.patch"
sha256 "10b18a193cf7951428ff5f2898399cf178769b04ae208020d28421a96e900d34"
end
end

resource "polly" do
Expand Down Expand Up @@ -86,8 +98,24 @@ def install
# can almost be treated as an entirely different build from llvm.
ENV.permit_arch_flags

target_arch =
case Hardware.oldest_cpu
when :arm_vortex_tempest
"AArch64"
else
"x86_64"
end
target_triple =
case Hardware.oldest_cpu
when :arm_vortex_tempest
"arm64-apple-darwin"
else
"x86_64-apple-darwin"
end
args = %W[
-DLIBOMP_ARCH=x86_64
-DLIBOMP_ARCH=#{target_arch}
-DLLVM_TARGETS_TO_BUILD=AArch64,x86_64
-DLLVM_DEFAULT_TARGET_TRIPLE=#{target_triple}
-DLINK_POLLY_INTO_TOOLS=ON
-DLLVM_BUILD_EXTERNAL_COMPILER_RT=ON
-DLLVM_BUILD_LLVM_DYLIB=ON
Expand Down