mirror of
https://github.com/SerenityOS/serenity.git
synced 2026-11-07 04:29:30 -10:00
Everywhere: Remove iOS support
Now that ladybird was hard-forked from SerenityOS, there's no good reason to keep supporting iOS. Ladybird only still exists in the SerenityOS repo to make testing LibWeb easier.
This commit is contained in:
1 parent
64aa3560b9
commit
77f058c32e
18 files changed
+34
-49
No files matched your search
+1
-6
@@ -76,16 +76,11 @@
|
||||
# define AK_OS_LINUX
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__) && defined(__MACH__) && !defined(__IOS__)
|
||||
#if defined(__APPLE__) && defined(__MACH__)
|
||||
# define AK_OS_MACOS
|
||||
# define AK_OS_BSD_GENERIC
|
||||
#endif
|
||||
|
||||
#if defined(__IOS__)
|
||||
# define AK_OS_IOS
|
||||
# define AK_OS_BSD_GENERIC
|
||||
#endif
|
||||
|
||||
#if defined(__FreeBSD__)
|
||||
# define AK_OS_BSD_GENERIC
|
||||
# define AK_OS_FREEBSD
|
||||
|
||||
+2
-2
@@ -12,7 +12,7 @@
|
||||
|
||||
#ifdef AK_OS_SERENITY
|
||||
# include <serenity.h>
|
||||
#elif defined(AK_OS_LINUX) || defined(AK_LIBC_GLIBC) || defined(AK_OS_MACOS) || defined(AK_OS_IOS) || defined(AK_OS_NETBSD) || defined(AK_OS_SOLARIS) || defined(AK_OS_HAIKU)
|
||||
#elif defined(AK_OS_LINUX) || defined(AK_LIBC_GLIBC) || defined(AK_OS_MACOS) || defined(AK_OS_NETBSD) || defined(AK_OS_SOLARIS) || defined(AK_OS_HAIKU)
|
||||
# include <pthread.h>
|
||||
# include <sys/resource.h>
|
||||
#elif defined(AK_OS_FREEBSD) || defined(AK_OS_OPENBSD)
|
||||
@@ -55,7 +55,7 @@ StackInfo::StackInfo()
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
pthread_attr_destroy(&attr);
|
||||
#elif defined(AK_OS_MACOS) || defined(AK_OS_IOS)
|
||||
#elif defined(AK_OS_MACOS)
|
||||
// NOTE: !! On MacOS, pthread_get_stackaddr_np gives the TOP of the stack, not the bottom!
|
||||
FlatPtr top_of_stack = (FlatPtr)pthread_get_stackaddr_np(pthread_self());
|
||||
m_size = (size_t)pthread_get_stacksize_np(pthread_self());
|
||||
|
||||
@@ -8,10 +8,6 @@ project(ladybird
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
if (IOS)
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
endif()
|
||||
|
||||
# FIXME: The rpath steps from lagom_install_rules.cmake do not produce a working binary
|
||||
# in the build directory on macOS.
|
||||
# We need to copy the libs into the build directory bundle as the install rules do.
|
||||
|
||||
@@ -4,7 +4,7 @@ if (NOT ENABLE_ACCELERATED_GRAPHICS OR EMSCRIPTEN)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if (APPLE AND NOT IOS)
|
||||
if (APPLE)
|
||||
set(HAS_ACCELERATED_GRAPHICS ON CACHE BOOL "" FORCE)
|
||||
set(ACCEL_GFX_LIBS "-framework OpenGL" CACHE STRING "" FORCE)
|
||||
else()
|
||||
|
||||
@@ -564,7 +564,7 @@ if (BUILD_LAGOM)
|
||||
|
||||
add_serenity_subdirectory(Userland/Shell)
|
||||
|
||||
if (NOT ENABLE_FUZZERS AND NOT ENABLE_COMPILER_EXPLORER_BUILD AND NOT IOS)
|
||||
if (NOT ENABLE_FUZZERS AND NOT ENABLE_COMPILER_EXPLORER_BUILD)
|
||||
# Lagom Services
|
||||
add_serenity_subdirectory(Userland/Services)
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ template("unix_toolchain") {
|
||||
}
|
||||
|
||||
tool("alink") {
|
||||
if (current_os == "ios" || current_os == "mac") {
|
||||
if (current_os == "mac") {
|
||||
command = "libtool -D -static -no_warning_for_no_symbols {{arflags}} -o {{output}} {{inputs}}"
|
||||
not_needed([ "ar" ])
|
||||
} else {
|
||||
@@ -93,7 +93,7 @@ template("unix_toolchain") {
|
||||
outfile = "{{output_dir}}/{{target_output_name}}{{output_extension}}"
|
||||
rspfile = outfile + ".rsp"
|
||||
rspfile_content = "{{inputs}}"
|
||||
if (current_os == "ios" || current_os == "mac") {
|
||||
if (current_os == "mac") {
|
||||
command = "$ld -shared {{ldflags}} -o $outfile @\"$rspfile\" {{libs}} {{frameworks}} -Wl,-install_name,@rpath/{{target_output_name}}{{output_extension}}"
|
||||
default_output_extension = ".dylib"
|
||||
} else {
|
||||
@@ -113,7 +113,7 @@ template("unix_toolchain") {
|
||||
|
||||
tool("solink_module") {
|
||||
outfile = "{{output_dir}}/{{target_output_name}}{{output_extension}}"
|
||||
if (current_os == "ios" || current_os == "mac") {
|
||||
if (current_os == "mac") {
|
||||
command = "$ld -shared {{ldflags}} -Wl,-flat_namespace -Wl,-undefined,suppress -o $outfile {{inputs}} {{libs}} {{frameworks}} -Wl,-install_name,@rpath/{{target_output_name}}{{output_extension}}"
|
||||
default_output_extension = ".dylib"
|
||||
} else {
|
||||
@@ -135,7 +135,7 @@ template("unix_toolchain") {
|
||||
command_launcher = "ccache"
|
||||
}
|
||||
outfile = "{{output_dir}}/{{target_output_name}}{{output_extension}}"
|
||||
if (current_os == "ios" || current_os == "mac") {
|
||||
if (current_os == "mac") {
|
||||
command = "$ld {{ldflags}} -o $outfile {{inputs}} {{libs}} {{frameworks}} -Wl,-rpath,@executable_path/../lib"
|
||||
} else {
|
||||
command = "$ld {{ldflags}} -o $outfile -Wl,--start-group {{inputs}} -Wl,--end-group -Wl,-rpath,\\\$ORIGIN/../lib {{libs}}"
|
||||
@@ -157,7 +157,7 @@ template("unix_toolchain") {
|
||||
description = "COPY {{source}} {{output}}"
|
||||
}
|
||||
|
||||
if (current_os == "ios" || current_os == "mac") {
|
||||
if (current_os == "mac") {
|
||||
tool("copy_bundle_data") {
|
||||
# https://github.com/nico/hack/blob/master/notes/copydir.md
|
||||
_copydir = "cd {{source}} && " +
|
||||
|
||||
@@ -42,7 +42,7 @@ if (HAVE_PULSEAUDIO)
|
||||
target_compile_definitions(LibAudio PRIVATE HAVE_PULSEAUDIO=1)
|
||||
endif()
|
||||
|
||||
if (APPLE AND NOT IOS)
|
||||
if (APPLE)
|
||||
target_sources(LibAudio PRIVATE PlaybackStreamAudioUnit.cpp)
|
||||
|
||||
find_library(AUDIO_UNIT AudioUnit REQUIRED)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
// Include the 119.9 KiB of dictionary data from a binary file
|
||||
extern u8 const brotli_dictionary_data[];
|
||||
#if defined(AK_OS_MACOS) || defined(AK_OS_IOS)
|
||||
#if defined(AK_OS_MACOS)
|
||||
asm(".const_data\n"
|
||||
".globl _brotli_dictionary_data\n"
|
||||
"_brotli_dictionary_data:\n");
|
||||
|
||||
@@ -88,7 +88,7 @@ elseif (LINUX AND NOT EMSCRIPTEN)
|
||||
FileWatcherLinux.cpp
|
||||
Platform/ProcessStatisticsLinux.cpp
|
||||
)
|
||||
elseif (APPLE AND NOT IOS)
|
||||
elseif (APPLE)
|
||||
list(APPEND SOURCES
|
||||
FileWatcherMacOS.mm
|
||||
Platform/ProcessStatisticsMach.cpp
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "Environment.h"
|
||||
#include <AK/ByteString.h>
|
||||
|
||||
#if defined(AK_OS_MACOS) || defined(AK_OS_IOS)
|
||||
#if defined(AK_OS_MACOS)
|
||||
# include <crt_externs.h>
|
||||
#else
|
||||
extern "C" char** environ;
|
||||
@@ -20,7 +20,7 @@ namespace Core::Environment {
|
||||
|
||||
char** raw_environ()
|
||||
{
|
||||
#if defined(AK_OS_MACOS) || defined(AK_OS_IOS)
|
||||
#if defined(AK_OS_MACOS)
|
||||
return *_NSGetEnviron();
|
||||
#else
|
||||
return environ;
|
||||
|
||||
@@ -92,7 +92,7 @@ bool LocalServer::listen(ByteString const& address)
|
||||
fcntl(m_fd, F_SETFD, FD_CLOEXEC);
|
||||
#endif
|
||||
VERIFY(m_fd >= 0);
|
||||
#if !defined(AK_OS_MACOS) && !defined(AK_OS_IOS)
|
||||
#if !defined(AK_OS_MACOS)
|
||||
rc = fchmod(m_fd, 0600);
|
||||
if (rc < 0) {
|
||||
perror("fchmod");
|
||||
@@ -129,7 +129,7 @@ ErrorOr<NonnullOwnPtr<LocalSocket>> LocalServer::accept()
|
||||
VERIFY(m_listening);
|
||||
sockaddr_un un;
|
||||
socklen_t un_size = sizeof(un);
|
||||
#if !defined(AK_OS_MACOS) && !defined(AK_OS_IOS) && !defined(AK_OS_HAIKU)
|
||||
#if !defined(AK_OS_MACOS) && !defined(AK_OS_HAIKU)
|
||||
int accepted_fd = ::accept4(m_fd, (sockaddr*)&un, &un_size, SOCK_NONBLOCK | SOCK_CLOEXEC);
|
||||
#else
|
||||
int accepted_fd = ::accept(m_fd, (sockaddr*)&un, &un_size);
|
||||
@@ -138,7 +138,7 @@ ErrorOr<NonnullOwnPtr<LocalSocket>> LocalServer::accept()
|
||||
return Error::from_syscall("accept"sv, -errno);
|
||||
}
|
||||
|
||||
#if defined(AK_OS_MACOS) || defined(AK_OS_IOS) || defined(AK_OS_HAIKU)
|
||||
#if defined(AK_OS_MACOS) || defined(AK_OS_HAIKU)
|
||||
int option = 1;
|
||||
ioctl(m_fd, FIONBIO, &option);
|
||||
(void)fcntl(accepted_fd, F_SETFD, FD_CLOEXEC);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <AK/Error.h>
|
||||
#include <AK/Noncopyable.h>
|
||||
|
||||
#if defined(AK_OS_MACOS) || defined(AK_OS_IOS)
|
||||
#if defined(AK_OS_MACOS)
|
||||
# include <mach/mach.h>
|
||||
#else
|
||||
extern "C" {
|
||||
|
||||
@@ -446,7 +446,7 @@ ErrorOr<Bytes> LocalSocket::receive_message(AK::Bytes buffer, int flags, Vector<
|
||||
|
||||
ErrorOr<pid_t> LocalSocket::peer_pid() const
|
||||
{
|
||||
#if defined(AK_OS_MACOS) || defined(AK_OS_IOS)
|
||||
#if defined(AK_OS_MACOS)
|
||||
pid_t pid;
|
||||
socklen_t pid_size = sizeof(pid);
|
||||
#elif defined(AK_OS_FREEBSD)
|
||||
@@ -468,7 +468,7 @@ ErrorOr<pid_t> LocalSocket::peer_pid() const
|
||||
socklen_t creds_size = sizeof(creds);
|
||||
#endif
|
||||
|
||||
#if defined(AK_OS_MACOS) || defined(AK_OS_IOS)
|
||||
#if defined(AK_OS_MACOS)
|
||||
TRY(System::getsockopt(m_helper.fd(), SOL_LOCAL, LOCAL_PEERPID, &pid, &pid_size));
|
||||
return pid;
|
||||
#elif defined(AK_OS_FREEBSD)
|
||||
|
||||
@@ -48,7 +48,7 @@ static int memfd_create(char const* name, unsigned int flags)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(AK_OS_MACOS) || defined(AK_OS_IOS)
|
||||
#if defined(AK_OS_MACOS)
|
||||
# include <mach-o/dyld.h>
|
||||
# include <sys/mman.h>
|
||||
#else
|
||||
@@ -141,7 +141,7 @@ static ErrorOr<Optional<struct group>> getgrent_impl(Span<char> buffer)
|
||||
namespace Core::System {
|
||||
|
||||
#ifndef HOST_NAME_MAX
|
||||
# if defined(AK_OS_MACOS) || defined(AK_OS_IOS)
|
||||
# if defined(AK_OS_MACOS)
|
||||
# define HOST_NAME_MAX 255
|
||||
# else
|
||||
# define HOST_NAME_MAX 64
|
||||
@@ -428,7 +428,7 @@ ErrorOr<Optional<struct spwd>> getspnam(StringView name)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(AK_OS_MACOS) && !defined(AK_OS_IOS) && !defined(AK_OS_HAIKU)
|
||||
#if !defined(AK_OS_MACOS) && !defined(AK_OS_HAIKU)
|
||||
ErrorOr<int> accept4(int sockfd, sockaddr* address, socklen_t* address_length, int flags)
|
||||
{
|
||||
auto fd = ::accept4(sockfd, address, address_length, flags);
|
||||
@@ -933,19 +933,17 @@ ErrorOr<Optional<struct group>> getgrnam(StringView name)
|
||||
return Optional<struct group> {};
|
||||
}
|
||||
|
||||
#if !defined(AK_OS_IOS)
|
||||
ErrorOr<void> clock_settime(clockid_t clock_id, struct timespec* ts)
|
||||
{
|
||||
# ifdef AK_OS_SERENITY
|
||||
#ifdef AK_OS_SERENITY
|
||||
int rc = syscall(SC_clock_settime, clock_id, ts);
|
||||
HANDLE_SYSCALL_RETURN_VALUE("clocksettime", rc, {});
|
||||
# else
|
||||
#else
|
||||
if (::clock_settime(clock_id, ts) < 0)
|
||||
return Error::from_syscall("clocksettime"sv, -errno);
|
||||
return {};
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static ALWAYS_INLINE ErrorOr<pid_t> posix_spawn_wrapper(StringView path, posix_spawn_file_actions_t const* file_actions, posix_spawnattr_t const* attr, char* const arguments[], char* const envp[], StringView function_name, decltype(::posix_spawn) spawn_function)
|
||||
{
|
||||
@@ -1431,7 +1429,7 @@ ErrorOr<void> exec(StringView filename, ReadonlySpan<StringView> arguments, Sear
|
||||
envp[environment->size()] = nullptr;
|
||||
|
||||
if (search_in_path == SearchInPath::Yes && !filename.contains('/')) {
|
||||
# if defined(AK_OS_MACOS) || defined(AK_OS_IOS) || defined(AK_OS_FREEBSD) || defined(AK_OS_SOLARIS)
|
||||
# if defined(AK_OS_MACOS) || defined(AK_OS_FREEBSD) || defined(AK_OS_SOLARIS)
|
||||
// These BSDs don't support execvpe(), so we'll have to manually search the PATH.
|
||||
ScopedValueRollback errno_rollback(errno);
|
||||
|
||||
@@ -1867,7 +1865,7 @@ ErrorOr<ByteString> current_executable_path()
|
||||
size_t len = sizeof(path);
|
||||
if (sysctl(mib, 4, path, &len, nullptr, 0) < 0)
|
||||
return Error::from_syscall("sysctl"sv, -errno);
|
||||
#elif defined(AK_OS_MACOS) || defined(AK_OS_IOS)
|
||||
#elif defined(AK_OS_MACOS)
|
||||
u32 size = sizeof(path);
|
||||
auto ret = _NSGetExecutablePath(path, &size);
|
||||
if (ret != 0)
|
||||
|
||||
@@ -157,9 +157,7 @@ ErrorOr<Optional<struct passwd>> getpwuid(uid_t);
|
||||
ErrorOr<Optional<struct group>> getgrent(Span<char> buffer);
|
||||
ErrorOr<Optional<struct group>> getgrgid(gid_t);
|
||||
|
||||
#if !defined(AK_OS_IOS)
|
||||
ErrorOr<void> clock_settime(clockid_t clock_id, struct timespec* ts);
|
||||
#endif
|
||||
|
||||
ErrorOr<pid_t> posix_spawn(StringView path, posix_spawn_file_actions_t const* file_actions, posix_spawnattr_t const* attr, char* const arguments[], char* const envp[]);
|
||||
ErrorOr<pid_t> posix_spawnp(StringView path, posix_spawn_file_actions_t* const file_actions, posix_spawnattr_t* const attr, char* const arguments[], char* const envp[]);
|
||||
|
||||
@@ -80,7 +80,7 @@ ErrorOr<NonnullOwnPtr<TCPSocket>> TCPServer::accept()
|
||||
VERIFY(m_listening);
|
||||
sockaddr_in in;
|
||||
socklen_t in_size = sizeof(in);
|
||||
#if !defined(AK_OS_MACOS) && !defined(AK_OS_IOS) && !defined(AK_OS_HAIKU)
|
||||
#if !defined(AK_OS_MACOS) && !defined(AK_OS_HAIKU)
|
||||
int accepted_fd = TRY(Core::System::accept4(m_fd, (sockaddr*)&in, &in_size, SOCK_NONBLOCK | SOCK_CLOEXEC));
|
||||
#else
|
||||
int accepted_fd = TRY(Core::System::accept(m_fd, (sockaddr*)&in, &in_size));
|
||||
@@ -88,7 +88,7 @@ ErrorOr<NonnullOwnPtr<TCPSocket>> TCPServer::accept()
|
||||
|
||||
auto socket = TRY(TCPSocket::adopt_fd(accepted_fd));
|
||||
|
||||
#if defined(AK_OS_MACOS) || defined(AK_OS_IOS) || defined(AK_OS_HAIKU)
|
||||
#if defined(AK_OS_MACOS) || defined(AK_OS_HAIKU)
|
||||
// FIXME: Ideally, we should let the caller decide whether it wants the
|
||||
// socket to be nonblocking or not, but there are currently places
|
||||
// which depend on this.
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#if defined(AK_OS_SERENITY)
|
||||
# include <serenity.h>
|
||||
#elif !defined(AK_OS_IOS) && defined(AK_OS_BSD_GENERIC)
|
||||
#elif defined(AK_OS_BSD_GENERIC)
|
||||
# include <sys/disk.h>
|
||||
#elif defined(AK_OS_LINUX)
|
||||
# include <linux/fs.h>
|
||||
@@ -231,7 +231,7 @@ ErrorOr<void> copy_file(StringView destination_path, StringView source_path, str
|
||||
|
||||
if (has_flag(preserve_mode, PreserveMode::Timestamps)) {
|
||||
struct timespec times[2] = {
|
||||
#if defined(AK_OS_MACOS) || defined(AK_OS_IOS)
|
||||
#if defined(AK_OS_MACOS)
|
||||
source_stat.st_atimespec,
|
||||
source_stat.st_mtimespec,
|
||||
#else
|
||||
@@ -283,7 +283,7 @@ ErrorOr<void> copy_directory(StringView destination_path, StringView source_path
|
||||
|
||||
if (has_flag(preserve_mode, PreserveMode::Timestamps)) {
|
||||
struct timespec times[2] = {
|
||||
#if defined(AK_OS_MACOS) || defined(AK_OS_IOS)
|
||||
#if defined(AK_OS_MACOS)
|
||||
source_stat.st_atimespec,
|
||||
source_stat.st_mtimespec,
|
||||
#else
|
||||
|
||||
@@ -30,8 +30,6 @@ namespace Web {
|
||||
# define OS_STRING "Linux"
|
||||
#elif defined(AK_OS_MACOS)
|
||||
# define OS_STRING "macOS"
|
||||
#elif defined(AK_OS_IOS)
|
||||
# define OS_STRING "iOS"
|
||||
#elif defined(AK_OS_WINDOWS)
|
||||
# define OS_STRING "Windows"
|
||||
#elif defined(AK_OS_FREEBSD)
|
||||
|
||||
Reference in new issue
Block a user