From a857b6297a8885519db9e908b2cccdacff4c56b3 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Fri, 15 Jul 2022 16:09:36 +0200 Subject: [PATCH] Toolchain: Don't pass `-lpthread` when pthreads are requested This is essentially a no-op since we have our replacement linker script, but if we can skip over that entirely, why not? --- .../Patches/gcc/0001-Add-a-gcc-driver-for-SerenityOS.patch | 2 +- .../llvm/0003-Driver-Add-support-for-SerenityOS.patch | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Toolchain/Patches/gcc/0001-Add-a-gcc-driver-for-SerenityOS.patch b/Toolchain/Patches/gcc/0001-Add-a-gcc-driver-for-SerenityOS.patch index 2360b95bec..0025e7d326 100644 --- a/Toolchain/Patches/gcc/0001-Add-a-gcc-driver-for-SerenityOS.patch +++ b/Toolchain/Patches/gcc/0001-Add-a-gcc-driver-for-SerenityOS.patch @@ -96,7 +96,7 @@ index 000000000..dc2f5361e +/* Default arguments you want when running your + i686-serenity-gcc/x86_64-serenity-gcc toolchain */ +#undef LIB_SPEC -+#define LIB_SPEC "%{pthread:-lpthread} -lc" /* link against C standard library */ ++#define LIB_SPEC "-lc" /* link against C standard library */ + +/* Files that are linked before user code. + The %s tells GCC to look for these files in the library directory. */ diff --git a/Toolchain/Patches/llvm/0003-Driver-Add-support-for-SerenityOS.patch b/Toolchain/Patches/llvm/0003-Driver-Add-support-for-SerenityOS.patch index 41a3425b91..a813d1fe1f 100644 --- a/Toolchain/Patches/llvm/0003-Driver-Add-support-for-SerenityOS.patch +++ b/Toolchain/Patches/llvm/0003-Driver-Add-support-for-SerenityOS.patch @@ -144,7 +144,7 @@ new file mode 100644 index 000000000..955422438 --- /dev/null +++ b/clang/lib/Driver/ToolChains/Serenity.cpp -@@ -0,0 +1,340 @@ +@@ -0,0 +1,337 @@ +//===---- Serenity.cpp - SerenityOS ToolChain Implementation ----*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. @@ -306,9 +306,6 @@ index 000000000..955422438 + } + + if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { -+ if (Args.hasArg(options::OPT_pthread, options::OPT_pthreads)) -+ CmdArgs.push_back("-lpthread"); -+ + if (!Args.hasArg(options::OPT_nolibc)) + CmdArgs.push_back("-lc"); + }