diff --git a/Aliases/llvm@10 b/Aliases/llvm@11 similarity index 100% rename from Aliases/llvm@10 rename to Aliases/llvm@11 diff --git a/Formula/llvm.rb b/Formula/llvm.rb index 035246a116f..4d73e1e639a 100644 --- a/Formula/llvm.rb +++ b/Formula/llvm.rb @@ -3,76 +3,60 @@ class Llvm < Formula homepage "https://llvm.org/" # The LLVM Project is under the Apache License v2.0 with LLVM Exceptions license "Apache-2.0" - revision 2 head "https://github.com/llvm/llvm-project.git" stable do - url "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/llvm-10.0.1.src.tar.xz" - sha256 "c5d8e30b57cbded7128d78e5e8dad811bff97a8d471896812f57fa99ee82cdf3" + url "https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/llvm-11.0.0.src.tar.xz" + sha256 "913f68c898dfb4a03b397c5e11c6a2f39d0f22ed7665c9cefa87a34423a72469" resource "clang" do - url "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/clang-10.0.1.src.tar.xz" - sha256 "f99afc382b88e622c689b6d96cadfa6241ef55dca90e87fc170352e12ddb2b24" - - patch :p1 do - url "https://raw.githubusercontent.com/Homebrew/formula-patches/c7da61787c62822804dd90192dd9dd254511192c/llvm/10.0.1-clang.diff" - sha256 "44a605f614a26fb20d127b041e2a87e6adc9b8332e07cbbb6b457bc391cda660" - end + url "https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/clang-11.0.0.src.tar.xz" + sha256 "0f96acace1e8326b39f220ba19e055ba99b0ab21c2475042dbc6a482649c5209" end resource "clang-tools-extra" do - url "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/clang-tools-extra-10.0.1.src.tar.xz" - sha256 "d093782bcfcd0c3f496b67a5c2c997ab4b85816b62a7dd5b27026634ccf5c11a" + url "https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/clang-tools-extra-11.0.0.src.tar.xz" + sha256 "fed318f75d560d0e0ae728e2fb8abce71e9d0c60dd120c9baac118522ce76c09" end resource "compiler-rt" do - url "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/compiler-rt-10.0.1.src.tar.xz" - sha256 "d90dc8e121ca0271f0fd3d639d135bfaa4b6ed41e67bd6eb77808f72629658fa" - - patch :p1 do - url "https://raw.githubusercontent.com/Homebrew/formula-patches/c7da61787c62822804dd90192dd9dd254511192c/llvm/10.0.1-compiiler-rt.diff" - sha256 "8ad0ce521b010dfb941c0979c1c072a2b40e4a69424374541d28122ba74ce4a0" - end + url "https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/compiler-rt-11.0.0.src.tar.xz" + sha256 "374aff82ff573a449f9aabbd330a5d0a441181c535a3599996127378112db234" end resource "libcxx" do - url "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/libcxx-10.0.1.src.tar.xz" - sha256 "def674535f22f83131353b3c382ccebfef4ba6a35c488bdb76f10b68b25be86c" + url "https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/libcxx-11.0.0.src.tar.xz" + sha256 "6c1ee6690122f2711a77bc19241834a9219dda5036e1597bfa397f341a9b8b7a" + end + + resource "libcxxabi" do + url "https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/libcxxabi-11.0.0.src.tar.xz" + sha256 "58697d4427b7a854ec7529337477eb4fba16407222390ad81a40d125673e4c15" end resource "libunwind" do - url "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/libunwind-10.0.1.src.tar.xz" - sha256 "741903ec1ebff2253ff19d803629d88dc7612598758b6e48bea2da168de95e27" + url "https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/libunwind-11.0.0.src.tar.xz" + sha256 "8455011c33b14abfe57b2fd9803fb610316b16d4c9818bec552287e2ba68922f" end resource "lld" do - url "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/lld-10.0.1.src.tar.xz" - sha256 "591449e0aa623a6318d5ce2371860401653c48bb540982ccdd933992cb88df7a" - - patch :p1 do - url "https://raw.githubusercontent.com/Homebrew/formula-patches/c7da61787c62822804dd90192dd9dd254511192c/llvm/10.0.1-lld.diff" - sha256 "734f87580e89d76507b8c41a5a75b5105c41a2d03a8dc2fad5c7ef027d771a3e" - end + url "https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/lld-11.0.0.src.tar.xz" + sha256 "efe7be4a7b7cdc6f3bcf222827c6f837439e6e656d12d6c885d5c8a80ff4fd1c" end resource "lldb" do - url "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/lldb-10.0.1.src.tar.xz" - sha256 "07abe87c25876aa306e73127330f5f37d270b6b082d50cc679e31b4fc02a3714" - - patch :p1 do - url "https://raw.githubusercontent.com/Homebrew/formula-patches/c7da61787c62822804dd90192dd9dd254511192c/llvm/10.0.1-lldb.diff" - sha256 "69c7d4c803a174dff6809d02255e7e4c19d80f25c73dd5fcf2657769db158e25" - end + url "https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/lldb-11.0.0.src.tar.xz" + sha256 "8570c09f57399e21e0eea0dcd66ae0231d47eafc7a04d6fe5c4951b13c4d2c72" end resource "openmp" do - url "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/openmp-10.0.1.src.tar.xz" - sha256 "d19f728c8e04fb1e94566c8d76aef50ec926cd2f95ef3bf1e0a5de4909b28b44" + url "https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/openmp-11.0.0.src.tar.xz" + sha256 "2d704df8ca67b77d6d94ebf79621b0f773d5648963dd19e0f78efef4404b684c" end resource "polly" do - url "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/polly-10.0.1.src.tar.xz" - sha256 "d2fb0bb86b21db1f52402ba231da7c119c35c21dfb843c9496fe901f2d6aa25a" + url "https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/polly-11.0.0.src.tar.xz" + sha256 "dcfadb8d11f2ea0743a3f19bab3b43ee1cb855e136bc81c76e2353cd76148440" end end @@ -108,11 +92,6 @@ class Llvm < Formula uses_from_macos "ncurses" uses_from_macos "zlib" - patch :p1 do - url "https://raw.githubusercontent.com/Homebrew/formula-patches/c7da61787c62822804dd90192dd9dd254511192c/llvm/10.0.1-llvm.diff" - sha256 "86b4e2bf10dfb9a04153e3d4fc744c3f323f3e13fc7b3a7d22e6791d47eb2e2c" - end - def install projects = %w[ clang @@ -127,10 +106,9 @@ class Llvm < Formula runtimes = %w[ compiler-rt libcxx + libcxxabi libunwind ] - # Can likely be added to the base runtimes array when 11.0.0 is released. - runtimes << "libcxxabi" if build.head? llvmpath = buildpath/"llvm" unless build.head? @@ -326,5 +304,21 @@ class Llvm < Formula EOS assert_equal "int main() { printf(\"Hello world!\"); }\n", shell_output("#{bin}/clang-format -style=google clangformattest.c") + + # Ensure LLVM did not regress output of `llvm-config --system-libs` which for a time + # was known to output incorrect linker flags; e.g., `-llibxml2.tbd` instead of `-lxml2`. + # On the other hand, note that a fully qualified path to `dylib` or `tbd` is OK, e.g., + # `/usr/local/lib/libxml2.tbd` or `/usr/local/lib/libxml2.dylib`. + shell_output("#{bin}/llvm-config --system-libs").chomp.strip.split(" ").each do |lib| + if lib.start_with?("-l") + assert !lib.end_with?(".tbd"), "expected abs path when lib reported as .tbd" + assert !lib.end_with?(".dylib"), "expected abs path when lib reported as .dylib" + else + p = Pathname.new(lib) + if p.extname == ".tbd" || p.extname == ".dylib" + assert p.absolute?, "expected abs path when lib reported as .tbd or .dylib" + end + end + end end end