summaryrefslogtreecommitdiff
path: root/Ports/mold
diff options
context:
space:
mode:
authorDaniel Bertalan <dani@danielbertalan.dev>2022-01-12 13:03:12 +0100
committerAndreas Kling <kling@serenityos.org>2022-01-12 14:54:12 +0100
commit3cbf20ca5d62d637b546d39fae411d31c3af4d70 (patch)
tree08665d0c2a10af3dfa774d7554710108da9cdb7c /Ports/mold
parentc7423dc20b7dbca786ff04d5ea06b7635fe37f21 (diff)
downloadserenity-3cbf20ca5d62d637b546d39fae411d31c3af4d70.zip
Ports: Remove obsolete mold patch
This is no longer needed, as both toolchains now support std::filesystem.
Diffstat (limited to 'Ports/mold')
-rw-r--r--Ports/mold/patches/0003-Replace-std-filesystem-usage-with-Core-File.patch89
1 files changed, 0 insertions, 89 deletions
diff --git a/Ports/mold/patches/0003-Replace-std-filesystem-usage-with-Core-File.patch b/Ports/mold/patches/0003-Replace-std-filesystem-usage-with-Core-File.patch
deleted file mode 100644
index 64171f6bba..0000000000
--- a/Ports/mold/patches/0003-Replace-std-filesystem-usage-with-Core-File.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-From b7141fc8a74705a0a772f5495a9a92ed7768a6af Mon Sep 17 00:00:00 2001
-From: Andrew Kaster <akaster@serenityos.org>
-Date: Tue, 11 Jan 2022 01:02:44 -0700
-Subject: [PATCH 3/7] Replace std::filesystem usage with Core::File
-
-At least the Clang toolchain does not support std::filesystem, so hack
-up the two files that use it to use Core::File abstractions instead.
----
- elf/subprocess.cc | 11 +++++++++++
- filepath.cc | 19 +++++++++++++++++++
- 2 files changed, 30 insertions(+)
-
-diff --git a/elf/subprocess.cc b/elf/subprocess.cc
-index 3ed66c89..9e2fa9f6 100644
---- a/elf/subprocess.cc
-+++ b/elf/subprocess.cc
-@@ -1,6 +1,12 @@
- #include "mold.h"
-
-+#ifdef __serenity__
-+#define AK_DONT_REPLACE_STD
-+#include <LibCore/File.h>
-+#else
- #include <filesystem>
-+#endif
-+
- #include <signal.h>
- #include <sys/socket.h>
- #include <sys/stat.h>
-@@ -251,7 +257,12 @@ void daemonize(Context<E> &ctx, std::function<void()> *wait_for_client,
- }
-
- static std::string get_self_path() {
-+#ifdef __serenity__
-+ auto str = Core::File::read_link("/proc/self/exe");
-+ return { str.characters(), str.length() };
-+#else
- return std::filesystem::read_symlink("/proc/self/exe");
-+#endif
- }
-
- static bool is_regular_file(const std::string &path) {
-diff --git a/filepath.cc b/filepath.cc
-index e12043bf..0e158da2 100644
---- a/filepath.cc
-+++ b/filepath.cc
-@@ -1,20 +1,39 @@
- #include "mold.h"
-
-+#ifdef __serenity__
-+#define AK_DONT_REPLACE_STD
-+#include <LibCore/File.h>
-+#else
- #include <filesystem>
-+#endif
- #include <sys/stat.h>
-
- namespace mold {
-
- std::string get_current_dir() {
-+#ifdef __serenity__
-+ auto str = Core::File::current_working_directory();
-+ return { str.characters(), str.length() };
-+#else
- return std::filesystem::current_path();
-+#endif
- }
-
- std::string get_realpath(std::string_view path) {
-+#ifdef __serenity__
-+ StringView sv{ path.data(), path.length() };
-+ errno = 0;
-+ auto str = Core::File::real_path_for(sv);
-+ if (str.is_empty() || errno != 0)
-+ return std::string(path);
-+ return { str.characters(), str.length() };
-+#else
- std::error_code ec;
- std::string ret = std::filesystem::canonical(path, ec);
- if (ec)
- return std::string(path);
- return ret;
-+#endif
- }
-
- bool path_is_dir(std::string_view path) {
---
-2.25.1
-