llvm: update to 20.1.6
This commit is contained in:
parent
1ed87c822b
commit
f2aaa1e6e5
@ -0,0 +1,60 @@
|
||||
From ea0972013811bb0a0e926f99f56c744e4d45a063 Mon Sep 17 00:00:00 2001
|
||||
From: jeremyd2019 <github@jdrake.com>
|
||||
Date: Wed, 21 May 2025 22:15:21 -0700
|
||||
Subject: [PATCH] [LLVM][Cygwin] add workaround for blocking connect/accept in
|
||||
AF_UNIX sockets (#140353)
|
||||
|
||||
On Cygwin, UNIX sockets involve a handshake between connect and accept
|
||||
to enable SO_PEERCRED/getpeereid handling. This necessitates accept
|
||||
being called before connect can return, but at least the tests in
|
||||
llvm/unittests/Support/raw_socket_stream_test do both on the same thread
|
||||
(first connect and then accept), resulting in a deadlock. Add a call to
|
||||
both places sockets are created that turns off the handshake (and
|
||||
SO_PEERCRED/getpeereid support).
|
||||
|
||||
References:
|
||||
* https://github.com/cygwin/cygwin/blob/cec8a6680ea1fe38f38001b06c34ae355a785209/winsup/cygwin/fhandler/socket_local.cc#L1462-L1471
|
||||
* https://inbox.sourceware.org/cygwin/Z_UERXFI1g-1v3p2@calimero.vinschen.de/T/#u
|
||||
---
|
||||
llvm/lib/Support/raw_socket_stream.cpp | 18 ++++++++++++++++++
|
||||
1 file changed, 18 insertions(+)
|
||||
|
||||
diff --git a/llvm/lib/Support/raw_socket_stream.cpp b/llvm/lib/Support/raw_socket_stream.cpp
|
||||
index 7a4be5759f..fd1c681672 100644
|
||||
--- a/llvm/lib/Support/raw_socket_stream.cpp
|
||||
+++ b/llvm/lib/Support/raw_socket_stream.cpp
|
||||
@@ -81,6 +81,15 @@ static Expected<int> getSocketFD(StringRef SocketPath) {
|
||||
"Create socket failed");
|
||||
}
|
||||
|
||||
+#ifdef __CYGWIN__
|
||||
+ // On Cygwin, UNIX sockets involve a handshake between connect and accept
|
||||
+ // to enable SO_PEERCRED/getpeereid handling. This necessitates accept being
|
||||
+ // called before connect can return, but at least the tests in
|
||||
+ // llvm/unittests/Support/raw_socket_stream_test do both on the same thread
|
||||
+ // (first connect and then accept), resulting in a deadlock. This call turns
|
||||
+ // off the handshake (and SO_PEERCRED/getpeereid support).
|
||||
+ setsockopt(Socket, SOL_SOCKET, SO_PEERCRED, NULL, 0);
|
||||
+#endif
|
||||
struct sockaddr_un Addr = setSocketAddr(SocketPath);
|
||||
if (::connect(Socket, (struct sockaddr *)&Addr, sizeof(Addr)) == -1)
|
||||
return llvm::make_error<StringError>(getLastSocketErrorCode(),
|
||||
@@ -147,6 +156,15 @@ Expected<ListeningSocket> ListeningSocket::createUnix(StringRef SocketPath,
|
||||
return llvm::make_error<StringError>(getLastSocketErrorCode(),
|
||||
"socket create failed");
|
||||
|
||||
+#ifdef __CYGWIN__
|
||||
+ // On Cygwin, UNIX sockets involve a handshake between connect and accept
|
||||
+ // to enable SO_PEERCRED/getpeereid handling. This necessitates accept being
|
||||
+ // called before connect can return, but at least the tests in
|
||||
+ // llvm/unittests/Support/raw_socket_stream_test do both on the same thread
|
||||
+ // (first connect and then accept), resulting in a deadlock. This call turns
|
||||
+ // off the handshake (and SO_PEERCRED/getpeereid support).
|
||||
+ setsockopt(Socket, SOL_SOCKET, SO_PEERCRED, NULL, 0);
|
||||
+#endif
|
||||
struct sockaddr_un Addr = setSocketAddr(SocketPath);
|
||||
if (::bind(Socket, (struct sockaddr *)&Addr, sizeof(Addr)) == -1) {
|
||||
// Grab error code from call to ::bind before calling ::close
|
||||
--
|
||||
2.49.0.windows.1
|
||||
|
||||
@ -8,7 +8,7 @@ pkgname=("llvm"
|
||||
"clang-analyzer"
|
||||
"compiler-rt"
|
||||
"lld")
|
||||
_version=20.1.5
|
||||
_version=20.1.6
|
||||
_rc=""
|
||||
_tag=llvmorg-${_version}${_rc}
|
||||
pkgver=${_version}${_rc/-/}
|
||||
@ -45,6 +45,7 @@ source=("${_url}/llvm-${pkgver}.src.tar.xz"{,.sig}
|
||||
"0005-LLVM-TargetParser-Handle-msys-targets-the-same-as-cy.patch"
|
||||
"0006-LLVM-Cygwin-Define-_GNU_SOURCE-on-Cygwin-as-well.-13.patch"
|
||||
"0007-Cygwin-Emit-COMDAT-name-correctly-for-Cygwin-138621.patch"
|
||||
"0008-LLVM-Cygwin-add-workaround-for-blocking-connect-acce.patch"
|
||||
"0101-Cygwin-Global-symbols-should-be-external-by-default-.patch"
|
||||
"0102-Clang-Cygwin-Enable-few-conditions-that-are-shared-w.patch"
|
||||
"0103-Cygwin-Enable-TLS-on-Cygwin-target-138618.patch"
|
||||
@ -66,21 +67,21 @@ source=("${_url}/llvm-${pkgver}.src.tar.xz"{,.sig}
|
||||
"0205-LLD-COFF-Ensure-.bss-is-merged-at-the-end-of-a-secti.patch"
|
||||
"0206-LLD-CMake-fix-testing-standalone-build-without-insta.patch"
|
||||
)
|
||||
sha256sums=('9a9a80ca4c0d902531f2b43e9e4d6c36b57cdd5702430e0b54567bf273bd32c1'
|
||||
sha256sums=('f09e304ca98bb809f492ec34f94f587361b4b0d06ed783fb3a41e7fb218e47a1'
|
||||
'SKIP'
|
||||
'97025772b25c6694db049d3c4be5a72d926299aa1a9b861f490d66750e31c9dd'
|
||||
'49a16d6b6878a6bdd9ead2d31ffb94c792675607471afa40096fbd48b3cbab66'
|
||||
'SKIP'
|
||||
'bdcebca627f377ffcff5405cd5694efbddb14c89ad7d0ea481b1646a42bfeca3'
|
||||
'34ff389ce2c34ac1fe8badcf842265295daa91fd1149d69a7ebaf131edf01e4d'
|
||||
'SKIP'
|
||||
'058c3cc029036899fcdfbeebec10f6ca170dc9f0c3314576405072a77340c029'
|
||||
'280239aa9d9b94df484022cd7c28e5601acea5d60d06bc99d6b7de5b4dc516fe'
|
||||
'SKIP'
|
||||
'1b5abaa2686c6c0e1f394113d0b2e026ff3cb9e11b6a2294c4f3883f1b02c89c'
|
||||
'b4b3efa5d5b01b3f211f1ba326bb6f0c318331f828202d332c95b7f30fca5f8c'
|
||||
'SKIP'
|
||||
'f0555603222189d8d2ff2d02747c63a3bbeb291fa72ce042c1a6d26399150baf'
|
||||
'bdf90d0428c2cb7b763677c0932509b6dca9f210183e9e73c129ab32d7b658ef'
|
||||
'SKIP'
|
||||
'8b3255668594ca3450ac5c041ac52c3c33300873d033cda49529e7fe1d4257e6'
|
||||
'fde825adf348b4cb3b778d8d0409a1ecab2ac0d5ae27031a4530756e909db2d8'
|
||||
'SKIP'
|
||||
'8667f47185bee07f7c7988ead7161b0d9e41a1a01d5d7afd8f325c607641470c'
|
||||
'33530189d31b2396b76a7ebac8f938747b3619154cc37015cef9dea29292f7e2'
|
||||
'SKIP'
|
||||
'0f446bd4886fc6eac575c7a7e8dcfc84d1186eb79f73e321966bccc214e57271'
|
||||
'32419b37a32c8387dc0df1a54d9459a046eaf8ba6564df6573c54829b50b850a'
|
||||
@ -89,6 +90,7 @@ sha256sums=('9a9a80ca4c0d902531f2b43e9e4d6c36b57cdd5702430e0b54567bf273bd32c1'
|
||||
'19be8aaa4ea24249ca750ab2a84fdf6ab9a03aee012f3f377d9525d7a6d3e7d9'
|
||||
'93b81f87a9444d8a1375c8f47cb1caed22359048839ae4eca0db52dd40c24077'
|
||||
'61cceb570d0d2df34d04f9f3364bc90d036b9d54891281ab7770646c1414d18d'
|
||||
'4c6639c9460d94c7e1d24e8660e92744338e35768dd82d3292f95b23b4945684'
|
||||
'b88be5ffdd13fd31e38cb84e7248247715858fda28cbd50a05221ae06d1cf2fe'
|
||||
'beda63f2b2dd76aceb8f7538b1fda21821c5cca2fe6d43fd0cf78869d3e209e9'
|
||||
'd3c0622966bae355028b6a30c2f6726c5417e75ab633c131630dd4bc78cd0795'
|
||||
@ -158,6 +160,7 @@ prepare() {
|
||||
apply_git_patch_with_msg 0005-LLVM-TargetParser-Handle-msys-targets-the-same-as-cy.patch
|
||||
apply_git_patch_with_msg 0006-LLVM-Cygwin-Define-_GNU_SOURCE-on-Cygwin-as-well.-13.patch
|
||||
apply_git_patch_with_msg 0007-Cygwin-Emit-COMDAT-name-correctly-for-Cygwin-138621.patch
|
||||
apply_git_patch_with_msg 0008-LLVM-Cygwin-add-workaround-for-blocking-connect-acce.patch
|
||||
|
||||
# Patch clang
|
||||
cd "${srcdir}"/clang
|
||||
|
||||
@ -17,6 +17,7 @@ Legend:
|
||||
- `"0005-LLVM-TargetParser-Handle-msys-targets-the-same-as-cy.patch"` :arrow_up_small: https://github.com/llvm/llvm-project/commit/6900e9026516963ae625b28dded2cdf0bd16e590
|
||||
- `"0006-LLVM-Cygwin-Define-_GNU_SOURCE-on-Cygwin-as-well.-13.patch"` :arrow_up_small: https://github.com/llvm/llvm-project/commit/9633f87e34dddce49619e7fc2d75c659c61a9db1
|
||||
- `"0007-Cygwin-Emit-COMDAT-name-correctly-for-Cygwin-138621.patch"` :arrow_down_small: https://github.com/llvm/llvm-project/commit/7157228667396f1c113a96e9e9ecb9f0ca82a645
|
||||
- `"0008-LLVM-Cygwin-add-workaround-for-blocking-connect-acce.patch"` :arrow_up_small: https://github.com/llvm/llvm-project/commit/7857543a6350f49f12d17af0bcf2c0f42db0311e
|
||||
- `"0101-Cygwin-Global-symbols-should-be-external-by-default-.patch"` :arrow_down_small: https://github.com/llvm/llvm-project/commit/76d866f7935b746e5e50e7d760344c14502bd8e7
|
||||
- `"0102-Clang-Cygwin-Enable-few-conditions-that-are-shared-w.patch"` :x:
|
||||
- `"0103-Cygwin-Enable-TLS-on-Cygwin-target-138618.patch"` :arrow_down_small: https://github.com/llvm/llvm-project/commit/eb6d51a2fdddcc305b51f7d412d0e5144cbd444d
|
||||
@ -29,7 +30,7 @@ Legend:
|
||||
- `"0110-Clang-Driver-add-a-Cygwin-ToolChain.patch"` :arrow_up_small: https://github.com/llvm/llvm-project/commit/52924a2d7255cdd280b2b82dad8616e01fe065da
|
||||
- `"0111-Clang-Driver-use-__cxa_atexit-by-default-on-Cygwin.-.patch"` :arrow_up_small: https://github.com/llvm/llvm-project/commit/ca3a5d37ef64668234cbce7236dd640a98e2d687
|
||||
- `"0112-Clang-CMake-use-CMakePushCheckState-138783.patch"` :arrow_up_small: https://github.com/llvm/llvm-project/commit/74c0422cfeac42c83b82a3ff5c0c0cde849bd240
|
||||
- `"0113-CMake-respect-LLVMConfig.cmake-s-LLVM_DEFINITIONS.patch"` :grey_question: https://github.com/llvm/llvm-project/pull/138587
|
||||
- `"0113-CMake-respect-LLVMConfig.cmake-s-LLVM_DEFINITIONS.patch"` :arrow_up_small: https://github.com/llvm/llvm-project/commit/ba4bd3f46e97b5637b16a0fa74b064fb3e6db8ff
|
||||
- `"0114-Cygwin-Internal-class-in-explicitly-instantiation-de.patch"` :grey_exclamation:
|
||||
- `"0115-Cygwin-Template-instantiations-should-be-exported-by.patch"` :arrow_down_small: https://github.com/llvm/llvm-project/commit/cb53ece2cab0096539e6a5c9d53da4e5db5cc270
|
||||
- `"0201-LLD-MinGW-Implement-dll-search-prefix-option.patch"` :x:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user