Skip to content

Commit

Permalink
Merge pull request Homebrew#144487 from fxcoudert/libgccjit
Browse files Browse the repository at this point in the history
libgccjit: fixes for Xcode 15 and macOS Sonoma
  • Loading branch information
BrewTestBot authored Sep 22, 2023
2 parents 3983fb8 + 98979c4 commit 9ccac85
Showing 1 changed file with 88 additions and 7 deletions.
95 changes: 88 additions & 7 deletions Formula/lib/libgccjit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,25 @@ class Libgccjit < Formula
url "https://raw.githubusercontent.com/Homebrew/formula-patches/3c5cbc8e9cf444a1967786af48e430588e1eb481/gcc/gcc-13.2.0.diff"
sha256 "2df7ef067871a30b2531a2013b3db661ec9e61037341977bfc451e30bf2c1035"
end

# Upstream fix to deal with macOS 14 SDK <math.h> header
# https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=93f803d53b5ccaabded9d7b4512b54da81c1c616
patch :DATA
end

livecheck do
formula "gcc"
end

bottle do
sha256 arm64_ventura: "e3eed781f22e42b9007f39c29b38fb3f3d842f022f53d5ae6972f6ea20a2dab0"
sha256 arm64_monterey: "065e4e5ac5affa47ca2c0f24167126e9bc34caed2abd9a83a812ceed3b3205e6"
sha256 arm64_big_sur: "56255d7cf3b4367abf4250981c4006a73267d1575a6cde47b7ad04a7d53ecae8"
sha256 ventura: "dd21a623693aeb88c39c3e2cd2bcd1e6af0f175aa305ddf287f4412e04894223"
sha256 monterey: "4423db4f757f18f76de6d995cf66b32d7324d054941dd80cfa5fbbbf4f369dcb"
sha256 big_sur: "7b562c31193634feb387ec43b40398e7e4f5621c720ad735ed3ba7c1e88b50c6"
sha256 x86_64_linux: "d668066aefdcb8de227bb6f4221d6ede91fc8e42ead20fbe82d773a33a7ffebf"
rebuild 1
sha256 arm64_ventura: "f23a372d2d5650e06559a7fb8421a4e29d4d2e8ad97d00e208a3371675f9677a"
sha256 arm64_monterey: "09c4e1474f48eac7ec6c665b0780c6278f66affaae315efcf49d3dcc2c4d3d14"
sha256 arm64_big_sur: "524fdd67751f3e38fc4ddde62ed84030c2af8225c119a6e11fffac37c679acd5"
sha256 ventura: "a5556233e7155e3079024c1623b48d8b927a6f4dadf9a49a17571dbcc344c03e"
sha256 monterey: "c9117c34aa462bbf78a88c7ca1d92e4d0e8befe943f08e41de8d1c841ff4d258"
sha256 big_sur: "acd8bc22b30e2d6bbe07b4e19d86fc09f07ca5307994cfb318782349092a1443"
sha256 x86_64_linux: "810bbac04a101d01b17bbf3a5e46d54f6d99534c26a343fa1e1e4e628400779b"
end

# The bottles are built on systems with the CLT installed, and do not work
Expand Down Expand Up @@ -78,6 +83,12 @@ def install
sdk = MacOS.sdk_path_if_needed
args << "--with-sysroot=#{sdk}" if sdk

# Work around a bug in Xcode 15's new linker (FB13038083)
if DevelopmentTools.clang_build_version >= 1500
toolchain_path = "/Library/Developer/CommandLineTools"
args << "--with-ld=#{toolchain_path}/usr/bin/ld-classic"
end

["BOOT_LDFLAGS=-Wl,-headerpad_max_install_names"]
else
# Fix cc1: error while loading shared libraries: libisl.so.15
Expand Down Expand Up @@ -169,3 +180,73 @@ def install
assert_equal "hello world", shell_output("./test")
end
end
__END__
diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
index 416d2c2e3a4..e52f11d8460 100644
--- a/fixincludes/fixincl.x
+++ b/fixincludes/fixincl.x
@@ -2,11 +2,11 @@
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
- * It has been AutoGen-ed January 22, 2023 at 09:03:29 PM by AutoGen 5.18.12
+ * It has been AutoGen-ed August 17, 2023 at 10:16:38 AM by AutoGen 5.18.12
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT SVN-MERGE THIS FILE, EITHER Sun Jan 22 21:03:29 CET 2023
+/* DO NOT SVN-MERGE THIS FILE, EITHER Thu Aug 17 10:16:38 CEST 2023
*
* You must regenerate it. Use the ./genfixes script.
*
@@ -3674,7 +3674,7 @@ tSCC* apzDarwin_Flt_Eval_MethodMachs[] = {
* content selection pattern - do fix if pattern found
*/
tSCC zDarwin_Flt_Eval_MethodSelect0[] =
- "^#if __FLT_EVAL_METHOD__ == 0$";
+ "^#if __FLT_EVAL_METHOD__ == 0( \\|\\| __FLT_EVAL_METHOD__ == -1)?$";

#define DARWIN_FLT_EVAL_METHOD_TEST_CT 1
static tTestDesc aDarwin_Flt_Eval_MethodTests[] = {
@@ -3685,7 +3685,7 @@ static tTestDesc aDarwin_Flt_Eval_MethodTests[] = {
*/
static const char* apzDarwin_Flt_Eval_MethodPatch[] = {
"format",
- "#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 16",
+ "%0 || __FLT_EVAL_METHOD__ == 16",
(char*)NULL };

/* * * * * * * * * * * * * * * * * * * * * * * * * *
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index 45e0cbc0c10..19e0ea2df66 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -1819,10 +1819,11 @@ fix = {
hackname = darwin_flt_eval_method;
mach = "*-*-darwin*";
files = math.h;
- select = "^#if __FLT_EVAL_METHOD__ == 0$";
+ select = "^#if __FLT_EVAL_METHOD__ == 0( \\|\\| __FLT_EVAL_METHOD__ == -1)?$";
c_fix = format;
- c_fix_arg = "#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 16";
- test_text = "#if __FLT_EVAL_METHOD__ == 0";
+ c_fix_arg = "%0 || __FLT_EVAL_METHOD__ == 16";
+ test_text = "#if __FLT_EVAL_METHOD__ == 0\n"
+ "#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == -1";
};

/*
diff --git a/fixincludes/tests/base/math.h b/fixincludes/tests/base/math.h
index 29b67579748..7b92f29a409 100644
--- a/fixincludes/tests/base/math.h
+++ b/fixincludes/tests/base/math.h
@@ -32,6 +32,7 @@

#if defined( DARWIN_FLT_EVAL_METHOD_CHECK )
#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 16
+#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == -1 || __FLT_EVAL_METHOD__ == 16
#endif /* DARWIN_FLT_EVAL_METHOD_CHECK */


--
2.39.3

0 comments on commit 9ccac85

Please sign in to comment.