mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-08 10:50:28 +00:00
various fixes
* getopt changes * removed some tbb call * used the new demangle callsite
This commit is contained in:
parent
a5ab4fa2cb
commit
640d1aec04
19 changed files with 30 additions and 23 deletions
|
@ -70,8 +70,8 @@ COSMOPOLITAN_C_END_
|
|||
#define SIGWINCH 28
|
||||
#define SIGXCPU 24
|
||||
#define SIGXFSZ 25
|
||||
#define SIGBUS 7
|
||||
|
||||
#define SIGBUS SIGBUS
|
||||
#define SIGTHR SIGTHR
|
||||
#define SIGCHLD SIGCHLD
|
||||
#define SIGCONT SIGCONT
|
||||
|
|
2
third_party/mold/common.h
vendored
2
third_party/mold/common.h
vendored
|
@ -71,7 +71,7 @@
|
|||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/ok.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/getopt/getopt.h"
|
||||
#include "libc/isystem/getopt.h"
|
||||
#include "third_party/musl/crypt.h"
|
||||
#include "third_party/musl/lockf.h"
|
||||
#endif
|
||||
|
|
3
third_party/mold/config.h
vendored
Normal file
3
third_party/mold/config.h
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
#define MOLD_VERSION "1.11.0"
|
||||
#define MOLD_LIBDIR "/usr/local/lib"
|
||||
#define MOLD_IS_SOLD 0
|
3
third_party/mold/demangle.cc
vendored
3
third_party/mold/demangle.cc
vendored
|
@ -2,6 +2,7 @@
|
|||
#include "third_party/mold/common.h"
|
||||
|
||||
#include "third_party/libcxx/cstdlib"
|
||||
#include "libc/stdio/stdio.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
// MISSING #include <cxxabi.h>
|
||||
|
@ -38,7 +39,7 @@ std::optional<std::string_view> cpp_demangle(std::string_view name) {
|
|||
#ifndef _WIN32
|
||||
if (name.starts_with("_Z")) {
|
||||
int status;
|
||||
char *p = abi::__cxa_demangle(std::string(name).c_str(), buf, &buflen, &status);
|
||||
char *p = __cxa_demangle(std::string(name).c_str(), buf, &buflen, &status);
|
||||
if (status == 0) {
|
||||
buf = p;
|
||||
return p;
|
||||
|
|
2
third_party/mold/elf/cmdline.cc
vendored
2
third_party/mold/elf/cmdline.cc
vendored
|
@ -36,7 +36,7 @@
|
|||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/ok.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/getopt/getopt.h"
|
||||
#include "third_party/getopt/getopt.internal.h"
|
||||
#include "third_party/musl/crypt.h"
|
||||
#include "third_party/musl/lockf.h"
|
||||
#endif
|
||||
|
|
2
third_party/mold/elf/input-files.cc
vendored
2
third_party/mold/elf/input-files.cc
vendored
|
@ -16,7 +16,7 @@
|
|||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/ok.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/getopt/getopt.h"
|
||||
#include "third_party/getopt/getopt.internal.h"
|
||||
#include "third_party/musl/crypt.h"
|
||||
#include "third_party/musl/lockf.h"
|
||||
#endif
|
||||
|
|
2
third_party/mold/elf/jobs.cc
vendored
2
third_party/mold/elf/jobs.cc
vendored
|
@ -39,7 +39,7 @@
|
|||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/ok.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/getopt/getopt.h"
|
||||
#include "third_party/getopt/getopt.internal.h"
|
||||
#include "third_party/musl/crypt.h"
|
||||
#include "third_party/musl/lockf.h"
|
||||
#endif
|
||||
|
|
2
third_party/mold/elf/lto-unix.cc
vendored
2
third_party/mold/elf/lto-unix.cc
vendored
|
@ -107,7 +107,7 @@
|
|||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/ok.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/getopt/getopt.h"
|
||||
#include "third_party/getopt/getopt.internal.h"
|
||||
#include "third_party/musl/crypt.h"
|
||||
#include "third_party/musl/lockf.h"
|
||||
|
||||
|
|
2
third_party/mold/elf/main.cc
vendored
2
third_party/mold/elf/main.cc
vendored
|
@ -50,7 +50,7 @@
|
|||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/ok.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/getopt/getopt.h"
|
||||
#include "third_party/getopt/getopt.internal.h"
|
||||
#include "third_party/musl/crypt.h"
|
||||
#include "third_party/musl/lockf.h"
|
||||
#endif
|
||||
|
|
4
third_party/mold/elf/mold-wrapper.c
vendored
4
third_party/mold/elf/mold-wrapper.c
vendored
|
@ -29,7 +29,7 @@
|
|||
#include "libc/stdio/temp.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/exit.h"
|
||||
#include "third_party/getopt/getopt.h"
|
||||
#include "third_party/getopt/getopt.internal.h"
|
||||
#include "third_party/musl/crypt.h"
|
||||
#include "third_party/musl/rand48.h"
|
||||
#include "libc/mem/alg.h"
|
||||
|
@ -45,7 +45,7 @@
|
|||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/ok.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/getopt/getopt.h"
|
||||
#include "third_party/getopt/getopt.internal.h"
|
||||
#include "third_party/musl/crypt.h"
|
||||
#include "third_party/musl/lockf.h"
|
||||
|
||||
|
|
2
third_party/mold/elf/mold.h
vendored
2
third_party/mold/elf/mold.h
vendored
|
@ -42,7 +42,7 @@
|
|||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/ok.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/getopt/getopt.h"
|
||||
#include "third_party/getopt/getopt.internal.h"
|
||||
#include "third_party/musl/crypt.h"
|
||||
#include "third_party/musl/lockf.h"
|
||||
#endif
|
||||
|
|
4
third_party/mold/elf/subprocess.cc
vendored
4
third_party/mold/elf/subprocess.cc
vendored
|
@ -2,7 +2,7 @@
|
|||
#if !defined(_WIN32) && !defined(__APPLE__)
|
||||
|
||||
#include "third_party/mold/elf/mold.h"
|
||||
// MISSING #include "config.h"
|
||||
#include "third_party/mold/config.h"
|
||||
|
||||
#include "third_party/libcxx/filesystem"
|
||||
#include "libc/calls/calls.h"
|
||||
|
@ -51,7 +51,7 @@
|
|||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/ok.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/getopt/getopt.h"
|
||||
#include "third_party/getopt/getopt.internal.h"
|
||||
#include "third_party/musl/crypt.h"
|
||||
#include "third_party/musl/lockf.h"
|
||||
|
||||
|
|
11
third_party/mold/main.cc
vendored
11
third_party/mold/main.cc
vendored
|
@ -1,6 +1,6 @@
|
|||
// clang-format off
|
||||
#include "third_party/mold/common.h"
|
||||
// MISSING #include "config.h"
|
||||
#include "third_party/mold/config.h"
|
||||
|
||||
#include "third_party/libcxx/cstring"
|
||||
#include "third_party/libcxx/filesystem"
|
||||
|
@ -29,7 +29,7 @@
|
|||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/ok.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/getopt/getopt.h"
|
||||
#include "third_party/getopt/getopt.internal.h"
|
||||
#include "third_party/musl/crypt.h"
|
||||
#include "third_party/musl/lockf.h"
|
||||
#endif
|
||||
|
@ -167,10 +167,11 @@ void install_signal_handler() {
|
|||
#endif
|
||||
|
||||
i64 get_default_thread_count() {
|
||||
// TODO(fzakaria): disable tbb callsites
|
||||
// mold doesn't scale well above 32 threads.
|
||||
int n = tbb::global_control::active_value(
|
||||
tbb::global_control::max_allowed_parallelism);
|
||||
return std::min(n, 32);
|
||||
// int n = tbb::global_control::active_value(
|
||||
// tbb::global_control::max_allowed_parallelism);
|
||||
return 1;
|
||||
}
|
||||
|
||||
} // namespace mold
|
||||
|
|
2
third_party/mold/mold.mk
vendored
2
third_party/mold/mold.mk
vendored
|
@ -15,12 +15,14 @@ THIRD_PARTY_MOLD_A_DIRECTDEPS = \
|
|||
THIRD_PARTY_LIBCXX \
|
||||
THIRD_PARTY_ZSTD \
|
||||
THIRD_PARTY_XXHASH \
|
||||
THIRD_PARTY_GETOPT \
|
||||
THIRD_PARTY_ZLIB
|
||||
|
||||
THIRD_PARTY_MOLD_A_DEPS := \
|
||||
$(call uniq,$(foreach x,$(THIRD_PARTY_MOLD_A_DIRECTDEPS),$($(x))))
|
||||
|
||||
# https://github.com/rui314/mold/blob/d4d93d7fb72dd19c44aafa4dd5397e35787d33ad/CMakeLists.txt#L62
|
||||
# TODO(fzakaria): figure out solution for -Wno-error=class-memaccess
|
||||
$(THIRD_PARTY_MOLD_OBJS): private \
|
||||
CPPFLAGS += \
|
||||
-std=gnu++20 \
|
||||
|
|
|
@ -41,7 +41,7 @@ cat <<EOF | $CC -o $t/b.o -c -fno-PIC -xc -
|
|||
#include "libc/stdio/temp.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/exit.h"
|
||||
#include "third_party/getopt/getopt.h"
|
||||
#include "third_party/getopt/getopt.internal.h"
|
||||
#include "third_party/musl/crypt.h"
|
||||
#include "third_party/musl/rand48.h"
|
||||
// MISSING #include <ucontext.h>
|
||||
|
|
2
third_party/mold/test/elf/mold-wrapper.sh
vendored
2
third_party/mold/test/elf/mold-wrapper.sh
vendored
|
@ -39,7 +39,7 @@ cat <<'EOF' | $CC -xc -o $t/exe -
|
|||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/ok.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/getopt/getopt.h"
|
||||
#include "third_party/getopt/getopt.internal.h"
|
||||
#include "third_party/musl/crypt.h"
|
||||
#include "third_party/musl/lockf.h"
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ cat <<EOF | $CC -fPIC -c -o $t/a.o -xc -
|
|||
#include "libc/stdio/temp.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/exit.h"
|
||||
#include "third_party/getopt/getopt.h"
|
||||
#include "third_party/getopt/getopt.internal.h"
|
||||
#include "third_party/musl/crypt.h"
|
||||
#include "third_party/musl/rand48.h"
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ cat <<EOF | $CC -c -o $t/b.o -xc -
|
|||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/ok.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/getopt/getopt.h"
|
||||
#include "third_party/getopt/getopt.internal.h"
|
||||
#include "third_party/musl/crypt.h"
|
||||
#include "third_party/musl/lockf.h"
|
||||
|
||||
|
|
2
third_party/xxhash/xxhash.h
vendored
2
third_party/xxhash/xxhash.h
vendored
|
@ -1828,7 +1828,7 @@ static void XXH_free(void* p) { (void)p; }
|
|||
#include "libc/stdio/temp.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/exit.h"
|
||||
#include "third_party/getopt/getopt.internal.h"
|
||||
#include "third_party/getopt/long.h"
|
||||
#include "third_party/musl/crypt.h"
|
||||
#include "third_party/musl/rand48.h"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue