-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[CMAKE] Fix layering issue between Concurrency and Darwin overlay #82973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
1969a41
b3fd1fd
d2dc4b8
972e6ae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,28 @@ | ||||||||||
//===--- CFExecutor.cpp ----------------------------===// | ||||||||||
// | ||||||||||
// This source file is part of the Swift.org open source project | ||||||||||
// | ||||||||||
// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors | ||||||||||
// Licensed under Apache License v2.0 with Runtime Library Exception | ||||||||||
// | ||||||||||
// See https://swift.org/LICENSE.txt for license information | ||||||||||
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors | ||||||||||
// | ||||||||||
//===----------------------------------------------------------------------===// | ||||||||||
#include "swift/Runtime/Concurrency.h" | ||||||||||
|
||||||||||
#if !defined(_WIN32) && !defined(__wasi__) && __has_include(<dlfcn.h>) | ||||||||||
#include <dlfcn.h> | ||||||||||
#endif | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This seems like we shouldn't bother with the guards as this is now Darwin specific. |
||||||||||
|
||||||||||
using namespace swift; | ||||||||||
|
||||||||||
SWIFT_CC(swift) | ||||||||||
extern "C" void * swift_concurrency_dlopen_noload(const char * __path) { | ||||||||||
return dlopen( __path, RTLD_NOLOAD); | ||||||||||
} | ||||||||||
|
||||||||||
SWIFT_CC(swift) | ||||||||||
extern "C" void * swift_concurrency_dlsym(void * __handle, const char * __symbol) { | ||||||||||
return dlsym(__handle, __symbol); | ||||||||||
} | ||||||||||
compnerd marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,15 +14,19 @@ | |
|
||
import Swift | ||
|
||
internal import Darwin | ||
@_silgen_name("swift_concurrency_dlopen_noload") | ||
private func dlopen(_ path: String) -> OpaquePointer? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this symbol is mapping in the Also, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. renamed it to |
||
|
||
@_silgen_name("swift_concurrency_dlsym") | ||
private func dlsym(_ handle: OpaquePointer?, _ symbol: String) -> OpaquePointer? | ||
|
||
// .. Dynamic binding .......................................................... | ||
|
||
enum CoreFoundation { | ||
static let path = | ||
"/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation" | ||
|
||
static let handle = unsafe dlopen(path, RTLD_NOLOAD) | ||
static let handle = unsafe dlopen(path) | ||
|
||
static var isPresent: Bool { return unsafe handle != nil } | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What API is this
import Darwin
pulling in?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's pulling in the
Darwin.os
functionality it looks like, you're right I was too zealous in removing this. I'm going to restore this and handle it in a separate PR