diff --git a/.buildkite/Dockerfile b/.buildkite/Dockerfile index 2ace3c0f50..18388fe6c5 100644 --- a/.buildkite/Dockerfile +++ b/.buildkite/Dockerfile @@ -1,12 +1,12 @@ -ARG LLVM_VERSION="18" -ARG REPORTED_LLVM_VERSION="18.1.8" +ARG LLVM_VERSION="19" +ARG REPORTED_LLVM_VERSION="19.1.7" ARG OLD_BUN_VERSION="1.1.38" ARG DEFAULT_CFLAGS="-mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -ffunction-sections -fdata-sections -faddrsig -fno-unwind-tables -fno-asynchronous-unwind-tables" ARG DEFAULT_CXXFLAGS="-flto=full -fwhole-program-vtables -fforce-emit-vtables" ARG BUILDKITE_AGENT_TAGS="queue=linux,os=linux,arch=${TARGETARCH}" FROM --platform=$BUILDPLATFORM ubuntu:20.04 as base-arm64 -FROM --platform=$BUILDPLATFORM ubuntu:18.04 as base-amd64 +FROM --platform=$BUILDPLATFORM ubuntu:20.04 as base-amd64 FROM base-$TARGETARCH as base ARG LLVM_VERSION diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index be833ae846..96580fb79d 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -11,8 +11,8 @@ on: env: BUN_VERSION: "1.2.0" - LLVM_VERSION: "18.1.8" - LLVM_VERSION_MAJOR: "18" + LLVM_VERSION: "19.1.7" + LLVM_VERSION_MAJOR: "19" jobs: clang-format: diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 934af25254..b21448ace5 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -11,8 +11,8 @@ on: env: BUN_VERSION: "1.2.0" - LLVM_VERSION: "18.1.8" - LLVM_VERSION_MAJOR: "18" + LLVM_VERSION: "19.1.7" + LLVM_VERSION_MAJOR: "19" jobs: clang-tidy: diff --git a/.github/workflows/run-lint.yml b/.github/workflows/run-lint.yml index 648da1a9ca..f21208972a 100644 --- a/.github/workflows/run-lint.yml +++ b/.github/workflows/run-lint.yml @@ -3,7 +3,6 @@ name: Lint permissions: contents: read env: - LLVM_VERSION: 16 BUN_VERSION: "1.2.0" on: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1ac91c70f7..331026c440 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -80,7 +80,7 @@ $ sudo zypper install clang18 lld18 llvm18 {% /codetabs %} -If none of the above solutions apply, you will have to install it [manually](https://github.com/llvm/llvm-project/releases/tag/llvmorg-18.1.8). +If none of the above solutions apply, you will have to install it [manually](https://github.com/llvm/llvm-project/releases/tag/llvmorg-19.1.7). Make sure Clang/LLVM 18 is in your path: diff --git a/Makefile b/Makefile index 66e0c2edc1..59adaee220 100644 --- a/Makefile +++ b/Makefile @@ -91,9 +91,9 @@ ZIG ?= $(shell which zig 2>/dev/null || echo -e "error: Missing zig. Please make # This is easier to happen than you'd expect. # Using realpath here causes issues because clang uses clang++ as a symlink # so if that's resolved, it won't build for C++ -REAL_CC = $(shell which clang-18 2>/dev/null || which clang 2>/dev/null) -REAL_CXX = $(shell which clang++-18 2>/dev/null || which clang++ 2>/dev/null) -CLANG_FORMAT = $(shell which clang-format-18 2>/dev/null || which clang-format 2>/dev/null) +REAL_CC = $(shell which clang-19 2>/dev/null || which clang 2>/dev/null) +REAL_CXX = $(shell which clang++-19 2>/dev/null || which clang++ 2>/dev/null) +CLANG_FORMAT = $(shell which clang-format-19 2>/dev/null || which clang-format 2>/dev/null) CC = $(REAL_CC) CXX = $(REAL_CXX) @@ -117,14 +117,14 @@ CC_WITH_CCACHE = $(CCACHE_PATH) $(CC) ifeq ($(OS_NAME),darwin) # Find LLVM ifeq ($(wildcard $(LLVM_PREFIX)),) - LLVM_PREFIX = $(shell brew --prefix llvm@18) + LLVM_PREFIX = $(shell brew --prefix llvm@19) endif ifeq ($(wildcard $(LLVM_PREFIX)),) LLVM_PREFIX = $(shell brew --prefix llvm) endif ifeq ($(wildcard $(LLVM_PREFIX)),) # This is kinda ugly, but I can't find a better way to error :( - LLVM_PREFIX = $(shell echo -e "error: Unable to find llvm. Please run 'brew install llvm@18' or set LLVM_PREFIX=/path/to/llvm") + LLVM_PREFIX = $(shell echo -e "error: Unable to find llvm. Please run 'brew install llvm@19' or set LLVM_PREFIX=/path/to/llvm") endif LDFLAGS += -L$(LLVM_PREFIX)/lib @@ -164,7 +164,7 @@ CMAKE_FLAGS_WITHOUT_RELEASE = -DCMAKE_C_COMPILER=$(CC) \ -DCMAKE_OSX_DEPLOYMENT_TARGET=$(MIN_MACOS_VERSION) \ $(CMAKE_CXX_COMPILER_LAUNCHER_FLAG) \ -DCMAKE_AR=$(AR) \ - -DCMAKE_RANLIB=$(which llvm-18-ranlib 2>/dev/null || which llvm-ranlib 2>/dev/null) \ + -DCMAKE_RANLIB=$(which llvm-19-ranlib 2>/dev/null || which llvm-ranlib 2>/dev/null) \ -DCMAKE_CXX_STANDARD=20 \ -DCMAKE_C_STANDARD=17 \ -DCMAKE_CXX_STANDARD_REQUIRED=ON \ @@ -191,7 +191,7 @@ endif ifeq ($(OS_NAME),linux) LIBICONV_PATH = -AR = $(shell which llvm-ar-18 2>/dev/null || which llvm-ar 2>/dev/null || which ar 2>/dev/null) +AR = $(shell which llvm-ar-19 2>/dev/null || which llvm-ar 2>/dev/null || which ar 2>/dev/null) endif OPTIMIZATION_LEVEL=-O3 $(MARCH_NATIVE) @@ -286,7 +286,7 @@ STRIP=/usr/bin/strip endif ifeq ($(OS_NAME),linux) -STRIP=$(shell which llvm-strip 2>/dev/null || which llvm-strip-18 2>/dev/null || which strip 2>/dev/null || echo "Missing strip") +STRIP=$(shell which llvm-strip 2>/dev/null || which llvm-strip-19 2>/dev/null || which strip 2>/dev/null || echo "Missing strip") endif @@ -674,7 +674,7 @@ endif .PHONY: assert-deps assert-deps: @echo "Checking if the required utilities are available..." - @if [ $(CLANG_VERSION) -lt "18" ]; then echo -e "ERROR: clang version >=18 required, found: $(CLANG_VERSION). Install with:\n\n $(POSIX_PKG_MANAGER) install llvm@18"; exit 1; fi + @if [ $(CLANG_VERSION) -lt "19" ]; then echo -e "ERROR: clang version >=19 required, found: $(CLANG_VERSION). Install with:\n\n $(POSIX_PKG_MANAGER) install llvm@19"; exit 1; fi @cmake --version >/dev/null 2>&1 || (echo -e "ERROR: cmake is required."; exit 1) @$(PYTHON) --version >/dev/null 2>&1 || (echo -e "ERROR: python is required."; exit 1) @$(ESBUILD) --version >/dev/null 2>&1 || (echo -e "ERROR: esbuild is required."; exit 1) diff --git a/cmake/Globals.cmake b/cmake/Globals.cmake index 7793a6a7f5..5d71f72642 100644 --- a/cmake/Globals.cmake +++ b/cmake/Globals.cmake @@ -421,6 +421,8 @@ function(register_command) file(RELATIVE_PATH filename ${BUILD_PATH} ${artifact}) if(filename STREQUAL "libbun-profile.a") # libbun-profile.a is now over 5gb in size, compress it first + list(APPEND CMD_COMMANDS COMMAND ${CMAKE_COMMAND} -E chdir ${BUILD_PATH} rm -r ${BUILD_PATH}/codegen) + list(APPEND CMD_COMMANDS COMMAND ${CMAKE_COMMAND} -E chdir ${BUILD_PATH} rm -r ${CACHE_PATH}) list(APPEND CMD_COMMANDS COMMAND ${CMAKE_COMMAND} -E chdir ${BUILD_PATH} gzip -6 libbun-profile.a) list(APPEND CMD_COMMANDS COMMAND ${CMAKE_COMMAND} -E chdir ${BUILD_PATH} buildkite-agent artifact upload libbun-profile.a.gz) else() diff --git a/cmake/targets/BuildBun.cmake b/cmake/targets/BuildBun.cmake index 60958ceaf2..d36cac0a5b 100644 --- a/cmake/targets/BuildBun.cmake +++ b/cmake/targets/BuildBun.cmake @@ -738,7 +738,7 @@ endif() # --- C/C++ Properties --- set_target_properties(${bun} PROPERTIES - CXX_STANDARD 20 + CXX_STANDARD 23 CXX_STANDARD_REQUIRED YES CXX_EXTENSIONS YES CXX_VISIBILITY_PRESET hidden @@ -959,28 +959,17 @@ endif() if(LINUX) if(NOT ABI STREQUAL "musl") - # on arm64 - if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm|ARM|arm64|ARM64|aarch64|AARCH64") - target_link_options(${bun} PUBLIC - -Wl,--wrap=exp - -Wl,--wrap=expf - -Wl,--wrap=fcntl64 - -Wl,--wrap=log - -Wl,--wrap=log2 - -Wl,--wrap=log2f - -Wl,--wrap=logf - -Wl,--wrap=pow - -Wl,--wrap=powf - ) - else() - target_link_options(${bun} PUBLIC - -Wl,--wrap=exp - -Wl,--wrap=expf - -Wl,--wrap=log2f - -Wl,--wrap=logf - -Wl,--wrap=powf - ) - endif() + target_link_options(${bun} PUBLIC + -Wl,--wrap=exp + -Wl,--wrap=expf + -Wl,--wrap=fcntl64 + -Wl,--wrap=log + -Wl,--wrap=log2 + -Wl,--wrap=log2f + -Wl,--wrap=logf + -Wl,--wrap=pow + -Wl,--wrap=powf + ) endif() if(NOT ABI STREQUAL "musl") diff --git a/cmake/tools/SetupLLVM.cmake b/cmake/tools/SetupLLVM.cmake index 92423dc607..7d8cc125b0 100644 --- a/cmake/tools/SetupLLVM.cmake +++ b/cmake/tools/SetupLLVM.cmake @@ -12,7 +12,7 @@ if(NOT ENABLE_LLVM) return() endif() -set(DEFAULT_LLVM_VERSION "18.1.8") +set(DEFAULT_LLVM_VERSION "19.1.7") optionx(LLVM_VERSION STRING "The version of LLVM to use" DEFAULT ${DEFAULT_LLVM_VERSION}) diff --git a/cmake/tools/SetupWebKit.cmake b/cmake/tools/SetupWebKit.cmake index ab4166fcdd..d9db3e013f 100644 --- a/cmake/tools/SetupWebKit.cmake +++ b/cmake/tools/SetupWebKit.cmake @@ -2,7 +2,7 @@ option(WEBKIT_VERSION "The version of WebKit to use") option(WEBKIT_LOCAL "If a local version of WebKit should be used instead of downloading") if(NOT WEBKIT_VERSION) - set(WEBKIT_VERSION 2ffd4be9f9513c30333d9e23c175cab4760584e3) + set(WEBKIT_VERSION 1b232942b0654e54e93dcf86bf6f5b581b37b1ae) endif() string(SUBSTRING ${WEBKIT_VERSION} 0 16 WEBKIT_VERSION_PREFIX) diff --git a/docs/project/building-windows.md b/docs/project/building-windows.md index 8831bd5c44..0a86f5045f 100644 --- a/docs/project/building-windows.md +++ b/docs/project/building-windows.md @@ -60,7 +60,7 @@ Visual Studio can be installed graphically using the wizard or through WinGet: After Visual Studio, you need the following: -- LLVM 18.1.8 +- LLVM 19.1.7 - Go - Rust - NASM @@ -81,7 +81,7 @@ After Visual Studio, you need the following: > irm https://get.scoop.sh | iex > scoop install nodejs-lts go rust nasm ruby perl ccache # scoop seems to be buggy if you install llvm and the rest at the same time -> scoop install llvm@18.1.8 +> scoop install llvm@19.1.7 ``` {% /codetabs %} diff --git a/packages/bun-uws/src/MoveOnlyFunction.h b/packages/bun-uws/src/MoveOnlyFunction.h index b1ae785e22..04b6b82ad2 100644 --- a/packages/bun-uws/src/MoveOnlyFunction.h +++ b/packages/bun-uws/src/MoveOnlyFunction.h @@ -82,7 +82,14 @@ namespace ofats { namespace any_detail { -using buffer = std::aligned_storage_t; +template +class my_aligned_storage_t { +private: + alignas(Align) std::byte t_buff[Len]; +}; + + +using buffer = my_aligned_storage_t; template inline constexpr bool is_small_object_v = diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index e9a698c941..0947531d23 100755 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -345,7 +345,7 @@ function Install-Rust { function Install-Llvm { Install-Package llvm ` -Command clang-cl ` - -Version "18.1.8" + -Version "19.1.7" Add-To-Path "$env:ProgramFiles\LLVM\bin" } diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 872b5623f8..f6fb37dac5 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -897,7 +897,7 @@ install_build_essentials() { } llvm_version_exact() { - print "18.1.8" + print "19.1.7" } llvm_version() { @@ -915,11 +915,12 @@ install_llvm() { install_packages "llvm@$(llvm_version)" ;; apk) + # alpine doesn't have a lld19 package on 3.21 atm so use bare one for now install_packages \ "llvm$(llvm_version)" \ "clang$(llvm_version)" \ "scudo-malloc" \ - "lld$(llvm_version)" + "lld" ;; esac } @@ -963,7 +964,7 @@ install_gcc() { ;; esac - llvm_v="18" + llvm_v="19" append_to_profile "export CC=clang-${llvm_v}" append_to_profile "export CXX=clang++-${llvm_v}" diff --git a/src/bun.js/bindings/BunDebugger.cpp b/src/bun.js/bindings/BunDebugger.cpp index c4a781d2ae..9315291799 100644 --- a/src/bun.js/bindings/BunDebugger.cpp +++ b/src/bun.js/bindings/BunDebugger.cpp @@ -52,7 +52,7 @@ public: void pauseWaitingForAutomaticInspection() override { } - void unpauseForInitializedInspector() override + void unpauseForInitializedInspector() { if (waitingForConnection) { waitingForConnection = false; diff --git a/src/bun.js/bindings/CPUFeatures.cpp b/src/bun.js/bindings/CPUFeatures.cpp index d6665cd6b7..367a2134e7 100644 --- a/src/bun.js/bindings/CPUFeatures.cpp +++ b/src/bun.js/bindings/CPUFeatures.cpp @@ -68,28 +68,48 @@ static uint8_t x86_cpu_features() #if CPU(ARM64) +#if OS(WINDOWS) +#elif OS(MACOS) +#include +#elif OS(LINUX) +#include +#include +#endif + static uint8_t aarch64_cpu_features() { uint8_t features = 0; #if OS(WINDOWS) #pragma error "TODO: Implement AArch64 CPU features for Windows" -#endif - -#if __has_builtin(__builtin_cpu_supports) - __builtin_cpu_init(); - - if (__builtin_cpu_supports("neon")) +#elif OS(MACOS) + int value = 0; + size_t size = sizeof(value); + if (sysctlbyname("hw.optional.AdvSIMD", &value, &size, NULL, 0) == 0 && value == 1) features |= 1 << static_cast(AArch64CPUFeature::neon); - if (__builtin_cpu_supports("crypto")) + if (sysctlbyname("hw.optional.floatingpoint", &value, &size, NULL, 0) == 0 && value == 1) features |= 1 << static_cast(AArch64CPUFeature::fp); - if (__builtin_cpu_supports("aes")) + if (sysctlbyname("hw.optional.arm.FEAT_AES", &value, &size, NULL, 0) == 0 && value == 1) features |= 1 << static_cast(AArch64CPUFeature::aes); - if (__builtin_cpu_supports("crc32")) + if (sysctlbyname("hw.optional.armv8_crc32", &value, &size, NULL, 0) == 0 && value == 1) features |= 1 << static_cast(AArch64CPUFeature::crc32); - if (__builtin_cpu_supports("atomics")) + if (sysctlbyname("hw.optional.arm.FEAT_LSE", &value, &size, NULL, 0) == 0 && value == 1) features |= 1 << static_cast(AArch64CPUFeature::atomics); - if (__builtin_cpu_supports("sve")) + if (sysctlbyname("hw.optional.arm.FEAT_SVE", &value, &size, NULL, 0) == 0 && value == 1) + features |= 1 << static_cast(AArch64CPUFeature::sve); +#elif OS(LINUX) + unsigned long hwcaps = getauxval(AT_HWCAP); + if (hwcaps & HWCAP_ASIMD) + features |= 1 << static_cast(AArch64CPUFeature::neon); + if (hwcaps & HWCAP_FP) + features |= 1 << static_cast(AArch64CPUFeature::fp); + if (hwcaps & HWCAP_AES) + features |= 1 << static_cast(AArch64CPUFeature::aes); + if (hwcaps & HWCAP_CRC32) + features |= 1 << static_cast(AArch64CPUFeature::crc32); + if (hwcaps & HWCAP_ATOMICS) + features |= 1 << static_cast(AArch64CPUFeature::atomics); + if (hwcaps & HWCAP_SVE) features |= 1 << static_cast(AArch64CPUFeature::sve); #endif diff --git a/src/bun.js/bindings/CallSitePrototype.cpp b/src/bun.js/bindings/CallSitePrototype.cpp index 4b76765670..b94b106043 100644 --- a/src/bun.js/bindings/CallSitePrototype.cpp +++ b/src/bun.js/bindings/CallSitePrototype.cpp @@ -177,7 +177,7 @@ JSC_DEFINE_HOST_FUNCTION(callSiteProtoFuncIsToplevel, (JSGlobalObject * globalOb if (auto* executable = function->jsExecutable()) { return JSValue::encode(jsBoolean(executable->isProgramExecutable() || executable->isModuleProgramExecutable())); } - } else if (auto* function = jsDynamicCast(functionValue)) { + } else if (jsDynamicCast(functionValue)) { return JSC::JSValue::encode(JSC::jsBoolean(true)); } } diff --git a/src/bun.js/bindings/KeyObject.cpp b/src/bun.js/bindings/KeyObject.cpp index ad0253e062..3c527a6c72 100644 --- a/src/bun.js/bindings/KeyObject.cpp +++ b/src/bun.js/bindings/KeyObject.cpp @@ -405,7 +405,7 @@ JSC_DEFINE_HOST_FUNCTION(KeyObject__createPrivateKey, (JSC::JSGlobalObject * glo break; } default: { - if (auto* keyObj = jsDynamicCast(keyJSValue)) { + if (jsDynamicCast(keyJSValue)) { if (format != "jwk"_s) { JSC::throwTypeError(globalObject, scope, "format should be 'jwk' when key type is 'object'"_s); return {}; @@ -1007,7 +1007,7 @@ JSC_DEFINE_HOST_FUNCTION(KeyObject__createPublicKey, (JSC::JSGlobalObject * glob break; } default: { - if (auto* keyObj = jsDynamicCast(keyJSValue)) { + if (jsDynamicCast(keyJSValue)) { if (format != "jwk"_s) { JSC::throwTypeError(globalObject, scope, "format should be 'jwk' when key type is 'object'"_s); return {}; diff --git a/src/bun.js/bindings/ModuleLoader.cpp b/src/bun.js/bindings/ModuleLoader.cpp index ae5a3b69ae..05e313eef3 100644 --- a/src/bun.js/bindings/ModuleLoader.cpp +++ b/src/bun.js/bindings/ModuleLoader.cpp @@ -284,7 +284,7 @@ OnLoadResult handleOnLoadResultNotPromise(Zig::GlobalObject* globalObject, JSC:: static OnLoadResult handleOnLoadResult(Zig::GlobalObject* globalObject, JSC::JSValue objectValue, BunString* specifier, bool wasModuleMock = false) { - if (JSC::JSPromise* promise = JSC::jsDynamicCast(objectValue)) { + if (JSC::jsDynamicCast(objectValue)) { OnLoadResult result = {}; result.type = OnLoadResultTypePromise; result.value.promise = objectValue; diff --git a/src/bun.js/bindings/UtilInspect.cpp b/src/bun.js/bindings/UtilInspect.cpp index 56724f8057..92c6105914 100644 --- a/src/bun.js/bindings/UtilInspect.cpp +++ b/src/bun.js/bindings/UtilInspect.cpp @@ -59,7 +59,7 @@ extern "C" JSC::EncodedJSValue JSC__JSValue__callCustomInspectFunction( arguments.append(inspectFn); auto inspectRet = JSC::profiledCall(globalObject, ProfilingReason::API, functionToCall, callData, thisValue, arguments); - if (auto exe = scope.exception()) { + if (scope.exception()) { *is_exception = true; return {}; } diff --git a/src/bun.js/bindings/bindings.cpp b/src/bun.js/bindings/bindings.cpp index ef0de56fa1..d6049d7849 100644 --- a/src/bun.js/bindings/bindings.cpp +++ b/src/bun.js/bindings/bindings.cpp @@ -273,7 +273,7 @@ AsymmetricMatcherResult matchAsymmetricMatcherAndGetFlags(JSGlobalObject* global JSCell* matcherPropCell = matcherProp.asCell(); AsymmetricMatcherConstructorType constructorType = AsymmetricMatcherConstructorType::none; - if (auto* expectAnything = jsDynamicCast(matcherPropCell)) { + if (jsDynamicCast(matcherPropCell)) { if (!readFlagsAndProcessPromise(matcherProp, flags, globalObject, otherProp, constructorType)) return AsymmetricMatcherResult::FAIL; @@ -325,7 +325,7 @@ AsymmetricMatcherResult matchAsymmetricMatcherAndGetFlags(JSGlobalObject* global return AsymmetricMatcherResult::PASS; } - if (auto* booleanObject = jsDynamicCast(otherProp)) { + if (jsDynamicCast(otherProp)) { return AsymmetricMatcherResult::PASS; } @@ -337,7 +337,7 @@ AsymmetricMatcherResult matchAsymmetricMatcherAndGetFlags(JSGlobalObject* global return AsymmetricMatcherResult::PASS; } - if (auto* numberObject = jsDynamicCast(otherProp)) { + if (jsDynamicCast(otherProp)) { return AsymmetricMatcherResult::PASS; } @@ -2237,7 +2237,7 @@ double JSC__JSValue__getLengthIfPropertyExistsInternal(JSC__JSValue value, JSC__ } case WebCore::JSDOMWrapperType: { - if (auto* headers = jsDynamicCast(cell)) + if (jsDynamicCast(cell)) return static_cast(jsCast(cell)->wrapped().size()); if (auto* blob = jsDynamicCast(cell)) { @@ -2437,7 +2437,7 @@ void JSC__JSValue___then(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, JSC__ if (JSC::JSPromise* promise = JSC::jsDynamicCast(cell)) { handlePromise(promise, arg1, arg2, ArgFn3, ArgFn4); - } else if (JSC::JSInternalPromise* promise = JSC::jsDynamicCast(cell)) { + } else if (JSC::jsDynamicCast(cell)) { RELEASE_ASSERT(false); } } diff --git a/src/bun.js/bindings/ncrypto.cpp b/src/bun.js/bindings/ncrypto.cpp index 3030627b9b..a07591fe53 100644 --- a/src/bun.js/bindings/ncrypto.cpp +++ b/src/bun.js/bindings/ncrypto.cpp @@ -2742,7 +2742,7 @@ EVPKeyPointer::operator Dsa() const bool EVPKeyPointer::validateDsaParameters() const { if (!pkey_) return false; - /* Validate DSA2 parameters from FIPS 186-4 */ + /* Validate DSA2 parameters from FIPS 186-4 */ #if OPENSSL_VERSION_MAJOR >= 3 if (EVP_default_properties_is_fips_enabled(nullptr) && EVP_PKEY_DSA == id()) { #else diff --git a/src/bun.js/bindings/webcore/EventEmitter.cpp b/src/bun.js/bindings/webcore/EventEmitter.cpp index 0e791cdafc..b68f5d2c47 100644 --- a/src/bun.js/bindings/webcore/EventEmitter.cpp +++ b/src/bun.js/bindings/webcore/EventEmitter.cpp @@ -148,7 +148,7 @@ int EventEmitter::listenerCount(const Identifier& eventType) if (UNLIKELY(registeredListener->wasRemoved())) continue; - if (JSC::JSObject* jsFunction = registeredListener->callback().jsFunction()) { + if (registeredListener->callback().jsFunction()) { result++; } } diff --git a/src/bun.js/bindings/webcore/MessagePortChannelRegistry.cpp b/src/bun.js/bindings/webcore/MessagePortChannelRegistry.cpp index f5888e9ed2..55f61f75c3 100644 --- a/src/bun.js/bindings/webcore/MessagePortChannelRegistry.cpp +++ b/src/bun.js/bindings/webcore/MessagePortChannelRegistry.cpp @@ -112,8 +112,8 @@ void MessagePortChannelRegistry::didCloseMessagePort(const MessagePortIdentifier return; #ifndef NDEBUG - // if (channel && channel->hasAnyMessagesPendingOrInFlight()) - // LOG(MessagePorts, "Registry: (Note) The channel closed for port %s had messages pending or in flight", port.logString().utf8().data()); + // if (channel && channel->hasAnyMessagesPendingOrInFlight()) + // LOG(MessagePorts, "Registry: (Note) The channel closed for port %s had messages pending or in flight", port.logString().utf8().data()); #endif channel->closePort(port); diff --git a/src/bun.js/bindings/webcore/SerializedScriptValue.cpp b/src/bun.js/bindings/webcore/SerializedScriptValue.cpp index 390d9d539d..024ec3582b 100644 --- a/src/bun.js/bindings/webcore/SerializedScriptValue.cpp +++ b/src/bun.js/bindings/webcore/SerializedScriptValue.cpp @@ -5665,7 +5665,7 @@ ExceptionOr> SerializedScriptValue::create(JSGlobalOb if (arrayBufferContentsArray.hasException()) return arrayBufferContentsArray.releaseException(); - // auto backingStores = ImageBitmap::detachBitmaps(WTFMove(imageBitmaps)); + // auto backingStores = ImageBitmap::detachBitmaps(WTFMove(imageBitmaps)); #if ENABLE(OFFSCREEN_CANVAS_IN_WORKERS) Vector> detachedCanvases; diff --git a/src/bun.js/bindings/webcore/SerializedScriptValue.h b/src/bun.js/bindings/webcore/SerializedScriptValue.h index 305debcdb6..f000d6ea6a 100644 --- a/src/bun.js/bindings/webcore/SerializedScriptValue.h +++ b/src/bun.js/bindings/webcore/SerializedScriptValue.h @@ -37,6 +37,7 @@ #include #include #include +#include "JavaScriptCore/WasmModule.h" #if ENABLE(WEB_CODECS) #include "WebCodecsEncodedVideoChunk.h" diff --git a/src/bun.js/bindings/webcore/WebSocket.cpp b/src/bun.js/bindings/webcore/WebSocket.cpp index 0cc2fe3ea7..23d5116ebb 100644 --- a/src/bun.js/bindings/webcore/WebSocket.cpp +++ b/src/bun.js/bindings/webcore/WebSocket.cpp @@ -1169,7 +1169,7 @@ void WebSocket::didReceiveClose(CleanStatus wasClean, unsigned short code, WTF:: return; const bool wasConnecting = m_state == CONNECTING; m_state = CLOSED; - if (auto* context = scriptExecutionContext()) { + if (scriptExecutionContext()) { this->incPendingActivityCount(); if (wasConnecting && isConnectionError) { ErrorEvent::Init eventInit = {}; diff --git a/src/bun.js/bindings/webcore/Worker.cpp b/src/bun.js/bindings/webcore/Worker.cpp index 9e6bf96a5f..38bcd17573 100644 --- a/src/bun.js/bindings/webcore/Worker.cpp +++ b/src/bun.js/bindings/webcore/Worker.cpp @@ -479,7 +479,7 @@ JSC_DEFINE_HOST_FUNCTION(jsReceiveMessageOnPort, (JSGlobalObject * lexicalGlobal if (auto* messagePort = jsDynamicCast(port)) { return JSC::JSValue::encode(messagePort->wrapped().tryTakeMessage(lexicalGlobalObject)); - } else if (auto* broadcastChannel = jsDynamicCast(port)) { + } else if (jsDynamicCast(port)) { // TODO: support broadcast channels return JSC::JSValue::encode(jsUndefined()); } diff --git a/src/bun.js/bindings/workaround-missing-symbols.cpp b/src/bun.js/bindings/workaround-missing-symbols.cpp index 2ca4eaf351..e55f4d2991 100644 --- a/src/bun.js/bindings/workaround-missing-symbols.cpp +++ b/src/bun.js/bindings/workaround-missing-symbols.cpp @@ -83,8 +83,11 @@ extern "C" int kill(int pid, int sig) #if defined(__x86_64__) __asm__(".symver exp,exp@GLIBC_2.2.5"); __asm__(".symver expf,expf@GLIBC_2.2.5"); +__asm__(".symver log,log@GLIBC_2.2.5"); +__asm__(".symver log2,log2@GLIBC_2.2.5"); __asm__(".symver log2f,log2f@GLIBC_2.2.5"); __asm__(".symver logf,logf@GLIBC_2.2.5"); +__asm__(".symver pow,pow@GLIBC_2.2.5"); __asm__(".symver powf,powf@GLIBC_2.2.5"); #elif defined(__aarch64__) __asm__(".symver expf,expf@GLIBC_2.17"); @@ -110,38 +113,22 @@ float BUN_WRAP_GLIBC_SYMBOL(expf)(float); float BUN_WRAP_GLIBC_SYMBOL(log2f)(float); float BUN_WRAP_GLIBC_SYMBOL(logf)(float); float BUN_WRAP_GLIBC_SYMBOL(powf)(float, float); - -#if defined(__aarch64__) - double BUN_WRAP_GLIBC_SYMBOL(pow)(double, double); double BUN_WRAP_GLIBC_SYMBOL(log)(double); double BUN_WRAP_GLIBC_SYMBOL(log2)(double); int BUN_WRAP_GLIBC_SYMBOL(fcntl64)(int, int, ...); -#endif - -#if defined(__x86_64__) || defined(__aarch64__) - float __wrap_expf(float x) { return expf(x); } float __wrap_powf(float x, float y) { return powf(x, y); } float __wrap_logf(float x) { return logf(x); } float __wrap_log2f(float x) { return log2f(x); } double __wrap_exp(double x) { return exp(x); } - -#if defined(__aarch64__) - double __wrap_pow(double x, double y) { return pow(x, y); } double __wrap_log(double x) { return log(x); } double __wrap_log2(double x) { return log2(x); } -#endif - -#endif // x86_64 or aarch64 - } // extern "C" -#if defined(__aarch64__) - typedef int (*fcntl64_func)(int fd, int cmd, ...); enum arg_type { @@ -232,8 +219,6 @@ extern "C" int __wrap_fcntl64(int fd, int cmd, ...) } } -#endif - extern "C" __attribute__((used)) char _libc_single_threaded = 0; extern "C" __attribute__((used)) char __libc_single_threaded = 0; diff --git a/src/bun.js/bindings/wtf-bindings.cpp b/src/bun.js/bindings/wtf-bindings.cpp index 073ff9e31b..f549709e66 100644 --- a/src/bun.js/bindings/wtf-bindings.cpp +++ b/src/bun.js/bindings/wtf-bindings.cpp @@ -17,7 +17,7 @@ #include static int orig_termios_fd = -1; static struct termios orig_termios; -static _Atomic int orig_termios_spinlock; +static std::atomic orig_termios_spinlock; static std::once_flag reset_once_flag; static int current_tty_mode = 0; diff --git a/src/bun.js/modules/NodeModuleModule.cpp b/src/bun.js/modules/NodeModuleModule.cpp index 2f8cf33b4a..32da70399a 100644 --- a/src/bun.js/modules/NodeModuleModule.cpp +++ b/src/bun.js/modules/NodeModuleModule.cpp @@ -882,7 +882,7 @@ JSC_DEFINE_HOST_FUNCTION(jsFunctionIsModuleResolveFilenameSlowPathEnabled, { return JSValue::encode( jsBoolean(defaultGlobalObject(globalObject) - ->hasOverriddenModuleResolveFilenameFunction)); + ->hasOverriddenModuleResolveFilenameFunction)); } } // namespace Bun @@ -912,7 +912,7 @@ void generateNativeModule_NodeModule(JSC::JSGlobalObject* lexicalGlobalObject, exportValues.append(constructor); for (unsigned i = 0; i < Bun::countof(Bun::nodeModuleObjectTableValues); - ++i) { + ++i) { const auto& entry = Bun::nodeModuleObjectTableValues[i]; const auto& property = Identifier::fromString(vm, entry.m_key); JSValue value = constructor->getIfPropertyExists(globalObject, property); diff --git a/src/bun.js/modules/NodeProcessModule.h b/src/bun.js/modules/NodeProcessModule.h index 5989dd9a8c..0b7b2f1c98 100644 --- a/src/bun.js/modules/NodeProcessModule.h +++ b/src/bun.js/modules/NodeProcessModule.h @@ -21,8 +21,8 @@ JSC_DEFINE_CUSTOM_GETTER(jsFunctionProcessModuleCommonJSGetter, { return JSValue::encode(reinterpret_cast(globalObject) - ->processObject() - ->get(globalObject, propertyName)); + ->processObject() + ->get(globalObject, propertyName)); } JSC_DEFINE_CUSTOM_SETTER(jsFunctionProcessModuleCommonJSSetter, diff --git a/test/napi/node-napi.test.ts b/test/napi/node-napi.test.ts index 1f78c2b8d1..8f552d83d3 100644 --- a/test/napi/node-napi.test.ts +++ b/test/napi/node-napi.test.ts @@ -87,7 +87,7 @@ beforeAll(async () => { // on linux CI, node-gyp will default to g++ and the version installed there is very old, // so we make it use clang instead ...(process.platform == "linux" && isCI - ? { "CC": "/usr/lib/llvm-18/bin/clang", CXX: "/usr/lib/llvm-18/bin/clang++" } + ? { "CC": "/usr/lib/llvm-19/bin/clang", CXX: "/usr/lib/llvm-19/bin/clang++" } : {}), }, });