Commit Graph

12 Commits

Author SHA1 Message Date
Alastair Houghton
64b891d5fe [Runtime] Add missing cast.
Apparently we're missing a cast in `_swift_initRuntimePath()`.  Previously
this code was accidentally not being used, which is why we hadn't noticed
it.

rdar://131294724
2024-07-08 10:29:31 +01:00
Alastair Houghton
d846689695 [Runtime] Use dyld to find the image path when possible.
For performance reasons, we want to avoid `dladdr()` when possible.

rdar://130954606
2024-07-02 14:11:10 +01:00
Alex Lorenz
94b1348183 stdlib: fix android build
the readlink addition in f4bf278 was introduced without a corresponding include.
2024-05-08 20:20:51 -07:00
Alastair Houghton
f4bf27852f [Backtracing] Make the backtracer work for fully-static Linux.
The backtracer and its build system need a couple of changes to make
them work with the new fully-static Linux support.

rdar://123507656
2024-05-07 16:51:34 +01:00
Alastair Houghton
e5ece81cc9 [Freestanding] Remove uses of stat() and dlsym().
We shouldn't be using stat() or dlsym() in the freestanding
runtime.

rdar://111214571
rdar://106555012
2023-06-23 17:05:59 +01:00
Alastair Houghton
1258d45152 [Backtracing] Build work.
Additional shimming required for some builds, as well as a few other build
related tweaks.

rdar://106234311
2023-03-04 15:46:30 +00:00
Alastair Houghton
b05f609e4c [Runtime] Remove spurious include of <filesystem>.
This was added when Saleem suggested using <filesystem> to avoid having
to do lots of string manipulation, but it turns out we can't use it on
macOS because of minimum deployment versions, and we also can't use it
on Ubuntu 18.04 because it doesn't exist there.

The code related to it was backed out already, but I missed the include.

rdar://106183273
2023-03-03 07:32:51 +00:00
Alastair Houghton
14a0ec38a2 [Backtracing] A couple more const fixes.
rdar://103071801
2023-03-02 09:42:00 +00:00
Alastair Houghton
81a8a7e9e2 [Backtracing] Fix some const problems as a result of the previous change.
rdar://103071801
2023-03-02 08:48:36 +00:00
Alastair Houghton
f6bfa7ef35 [Backtracing] Change the return type of one of the paths functions.
Since it's copying, it may as well return `char *` instead of
`const char *`.

rdar://103071801
2023-03-01 19:08:08 +00:00
Alastair Houghton
69bad8cb09 [Backtracing] Rename a couple of functions, some comment changes.
Renamed a couple of functions following review feedback.  Also added some
extra words to the comments.

rdar://103071801
2023-03-01 13:43:15 +00:00
Alastair Houghton
f02f62f1e3 [Backtracing] Add support for looking up paths for auxiliary executables.
We need to be able to locate `swift-backtrace` relative to the current
location of the runtime library.

This needs to work:

* In a Swift build directory.
* On Darwin, where we're installed in /usr/lib/swift and /usr/libexec/swift.
* On Linux, where we're in /usr/lib/swift/linux and /usr/libexec/swift/linux.
* On Windows, where we may be in a flat directory layout (because of limitations
  of Windows DLL lookups).

rdar://103071801
2023-03-01 13:43:15 +00:00