 ///            or executable. If unable to find the appropriate object, returns
 ///            `nil`.
 func findFirstObjectFile(for dsohandle: UnsafeRawPointer = #dsohandle) -> URL? {
+#if os(Linux)
+  var info = Dl_info()
+#else
   var info = dl_info()
+#endif
   if dladdr(dsohandle, &info) == 0 {
     return nil
   }

  ///           - lib/
  ///             - swift/
  ///               - ${target}/
  ///                 - libswiftSwiftSyntax.[dylib|so]
  ///         ```
  static func locateSwiftc() -> URL? {
    guard let libraryPath = findFirstObjectFile() else { return nil }
    let swiftcURL = libraryPath.deletingLastPathComponent()
                               .deletingLastPathComponent()
                               .deletingLastPathComponent()
                               .deletingLastPathComponent()
                               .appendingPathComponent("bin")
                               .appendingPathComponent("swiftc")
    guard FileManager.default.fileExists(atPath: swiftcURL.path) else {
      return nil
    }

///   - arguments: A list of strings to pass to the process as arguments.
/// - Returns: A ProcessResult containing stdout, stderr, and the exit code.
func run(_ executable: URL, arguments: [String] = []) -> ProcessResult {
#if _runtime(_ObjC)
  // Use an autoreleasepool to prevent memory- and file-descriptor leaks.
  return autoreleasepool { () -> ProcessResult in
    runCore(executable, arguments)
  }
#else
  return runCore(executable, arguments)
#endif
}

/// Finds the dylib or executable which the provided address falls in.
