mirror of
https://github.com/SerenityOS/serenity
synced 2026-04-25 17:15:42 +02:00
Toolchain+Ports: Update LLVM to 22.1.0
This commit is contained in:
@@ -18,7 +18,7 @@ endif()
|
||||
|
||||
# Check for toolchain mismatch, user might need to rebuild toolchain
|
||||
set(GCC_VERSION "15.2.0")
|
||||
set(LLVM_VERSION "21.1.0")
|
||||
set(LLVM_VERSION "22.1.0")
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
set(EXPECTED_COMPILER_VERSION "${GCC_VERSION}")
|
||||
else()
|
||||
|
||||
@@ -197,7 +197,7 @@ This list is also available at [ports.serenityos.net](https://ports.serenityos.n
|
||||
| [`libzip`](libzip/) | libzip | 1.10.1 | https://libzip.org/ |
|
||||
| [`links`](links/) | Links web browser | 2.29 | http://links.twibright.com/ |
|
||||
| [`lite-xl`](lite-xl/) | Lite-XL | 2.1.3 | https://lite-xl.com/ |
|
||||
| [`llvm`](llvm/) | LLVM | 21.1.0 | https://llvm.org/ |
|
||||
| [`llvm`](llvm/) | LLVM | 22.1.0 | https://llvm.org/ |
|
||||
| [`lolcat`](lolcat/) | lolcat | 1212a9c | https://github.com/jaseg/lolcat/ |
|
||||
| [`lowdown`](lowdown/) | lowdown | 1.0.2 | https://kristaps.bsd.lv/lowdown/ |
|
||||
| [`lrzip`](lrzip/) | lrzip | 0.651 | https://github.com/ckolivas/lrzip |
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#!/usr/bin/env -S bash ../.port_include.sh
|
||||
port='llvm'
|
||||
useconfigure='true'
|
||||
version='21.1.0'
|
||||
version='22.1.0'
|
||||
workdir="llvm-project-${version}.src"
|
||||
configopts=(
|
||||
"-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt"
|
||||
)
|
||||
files=(
|
||||
"https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz#1672e3efb4c2affd62dbbe12ea898b28a451416c7d95c1bd0190c26cbe878825"
|
||||
"https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz#25d2e2adc4356d758405dd885fcfd6447bce82a90eb78b6b87ce0934bd077173"
|
||||
)
|
||||
depends=(
|
||||
"ncurses"
|
||||
|
||||
@@ -63,8 +63,8 @@ echo PREFIX is "$PREFIX"
|
||||
|
||||
mkdir -p "$DIR/Tarballs"
|
||||
|
||||
LLVM_VERSION="21.1.0"
|
||||
LLVM_MD5SUM="b2c81351902a6526499ceb4172b0b994"
|
||||
LLVM_VERSION="22.1.0"
|
||||
LLVM_MD5SUM="eebd30f81349347d789f04b5ddd41112"
|
||||
LLVM_NAME="llvm-project-$LLVM_VERSION.src"
|
||||
LLVM_PKG="$LLVM_NAME.tar.xz"
|
||||
LLVM_URL="https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/$LLVM_PKG"
|
||||
|
||||
@@ -16,7 +16,7 @@ Co-authored-by: Andrew Kaster <akaster@serenityos.org>
|
||||
Co-authored-by: Daniel Bertalan <dani@danielbertalan.dev>
|
||||
Co-authored-by: Dan Klishch <danilklishch@gmail.com>
|
||||
---
|
||||
clang/lib/Basic/Targets.cpp | 12 ++
|
||||
clang/lib/Basic/Targets.cpp | 13 ++
|
||||
clang/lib/Basic/Targets/OSTargets.h | 17 ++
|
||||
clang/lib/Driver/CMakeLists.txt | 1 +
|
||||
clang/lib/Driver/Driver.cpp | 4 +
|
||||
@@ -32,7 +32,7 @@ Co-authored-by: Dan Klishch <danilklishch@gmail.com>
|
||||
clang/test/Driver/pic.c | 6 +
|
||||
clang/test/Driver/save-stats.c | 2 +
|
||||
clang/test/Driver/serenity.cpp | 199 +++++++++++++++++
|
||||
16 files changed, 534 insertions(+), 1 deletion(-)
|
||||
16 files changed, 535 insertions(+), 1 deletion(-)
|
||||
create mode 100644 clang/lib/Driver/ToolChains/Serenity.cpp
|
||||
create mode 100644 clang/lib/Driver/ToolChains/Serenity.h
|
||||
create mode 100644 clang/test/Driver/Inputs/serenity_x86_64_tree/usr/include/c++/v1/.keep
|
||||
@@ -43,30 +43,31 @@ Co-authored-by: Dan Klishch <danilklishch@gmail.com>
|
||||
create mode 100644 clang/test/Driver/serenity.cpp
|
||||
|
||||
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
|
||||
index 5d11578893c66d2ec5f8ef40617e49d4fad615dc..0cc3e60a383c380999a845f325f97a8ee7011e1f 100644
|
||||
index 263253918d965d9447a8b673661d14af49502dc1..44ac616229c37d95176dd0ddc1e759d26ccd4dab 100644
|
||||
--- a/clang/lib/Basic/Targets.cpp
|
||||
+++ b/clang/lib/Basic/Targets.cpp
|
||||
@@ -173,6 +173,9 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
|
||||
case llvm::Triple::OpenBSD:
|
||||
return std::make_unique<OpenBSDTargetInfo<AArch64leTargetInfo>>(Triple,
|
||||
Opts);
|
||||
@@ -175,6 +175,9 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
|
||||
case llvm::Triple::Hurd:
|
||||
return std::make_unique<HurdTargetInfo<AArch64leTargetInfo>>(Triple,
|
||||
Opts);
|
||||
+ case llvm::Triple::Serenity:
|
||||
+ return std::make_unique<SerenityTargetInfo<AArch64leTargetInfo>>(Triple,
|
||||
+ Opts);
|
||||
case llvm::Triple::Win32:
|
||||
switch (Triple.getEnvironment()) {
|
||||
case llvm::Triple::GNU:
|
||||
@@ -472,6 +475,9 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
|
||||
case llvm::Triple::Managarm:
|
||||
return std::make_unique<ManagarmTargetInfo<RISCV64TargetInfo>>(Triple,
|
||||
@@ -473,6 +476,10 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
|
||||
Opts);
|
||||
case llvm::Triple::Hurd:
|
||||
return std::make_unique<HurdTargetInfo<RISCV64TargetInfo>>(Triple, Opts);
|
||||
+
|
||||
+ case llvm::Triple::Serenity:
|
||||
+ return std::make_unique<SerenityTargetInfo<RISCV64TargetInfo>>(Triple,
|
||||
+ Opts);
|
||||
default:
|
||||
return std::make_unique<RISCV64TargetInfo>(Triple, Opts);
|
||||
}
|
||||
@@ -597,6 +603,9 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
|
||||
@@ -596,6 +603,9 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
|
||||
return std::make_unique<MCUX86_32TargetInfo>(Triple, Opts);
|
||||
case llvm::Triple::Hurd:
|
||||
return std::make_unique<HurdTargetInfo<X86_32TargetInfo>>(Triple, Opts);
|
||||
@@ -76,7 +77,7 @@ index 5d11578893c66d2ec5f8ef40617e49d4fad615dc..0cc3e60a383c380999a845f325f97a8e
|
||||
default:
|
||||
return std::make_unique<X86_32TargetInfo>(Triple, Opts);
|
||||
}
|
||||
@@ -663,6 +672,9 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
|
||||
@@ -660,6 +670,9 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
|
||||
case llvm::Triple::Managarm:
|
||||
return std::make_unique<ManagarmTargetInfo<X86_64TargetInfo>>(Triple,
|
||||
Opts);
|
||||
@@ -87,10 +88,10 @@ index 5d11578893c66d2ec5f8ef40617e49d4fad615dc..0cc3e60a383c380999a845f325f97a8e
|
||||
return std::make_unique<X86_64TargetInfo>(Triple, Opts);
|
||||
}
|
||||
diff --git a/clang/lib/Basic/Targets/OSTargets.h b/clang/lib/Basic/Targets/OSTargets.h
|
||||
index c1a68f464e83124aa0d75680dfaf84f4dfb76e0c..0c9a854f09ec9754cdb10ad7e052afb10953ab68 100644
|
||||
index 04608649a8634fbf5a659c234f67f1f67719a341..951bcfbde594d4ef4d0b29467bfc3107e587a742 100644
|
||||
--- a/clang/lib/Basic/Targets/OSTargets.h
|
||||
+++ b/clang/lib/Basic/Targets/OSTargets.h
|
||||
@@ -1070,6 +1070,23 @@ public:
|
||||
@@ -1089,6 +1089,23 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
@@ -115,7 +116,7 @@ index c1a68f464e83124aa0d75680dfaf84f4dfb76e0c..0c9a854f09ec9754cdb10ad7e052afb1
|
||||
} // namespace clang
|
||||
#endif // LLVM_CLANG_LIB_BASIC_TARGETS_OSTARGETS_H
|
||||
diff --git a/clang/lib/Driver/CMakeLists.txt b/clang/lib/Driver/CMakeLists.txt
|
||||
index 0268ec49eaf119e0d459e8747491684b1ce11675..1d2b39cb60fccbd6579c15b24d4c636d7cb23907 100644
|
||||
index 0026ba89917195530e522bbe145b1f70d645de77..715fcc5ae945d3112932364a9e7328dfc4151401 100644
|
||||
--- a/clang/lib/Driver/CMakeLists.txt
|
||||
+++ b/clang/lib/Driver/CMakeLists.txt
|
||||
@@ -76,6 +76,7 @@ add_clang_library(clangDriver
|
||||
@@ -127,7 +128,7 @@ index 0268ec49eaf119e0d459e8747491684b1ce11675..1d2b39cb60fccbd6579c15b24d4c636d
|
||||
ToolChains/SPIRV.cpp
|
||||
ToolChains/SPIRVOpenMP.cpp
|
||||
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
|
||||
index 55748c0bce91872c37d782214110fe1d8b9deb7a..75f5578d06e56f026f7575262565789eb2b0f614 100644
|
||||
index eb3f9cbea2845a16d35d463580d16c9f7b790052..3a1804a8636ecbedcb576a7cfd2450da8fc451a5 100644
|
||||
--- a/clang/lib/Driver/Driver.cpp
|
||||
+++ b/clang/lib/Driver/Driver.cpp
|
||||
@@ -46,6 +46,7 @@
|
||||
@@ -138,7 +139,7 @@ index 55748c0bce91872c37d782214110fe1d8b9deb7a..75f5578d06e56f026f7575262565789e
|
||||
#include "ToolChains/Solaris.h"
|
||||
#include "ToolChains/TCE.h"
|
||||
#include "ToolChains/UEFI.h"
|
||||
@@ -6850,6 +6851,9 @@ const ToolChain &Driver::getToolChain(const ArgList &Args,
|
||||
@@ -6883,6 +6884,9 @@ const ToolChain &Driver::getToolChain(const ArgList &Args,
|
||||
case llvm::Triple::Managarm:
|
||||
TC = std::make_unique<toolchains::Managarm>(*this, Target, Args);
|
||||
break;
|
||||
@@ -149,10 +150,10 @@ index 55748c0bce91872c37d782214110fe1d8b9deb7a..75f5578d06e56f026f7575262565789e
|
||||
TC = std::make_unique<toolchains::Solaris>(*this, Target, Args);
|
||||
break;
|
||||
diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp
|
||||
index 07a3ae925f96df53678e138c294d9c5d7db950ae..d737380a681511cfc47da24f0b46947b0729faac 100644
|
||||
index 77a2c73f0d446b124bf3d0e3cf95544d6c695319..095d216fa54c683ffa6f018b58f3d82c1f50a3d8 100644
|
||||
--- a/clang/lib/Driver/ToolChain.cpp
|
||||
+++ b/clang/lib/Driver/ToolChain.cpp
|
||||
@@ -696,6 +696,8 @@ StringRef ToolChain::getOSLibName() const {
|
||||
@@ -717,6 +717,8 @@ StringRef ToolChain::getOSLibName() const {
|
||||
return "sunos";
|
||||
case llvm::Triple::AIX:
|
||||
return "aix";
|
||||
@@ -161,7 +162,7 @@ index 07a3ae925f96df53678e138c294d9c5d7db950ae..d737380a681511cfc47da24f0b46947b
|
||||
default:
|
||||
return getOS();
|
||||
}
|
||||
@@ -1335,7 +1337,8 @@ ToolChain::UnwindLibType ToolChain::GetUnwindLibType(
|
||||
@@ -1358,7 +1360,8 @@ ToolChain::UnwindLibType ToolChain::GetUnwindLibType(
|
||||
else if (LibName == "platform" || LibName == "") {
|
||||
ToolChain::RuntimeLibType RtLibType = GetRuntimeLibType(Args);
|
||||
if (RtLibType == ToolChain::RLT_CompilerRT) {
|
||||
@@ -173,7 +174,7 @@ index 07a3ae925f96df53678e138c294d9c5d7db950ae..d737380a681511cfc47da24f0b46947b
|
||||
unwindLibType = ToolChain::UNW_None;
|
||||
diff --git a/clang/lib/Driver/ToolChains/Serenity.cpp b/clang/lib/Driver/ToolChains/Serenity.cpp
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..52d7789fd92cf667c99577a3f7e3ba940ee789ad
|
||||
index 0000000000000000000000000000000000000000..2f224f4305108385e8526dd7d681920f49b47afa
|
||||
--- /dev/null
|
||||
+++ b/clang/lib/Driver/ToolChains/Serenity.cpp
|
||||
@@ -0,0 +1,202 @@
|
||||
@@ -190,8 +191,8 @@ index 0000000000000000000000000000000000000000..52d7789fd92cf667c99577a3f7e3ba94
|
||||
+#include "clang/Driver/CommonArgs.h"
|
||||
+#include "clang/Driver/Compilation.h"
|
||||
+#include "clang/Driver/Driver.h"
|
||||
+#include "clang/Driver/Options.h"
|
||||
+#include "clang/Driver/SanitizerArgs.h"
|
||||
+#include "clang/Options/Options.h"
|
||||
+#include "llvm/Option/ArgList.h"
|
||||
+#include "llvm/Support/VirtualFileSystem.h"
|
||||
+#include <string>
|
||||
@@ -472,10 +473,10 @@ index 0000000000000000000000000000000000000000..6f86c30da8ca1e552102bf305d6ffcc7
|
||||
+
|
||||
+#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_SERENITY_H
|
||||
diff --git a/clang/lib/Lex/InitHeaderSearch.cpp b/clang/lib/Lex/InitHeaderSearch.cpp
|
||||
index 3e22b4001bde770167ca19c40d3849817adaf3ef..57012e5997d788ffedfe8fa83f25404e717fdcb2 100644
|
||||
index e30925f4e548c377d8cdd6621f5609e74f37b04a..ed6e72929b71892f6bf1b220474a3d63638a20cd 100644
|
||||
--- a/clang/lib/Lex/InitHeaderSearch.cpp
|
||||
+++ b/clang/lib/Lex/InitHeaderSearch.cpp
|
||||
@@ -228,6 +228,7 @@ bool InitHeaderSearch::ShouldAddDefaultIncludePaths(
|
||||
@@ -227,6 +227,7 @@ bool InitHeaderSearch::ShouldAddDefaultIncludePaths(
|
||||
case llvm::Triple::PS4:
|
||||
case llvm::Triple::PS5:
|
||||
case llvm::Triple::RTEMS:
|
||||
|
||||
@@ -25,10 +25,10 @@ Co-Authored-By: Tim Schumacher <timschumi@gmx.de>
|
||||
6 files changed, 21 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
|
||||
index c126b0d073322248cf21845bb75fea9362c99892..32cdd83c0b9f008e54667316cbeffb463e4c760f 100644
|
||||
index 311123084bf5874ce991dbf000466cb8f1c2bedb..fe46b41d0e3609372404c4e8d2657df6646e78ea 100644
|
||||
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
|
||||
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
|
||||
@@ -560,6 +560,9 @@ elseif(MINGW OR CYGWIN)
|
||||
@@ -567,6 +567,9 @@ elseif(MINGW OR CYGWIN)
|
||||
if (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
append("-Wa,-mbig-obj" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
||||
endif()
|
||||
@@ -39,7 +39,7 @@ index c126b0d073322248cf21845bb75fea9362c99892..32cdd83c0b9f008e54667316cbeffb46
|
||||
|
||||
option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON)
|
||||
diff --git a/llvm/include/llvm/ADT/bit.h b/llvm/include/llvm/ADT/bit.h
|
||||
index d6e33c3e6133a0171e6f5b0ec40a76d371043c36..3ecea1c4e44ac7f889fa5d526b50c17b11a818e6 100644
|
||||
index 5971b75045b6b5f40b46900b685faf2e475c5a7f..94e85cc1d6e5f1ae7070c3edf8cb55984f156d3d 100644
|
||||
--- a/llvm/include/llvm/ADT/bit.h
|
||||
+++ b/llvm/include/llvm/ADT/bit.h
|
||||
@@ -30,7 +30,8 @@
|
||||
@@ -53,10 +53,10 @@ index d6e33c3e6133a0171e6f5b0ec40a76d371043c36..3ecea1c4e44ac7f889fa5d526b50c17b
|
||||
#elif defined(_AIX)
|
||||
#include <sys/machine.h>
|
||||
diff --git a/llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp b/llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp
|
||||
index ea3b22a0924372426e698ccdea69eb8395ebb70f..91536d4c1136813d907b840c81c7c370401bf3a8 100644
|
||||
index 4e7db822776ccdb3a42b33ab10f914d52602eb09..504ca6547aab0fcb2bd6290c1975524a085e8383 100644
|
||||
--- a/llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp
|
||||
+++ b/llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp
|
||||
@@ -228,7 +228,8 @@ SharedMemoryMapper::Create(ExecutorProcessControl &EPC, SymbolAddrs SAs) {
|
||||
@@ -219,7 +219,8 @@ SharedMemoryMapper::Create(ExecutorProcessControl &EPC, SymbolAddrs SAs) {
|
||||
|
||||
void SharedMemoryMapper::reserve(size_t NumBytes,
|
||||
OnReservedFunction OnReserved) {
|
||||
@@ -67,10 +67,10 @@ index ea3b22a0924372426e698ccdea69eb8395ebb70f..91536d4c1136813d907b840c81c7c370
|
||||
int SharedMemoryId = -1;
|
||||
EPC.callSPSWrapperAsync<
|
||||
diff --git a/llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp b/llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp
|
||||
index 8c24b1f3f5265c9263709013502f54cc5d4f3175..207a9272c1ccc3852d91e0adc50f0ada92bf55e0 100644
|
||||
index 423a1bd496c96b89d517187ab794f70eb8091bbc..7a2b7bba0fc7c25f41d6413f1ab09610a59b9a7b 100644
|
||||
--- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp
|
||||
+++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp
|
||||
@@ -52,7 +52,8 @@ static DWORD getWindowsProtectionFlags(MemProt MP) {
|
||||
@@ -50,7 +50,8 @@ static DWORD getWindowsProtectionFlags(MemProt MP) {
|
||||
|
||||
Expected<std::pair<ExecutorAddr, std::string>>
|
||||
ExecutorSharedMemoryMapperService::reserve(uint64_t Size) {
|
||||
@@ -81,10 +81,10 @@ index 8c24b1f3f5265c9263709013502f54cc5d4f3175..207a9272c1ccc3852d91e0adc50f0ada
|
||||
#if defined(LLVM_ON_UNIX)
|
||||
|
||||
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc
|
||||
index 277247e3cc2366cc2e2fdd05d1c454f0adf4b046..0778e4772052153758ff705fec779ce4dd971ddf 100644
|
||||
index fc71ca46d823a512925262f786bcdc6a3598d575..2fc55ec7c18bbb38691819f219f3885bf280d509 100644
|
||||
--- a/llvm/lib/Support/Unix/Path.inc
|
||||
+++ b/llvm/lib/Support/Unix/Path.inc
|
||||
@@ -108,7 +108,7 @@ typedef uint_t uint;
|
||||
@@ -111,7 +111,7 @@ typedef uint_t uint;
|
||||
#endif
|
||||
|
||||
#if defined(__NetBSD__) || defined(__DragonFly__) || defined(__GNU__) || \
|
||||
@@ -93,7 +93,7 @@ index 277247e3cc2366cc2e2fdd05d1c454f0adf4b046..0778e4772052153758ff705fec779ce4
|
||||
#define STATVFS_F_FLAG(vfs) (vfs).f_flag
|
||||
#else
|
||||
#define STATVFS_F_FLAG(vfs) (vfs).f_flags
|
||||
@@ -511,6 +511,9 @@ static bool is_local_impl(struct STATVFS &Vfs) {
|
||||
@@ -520,6 +520,9 @@ static bool is_local_impl(struct STATVFS &Vfs) {
|
||||
#elif defined(__HAIKU__)
|
||||
// Haiku doesn't expose this information.
|
||||
return false;
|
||||
@@ -104,10 +104,10 @@ index 277247e3cc2366cc2e2fdd05d1c454f0adf4b046..0778e4772052153758ff705fec779ce4
|
||||
// statvfs::f_basetype contains a null-terminated FSType name of the mounted
|
||||
// target
|
||||
diff --git a/llvm/lib/Support/Unix/Program.inc b/llvm/lib/Support/Unix/Program.inc
|
||||
index 4f17b2257a756e6fc67ea01a8cad85bd42696118..152305e46dd3fb26b30a845240f3f2744ca7ffa4 100644
|
||||
index 489ca03b3067069e527a4416758e1a215aadda9e..b3e76af711c5e3ddaa74ea68b1d48f30c1749310 100644
|
||||
--- a/llvm/lib/Support/Unix/Program.inc
|
||||
+++ b/llvm/lib/Support/Unix/Program.inc
|
||||
@@ -335,7 +335,7 @@ static bool Execute(ProcessInfo &PI, StringRef Program,
|
||||
@@ -334,7 +334,7 @@ static bool Execute(ProcessInfo &PI, StringRef Program,
|
||||
namespace llvm {
|
||||
namespace sys {
|
||||
|
||||
@@ -116,7 +116,7 @@ index 4f17b2257a756e6fc67ea01a8cad85bd42696118..152305e46dd3fb26b30a845240f3f274
|
||||
static pid_t(wait4)(pid_t pid, int *status, int options, struct rusage *usage);
|
||||
#elif !defined(__Fuchsia__)
|
||||
using ::wait4;
|
||||
@@ -378,6 +378,13 @@ pid_t(llvm::sys::wait4)(pid_t pid, int *status, int options,
|
||||
@@ -377,6 +377,13 @@ pid_t(llvm::sys::wait4)(pid_t pid, int *status, int options,
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -16,15 +16,15 @@ it, and the ELF sections that store version data would just waste space.
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
|
||||
index 32cdd83c0b9f008e54667316cbeffb463e4c760f..dfae22ba01dd81787ebb9d6962a4efddccc44753 100644
|
||||
index fe46b41d0e3609372404c4e8d2657df6646e78ea..c3fccfb84907a242254bddb22b8cfd280e38dac0 100644
|
||||
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
|
||||
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
|
||||
@@ -232,7 +232,7 @@ if(WIN32 OR CYGWIN)
|
||||
elseif(FUCHSIA OR UNIX)
|
||||
set(LLVM_ON_WIN32 0)
|
||||
@@ -237,7 +237,7 @@ if(WIN32)
|
||||
set(LLVM_ON_UNIX 0)
|
||||
elseif(FUCHSIA OR UNIX OR CYGWIN)
|
||||
set(LLVM_ON_UNIX 1)
|
||||
- if(APPLE OR ${CMAKE_SYSTEM_NAME} MATCHES "AIX")
|
||||
+ if(APPLE OR SERENITYOS OR ${CMAKE_SYSTEM_NAME} MATCHES "AIX")
|
||||
- if(APPLE OR CYGWIN OR "${CMAKE_SYSTEM_NAME}" MATCHES "AIX")
|
||||
+ if(APPLE OR SERENITYOS OR CYGWIN OR "${CMAKE_SYSTEM_NAME}" MATCHES "AIX")
|
||||
set(LLVM_HAVE_LINK_VERSION_SCRIPT 0)
|
||||
else()
|
||||
set(LLVM_HAVE_LINK_VERSION_SCRIPT 1)
|
||||
|
||||
@@ -9,12 +9,12 @@ enough to linux to use the pre-canned InstrProfiling implementation.
|
||||
clang/lib/Driver/ToolChains/Serenity.cpp | 3 +++
|
||||
clang/test/Driver/instrprof-ld.c | 20 +++++++++++++++++++
|
||||
compiler-rt/cmake/config-ix.cmake | 2 +-
|
||||
.../lib/profile/InstrProfilingPlatformLinux.c | 3 ++-
|
||||
.../lib/profile/InstrProfilingPlatformOther.c | 2 +-
|
||||
.../lib/profile/InstrProfilingPlatformLinux.c | 2 +-
|
||||
.../lib/profile/InstrProfilingPlatformOther.c | 3 ++-
|
||||
5 files changed, 27 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/clang/lib/Driver/ToolChains/Serenity.cpp b/clang/lib/Driver/ToolChains/Serenity.cpp
|
||||
index 52d7789fd92cf667c99577a3f7e3ba940ee789ad..07f785eb4de117d4631ad2021044bd7df91d91af 100644
|
||||
index 2f224f4305108385e8526dd7d681920f49b47afa..922b72921125d3ca8fae839ba5e322147d9f3c03 100644
|
||||
--- a/clang/lib/Driver/ToolChains/Serenity.cpp
|
||||
+++ b/clang/lib/Driver/ToolChains/Serenity.cpp
|
||||
@@ -162,6 +162,9 @@ void tools::serenity::Linker::ConstructJob(Compilation &C, const JobAction &JA,
|
||||
@@ -66,42 +66,43 @@ index a96bba4a1e763ce4a8ca1ef11f29bcf49ccff10a..4b099da9e2d2f0986636976a05443c94
|
||||
// RUN: --target=x86_64-apple-darwin14 -fprofile-instr-generate -fuse-ld=ld \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir \
|
||||
diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
|
||||
index e3310b1ff0e2ceaac82a0269d61d30b1a8badaf9..365072cc7b7db59568cc75ae9e5d992645bbef98 100644
|
||||
index 1f82ff3cf75312d58c1a28547a75174fc09df536..0a99d9653735c306cde9a2832ca1b4fd12175f2d 100644
|
||||
--- a/compiler-rt/cmake/config-ix.cmake
|
||||
+++ b/compiler-rt/cmake/config-ix.cmake
|
||||
@@ -836,7 +836,7 @@ else()
|
||||
@@ -842,7 +842,7 @@ else()
|
||||
endif()
|
||||
|
||||
if (PROFILE_SUPPORTED_ARCH AND NOT LLVM_USE_SANITIZER AND
|
||||
- OS_NAME MATCHES "Darwin|Linux|FreeBSD|Windows|Android|Fuchsia|SunOS|NetBSD|AIX|WASI|Haiku")
|
||||
+ OS_NAME MATCHES "Darwin|Linux|FreeBSD|Windows|Android|Fuchsia|SunOS|NetBSD|AIX|WASI|Haiku|SerenityOS")
|
||||
- (OS_NAME MATCHES "Darwin|Linux|FreeBSD|Windows|Android|Fuchsia|SunOS|NetBSD|AIX|WASI|Haiku" OR COMPILER_RT_PROFILE_BAREMETAL))
|
||||
+ (OS_NAME MATCHES "Darwin|Linux|FreeBSD|Windows|Android|Fuchsia|SunOS|NetBSD|AIX|WASI|Haiku|SerenityOS" OR COMPILER_RT_PROFILE_BAREMETAL))
|
||||
set(COMPILER_RT_HAS_PROFILE TRUE)
|
||||
else()
|
||||
set(COMPILER_RT_HAS_PROFILE FALSE)
|
||||
diff --git a/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c b/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c
|
||||
index 558b7fc8cad62a5d64c35317712098029ee63802..45389ae2787a0185097dade108ecf71790bec6ba 100644
|
||||
index acdb222004fd47ac8e3016eafdaeda69d2bb2e04..42cfc8805f6455119291bd700fa9d6f739b2370d 100644
|
||||
--- a/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c
|
||||
+++ b/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c
|
||||
@@ -8,7 +8,8 @@
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#if defined(__linux__) || defined(__FreeBSD__) || defined(__Fuchsia__) || \
|
||||
(defined(__sun__) && defined(__svr4__)) || defined(__NetBSD__) || \
|
||||
- defined(_AIX) || defined(__wasm__) || defined(__HAIKU__)
|
||||
+ defined(_AIX) || defined(__wasm__) || defined(__HAIKU__) || \
|
||||
+ defined(__serenity__)
|
||||
defined(_AIX) || defined(__wasm__) || defined(__HAIKU__) || \
|
||||
- defined(COMPILER_RT_PROFILE_BAREMETAL)
|
||||
+ defined(__serenity__) || defined(COMPILER_RT_PROFILE_BAREMETAL)
|
||||
|
||||
#if !defined(_AIX) && !defined(__wasm__)
|
||||
#include <elf.h>
|
||||
#if !defined(_AIX) && !defined(__wasm__) && \
|
||||
!defined(COMPILER_RT_PROFILE_BAREMETAL)
|
||||
diff --git a/compiler-rt/lib/profile/InstrProfilingPlatformOther.c b/compiler-rt/lib/profile/InstrProfilingPlatformOther.c
|
||||
index 19414ab78b3bea97b746660d8c8c9e3837b31218..03cb13161f803a3f6fb94260b6b8ce72c2a4eb8b 100644
|
||||
index f5d1c74f1011532f19c25cbb395edccc0e07217a..45732aa3436c6bca7f954edee88a39ec0a1a58ca 100644
|
||||
--- a/compiler-rt/lib/profile/InstrProfilingPlatformOther.c
|
||||
+++ b/compiler-rt/lib/profile/InstrProfilingPlatformOther.c
|
||||
@@ -9,7 +9,7 @@
|
||||
@@ -16,8 +16,9 @@
|
||||
#if !defined(__APPLE__) && !defined(__linux__) && !defined(__FreeBSD__) && \
|
||||
!defined(__Fuchsia__) && !(defined(__sun__) && defined(__svr4__)) && \
|
||||
!defined(__NetBSD__) && !defined(_WIN32) && !defined(_AIX) && \
|
||||
- !defined(__wasm__) && !defined(__HAIKU__)
|
||||
+ !defined(__wasm__) && !defined(__HAIKU__) && !defined(__serenity__)
|
||||
- !defined(__wasm__) && !defined(__HAIKU__) && \
|
||||
+ !defined(__wasm__) && !defined(__HAIKU__) && !defined(__serenity__) && \
|
||||
!defined(COMPILER_RT_PROFILE_BAREMETAL)
|
||||
+
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -28,22 +28,22 @@ LibC, namely:
|
||||
create mode 100644 libcxx/include/__locale_dir/locale_base_api/serenity.h
|
||||
|
||||
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
|
||||
index 85758c671e1e079a7d7b341e89ffe967fdd1ea54..a1f500f31217f0ce0cacb8245e73eab09b49c859 100644
|
||||
index 787cfffa5019553895a14ae9ba49498725333192..5abbeabe3588b385d442be40e34763ae1a11ab1a 100644
|
||||
--- a/libcxx/include/CMakeLists.txt
|
||||
+++ b/libcxx/include/CMakeLists.txt
|
||||
@@ -519,6 +519,7 @@ set(files
|
||||
@@ -525,6 +525,7 @@ set(files
|
||||
__locale_dir/locale_base_api/bsd_locale_fallbacks.h
|
||||
__locale_dir/locale_base_api/ibm.h
|
||||
__locale_dir/locale_base_api/musl.h
|
||||
__locale_dir/locale_base_api/openbsd.h
|
||||
+ __locale_dir/locale_base_api/serenity.h
|
||||
__locale_dir/messages.h
|
||||
__locale_dir/money.h
|
||||
__locale_dir/num.h
|
||||
diff --git a/libcxx/include/__config b/libcxx/include/__config
|
||||
index fd15e07c5ef7b846a1aa07ed62a9ae64beccb683..97467f07be611d153c0f6d04854406a24b04adcd 100644
|
||||
index 30bc8c808fce3b7ab577d4cf2f495d5ea8ef4af1..2c66a9f153079c0661e8087a48e34980aabbc240 100644
|
||||
--- a/libcxx/include/__config
|
||||
+++ b/libcxx/include/__config
|
||||
@@ -842,7 +842,8 @@ typedef __char32_t char32_t;
|
||||
@@ -631,7 +631,8 @@ typedef __char32_t char32_t;
|
||||
defined(__APPLE__) || \
|
||||
defined(__MVS__) || \
|
||||
defined(_AIX) || \
|
||||
@@ -53,7 +53,7 @@ index fd15e07c5ef7b846a1aa07ed62a9ae64beccb683..97467f07be611d153c0f6d04854406a2
|
||||
// clang-format on
|
||||
# undef _LIBCPP_HAS_THREAD_API_PTHREAD
|
||||
# define _LIBCPP_HAS_THREAD_API_PTHREAD 1
|
||||
@@ -925,7 +926,7 @@ typedef __char32_t char32_t;
|
||||
@@ -706,7 +707,7 @@ typedef __char32_t char32_t;
|
||||
# endif
|
||||
|
||||
# if defined(__BIONIC__) || defined(__NuttX__) || defined(__Fuchsia__) || defined(__wasi__) || \
|
||||
@@ -76,18 +76,18 @@ index 9fa8f8c9088e1fc42408dca5b8d046668a0fc101..2a9cbec71ea6e6692152cf787891762c
|
||||
# include <__cxx03/string>
|
||||
|
||||
diff --git a/libcxx/include/__locale_dir/locale_base_api.h b/libcxx/include/__locale_dir/locale_base_api.h
|
||||
index 8dbc28e839839660a01678f0406d1019f5c534f9..3e9ee9a28fba04b9f5166be6e1e6bd30bd1fce94 100644
|
||||
index 0474c1db359dea406b4313e22fe12daaf6c61aad..f9a48197ae60e75818dc000295135806d9e6734b 100644
|
||||
--- a/libcxx/include/__locale_dir/locale_base_api.h
|
||||
+++ b/libcxx/include/__locale_dir/locale_base_api.h
|
||||
@@ -133,6 +133,8 @@
|
||||
# include <__locale_dir/locale_base_api/android.h>
|
||||
@@ -132,6 +132,8 @@
|
||||
# include <__locale_dir/locale_base_api/ibm.h>
|
||||
# elif defined(__OpenBSD__)
|
||||
# include <__locale_dir/locale_base_api/openbsd.h>
|
||||
+# elif defined(__serenity__)
|
||||
+# include <__locale_dir/locale_base_api/serenity.h>
|
||||
# elif defined(__wasi__) || _LIBCPP_HAS_MUSL_LIBC
|
||||
# include <__locale_dir/locale_base_api/musl.h>
|
||||
# endif
|
||||
|
||||
# include <__locale_dir/locale_base_api/bsd_locale_fallbacks.h>
|
||||
diff --git a/libcxx/include/__locale_dir/locale_base_api/serenity.h b/libcxx/include/__locale_dir/locale_base_api/serenity.h
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..13abb601dcb75d1459df0b943ef6ca3e911c8e46
|
||||
@@ -117,15 +117,15 @@ index 0000000000000000000000000000000000000000..13abb601dcb75d1459df0b943ef6ca3e
|
||||
+
|
||||
+#endif // _LIBCPP___LOCALE_LOCALE_BASE_API_SERENITY_H
|
||||
diff --git a/libcxx/include/__locale_dir/messages.h b/libcxx/include/__locale_dir/messages.h
|
||||
index c04bf04025ff0ab99370bc201a5cf14f475aa485..0a9ee60e0e6bd02061ab0ffd04d096e4fab65976 100644
|
||||
index 686f472840c222226b2e53fa1e3757c47ded8f13..b2c4a6fc3c60084e2450c7fb210d6eb021c05911 100644
|
||||
--- a/libcxx/include/__locale_dir/messages.h
|
||||
+++ b/libcxx/include/__locale_dir/messages.h
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
# if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
|
||||
// Most unix variants have catopen. These are the specific ones that don't.
|
||||
-# if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION) && !defined(__EMSCRIPTEN__)
|
||||
+# if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION) && !defined(__EMSCRIPTEN__) && !defined(__serenity__)
|
||||
-# if !defined(__BIONIC__) && !_LIBCPP_LIBC_NEWLIB && !defined(__EMSCRIPTEN__)
|
||||
+# if !defined(__BIONIC__) && !_LIBCPP_LIBC_NEWLIB && !defined(__EMSCRIPTEN__) && !defined(__serenity__)
|
||||
# define _LIBCPP_HAS_CATOPEN 1
|
||||
# include <nl_types.h>
|
||||
# else
|
||||
@@ -143,7 +143,7 @@ index 5fc04b6b4b2990c1a5f5b7fae083108c27e907b5..787cc04d57929537d73d871ffd10d146
|
||||
# include <string>
|
||||
|
||||
diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
|
||||
index f59fe0e08fccb7217882d1c9fff414d6b915ead0..438657fd1cc9b117f8eb4e30d5f2f8c99ce09fe9 100644
|
||||
index 2c04cbd1b2729bfa13f6041d833c2962e0a36578..dca7e8fff21eca508388c79fe5593d1206deeb9e 100644
|
||||
--- a/libcxx/src/CMakeLists.txt
|
||||
+++ b/libcxx/src/CMakeLists.txt
|
||||
@@ -113,6 +113,10 @@ elseif(ZOS)
|
||||
@@ -158,7 +158,7 @@ index f59fe0e08fccb7217882d1c9fff414d6b915ead0..438657fd1cc9b117f8eb4e30d5f2f8c9
|
||||
|
||||
if (LIBCXX_ENABLE_FILESYSTEM)
|
||||
diff --git a/libcxx/src/include/config_elast.h b/libcxx/src/include/config_elast.h
|
||||
index 7edff2d9375d46f465a1d72b916b1ccb1a555724..ba24e85be8d0a2b4502d5986377081c1bcd036ee 100644
|
||||
index be665a97bf91b5ade7d97b64f6a6b371514260b3..d0919e270d92e283aa6a1ba0a666c1e75d7f929a 100644
|
||||
--- a/libcxx/src/include/config_elast.h
|
||||
+++ b/libcxx/src/include/config_elast.h
|
||||
@@ -37,6 +37,8 @@
|
||||
|
||||
@@ -13,23 +13,23 @@ and __riscv_cpu_model.
|
||||
3 files changed, 24 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/clang/include/clang/Basic/DiagnosticFrontendKinds.td b/clang/include/clang/Basic/DiagnosticFrontendKinds.td
|
||||
index 8a8db27490f0677ff6c5d23ce3c4d16cb448c48a..d152a7c519eaba04b41ba9924da61d48499d2f1c 100644
|
||||
index e2b257ceae80d9acfc2d33a6975fc4916e73ac81..21b28586b0ed296c5f29553da44d078ca36768b4 100644
|
||||
--- a/clang/include/clang/Basic/DiagnosticFrontendKinds.td
|
||||
+++ b/clang/include/clang/Basic/DiagnosticFrontendKinds.td
|
||||
@@ -386,7 +386,7 @@ def err_ast_action_on_llvm_ir : Error<
|
||||
@@ -393,7 +393,7 @@ def err_ast_action_on_llvm_ir : Error<
|
||||
def err_invalid_llvm_ir : Error<"invalid LLVM IR input: %0">;
|
||||
|
||||
def err_os_unsupport_riscv_fmv : Error<
|
||||
- "function multiversioning is currently only supported on Linux">;
|
||||
+ "function multiversioning is currently only supported on Linux and SerenityOS">;
|
||||
|
||||
def warn_hlsl_langstd_minimal :
|
||||
Warning<"support for HLSL language version %0 is incomplete, "
|
||||
def warn_unreachable_version
|
||||
: Warning<"function version '%0' is unreachable; ignoring version">,
|
||||
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
|
||||
index 776a646ceb32fa7689c80e9837f1955dc4ce93ea..32f80e1b21f5f1683a09126eab24a8ccf25ea8a3 100644
|
||||
index 6c0589be329132b1c1b45407c3488cef591f1b7a..797bd49d0228a418b7dc65ecca3d756d5b85d2d9 100644
|
||||
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
|
||||
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
|
||||
@@ -2987,8 +2987,9 @@ void CodeGenFunction::EmitMultiVersionResolver(
|
||||
@@ -3020,8 +3020,9 @@ void CodeGenFunction::EmitMultiVersionResolver(
|
||||
void CodeGenFunction::EmitRISCVMultiVersionResolver(
|
||||
llvm::Function *Resolver, ArrayRef<FMVResolverOption> Options) {
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Lucas Chollet <lucas.chollet@free.fr>
|
||||
Date: Thu, 22 Jan 2026 12:30:30 +0100
|
||||
Subject: [PATCH] [libcxxabi] Define __cxa_thread_atexit on serenity
|
||||
|
||||
---
|
||||
libcxxabi/include/cxxabi.h | 2 +-
|
||||
libcxxabi/src/cxa_thread_atexit.cpp | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/libcxxabi/include/cxxabi.h b/libcxxabi/include/cxxabi.h
|
||||
index 9ea93680f62e06365ddba048b7a26a19c5b0fa45..e3c7d73b297e8fd45d250715a33722b7d5e05264 100644
|
||||
--- a/libcxxabi/include/cxxabi.h
|
||||
+++ b/libcxxabi/include/cxxabi.h
|
||||
@@ -180,7 +180,7 @@ __cxa_decrement_exception_refcount(void *primary_exception) _LIBCXXABI_NOEXCEPT;
|
||||
extern _LIBCXXABI_FUNC_VIS bool __cxa_uncaught_exception() _LIBCXXABI_NOEXCEPT;
|
||||
extern _LIBCXXABI_FUNC_VIS unsigned int __cxa_uncaught_exceptions() _LIBCXXABI_NOEXCEPT;
|
||||
|
||||
-#if defined(__linux__) || defined(__Fuchsia__)
|
||||
+#if defined(__linux__) || defined(__Fuchsia__) || defined(__serenity__)
|
||||
// Linux and Fuchsia TLS support. Not yet an official part of the Itanium ABI.
|
||||
// https://sourceware.org/glibc/wiki/Destructor%20support%20for%20thread_local%20variables
|
||||
extern _LIBCXXABI_FUNC_VIS int __cxa_thread_atexit(void (*)(void *), void *,
|
||||
diff --git a/libcxxabi/src/cxa_thread_atexit.cpp b/libcxxabi/src/cxa_thread_atexit.cpp
|
||||
index 402a52c741012d168a7ab0d3a839e7a765aee7e7..f3915832b6d529c45bc7f367af9fd319335f2788 100644
|
||||
--- a/libcxxabi/src/cxa_thread_atexit.cpp
|
||||
+++ b/libcxxabi/src/cxa_thread_atexit.cpp
|
||||
@@ -106,7 +106,7 @@ namespace {
|
||||
|
||||
#endif // HAVE___CXA_THREAD_ATEXIT_IMPL
|
||||
|
||||
-#if defined(__linux__) || defined(__Fuchsia__)
|
||||
+#if defined(__linux__) || defined(__Fuchsia__) || defined(__serenity__)
|
||||
extern "C" {
|
||||
|
||||
_LIBCXXABI_FUNC_VIS int __cxa_thread_atexit(Dtor dtor, void* obj, void* dso_symbol) throw() {
|
||||
@@ -70,3 +70,8 @@ The SerenityOS dynamic linker provides a magic function
|
||||
"__get_riscv_feature_bits" that populates __riscv_feature_bits
|
||||
and __riscv_cpu_model.
|
||||
|
||||
## `0007-libcxxabi-Define-__cxa_thread_atexit-on-serenity.patch`
|
||||
|
||||
Define __cxa_thread_atexit on serenity
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user